/* IsaacLadder — дизайн-система.

   Матовое стекло поверх живого фона: полупрозрачные слои с размытием,
   тонкая светлая кромка сверху и мягкая тень снизу. Всё на чистом CSS —
   ни одного внешнего файла, шрифта или картинки, чтобы страница открывалась
   мгновенно и работала без интернета до самого сервера. */

:root {
  /* Основа. Фон почти чёрный с синевой — на нём стекло читается лучше всего. */
  --bg:          #07070c;
  --bg-soft:     #0d0d16;

  --text:        #f5f5f7;
  --text-dim:    rgba(245, 245, 247, .62);
  --text-faint:  rgba(245, 245, 247, .38);

  /* Стекло: три уровня «толщины» для разной глубины слоёв. */
  --glass:       rgba(255, 255, 255, .055);
  --glass-2:     rgba(255, 255, 255, .085);
  --glass-3:     rgba(255, 255, 255, .12);
  --edge:        rgba(255, 255, 255, .14);
  --edge-soft:   rgba(255, 255, 255, .07);

  --accent:      #ff453a;
  --accent-soft: rgba(255, 69, 58, .16);
  --blue:        #0a84ff;
  --green:       #30d158;
  --amber:       #ff9f0a;
  --purple:      #bf5af2;

  --r-lg: 28px;
  --r-md: 20px;
  --r-sm: 13px;

  --shadow: 0 24px 70px rgba(0, 0, 0, .55);
  --shadow-sm: 0 8px 26px rgba(0, 0, 0, .38);

  /* Пружина: лёгкий перелёт делает интерфейс «живым», без него всё ощущается
     как перерисовка, а не как движение. */
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --ease: cubic-bezier(.4, 0, .22, 1);

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
          "Segoe UI Variable", "Segoe UI", Inter, system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Mono", Consolas, monospace;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* --- Живой фон ------------------------------------------------------------ */
/* Четыре размытых пятна медленно дрейфуют и дышат. Лежат под контентом,
   не перехватывают клики и не влияют на раскладку. */

.bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  /* Основа не плоская: верх заметно светлее низа, иначе страница читается
     как равномерный угольный лист. */
  background:
    linear-gradient(180deg, #14141f 0%, #0b0b13 38%, var(--bg) 100%);
}

/* Верхний прожектор: даёт странице «верх» и «низ». */
.bg::before {
  content: "";
  position: absolute;
  inset: -25% -10% auto -10%;
  height: 100vh;
  background: radial-gradient(56% 100% at 50% 0%,
    rgba(255, 255, 255, .13), rgba(255, 255, 255, .04) 40%, transparent 70%);
}

.bg i {
  position: absolute;
  display: block;
  border-radius: 50%;
  /* Сильное размытие и низкая непрозрачность: свет, а не цветное пятно.
     Прошлая версия давала грязь там, где источники накладывались. */
  filter: blur(115px);
  opacity: .52;
  will-change: transform;
}

.bg i:nth-child(1) {
  width: 58vw; height: 58vw;
  top: -22vw; left: -14vw;
  background: radial-gradient(circle, rgba(255, 69, 58, .9), transparent 66%);
  animation: drift-a 40s var(--ease) infinite alternate;
}
.bg i:nth-child(2) {
  width: 50vw; height: 50vw;
  top: -6vh; right: -18vw;
  background: radial-gradient(circle, rgba(10, 132, 255, .75), transparent 66%);
  animation: drift-b 52s var(--ease) infinite alternate;
}
.bg i:nth-child(3) {
  width: 44vw; height: 44vw;
  bottom: -24vw; left: 26vw;
  background: radial-gradient(circle, rgba(191, 90, 242, .5), transparent 68%);
  animation: drift-c 46s var(--ease) infinite alternate;
}
/* Четвёртый источник намеренно почти невидим: он лишь снимает провал по
   центру, где два верхних света уже погасли. */
.bg i:nth-child(4) {
  width: 34vw; height: 34vw;
  top: 46vh; left: 34vw;
  background: radial-gradient(circle, rgba(255, 159, 10, .34), transparent 70%);
  animation: drift-d 58s var(--ease) infinite alternate;
}

@keyframes drift-a {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  100% { transform: translate3d(10vw, 8vh, 0) scale(1.18); }
}
@keyframes drift-b {
  0%   { transform: translate3d(0, 0, 0) scale(1.08); }
  100% { transform: translate3d(-11vw, 12vh, 0) scale(.9); }
}
@keyframes drift-c {
  0%   { transform: translate3d(0, 0, 0) scale(.92); }
  100% { transform: translate3d(13vw, -9vh, 0) scale(1.14); }
}
@keyframes drift-d {
  0%   { transform: translate3d(0, 0, 0) scale(1); opacity: .22; }
  100% { transform: translate3d(-10vw, -6vh, 0) scale(1.3); opacity: .42; }
}

/* Зернистость поверх градиентов: без неё большие плавные заливки
   расслаиваются полосами на обычных мониторах. */
.bg::after {
  content: "";
  position: absolute;
  inset: -50%;
  opacity: .16;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* --- Каркас --------------------------------------------------------------- */

.wrap {
  position: relative;
  max-width: 1120px;
  margin: 0 auto;
  padding: 22px 24px 96px;
}

.topbar {
  position: sticky;
  top: 14px;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 14px 11px 20px;
  margin-bottom: 34px;
  border-radius: 999px;
  background: rgba(20, 20, 28, .55);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border: 1px solid var(--edge-soft);
  box-shadow: var(--shadow-sm);
}

/* Марка. Цвет несёт знак, а надпись остаётся одноцветной: раскрашенное
   слово из двух половин — самая заметная примета дешёвого логотипа. */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--text);
  text-decoration: none;
}

