/*
 * HumanUpgrade — ветка модулей программ (как героблок humanupgrade.pro):
 * ядро слева, цепочка модулей вправо, ответвления сверху и снизу.
 * Рамка плитки кодирует состояние: свечение — открыт, обычная — дальше, точечная — заперт.
 */

.hu-modules-hero {
  display: grid;
  gap: var(--space-8);
  align-items: center;
  overflow: hidden;
  padding: var(--space-8) var(--space-6);
  position: relative;
  border: 1px solid var(--divider);
  border-radius: var(--radius-2xl);
  background: var(--canvas);
}
@media (min-width: 1080px) {
  .hu-modules-hero {
    grid-template-columns: minmax(18rem, 23rem) minmax(0, 1fr);
    min-height: 32rem;
    padding: var(--space-10);
  }
}
.hu-modules-hero__offer {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}
.hu-modules-hero__offer > .jv-hud-pill {
  align-self: flex-start;
}
.hu-modules-hero__map {
  position: relative;
  z-index: 2;
  min-width: 0;
}

.hu-chain-wrap {
  position: relative;
  overflow-x: auto;
  overflow-y: hidden;
  padding: var(--space-6) 0 4.5rem;
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent 100%);
  mask-image: linear-gradient(90deg, #000 88%, transparent 100%);
}
.hu-chain-wrap::-webkit-scrollbar {
  display: none;
}
.hu-chain {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1.75rem;
  width: max-content;
  padding-inline: var(--space-6) 4rem;
}
.hu-chain__wires {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}
.hu-chain__wire {
  fill: none;
  stroke: var(--brand);
  stroke-width: 1;
  opacity: 0.4;
}
.hu-chain__wire.is-dim {
  opacity: 0.14;
  stroke-dasharray: 3 5;
}

/* Ядро — базовый агент. */
.hu-chain__core {
  position: relative;
  display: grid;
  flex: none;
  place-items: center;
  width: 9rem;
  height: 9rem;
  border: 1px solid var(--divider);
  border-radius: var(--radius-full);
  background: radial-gradient(circle, var(--brand-glow-soft) 0%, transparent 70%);
}
.hu-chain__core-cap {
  position: absolute;
  top: calc(100% + var(--space-2));
  left: 50%;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  width: 12rem;
  text-align: center;
  transform: translateX(-50%);
}
@media (max-width: 1079.98px) {
  .hu-chain__core {
    display: none;
  }
}

/* Ряды: 1 — ответвления вверх, 2 — модули, 3 — ответвления вниз. */
.hu-chain__rows {
  position: relative;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 9.5rem;
  grid-template-rows: 5rem auto 5rem;
  column-gap: 1.125rem;
  align-items: center;
  margin: 0;
  padding: 0;
  list-style: none;
}
.hu-chain__rows > li {
  grid-row: 2;
}
.hu-chain__rows > .hu-branch--up {
  grid-row: 1;
}
.hu-chain__rows > .hu-branch--down {
  grid-row: 3;
}

/* Плитка модуля. */
.hu-mod {
  position: relative;
  display: block;
  padding: var(--space-3);
  border: 1px solid var(--divider);
  background: var(--surface);
  color: var(--body);
  text-decoration: none;
  transition: border-color var(--dur-base), transform var(--dur-base) var(--ease-hud), opacity var(--dur-base);
}
a.hu-mod:hover {
  border-color: var(--brand);
  transform: translateY(-2px);
}
.hu-mod__row {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}
.hu-mod__icon,
.hu-branch__icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border: 1px solid var(--divider);
  color: var(--brand);
}
.hu-mod__num {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.5625rem;
  letter-spacing: 0.14em;
  color: var(--subtle);
}
.hu-mod__name {
  display: block;
  margin-top: 0.125rem;
  color: var(--heading);
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1.2;
}
.hu-mod__bar {
  display: block;
  height: 2px;
  margin-top: var(--space-3);
  background: var(--divider);
}
.hu-mod__bar i {
  display: block;
  height: 100%;
  background: var(--brand);
}
.hu-mod__state {
  display: block;
  margin-top: var(--space-2);
  font-family: var(--font-mono);
  font-size: 0.5rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--subtle);
}
.hu-mod--open {
  border-color: var(--brand);
  box-shadow: 0 0 0 1px var(--brand-glow-soft), 0 0 24px var(--brand-shadow);
}
.hu-mod--open .hu-mod__num,
.hu-mod--open .hu-mod__state {
  color: var(--brand);
}
.hu-mod--locked {
  border-style: dotted;
  opacity: 0.4;
}
.hu-mod--locked .hu-mod__icon {
  color: var(--subtle);
}

/* Ответвление: что модуль даёт помимо навыка. */
.hu-branch {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) 0.625rem;
  border: 1px solid var(--divider);
  background: var(--surface);
}
.hu-branch__icon {
  width: 1.75rem;
  height: 1.75rem;
}
.hu-branch__text {
  font-family: var(--font-mono);
  font-size: 0.5625rem;
  letter-spacing: 0.12em;
  line-height: 1.45;
  text-transform: uppercase;
  color: var(--muted);
}

.hu-chain-hint {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-5);
}
.hu-chain-hint span {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-size: 0.5625rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--subtle);
}
.hu-chain-hint i {
  width: 1.25rem;
  border-top: 1px solid var(--brand);
}
.hu-chain-hint i.is-dotted {
  border-top-style: dotted;
}