.mark {
  width: 22px;
  height: 22px;
  flex: none;
  filter: drop-shadow(0 3px 12px rgba(255, 69, 58, .45));
  transition: transform .5s var(--spring);
}
.brand:hover .mark { transform: translateY(-1px) rotate(-6deg); }

/* Верхний регистр с разрядкой. В смешанном написании заглавная «I» почти в
   любой гротеске неотличима от строчной «l», и IsaacLadder читается как
   «Megalsaac» — на скриншоте это было видно первым делом. */
.wordmark {
  font-size: 13.5px;
  font-weight: 650;
  letter-spacing: .13em;
  text-transform: uppercase;
  white-space: nowrap;
}

.topbar nav { display: flex; align-items: center; gap: 6px; }

/* --- Вкладки -------------------------------------------------------------- */
/* Живут в шапке и видны на любой странице: из профиля или диагностики всегда
   есть дорога обратно к матчу, без «назад» в браузере. */

.tabs {
  display: flex;
  gap: 2px;
  padding: 3px;
  background: rgba(0, 0, 0, .28);
  border: 1px solid var(--edge-soft);
  border-radius: 999px;
}
.tabs button {
  padding: 8px 16px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-faint);
  background: transparent;
  border: none;
  border-radius: 999px;
  box-shadow: none;
  backdrop-filter: none;
}
.tabs button:hover { transform: none; color: var(--text); background: rgba(255,255,255,.05); }
.tabs button.on {
  color: var(--text);
  background: var(--glass-3);
  box-shadow: 0 2px 10px rgba(0, 0, 0, .35);
}

.tab-body { animation: rise .45s var(--ease) both; }

/* --- Пары «название — значение» ------------------------------------------- */

.kv {
  display: grid;
  grid-template-columns: minmax(120px, auto) 1fr;
  gap: 0;
  margin: 0;
}
.kv dt, .kv dd {
  margin: 0;
  padding: 9px 0;
  font-size: 13.5px;
  border-bottom: 1px solid rgba(255, 255, 255, .045);
  min-width: 0;
}
.kv dt { color: var(--text-faint); padding-right: 16px; }
.kv dd {
  font-family: var(--mono);
  font-size: 12.5px;
  text-align: right;
  overflow-wrap: anywhere;
}
.kv dt:last-of-type, .kv dd:last-of-type { border-bottom: none; }

/* --- Лента событий -------------------------------------------------------- */

.log {
  max-height: 320px;
  overflow-y: auto;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.9;
  color: var(--text-dim);
}
.log > div { border-bottom: 1px solid rgba(255, 255, 255, .04); padding: 2px 0; }

/* --- Стекло --------------------------------------------------------------- */

.glass {
  position: relative;
  background: var(--glass);
  backdrop-filter: blur(34px) saturate(180%);
  -webkit-backdrop-filter: blur(34px) saturate(180%);
  border: 1px solid var(--edge-soft);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}

/* Блик по верхней кромке — то, что читается глазом как «стекло». */
.glass::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg,
    transparent, rgba(255, 255, 255, .5) 22%, rgba(255, 255, 255, .5) 78%, transparent);
  pointer-events: none;
}

.card { padding: 28px; }
.card-sm { padding: 20px; }

.stack { display: grid; gap: 18px; }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.row-tight { display: flex; align-items: center; gap: 8px; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }

/* --- Типографика ---------------------------------------------------------- */

h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -.028em; }

.display {
  font-size: clamp(40px, 7vw, 76px);
  line-height: 1.02;
  letter-spacing: -.045em;
  font-weight: 700;
}
.display em {
  font-style: normal;
  background: linear-gradient(120deg, var(--accent), var(--amber) 55%, var(--purple));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

h1 { font-size: 30px; }
h2 { font-size: 21px; }
h3 { font-size: 16px; }

.eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.lead { font-size: 18px; line-height: 1.55; color: var(--text-dim); }
.dim { color: var(--text-dim); font-size: 14px; line-height: 1.6; }
.faint { color: var(--text-faint); font-size: 13px; line-height: 1.6; }
.mono { font-family: var(--mono); }
.hidden { display: none !important; }

/* --- Кнопки --------------------------------------------------------------- */

button, .btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -.01em;
  color: var(--text);
  background: var(--glass-2);
  border: 1px solid var(--edge);
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: transform .28s var(--spring), background .2s var(--ease),
              border-color .2s var(--ease), box-shadow .25s var(--ease), opacity .2s;
}
button:hover, .btn:hover {
  background: var(--glass-3);
  border-color: rgba(255, 255, 255, .24);
  transform: translateY(-2px);
}
button:active, .btn:active { transform: translateY(0) scale(.98); }
button:disabled { opacity: .38; cursor: not-allowed; transform: none; }
button:focus-visible, .btn:focus-visible,
input:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }

.btn-primary {
  background: linear-gradient(180deg, #ff5c52, var(--accent));
  border-color: transparent;
  box-shadow: 0 10px 30px rgba(255, 69, 58, .34);
}
.btn-primary:hover {
  background: linear-gradient(180deg, #ff6a60, #ff4f44);
  box-shadow: 0 14px 38px rgba(255, 69, 58, .44);
}

.btn-go {
  background: linear-gradient(180deg, #3ddc6b, var(--green));
  border-color: transparent;
  color: #04210e;
  box-shadow: 0 10px 30px rgba(48, 209, 88, .3);
}
.btn-go:hover { background: linear-gradient(180deg, #4ce87a, #35d95e); }

.btn-sm { padding: 8px 15px; font-size: 13.5px; }
.btn-wide { width: 100%; }
.btn-quiet { background: transparent; border-color: var(--edge-soft); color: var(--text-dim); }
.btn-quiet:hover { color: var(--text); }

/* --- Поля ----------------------------------------------------------------- */

label {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .02em;
  color: var(--text-faint);
}

input[type="text"], input[type="password"] {
  width: 100%;
  padding: 14px 16px;
  font-family: var(--font);
  font-size: 16px;
  color: var(--text);
  background: rgba(0, 0, 0, .3);
  border: 1px solid var(--edge-soft);
  border-radius: var(--r-sm);
  outline: none;
  transition: border-color .2s var(--ease), background .2s var(--ease),
              box-shadow .2s var(--ease);
}
input::placeholder { color: rgba(245, 245, 247, .25); }
input:focus {
  border-color: rgba(255, 255, 255, .3);
  background: rgba(0, 0, 0, .42);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, .05);
}

.field { margin-bottom: 16px; }

/* Сегментированный переключатель — как в системных настройках Apple. */
.segmented {
  display: flex;
  gap: 3px;
  padding: 3px;
  background: rgba(0, 0, 0, .32);
  border: 1px solid var(--edge-soft);
  border-radius: 999px;
}
.segmented button {
  flex: 1;
  padding: 9px 16px;
  font-size: 14px;
  background: transparent;
  border: none;
  border-radius: 999px;
  color: var(--text-dim);
  box-shadow: none;
  backdrop-filter: none;
}
.segmented button:hover { transform: none; color: var(--text); background: rgba(255,255,255,.05); }
.segmented button.on {
  background: var(--glass-3);
  color: var(--text);
  box-shadow: 0 2px 10px rgba(0, 0, 0, .3);
}

/* --- Значки статуса ------------------------------------------------------- */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 13px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .01em;
  color: var(--text-dim);
  background: var(--glass);
  border: 1px solid var(--edge-soft);
  border-radius: 999px;
  white-space: nowrap;
}
.chip::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 50%;
  background: currentColor;
  opacity: .85;
}
.chip.live   { color: #ff8078; border-color: rgba(255, 69, 58, .35); }
.chip.live::before { animation: pulse 1.6s var(--ease) infinite; }
.chip.ok     { color: #5ee085; border-color: rgba(48, 209, 88, .32); }
.chip.warn   { color: #ffc061; border-color: rgba(255, 159, 10, .32); }
.chip.info   { color: #6bb6ff; border-color: rgba(10, 132, 255, .32); }
.chip.plain::before { display: none; }

@keyframes pulse { 50% { opacity: .2; transform: scale(.75); } }

.alert {
  padding: 14px 18px;
  font-size: 14.5px;
  border-radius: var(--r-sm);
  background: var(--accent-soft);
  border: 1px solid rgba(255, 69, 58, .32);
  color: #ffd9d5;
}
.alert.good { background: rgba(48, 209, 88, .13); border-color: rgba(48, 209, 88, .3); color: #ccf5d8; }

/* --- Крупные значения ----------------------------------------------------- */

.hero-value {
  font-family: var(--mono);
  font-size: clamp(30px, 6vw, 52px);
  font-weight: 700;
  letter-spacing: .14em;
  text-align: center;
  padding: 26px 16px;
  border-radius: var(--r-md);
  background: rgba(0, 0, 0, .32);
  border: 1px dashed var(--edge);
  user-select: all;
}
.hero-value.seed { color: var(--amber); }

.stat-tile {
  padding: 16px 18px;
  border-radius: var(--r-md);
  background: var(--glass);
  border: 1px solid var(--edge-soft);
}
.stat-tile .k {
  font-size: 11px; font-weight: 600; letter-spacing: .1em;
  text-transform: uppercase; color: var(--text-faint); margin-bottom: 6px;
}
.stat-tile .v { font-size: 25px; font-weight: 700; letter-spacing: -.02em; font-family: var(--mono); }

/* --- Токен ---------------------------------------------------------------- */

.token-box {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--r-sm);
  background: rgba(0, 0, 0, .38);
  border: 1px solid var(--edge-soft);
}
.token-box code {
  flex: 1;
  font-family: var(--mono);
  font-size: 14px;
  letter-spacing: .04em;
  word-break: break-all;
  color: var(--text);
  user-select: all;
}
.token-box.masked code { filter: blur(6px); user-select: none; }

/* --- Драфт ---------------------------------------------------------------- */

.turn {
  padding: 20px 24px;
  border-radius: var(--r-md);
  text-align: center;
  font-size: 17px;
  font-weight: 600;
  color: var(--text-dim);
  background: var(--glass);
  border: 1px solid var(--edge-soft);
  transition: all .35s var(--ease);
}
.turn.mine {
  color: #fff;
  background: linear-gradient(180deg, rgba(255, 69, 58, .22), rgba(255, 69, 58, .07));
  border-color: rgba(255, 69, 58, .45);
  box-shadow: 0 0 40px rgba(255, 69, 58, .18);
}

.progress {
  height: 4px;
  margin-top: 14px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .4);
  overflow: hidden;
}
.progress i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--amber));
  transition: width .5s var(--spring);
}

.chips { display: flex; flex-wrap: wrap; gap: 8px; }

.pick {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 15px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  background: var(--glass);
  border: 1px solid var(--edge-soft);
  border-radius: 999px;
  cursor: pointer;
  transition: transform .25s var(--spring), background .18s, border-color .18s;
}
.pick:hover { transform: translateY(-3px); background: var(--glass-3); border-color: rgba(255,255,255,.26); }
.pick.banned {
  color: var(--text-faint);
  background: rgba(0, 0, 0, .28);
  border-style: dashed;
  text-decoration: line-through;
  cursor: default;
  transform: none;
}
.pick.banned:hover { transform: none; border-color: var(--edge-soft); background: rgba(0,0,0,.28); }
.pick.locked { opacity: .42; cursor: not-allowed; }
.pick.locked:hover { transform: none; }

/* --- Значки предметов ------------------------------------------------------ */
/* Слот держит либо настоящий спрайт, либо нарисованный знак. Если картинки
   нет, img удаляет себя сам, и остаётся знак — без пустых рамок. */

.icon-slot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  flex: none;
}
.icon-img { width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; }
/* Когда спрайт есть, нарисованный знак прячется. */
.icon-img + .icon { display: none; }

.icon { display: inline-flex; width: 100%; height: 100%; }
.icon svg { width: 100%; height: 100%; display: block; }

.icon.tone-s { color: #ff6b5f; }
.icon.tone-a { color: #ffb340; }
.icon.tone-b { color: #5ab0ff; }
.icon.tone-v { color: #c98cff; }
.icon.tone-g { color: #5fdc86; }

/* В сетке банов знак крупнее: там он и есть основной ориентир. */
.pick .icon-slot { width: 20px; height: 20px; margin-right: 2px; }
.pick.banned .icon-slot { opacity: .35; filter: grayscale(1); }

.tier {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 5px;
  background: rgba(255, 255, 255, .1);
  color: var(--text-dim);
}
.tier-S { background: rgba(255, 69, 58, .22); color: #ff9a93; }
.tier-A { background: rgba(255, 159, 10, .2); color: #ffc061; }
.tier-B { background: rgba(10, 132, 255, .18); color: #7cbcff; }

/* --- Табло гонки ---------------------------------------------------------- */

.versus { display: grid; grid-template-columns: 1fr auto 1fr; gap: 16px; align-items: stretch; }

.vs-mid {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; min-width: 76px;
}
.vs-mid .vs {
  font-size: 22px; font-weight: 700; letter-spacing: .04em;
  color: var(--text-faint);
}

.player {
  padding: 22px;
  border-radius: var(--r-lg);
  background: var(--glass);
  backdrop-filter: blur(30px) saturate(170%);
  -webkit-backdrop-filter: blur(30px) saturate(170%);
  border: 1px solid var(--edge-soft);
  border-top: 2px solid var(--blue);
  box-shadow: var(--shadow);
  transition: border-color .3s var(--ease), box-shadow .3s var(--ease);
}
.player.guest { border-top-color: var(--amber); }
.player.offline { opacity: .55; }
.player.winner {
  border-color: rgba(48, 209, 88, .45);
  border-top-color: var(--green);
  box-shadow: 0 0 50px rgba(48, 209, 88, .18), var(--shadow);
}

.player .name { font-size: 23px; font-weight: 700; letter-spacing: -.025em; }
.player .meta {
  font-size: 12px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--text-faint); margin: 4px 0 18px;
}

.items { display: flex; flex-wrap: wrap; gap: 6px; max-height: 122px; overflow-y: auto; }
.items span {
  padding: 4px 9px; font-size: 12px; color: var(--text-dim);
  background: rgba(0, 0, 0, .3); border: 1px solid var(--edge-soft); border-radius: 7px;
}

.note {
  margin-top: 10px; padding: 9px 13px;
  font-size: 13px; font-weight: 500;
  color: #ffd9a8;
  background: rgba(255, 159, 10, .1);
  border-left: 2px solid var(--amber);
  border-radius: 0 8px 8px 0;
}

/* --- Таблица -------------------------------------------------------------- */

table { width: 100%; border-collapse: collapse; }
th {
  padding: 10px 14px;
  font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  text-align: left; color: var(--text-faint);
  border-bottom: 1px solid var(--edge-soft);
}
td { padding: 13px 14px; font-size: 15px; border-bottom: 1px solid rgba(255,255,255,.045); }
tbody tr { transition: background .18s; }
tbody tr:hover { background: rgba(255, 255, 255, .03); }
td.num { font-family: var(--mono); }

.rank {
  display: inline-flex; align-items: center; justify-content: center;
  width: 27px; height: 27px;
  font-family: var(--mono); font-size: 13px; font-weight: 700;
  color: var(--text-dim);
  background: rgba(0, 0, 0, .3);
  border: 1px solid var(--edge-soft);
  border-radius: 9px;
}
.rank.top { color: var(--accent); border-color: rgba(255, 69, 58, .4); }

/* --- Шаги ----------------------------------------------------------------- */

.steps { margin: 0; padding: 0; list-style: none; counter-reset: s; }
.steps li {
  position: relative; counter-increment: s;
  margin-left: 14px; padding: 0 0 22px 42px;
  font-size: 15px; line-height: 1.65; color: var(--text-dim);
  border-left: 1px solid var(--edge-soft);
}
.steps li:last-child { border-left-color: transparent; padding-bottom: 0; }
.steps li::before {
  content: counter(s);
  position: absolute; left: -14px; top: -3px;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 13px; font-weight: 700;
  color: var(--accent);
  background: rgba(20, 20, 28, .9);
  border: 1px solid rgba(255, 69, 58, .4);
  border-radius: 50%;
}
.steps li b { color: var(--text); font-weight: 600; }

/* ========================================================================== */
/* ЛЕНДИНГ                                                                    */
/* ========================================================================== */

/* --- Навигация ------------------------------------------------------------ */
/* Наверху страницы прозрачная, при прокрутке набирает подложку. Постоянная
   «пилюля» поверх контента всё время спорит с ним за внимание. */

.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 60;
  transition: background .45s var(--ease), backdrop-filter .45s var(--ease);
}
.nav::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--edge-soft) 20%,
                              var(--edge-soft) 80%, transparent);
  opacity: 0;
  transition: opacity .45s var(--ease);
}
.nav.solid {
  background: rgba(7, 7, 12, .6);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
}
.nav.solid::after { opacity: 1; }

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 17px 26px;
}
.nav-actions { display: flex; align-items: center; gap: 9px; }

/* --- Полотно -------------------------------------------------------------- */

.page { position: relative; }
.section {
  max-width: 1180px;
  margin: 0 auto;
  padding: 118px 26px;
}
.section.tight { padding-top: 0; }
.measure { max-width: 62ch; }

.section-head { margin-bottom: 52px; }
.section-head h2 {
  font-size: clamp(30px, 4.4vw, 46px);
  letter-spacing: -.04em;
  line-height: 1.05;
}
.section-head p { margin: 16px 0 0; }

/* --- Герой ---------------------------------------------------------------- */

/* Высота ограничена сверху: на «100svh» при высоком окне герой растягивался,
   контент собирался в середине, а сид уезжал за сгиб. */
.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: min(100svh, 860px);
  padding: 118px 26px 64px;
  text-align: center;
}

.hero h1 {
  font-size: clamp(44px, 7.6vw, 92px);
  line-height: .96;
  letter-spacing: -.05em;
  font-weight: 700;
  margin: 0;
}
/* Второй мыслью заголовок договаривает — значит, и звучать она должна тише:
   меньший кегль и приглушённый тон вместо второго цвета. */
.hero h1 .muted {
  display: block;
  margin-top: .12em;
  font-size: .54em;
  letter-spacing: -.035em;
  color: rgba(245, 245, 247, .42);
}

.hero .lead {
  margin: 28px auto 32px;
  max-width: 50ch;
  font-size: clamp(16px, 1.5vw, 19px);
  color: rgba(245, 245, 247, .68);
}

.hero-cta button { padding: 14px 26px; font-size: 15.5px; }

.hero-cta { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }

.eyebrow-line {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 26px;
}
.eyebrow-line::before, .eyebrow-line::after {
  content: "";
  width: 28px;
  height: 1px;
  background: var(--edge);
}

/* --- Сид в герое ---------------------------------------------------------- */
/* Подпись проекта: сид — то, вокруг чего всё крутится. Символы
   перещёлкиваются и встают на место, под ними две дорожки забега. */

.seedbox {
  margin-top: 52px;
  width: min(660px, 100%);
  padding: 26px 22px 22px;
  border-radius: var(--r-lg);
  background: rgba(255, 255, 255, .028);
  border: 1px solid var(--edge-soft);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
}
.seed-glyphs {
  display: flex;
  justify-content: center;
  gap: clamp(3px, 1.1vw, 9px);
  font-family: var(--mono);
  font-size: clamp(22px, 4.6vw, 44px);
  font-weight: 700;
  letter-spacing: 0;
}
.seed-glyphs span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.05em;
  /* Крутящийся символ должен читаться: на --text-faint блок выглядел
     погасшим ровно в те секунды, когда он живее всего. */
  color: rgba(245, 245, 247, .55);
  transition: color .45s var(--ease), transform .45s var(--spring);
}
.seed-glyphs span.set { color: var(--amber); transform: translateY(-2px); }
.seed-glyphs span.gap { width: .5em; }

.lanes { margin-top: 24px; display: grid; gap: 11px; }
.lane {
  position: relative;
  height: 2px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .07);
  overflow: visible;
}
.lane i {
  position: absolute;
  top: 50%;
  left: 0;
  width: 7px; height: 7px;
  margin-top: -3.5px;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 14px var(--blue);
}
.lane.b i { background: var(--amber); box-shadow: 0 0 14px var(--amber); }
.lane i { animation: race-a 7.5s var(--ease) infinite; }
.lane.b i { animation: race-b 7.5s var(--ease) infinite; }

@keyframes race-a {
  0%   { left: 0; }
  62%  { left: 74%; }
  100% { left: 100%; }
}
@keyframes race-b {
  0%   { left: 0; }
  62%  { left: 61%; }
  100% { left: 92%; }
}

.seed-caption {
  margin-top: 18px;
  text-align: center;
  font-size: 12px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-faint);
}

/* --- Ступени -------------------------------------------------------------- */

.flow { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }

.step-card {
  position: relative;
  padding: 26px 22px 24px;
  border-radius: var(--r-md);
  background: var(--glass);
  border: 1px solid var(--edge-soft);
  backdrop-filter: blur(26px) saturate(170%);
  -webkit-backdrop-filter: blur(26px) saturate(170%);
  transition: transform .5s var(--spring), border-color .3s var(--ease),
              background .3s var(--ease);
}
.step-card:hover {
  transform: translateY(-5px);
  border-color: rgba(255, 255, 255, .18);
  background: var(--glass-2);
}
.step-card .n {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .1em;
  color: var(--accent);
  margin-bottom: 16px;
}
.step-card h3 { font-size: 17px; margin-bottom: 8px; letter-spacing: -.02em; }
.step-card p { margin: 0; font-size: 14px; line-height: 1.6; color: var(--text-dim); }

/* --- Гайд по запуску ------------------------------------------------------ */

.guide { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }

.guide-step {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 28px 24px 24px;
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, rgba(255, 255, 255, .055),
                                      rgba(255, 255, 255, .02));
  border: 1px solid var(--edge-soft);
  backdrop-filter: blur(26px) saturate(170%);
  -webkit-backdrop-filter: blur(26px) saturate(170%);
}
.guide-step .n {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}
.guide-step h3 { font-size: 19px; margin-bottom: 10px; letter-spacing: -.02em; }
.guide-step p {
  margin: 0 0 20px;
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--text-dim);
}
/* Кнопка прижата к низу — так три карточки выглядят одной строкой,
   даже когда текста в них разное количество. */
.guide-step > :last-child { margin-top: auto; }

/* --- Кнопка GitHub --------------------------------------------------------- */

.btn-github {
  gap: 9px;
  background: rgba(255, 255, 255, .1);
  border-color: rgba(255, 255, 255, .18);
  color: var(--text);
}
.btn-github:hover {
  background: rgba(255, 255, 255, .17);
  border-color: rgba(255, 255, 255, .3);
}
.btn-github svg { flex: none; }

@media (max-width: 620px) {
  /* На узком экране в шапке остаётся только значок: подпись съедает место,
     которое нужнее кнопке входа. */
  .nav-github .gh-text { display: none; }
  .nav-github { padding-left: 12px; padding-right: 12px; }
}

/* --- Что делает мод ------------------------------------------------------- */

.rules { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }

.rule {
  padding: 30px 26px;
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, rgba(255, 255, 255, .05),
                                      rgba(255, 255, 255, .018));
  border: 1px solid var(--edge-soft);
  backdrop-filter: blur(26px) saturate(170%);
  -webkit-backdrop-filter: blur(26px) saturate(170%);
}
.rule .glyph {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 20px;
  border-radius: 12px;
  background: rgba(255, 69, 58, .13);
  border: 1px solid rgba(255, 69, 58, .28);
  font-size: 18px;
}
.rule h3 { font-size: 18px; margin-bottom: 10px; letter-spacing: -.02em; }
.rule p { margin: 0; font-size: 14.5px; line-height: 1.65; color: var(--text-dim); }

/* --- Закрывающий призыв --------------------------------------------------- */

.closer {
  position: relative;
  text-align: center;
  padding: 92px 32px;
  border-radius: 36px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .06),
                                      rgba(255, 255, 255, .015));
  border: 1px solid var(--edge-soft);
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  overflow: hidden;
}
.closer::before {
  content: "";
  position: absolute;
  inset: -60% 20% auto 20%;
  height: 120%;
  background: radial-gradient(50% 50% at 50% 50%, rgba(255, 69, 58, .22), transparent 70%);
  pointer-events: none;
}
.closer h2 {
  position: relative;
  font-size: clamp(32px, 5.4vw, 58px);
  letter-spacing: -.045em;
  line-height: 1.02;
}
.closer p { position: relative; margin: 18px auto 32px; max-width: 46ch; }
.closer .row { position: relative; justify-content: center; }

.foot {
  max-width: 1180px;
  margin: 0 auto;
  padding: 34px 26px 46px;
  border-top: 1px solid rgba(255, 255, 255, .05);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

/* --- Модальный вход ------------------------------------------------------- */
/* Форма не занимает половину первого экрана: она открывается поверх и
   закрывается, а главная остаётся про игру, а не про поля ввода. */

.sheet-wrap {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(4, 4, 8, .62);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  opacity: 0;
  transition: opacity .32s var(--ease);
}
.sheet-wrap[hidden] { display: none; }
.sheet-wrap.open { opacity: 1; }

.sheet {
  width: min(420px, 100%);
  padding: 30px;
  border-radius: var(--r-lg);
  background: rgba(22, 22, 30, .82);
  border: 1px solid var(--edge);
  box-shadow: 0 40px 120px rgba(0, 0, 0, .7);
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  transform: translateY(16px) scale(.96);
  opacity: 0;
  transition: transform .45s var(--spring), opacity .3s var(--ease);
}
.sheet-wrap.open .sheet { transform: none; opacity: 1; }

.sheet-close {
  position: absolute;
  top: 18px; right: 18px;
  width: 32px; height: 32px;
  padding: 0;
  font-size: 17px;
  line-height: 1;
  border-radius: 50%;
  color: var(--text-dim);
}

/* --- Блик под курсором ---------------------------------------------------- */
/* Стекло становится стеклом, когда по нему движется отражение. Координаты
   пишет JS в --mx/--my. */

.lit { position: relative; }
.lit::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(400px circle at var(--mx, 50%) var(--my, 0%),
                              rgba(255, 255, 255, .08), transparent 62%);
  opacity: 0;
  transition: opacity .5s var(--ease);
  pointer-events: none;
}
.lit:hover::after { opacity: 1; }

/* --- Проявление при прокрутке --------------------------------------------- */

.reveal {
  opacity: 0;
  transform: translateY(30px);
  filter: blur(7px);
  transition: opacity .95s var(--ease), transform .95s var(--ease),
              filter .95s var(--ease);
}
.reveal.in { opacity: 1; transform: none; filter: none; }

/* --- Адаптив лендинга ----------------------------------------------------- */

@media (max-width: 900px) {
  .flow { grid-template-columns: repeat(2, 1fr); }
  .guide { grid-template-columns: 1fr; }
  .rules { grid-template-columns: 1fr; }
  .section { padding: 78px 20px; }
  .hero { padding: 116px 20px 56px; }
  .closer { padding: 62px 24px; border-radius: 28px; }
}
@media (max-width: 560px) {
  .flow { grid-template-columns: 1fr; }
  .nav-inner { padding: 14px 18px; }
  .hero-cta { width: 100%; }
  .hero-cta button { flex: 1 1 100%; }
}

/* --- Появление ------------------------------------------------------------ */

.rise { animation: rise .7s var(--ease) both; }
.rise:nth-child(2) { animation-delay: .07s; }
.rise:nth-child(3) { animation-delay: .14s; }
.rise:nth-child(4) { animation-delay: .21s; }
.rise:nth-child(5) { animation-delay: .28s; }

@keyframes rise {
  from { opacity: 0; transform: translateY(22px); filter: blur(6px); }
  to   { opacity: 1; transform: none; filter: none; }
}

.view { animation: rise .5s var(--ease) both; }

/* --- Адаптив -------------------------------------------------------------- */

@media (max-width: 980px) {
  /* Шапка перестаёт быть одной строкой: вкладки уезжают на второй ряд и
     прокручиваются вбок, вместо того чтобы сжимать бренд и кнопку выхода. */
  .topbar { flex-wrap: wrap; border-radius: var(--r-md); }
  .tabs {
    order: 3;
    width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs button { flex: 0 0 auto; }
}

@media (max-width: 780px) {
  .wrap { padding: 16px 16px 70px; }
  .kv { grid-template-columns: 1fr; }
  .kv dt { padding-bottom: 0; border-bottom: none; }
  .kv dd { text-align: left; padding-top: 2px; }
  .versus { grid-template-columns: 1fr; }
  .vs-mid { flex-direction: row; padding: 4px 0; }
  .topbar { padding: 10px 12px; }
  .brand span.full { display: none; }
  .card { padding: 22px; }
}

/* Уважаем системную настройку: анимации фона особенно тяжелы для тех,
   кому движение противопоказано. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .bg i, .lane i { animation: none; }
  /* Проявление отключено — блоки обязаны быть видимы сразу. */
  .reveal { opacity: 1; transform: none; filter: none; }
}
