/* Sheber.AI. Автор платформы: Темирлан Ануарханов.

   Визуальный язык
   - Режим: рабочий инструмент. Сначала понятно, где что лежит, потом характер.
   - Оболочка в своём цвете: тёмно-синяя навигация, светлая рабочая зона.
   - Один фирменный приём: схема линий. Уровень — линия своего цвета, миссии — станции,
     экзамен — пересадка. Приём живёт в маршруте, шагах миссии и прогрессе, а не в рамках.
   - Один шрифт: Onest (лежит в /fonts, лицензия OFL). Значки: Lucide.
   - Жёлтый — только «сейчас» и очки. Цвета линий — только уровни. */

@font-face {
  font-family: "Onest"; font-weight: 100 900; font-style: normal; font-display: swap;
  src: url("/fonts/onest-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Onest"; font-weight: 100 900; font-style: normal; font-display: swap;
  src: url("/fonts/onest-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Onest"; font-weight: 100 900; font-style: normal; font-display: swap;
  src: url("/fonts/onest-cyrillic-ext.woff2") format("woff2");
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}

:root {
  --ground: #F3F5FA;
  --surface: #FFFFFF;
  --sunk: #F6F8FC;
  --ink: #121A30;
  --ink-2: #4A5570;
  --ink-3: #78839B;
  --hair: #E2E7F0;
  --hair-2: #EDF1F6;
  --rail: #0F1630;
  --rail-2: #1B2448;
  --rail-ink: #C7CFE6;
  --rail-mut: #8A95B6;
  --now: #FFC93C;
  --now-ink: #3B2A00;
  --link: #2B59E3;
  --l0: #667289;
  --l1: #0E9B68;
  --l2: #2F6BFF;
  --l3: #8E44E6;
  --l4: #EE5C0A;
  --ok: #0B8A5B;
  --ok-bg: #E3F6EE;
  --bad: #CF362F;
  --bad-bg: #FCECEB;
  --warn-bg: #FFF4D1;
  --line: var(--l1);
  --font: "Onest", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --r-s: 8px;
  --r: 12px;
  --r-l: 18px;
  --shadow: 0 1px 2px rgba(18, 26, 48, .05), 0 10px 28px -16px rgba(18, 26, 48, .22);
  --shadow-up: 0 2px 4px rgba(18, 26, 48, .06), 0 22px 44px -22px rgba(18, 26, 48, .34);
  --ease: cubic-bezier(.16, 1, .3, 1);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-color: #C2CADB transparent; scrollbar-width: thin; }
body {
  margin: 0; background: var(--ground); color: var(--ink);
  font: 400 1rem/1.55 var(--font); caret-color: var(--link);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
::selection { background: #FFE08A; color: var(--ink); }
h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -.02em; line-height: 1.16; text-wrap: balance; }
h1 { font-size: 2rem; }
h2 { font-size: 1.375rem; }
h3 { font-size: 1.0625rem; letter-spacing: -.01em; font-weight: 650; }
p { margin: 0 0 .75em; text-wrap: pretty; }
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 3px; border-radius: 6px; }
.muted { color: var(--ink-2); }
.small { font-size: .875rem; }
.num { font-variant-numeric: tabular-nums; font-weight: 650; }
.boot { padding: 64px 16px; text-align: center; color: var(--ink-2); }
.ic { width: 20px; height: 20px; flex: none; }
.ic.s { width: 16px; height: 16px; }
.ic.l { width: 26px; height: 26px; }

/* ---------- оболочка: тёмная навигация и рабочая зона */
.app { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; }
.rail {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--rail); color: var(--rail-ink);
  display: flex; flex-direction: column; padding: 22px 14px 16px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; font-weight: 700; font-size: 1.125rem; letter-spacing: -.02em; white-space: nowrap; }
.rail .brand { color: #fff; padding: 2px 10px 22px; }
.mark { display: inline-flex; align-items: center; height: 24px; padding: 0 6px; border-radius: 12px; background: #fff; }
.mark i { width: 9px; height: 9px; border-radius: 50%; margin: 0 2px; background: var(--l1); }
.mark i:nth-child(2) { background: var(--now); }
.mark i:nth-child(3) { background: var(--l4); }
.brand.dark .mark { background: var(--ink); }
.brand .tld { font-weight: 500; opacity: .62; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px;
  color: var(--rail-ink); text-decoration: none; font-weight: 500; transition: background .15s, color .15s;
}
.nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav a.on { background: var(--rail-2); color: #fff; }
.nav a.on .ic { color: var(--now); }
.rail-foot { margin-top: auto; padding-top: 18px; display: grid; gap: 10px; }
.who {
  display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; align-items: center; padding: 12px;
  border-radius: var(--r); background: var(--rail-2); color: #fff; text-decoration: none;
}
.who .emblem { grid-row: span 2; }
.who b { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who span.sub { color: var(--rail-mut); font-size: .8125rem; }
.who .xp { color: var(--now); font-weight: 650; }
.credit { color: var(--rail-mut); font-size: .75rem; line-height: 1.4; padding: 0 10px; }
.credit a { color: var(--rail-ink); }
.work { min-width: 0; }
main { max-width: 1120px; margin: 0 auto; padding: 36px 40px 72px; }

/* ---------- знак линии */
.emblem {
  --s: 36px; width: var(--s); height: var(--s); flex: none; border-radius: 50%; display: inline-grid; place-items: center;
  background: var(--line); color: #fff; font-weight: 800; font-size: calc(var(--s) * .5); line-height: 1; letter-spacing: 0;
  box-shadow: inset 0 0 0 calc(var(--s) * .07) rgba(255, 255, 255, .28);
}
.emblem.s { --s: 26px; }
.emblem.l { --s: 64px; }
.emblem.xl { --s: 120px; }
.emblem.off { background: var(--hair); color: var(--ink-3); box-shadow: none; }
.sign { display: inline-flex; align-items: center; gap: 10px; }

/* ---------- мелкие элементы */
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; background: var(--hair-2); color: var(--ink-2); font-size: .8125rem; font-weight: 500; white-space: nowrap; }
.tag .ic { width: 14px; height: 14px; }
.tag.line { background: var(--line); color: #fff; }
.tag.xp { background: var(--now); color: var(--now-ink); font-weight: 650; }
.tag.ok { background: var(--ok-bg); color: #075E3F; }
.tag.new { background: var(--l4); color: #fff; }
.meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin: 10px 0 14px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 20px;
  border: 1px solid var(--ink); border-radius: 10px; background: var(--ink); color: #fff;
  font-weight: 600; text-decoration: none; cursor: pointer; line-height: 1.2; white-space: nowrap;
  transition: background .15s, transform .12s var(--ease), box-shadow .15s;
}
.btn:hover { background: #24304F; border-color: #24304F; box-shadow: var(--shadow); }
.btn:active { transform: scale(.98); }
.btn.go { background: var(--now); border-color: var(--now); color: var(--now-ink); }
.btn.go:hover { background: #FFD666; border-color: #FFD666; }
.btn.ghost { background: transparent; color: var(--ink); border-color: #BAC3D4; }
.btn.ghost:hover { background: var(--surface); border-color: var(--ink); box-shadow: none; }
.btn.sm { min-height: 34px; padding: 0 12px; font-size: .875rem; border-radius: 8px; }
.btn.big { min-height: 52px; padding: 0 26px; font-size: 1.0625rem; border-radius: 12px; }
.btn.danger { background: transparent; color: var(--bad); border-color: #EBB7B4; }
.btn.danger:hover { background: var(--bad-bg); box-shadow: none; }
.btn[disabled] { opacity: .45; cursor: default; box-shadow: none; transform: none; }
.linkbtn { background: none; border: 0; padding: 4px 0; color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.linkbtn:hover { color: var(--ink); }

.field { display: block; margin-bottom: 16px; }
.field > span, .flabel { display: block; font-weight: 600; margin-bottom: 6px; font-size: .9375rem; }
.field small { display: block; color: var(--ink-2); margin-top: 5px; font-size: .8125rem; }
input[type=text], input[type=password], input[type=number], input[type=url], select, textarea {
  width: 100%; min-height: 46px; padding: 10px 14px; border: 1px solid #C3CBDA; border-radius: 10px; background: var(--surface);
  transition: border-color .15s, box-shadow .15s;
}
input:hover, select:hover, textarea:hover { border-color: #97A2B8; }
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--link); box-shadow: 0 0 0 3px rgba(43, 89, 227, .18); }
textarea { min-height: 160px; resize: vertical; line-height: 1.5; }
.check { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; }
.check input { width: 20px; height: 20px; min-height: 0; accent-color: var(--ink); }
.err { color: var(--bad); font-weight: 600; margin: 8px 0; }
.err:empty { display: none; }
.okmsg { color: var(--ok); font-weight: 600; margin: 8px 0; }

.panel { background: var(--surface); border: 1px solid var(--hair); border-radius: var(--r-l); padding: 24px; box-shadow: var(--shadow); }
.stack > * + * { margin-top: 20px; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.pagehead { margin-bottom: 26px; }
.pagehead p { color: var(--ink-2); max-width: 68ch; margin: 8px 0 0; font-size: 1.0625rem; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; padding: 4px; background: var(--hair-2); border-radius: 12px; margin-bottom: 20px; width: fit-content; max-width: 100%; }
.tabs button { background: none; border: 0; padding: 8px 14px; border-radius: 9px; cursor: pointer; color: var(--ink-2); font-weight: 600; transition: background .15s, color .15s; }
.tabs button:hover { color: var(--ink); }
.tabs button[aria-selected=true] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(18, 26, 48, .12); }
.tip { display: flex; gap: 10px; margin: 12px 0 0; padding: 10px 14px; background: var(--warn-bg); border-radius: 10px; font-size: .9375rem; color: #4A3900; }
.tip .ic { margin-top: 2px; color: #9A7400; }
.helper { display: flex; gap: 10px; align-items: flex-start; background: var(--sunk); border: 1px solid var(--hair); padding: 12px 14px; border-radius: 10px; margin: 0 0 18px; font-size: .9375rem; }
.helper .ic { margin-top: 2px; color: var(--ink-3); }
.banner { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 18px; border-radius: var(--r); background: var(--ok-bg); color: #075E3F; font-weight: 600; margin-bottom: 20px; }
.banner.warn { background: var(--warn-bg); color: #4A3900; }
.banner span { display: inline-flex; align-items: center; gap: 10px; }

/* ---------- сцена: вход, настройка, тест */
.stage { min-height: 100vh; display: grid; grid-template-rows: auto 1fr auto; background: var(--ground) url("/art.svg") center top / 1600px auto no-repeat; }
.stage-top { padding: 26px 32px 0; }
.stage-body { display: grid; place-items: start center; padding: 28px 20px 40px; }
.stage-foot { padding: 0 20px 24px; text-align: center; color: var(--ink-2); font-size: .8125rem; }
.stage-foot a { color: var(--ink); }
.sheet { width: 100%; max-width: 460px; background: var(--surface); border: 1px solid var(--hair); border-radius: 22px; padding: 34px 34px 30px; box-shadow: var(--shadow-up); }
.sheet.wide { max-width: 700px; padding: 38px 42px 34px; }
.sheet h1 { font-size: 1.75rem; margin-bottom: 10px; }
.lead2 { font-size: 1.0625rem; color: var(--ink-2); max-width: 56ch; margin-bottom: 22px; }

/* шаги настройки и теста как станции одной линии */
.stepline { display: flex; align-items: center; gap: 0; margin: 0 0 28px; }
.stepline i { width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 3px solid var(--hair); flex: none; transition: border-color .3s, background .3s; }
.stepline i.done { background: var(--ink); border-color: var(--ink); }
.stepline i.now { border-color: var(--ink); box-shadow: 0 0 0 4px var(--now); }
.stepline b { flex: 1; height: 3px; background: var(--hair); }
.stepline b.done { background: var(--ink); }
.progress { height: 6px; background: var(--hair); border-radius: 3px; overflow: hidden; margin: 10px 0 26px; }
.progress i { display: block; height: 100%; background: var(--ink); border-radius: 3px; transition: width .35s var(--ease); }

.choices { display: grid; gap: 10px; }
.choice {
  display: flex; align-items: center; gap: 14px; padding: 16px 18px; border: 1px solid #C3CBDA; border-radius: var(--r);
  background: var(--surface); font-size: 1.0625rem; font-weight: 600; cursor: pointer; text-align: left;
  transition: border-color .15s, box-shadow .15s, transform .12s var(--ease);
}
.choice:hover { border-color: var(--ink); box-shadow: var(--shadow); }
.choice:active { transform: scale(.99); }
.choice .ic { color: var(--ink-3); }
.choice span.grow { flex: 1; }
.choice small { display: block; font-weight: 400; color: var(--ink-2); font-size: .875rem; margin-top: 2px; }
.choice.guess { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.bigcode { display: inline-block; font-size: 1.75rem; font-weight: 700; letter-spacing: -.01em; padding: 14px 20px; background: var(--sunk); border: 1px dashed #AEB8CC; border-radius: var(--r); margin: 2px 0 16px; word-break: break-all; }
.howto { margin: 0 0 20px; padding: 0; list-style: none; counter-reset: how; }
.howto li { counter-increment: how; position: relative; padding: 0 0 12px 40px; font-size: 1.0625rem; }
.howto li::before { content: counter(how); position: absolute; left: 0; top: 0; width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font-size: .8125rem; font-weight: 700; }
.panel .howto { margin-bottom: 0; }
.panel .howto li:last-child { padding-bottom: 0; }
.wizbtns { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 24px; }
.wizfoot { display: flex; justify-content: space-between; gap: 16px; margin: 30px 0 0; padding-top: 18px; border-top: 1px solid var(--hair); flex-wrap: wrap; }
.sheet .hint { display: none; }
.testq { border: 0; padding: 0; margin: 0; min-width: 0; }
.testq legend { padding: 0; margin-bottom: 18px; }
.testq h2 { font-size: 1.5rem; line-height: 1.25; }
.testnav { display: flex; justify-content: space-between; margin-top: 24px; gap: 12px; }
.reveal { text-align: center; padding: 8px 0 6px; }
.reveal .emblem { margin: 0 auto 18px; display: grid; animation: arrive .8s var(--ease) both; }
.reveal h1 { font-size: 2.5rem; }
@keyframes arrive { from { transform: scale(.3); opacity: 0; filter: blur(6px); } to { transform: none; opacity: 1; filter: none; } }

/* ---------- кабинет: главное — линия и следующий шаг */
.hero { background: var(--rail); color: #fff; border-radius: 22px; padding: 30px 32px 28px; box-shadow: var(--shadow-up); }
.hero-head { display: grid; grid-template-columns: auto 1fr auto; gap: 20px; align-items: center; }
.hero h1 { font-size: 2.125rem; }
.hero .goal { color: var(--rail-ink); margin: 6px 0 0; max-width: 56ch; }
.facts { display: flex; gap: 8px; flex-wrap: wrap; list-style: none; margin: 0; padding: 0; }
.facts li { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; background: var(--rail-2); color: var(--rail-ink); font-size: .9375rem; white-space: nowrap; }
.facts b { color: #fff; font-weight: 700; }
.facts .ic { width: 16px; height: 16px; color: var(--now); }

.map { position: relative; display: flex; align-items: flex-start; margin: 30px 0 4px; padding: 6px 0 2px; overflow-x: auto; scrollbar-width: none; }
.map::-webkit-scrollbar { display: none; }
.map-track, .map-fill { position: absolute; top: 21px; height: 6px; border-radius: 3px; left: calc(50% / var(--n)); }
.map-track { right: calc(50% / var(--n)); background: rgba(255, 255, 255, .14); }
.map-fill { width: calc((100% - 100% / var(--n)) * var(--p) / (var(--n) - 1)); background: var(--line); animation: run 1.1s var(--ease) both; transform-origin: left center; }
@keyframes run { from { transform: scaleX(0); } to { transform: none; } }
.stop { position: relative; flex: 1 0 76px; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 0 2px; text-decoration: none; color: var(--rail-mut); font-size: .8125rem; line-height: 1.25; text-align: center; }
.stop .dot { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--rail); border: 5px solid #39446B; color: #fff; transition: transform .2s var(--ease); }
.stop .dot .ic { width: 16px; height: 16px; stroke-width: 3; }
.stop.done .dot { background: var(--line); border-color: var(--line); }
.stop.now .dot { background: var(--now); border-color: var(--now); color: var(--now-ink); box-shadow: 0 0 0 6px rgba(255, 201, 60, .22); }
.stop.now { color: #fff; font-weight: 600; }
.stop.xfer .dot { border-radius: 12px; }
a.stop:hover .dot { transform: scale(1.1); }
a.stop:hover { color: #fff; }

.next { display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: center; margin-top: 26px; padding-top: 24px; border-top: 1px solid rgba(255, 255, 255, .12); }
.next h2 { font-size: 1.5rem; }
.next p { color: var(--rail-ink); margin: 6px 0 0; max-width: 60ch; }
.next .meta { margin: 12px 0 0; }
.next .tag { background: var(--rail-2); color: var(--rail-ink); }
.next .tag.xp { background: var(--now); color: var(--now-ink); }

.radar { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; justify-items: center; }
.radar .bars { width: 100%; }
.sheet .radar { grid-template-columns: 230px minmax(0, 1fr); gap: 26px; align-items: center; }
.radar svg { width: 230px; height: 200px; overflow: visible; }
.radar text { font-size: 10.5px; fill: var(--ink-2); font-weight: 500; }
.radar .web { fill: none; stroke: var(--hair); stroke-width: 1; }
.radar .axis { stroke: var(--hair); stroke-width: 1; }
.radar .shape { fill: var(--line); fill-opacity: .16; stroke: var(--line); stroke-width: 2.5; stroke-linejoin: round; }
.radar .pt { fill: var(--surface); stroke: var(--line); stroke-width: 2.5; }
.bars { display: grid; gap: 9px; }
.bar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; align-items: baseline; font-size: .9375rem; }
.bar .tr { grid-column: 1 / -1; height: 6px; background: var(--hair-2); border-radius: 3px; overflow: hidden; }
.bar .tr i { display: block; height: 100%; background: var(--line); border-radius: 3px; }
.bar b { font-weight: 650; font-variant-numeric: tabular-nums; }
.bar.focus span:first-child { font-weight: 650; }
.bar.focus span:first-child::after { content: "подтянуть"; margin-left: 8px; padding: 1px 8px; border-radius: 999px; background: var(--warn-bg); color: #6B5200; font-size: .75rem; font-weight: 600; }

.medals { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px 20px; }
.medal { display: grid; grid-template-columns: 48px 1fr; gap: 12px; align-items: center; }
.medal .disc { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--now); color: var(--now-ink); box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .5), 0 4px 10px -4px rgba(180, 130, 0, .6); }
.medal .disc .ic { width: 22px; height: 22px; }
.medal.off .disc { background: transparent; color: #A9B2C6; box-shadow: inset 0 0 0 1.5px #C9D0DF; }
.medal b { display: block; line-height: 1.25; font-weight: 650; }
.medal span { display: block; color: var(--ink-2); font-size: .8125rem; line-height: 1.35; margin-top: 2px; }
.medal.off b { color: var(--ink-2); }
.log { list-style: none; margin: 0; padding: 0; }
.log li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--hair-2); font-size: .9375rem; }
.log li:last-child { border: 0; padding-bottom: 0; }
.log b { white-space: nowrap; font-variant-numeric: tabular-nums; color: #7A5B00; }

/* ---------- маршрут */
.linetabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 22px; }
.linetab { display: inline-flex; align-items: center; gap: 10px; padding: 6px 16px 6px 6px; border: 1px solid var(--hair); background: var(--surface); border-radius: 999px; cursor: pointer; font-weight: 600; transition: border-color .15s, box-shadow .15s; }
.linetab.plain { padding: 8px 16px; }
.linetab:hover { border-color: #97A2B8; }
.linetab[aria-selected=true] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.linetab.locked { color: var(--ink-3); }
.lineinfo { display: grid; grid-template-columns: auto 1fr; gap: 6px 18px; align-items: center; margin-bottom: 8px; }
.lineinfo .emblem { grid-row: span 2; }
.lineinfo p { margin: 0; color: var(--ink-2); max-width: 70ch; }
.route { list-style: none; margin: 18px 0 0; padding: 0; position: relative; }
.route::before { content: ""; position: absolute; left: 15px; top: 26px; bottom: 26px; width: 6px; background: var(--line); border-radius: 3px; }
.route li { position: relative; padding-left: 58px; }
.route .dot { position: absolute; left: 0; top: 16px; width: 36px; height: 36px; border-radius: 50%; background: var(--surface); border: 5px solid var(--line); display: grid; place-items: center; color: #fff; }
.route .dot .ic { width: 16px; height: 16px; stroke-width: 3; }
.route li.done .dot { background: var(--line); }
.route li.now .dot { background: var(--now); border-color: var(--now); color: var(--now-ink); box-shadow: 0 0 0 6px rgba(255, 201, 60, .3); }
.route li.xfer .dot { border-radius: 12px; border-color: var(--ink); }
.route li.xfer.done .dot { background: var(--ink); }
.route li.shut .dot { border-color: #C9D0DF; color: var(--ink-3); }
.station { display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; align-items: center; padding: 14px 16px; margin: 0 0 4px; border-radius: var(--r); text-decoration: none; color: var(--ink); transition: background .15s; }
a.station:hover { background: var(--sunk); }
.station h3 { font-size: 1.125rem; }
.station .meta { margin: 8px 0 0; }
.station.locked { color: var(--ink-3); }
.station .state { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: .875rem; white-space: nowrap; color: var(--ink-2); }
.station .state.go { color: var(--ink); }

/* ---------- миссия: лист и боковая сводка */
.mission { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 24px; align-items: start; }
.mission.solo { grid-template-columns: minmax(0, 760px); }
.paper { background: var(--surface); border: 1px solid var(--hair); border-radius: 22px; box-shadow: var(--shadow); padding: 34px 38px; }
.paper > header h1 { margin: 14px 0 12px; }
.paper .goal { font-size: 1.125rem; margin: 0 0 6px; max-width: 62ch; }
.block { margin-top: 34px; padding-top: 30px; border-top: 1px solid var(--hair); }
.block > h2 { margin-bottom: 14px; }
.crumb { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 16px; color: var(--ink-2); text-decoration: none; font-weight: 500; }
.crumb:hover { color: var(--ink); }
.side { position: sticky; top: 24px; display: grid; gap: 14px; }
.side .panel { padding: 20px; }
.todo { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 10px; }
.todo li { display: grid; grid-template-columns: 24px 1fr auto; gap: 10px; align-items: center; font-weight: 500; }
.todo .ic { color: #B3BCCE; }
.todo li.done .ic { color: var(--ok); }
.todo small { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.sidelinks { display: grid; gap: 8px; }

.steps { list-style: none; margin: 0; padding: 0; position: relative; }
.steps::before { content: ""; position: absolute; left: 14px; top: 18px; bottom: 30px; width: 4px; background: var(--hair); border-radius: 2px; }
.step { position: relative; padding: 0 0 30px 52px; }
.step:last-child { padding-bottom: 0; }
.step .n { position: absolute; left: 0; top: 0; width: 32px; height: 32px; border-radius: 50%; background: var(--surface); border: 4px solid var(--line); display: grid; place-items: center; font-weight: 700; font-size: .9375rem; }
.step.done .n { background: var(--line); color: #fff; }
.step.done .n .ic { width: 15px; height: 15px; stroke-width: 3; }
.step h3 { font-size: 1.1875rem; margin: 3px 0 8px; }
.rich p { margin: 0 0 .65em; max-width: 68ch; }
.rich ul { margin: 0 0 .65em; padding-left: 1.2em; list-style: disc; }
.rich li { margin-bottom: .3em; }
.rich li::marker { color: var(--ink-3); }
.rich > :last-child { margin-bottom: 0; }
.prompt { margin: 14px 0 4px; border: 1px solid var(--hair); border-radius: var(--r); background: var(--sunk); overflow: hidden; }
.prompt .bar2 { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 8px 8px 16px; color: var(--ink-2); font-size: .8125rem; font-weight: 500; }
.prompt pre { margin: 0; padding: 4px 16px 14px; white-space: pre-wrap; word-break: break-word; font: 400 .9688rem/1.55 var(--font); color: var(--ink); }
.hint { display: flex; gap: 8px; margin: 0; padding: 10px 16px; border-top: 1px solid var(--hair); font-size: .8438rem; color: var(--ink-2); background: var(--surface); }
.hint .ic { width: 16px; height: 16px; margin-top: 2px; color: var(--ink-3); }
.stepdone { margin-top: 14px; }
.crit { list-style: none; padding: 0; margin: 10px 0 16px; display: grid; gap: 6px; }
.crit li { display: grid; grid-template-columns: 20px 1fr; gap: 10px; align-items: start; }
.crit .ic { width: 18px; height: 18px; margin-top: 3px; color: var(--ok); }
.q { border: 0; padding: 0; margin: 0 0 26px; min-width: 0; }
.q legend { font-weight: 650; font-size: 1.0625rem; padding: 0; margin-bottom: 10px; }
.opt { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid #C3CBDA; border-radius: var(--r); margin-top: 8px; cursor: pointer; background: var(--surface); transition: border-color .15s, background .15s; }
.opt:hover { border-color: var(--ink); }
.opt input { margin-top: 3px; width: 18px; height: 18px; min-height: 0; accent-color: var(--ink); flex: none; }
.opt.sel { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.opt.right { border-color: var(--ok); background: var(--ok-bg); box-shadow: none; }
.opt.wrong { border-color: var(--bad); background: var(--bad-bg); box-shadow: none; }
.q[disabled] .opt { cursor: default; }
.why { margin: 10px 0 0; padding: 10px 14px; background: var(--sunk); border-radius: 10px; font-size: .9375rem; }

/* ---------- таблицы */
.tablewrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--hair); border-radius: var(--r-l); box-shadow: var(--shadow); }
.tablewrap.flat { border: 0; box-shadow: none; border-radius: 0; }
table { border-collapse: collapse; width: 100%; font-size: .9375rem; }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--hair-2); vertical-align: middle; }
th { color: var(--ink-2); font-weight: 600; font-size: .8125rem; white-space: nowrap; background: var(--sunk); }
tbody tr { transition: background .12s; }
tbody tr:hover td { background: var(--sunk); }
tr:last-child td { border-bottom: 0; }
td.r, th.r { text-align: right; font-variant-numeric: tabular-nums; }
tr.mine td, tr.mine:hover td { background: var(--warn-bg); font-weight: 600; }
.place { font-weight: 700; width: 56px; font-variant-numeric: tabular-nums; }
td .actions { min-width: 270px; }

/* ---------- библиотека, программа, автор */
.pcard h3 { margin-bottom: 4px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; }
.times { list-style: none; margin: 0; padding: 0; }
.times li { display: grid; grid-template-columns: 64px 1fr; gap: 16px; padding: 13px 0; border-bottom: 1px solid var(--hair-2); }
.times li:last-child { border: 0; padding-bottom: 0; }
.times time { font-weight: 700; font-variant-numeric: tabular-nums; font-size: 1.0625rem; }
.times .brk { color: var(--ink-3); }
.author { display: grid; grid-template-columns: 88px 1fr; gap: 22px; align-items: start; }
.avatar { width: 88px; height: 88px; border-radius: 50%; background: var(--rail); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 1.875rem; letter-spacing: -.02em; }
.contacts { list-style: none; padding: 0; margin: 12px 0 0; }
.contacts li { margin-bottom: 4px; }

/* ---------- сообщения */
#toasts { position: fixed; right: 20px; bottom: 20px; z-index: 90; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; pointer-events: none; }
.toast { display: inline-flex; align-items: center; gap: 10px; background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; font-weight: 600; box-shadow: var(--shadow-up); animation: pop .35s var(--ease) both; max-width: 360px; }
.toast.xp { background: var(--now); color: var(--now-ink); font-weight: 700; font-size: 1.0625rem; }
.toast.bad { background: var(--bad); }
@keyframes pop { from { transform: translateY(14px) scale(.96); opacity: 0; } to { transform: none; opacity: 1; } }
.overlay { position: fixed; inset: 0; background: rgba(15, 22, 48, .62); z-index: 70; display: grid; place-items: center; padding: 20px; }
.modal { background: var(--surface); border-radius: 22px; padding: 36px 34px 30px; max-width: 460px; width: 100%; text-align: center; box-shadow: var(--shadow-up); animation: pop .35s var(--ease) both; }
.modal .emblem { margin: 0 auto 16px; display: grid; animation: arrive .8s var(--ease) both; }
.modal h2 { margin-bottom: 8px; }
.modal .btn { margin-top: 14px; }

/* ---------- панель тренера */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; margin-bottom: 20px; }
.kpi { padding: 20px 22px; }
.kpi b { display: block; font-size: 2rem; line-height: 1.1; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.dist { display: grid; gap: 10px; }
.dist .row { display: grid; grid-template-columns: 28px 124px 1fr 30px; gap: 12px; align-items: center; }
.dist .row .emblem { --s: 26px; }
.dist .tr { height: 8px; background: var(--hair-2); border-radius: 4px; overflow: hidden; }
.dist .tr i { display: block; height: 100%; background: var(--line); border-radius: 4px; min-width: 3px; }
.dist b { text-align: right; font-variant-numeric: tabular-nums; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; }
.workcard { border: 1px solid var(--hair); border-radius: var(--r-l); background: var(--surface); padding: 18px 20px; margin-bottom: 12px; box-shadow: var(--shadow); }
.workcard pre { white-space: pre-wrap; word-break: break-word; font: inherit; margin: 10px 0 12px; }
.workcard.picked { border-color: var(--now); box-shadow: inset 0 0 0 2px var(--now); }
.formgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 18px; }

/* экран зала: проектор в полутёмной комнате, поэтому тёмный */
.hall { position: fixed; inset: 0; z-index: 80; background: var(--rail); color: #fff; padding: 32px 40px; overflow: auto; display: grid; grid-template-rows: auto 1fr; gap: 26px; }
.hall h1 { font-size: 2.5rem; }
.hall .join { color: var(--rail-ink); font-size: 1.375rem; margin: 8px 0 0; }
.hall .join b { color: var(--now); font-weight: 700; letter-spacing: .02em; }
.hall-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; flex-wrap: wrap; }
.hall-body { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 44px; align-items: start; }
.hall h2 { color: var(--rail-mut); font-size: 1.25rem; font-weight: 600; margin-bottom: 14px; }
.hall .kpis { margin: 0 0 28px; }
.hall .kpi { background: var(--rail-2); border-radius: var(--r-l); }
.hall .kpi b { font-size: 3rem; }
.hall .kpi span { color: var(--rail-ink); }
.hall .dist { gap: 16px; }
.hall .dist .row { grid-template-columns: 44px 190px 1fr 60px; font-size: 1.375rem; gap: 16px; }
.hall .dist .row .emblem { --s: 42px; }
.hall .dist .tr { background: var(--rail-2); height: 12px; border-radius: 6px; }
.hall .dist .tr i { border-radius: 6px; }
.hall .dist b { font-size: 1.875rem; font-weight: 700; }
.hall ol { list-style: none; margin: 0; padding: 0; }
.hall ol li { display: grid; grid-template-columns: 40px 34px 1fr auto; gap: 14px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--rail-2); font-size: 1.3125rem; }
.hall ol .emblem { --s: 32px; }
.hall ol b { font-size: 1.625rem; font-weight: 700; color: var(--now); font-variant-numeric: tabular-nums; }
.hall .feed li { grid-template-columns: 1fr; font-size: 1.125rem; color: var(--rail-ink); }
.hall .feed strong { color: #fff; }
.hall .btn { border-color: #55608A; background: transparent; }
.hall .btn:hover { background: var(--rail-2); border-color: #fff; box-shadow: none; }

/* ---------- игры: список, теория, игровое поле
   Поле тёмное, как главный блок кабинета: здесь человек занят одним делом.
   Жёлтый по-прежнему значит «сейчас» и баллы. Верно и неверно — зелёный и красный. */
.games { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-bottom: 36px; }
.gtile { display: grid; gap: 12px; align-content: start; }
.gtile p { margin: 0; }
.gicon { width: 52px; height: 52px; border-radius: 14px; background: var(--rail); color: #fff; display: grid; place-items: center; }
.gicon .ic { width: 26px; height: 26px; }
.bins { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 0; padding: 0; }
.gfoot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 8px; padding-top: 16px; border-top: 1px solid var(--hair); }
.subhead { margin-bottom: 14px; }
.tag.bad { background: var(--bad-bg); color: #8E221D; }

.gamewrap { max-width: 900px; }
.arena { background: var(--rail); color: #fff; border-radius: 22px; padding: 26px 30px 30px; box-shadow: var(--shadow-up); }
.arena :focus-visible { outline-color: var(--now); }
.arena-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.arena-top h1 { font-size: 1.5rem; }
.arena-top .count { color: var(--rail-mut); margin: 4px 0 0; max-width: 56ch; }
.arena-side { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.score { display: inline-flex; align-items: baseline; gap: 8px; color: var(--rail-ink); }
.score b { color: var(--now); font-size: 1.75rem; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.streak { display: inline-flex; align-items: center; gap: 5px; align-self: center; padding: 3px 10px; border-radius: 999px; background: var(--rail-2); color: #fff; font-size: .8125rem; font-weight: 600; }
.streak .ic { color: var(--now); }
.btn.onrail { background: transparent; border-color: #55608A; color: #fff; }
.btn.onrail:hover { background: var(--rail-2); border-color: #fff; box-shadow: none; }
.pips { display: flex; gap: 6px; margin: 20px 0 22px; }
.pips i { flex: 1; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .14); }
.pips i.ok { background: #3DD598; }
.pips i.no { background: #FF7A72; }
.pips i.now { background: var(--now); }

.gcard { position: relative; overflow: hidden; background: var(--surface); color: var(--ink); border-radius: 18px; padding: 30px 30px 26px; min-height: 196px; display: grid; align-content: center; gap: 12px; animation: deal .3s var(--ease) both; }
@keyframes deal { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }
.gtimer { position: absolute; inset: 0 0 auto 0; height: 6px; background: var(--hair-2); }
.gtimer i { display: block; height: 100%; width: 100%; background: var(--now); }
.gq { margin: 0; font-size: 1.4375rem; font-weight: 600; line-height: 1.34; letter-spacing: -.012em; text-wrap: balance; }
.gq.sm { font-size: 1.0625rem; font-weight: 500; color: var(--ink-2); letter-spacing: 0; }
.gverdict { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 1.1875rem; font-weight: 700; }
.gverdict.ok { color: #075E3F; }
.gverdict.no { color: #A82A24; }
.gverdict .ic { width: 24px; height: 24px; }
.gverdict .plus { margin-left: auto; padding: 2px 12px; border-radius: 999px; background: var(--now); color: var(--now-ink); font-size: 1rem; font-variant-numeric: tabular-nums; }
.gwhy { margin: 0; font-size: 1.0625rem; max-width: 62ch; }
.gask { margin: 20px 0 10px; color: var(--rail-ink); font-weight: 500; }
.gopts { display: grid; gap: 10px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.gopts.n2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.gopts.n4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.gcard + .gopts { margin-top: 20px; }
.gopt {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; min-height: 64px; padding: 12px 14px;
  border: 1px solid #39446B; border-radius: 14px; background: var(--rail-2); color: #fff; font-weight: 600; font-size: 1.0625rem; line-height: 1.2;
  text-align: left; cursor: pointer; transition: border-color .15s, background .15s, transform .12s var(--ease);
}
.gopt:hover:not([disabled]) { border-color: #fff; background: #25305C; }
.gopt:active:not([disabled]) { transform: scale(.98); }
.gopt[disabled] { cursor: default; }
.gopt kbd { font: inherit; font-size: .75rem; font-weight: 600; color: var(--rail-mut); border: 1px solid #39446B; border-radius: 6px; padding: 1px 7px; }
.gopt.right { background: #087A50; border-color: #087A50; }
.gopt.wrong { background: #B92F28; border-color: #B92F28; }
.gopt.dim { opacity: .45; }
.gnext { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 20px; color: var(--rail-mut); font-size: .9375rem; }

.gexplain { display: grid; gap: 12px; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 22px 0 16px; }
.gexplain.n2, .gexplain.n4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.gex { background: var(--rail-2); border-radius: 14px; padding: 16px 18px; }
.gex h3 { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.gex p { margin: 0; color: var(--rail-ink); font-size: .9375rem; }
.gex .eg { margin-top: 8px; color: var(--rail-mut); }
.gnote { color: var(--rail-ink); max-width: 72ch; margin: 0 0 10px; }
.gbtns { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }
.gresult { padding-top: 4px; }
.gresult h2 { font-size: 1.875rem; }
.gscore { margin: 10px 0 0; color: var(--rail-ink); font-size: 1.0625rem; max-width: 64ch; }
.gscore b { color: var(--now); font-weight: 700; font-variant-numeric: tabular-nums; }
.glesson { margin: 14px 0 0; padding: 14px 18px; border-radius: 14px; background: var(--rail-2); max-width: 70ch; }
.greview { margin-top: 20px; }
.greview h2 { margin-bottom: 6px; }
.grow { padding: 16px 0; border-bottom: 1px solid var(--hair-2); }
.grow:last-child { border: 0; padding-bottom: 0; }
.grow p { margin: 0; }
.grow .gt { font-weight: 600; font-size: 1.0625rem; }
.ganswers { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0 !important; }

/* теория перед игрой: текст слева, рисунок с подписью справа */
.slide { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 30px; align-items: center; margin: 22px 0; }
.slide-text h2 { font-size: 1.75rem; margin-bottom: 14px; }
.slide-text .rich { color: var(--rail-ink); font-size: 1.0625rem; }
.slide-text .rich strong { color: #fff; }
.slide-text .rich li { margin-bottom: .5em; }
.slide-text .rich li::marker { color: var(--now); }
.slide-art { margin: 0; background: var(--surface); color: var(--ink); border-radius: 18px; overflow: hidden; animation: deal .3s var(--ease) both; }
.slide-art .art, .slide-art img { display: block; width: 100%; height: auto; }
.slide-art .art { padding: 10px 10px 0; }
.art text { font-family: var(--font); }
.slide-art figcaption { padding: 12px 20px 16px; border-top: 1px solid var(--hair); font-weight: 650; font-size: 1.0625rem; line-height: 1.35; text-align: center; text-wrap: balance; }
.deck-nav { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.deck-dots { display: flex; align-items: center; gap: 12px; color: var(--rail-mut); font-size: .875rem; }
.deck-dots span { display: flex; gap: 6px; }
.deck-dots i { width: 9px; height: 9px; border-radius: 50%; background: rgba(255, 255, 255, .18); }
.deck-dots i.done { background: #fff; }
.deck-dots i.now { background: var(--now); }
.deck-dots b { font-weight: 500; }
.deck-skip { margin: 14px 0 0; text-align: center; }
.deck-skip .linkbtn { color: var(--rail-mut); }
.deck-skip .linkbtn:hover { color: #fff; }

/* на весь экран: тренер показывает теорию и игру на проекторе */
.arena.full { position: fixed; inset: 0; z-index: 60; border-radius: 0; overflow: auto; padding: 4vh 5vw; display: flex; flex-direction: column; justify-content: center; }
.arena.full > * { width: 100%; max-width: 1240px; margin-left: auto; margin-right: auto; flex: none; }
.arena.full .arena-top h1 { font-size: clamp(1.5rem, 2.2vw, 2.25rem); }
.arena.full .slide { gap: 4vw; margin: 3vh auto; }
.arena.full .slide-text h2 { font-size: clamp(1.875rem, 3.1vw, 3.25rem); margin-bottom: .6em; }
.arena.full .slide-text .rich { font-size: clamp(1.125rem, 1.65vw, 1.75rem); }
.arena.full .slide-art figcaption { font-size: clamp(1.125rem, 1.55vw, 1.625rem); }
.arena.full .gq { font-size: clamp(1.5rem, 2.5vw, 2.5rem); }
.arena.full .gq.sm { font-size: clamp(1.0625rem, 1.4vw, 1.5rem); }
.arena.full .gwhy { font-size: clamp(1.0625rem, 1.5vw, 1.625rem); }
.arena.full .gopt { font-size: clamp(1.0625rem, 1.5vw, 1.5rem); min-height: 9vh; }
.arena.full .gcard { min-height: 30vh; padding: 5vh 3vw; }
.arena.show { z-index: 85; }

/* кнопка «Нужна помощь»: всегда под рукой, но не поверх уведомлений справа */
.helpdock { position: fixed; left: 276px; bottom: 20px; z-index: 40; display: flex; align-items: center; gap: 12px; }
.helpdock .btn { box-shadow: var(--shadow-up); }
.helpdock.on { background: var(--now); color: var(--now-ink); padding: 10px 16px; border-radius: 12px; font-weight: 650; box-shadow: var(--shadow-up); }
.helpdock.on > span { display: inline-flex; align-items: center; gap: 8px; }
.helpdock.on .linkbtn { color: var(--now-ink); }

/* комментарий тренера в практике */
.review { margin: 0 0 18px; padding: 14px 18px; border-radius: var(--r); background: var(--sunk); border: 1px solid var(--hair); }
.review.back { background: var(--warn-bg); border-color: #F2D98A; }
.review p { margin: 0; }
.review .rhead { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.review .rtext { white-space: pre-wrap; }
.workcard.back { border-color: #EBB7B4; }

/* экран «Зал» у тренера */
.kpi.hot { background: var(--now); border-color: var(--now); }
.kpi.hot .muted { color: var(--now-ink); }
.live { align-items: start; }
.livelist { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.livelist li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--hair-2); }
.livelist li:last-child { border-bottom: 0; }
.livelist li > .muted { grid-column: 1; }
.livelist li > .btn { grid-column: 2; grid-row: 1 / span 2; }
.tag.topic { background: var(--ink); color: #fff; }

/* тема: теория, тест и практика — три шага одной линии слева направо */
.topic .thead { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px; align-items: center; margin-bottom: 18px; }
.topic .thead p { margin: 4px 0 0; }
.tsteps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; counter-reset: ts; }
.tsteps > li { counter-increment: ts; position: relative; background: var(--sunk); border: 1px solid var(--hair); border-radius: var(--r); padding: 16px 16px 16px 50px; display: grid; gap: 10px; align-content: start; }
.tsteps > li::before { content: counter(ts); position: absolute; left: 14px; top: 14px; width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font-size: .8125rem; font-weight: 700; }
.tsteps h3 { font-size: 1rem; }
.tsteps p { margin: 0; }
.tsteps .btn { justify-self: start; }
.topic.admin .tsteps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.topic.admin .tsteps > li:last-child { grid-column: 1 / -1; }
.tgame { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 10px; align-items: center; padding: 10px 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--hair); color: var(--ink); text-decoration: none; font-weight: 600; transition: border-color .15s; }
.tgame:hover { border-color: var(--ink); }
.tgame .ic { grid-row: span 2; color: var(--ink-2); }
.tgame small { color: var(--ink-2); font-weight: 400; font-size: .8125rem; }
.tgame.main { background: var(--now); border-color: var(--now); color: var(--now-ink); }
.tgame.main .ic, .tgame.main small { color: var(--now-ink); }
.tmethod { font-size: .9375rem; }
.tlines td { padding: 8px 12px; vertical-align: top; }
.tlines td:first-child { white-space: nowrap; }
.rechead { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 36px 0 14px; }
.recsel { width: auto; min-width: 260px; }
.gtile.locked { background: var(--sunk); box-shadow: none; }
.gtile.locked .gicon { background: var(--hair); color: var(--ink-3); }
.gtile.locked h2 { color: var(--ink-2); }
.games + .subhead { margin-top: 0; }

/* практика: шаги на тёмном, задание и таблица сопоставления на светлом листе */
.gsteps { margin: 20px 0 16px; padding: 0; list-style: none; counter-reset: gs; display: grid; gap: 10px; max-width: 72ch; }
.gsteps li { counter-increment: gs; position: relative; padding-left: 40px; color: var(--rail-ink); }
.gsteps li::before { content: counter(gs); position: absolute; left: 0; top: -1px; width: 26px; height: 26px; border-radius: 50%; background: var(--rail-2); color: #fff; display: grid; place-items: center; font-size: .8125rem; font-weight: 700; }
.score .ic { align-self: center; color: var(--rail-mut); }
.mtask { margin-top: 20px; }
.mtask h2 { margin: 26px 0 8px; }
.mtask h2:first-child { margin-top: 0; }
.mrows { margin-top: 6px; }
.mrow { display: grid; grid-template-columns: 30px minmax(0, 1fr) minmax(0, 1.15fr); gap: 14px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--hair-2); }
.mrow:last-child { border-bottom: 0; }
.mnum { width: 26px; height: 26px; border-radius: 50%; background: var(--hair-2); color: var(--ink-2); display: grid; place-items: center; font-size: .8125rem; font-weight: 700; }
.mtext { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.mfoot { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 18px; }
.gsituation { margin: 18px 0 0; padding: 14px 18px; border-radius: 14px; background: var(--rail-2); font-size: 1.0625rem; max-width: 72ch; }
.bpart { margin: 0 0 22px; }
.bpart legend { margin-bottom: 4px; }
.deckrow { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 12px 24px; align-items: center; }
.deckrow p { margin: 4px 0 0; }
.hall-tabs { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.hall .btn[aria-pressed=true] { background: #fff; border-color: #fff; color: var(--ink); }

/* ---------- узкие экраны */
@media (max-width: 1080px) {
  .mission { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; }
}
@media (max-width: 960px) {
  .app { display: block; }
  .rail { position: sticky; z-index: 30; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 14px 0; overflow: visible; }
  .rail .brand { padding: 4px 2px; }
  .rail-foot { margin: 0 0 0 auto; padding: 0; order: 2; }
  .rail-foot .credit { display: none; }
  .who { padding: 5px 14px 5px 5px; border-radius: 999px; gap: 0 8px; }
  .who .emblem { --s: 28px; grid-row: auto; }
  .who b { display: none; }
  .nav { order: 3; flex-direction: row; flex-basis: 100%; overflow-x: auto; scrollbar-width: none; gap: 2px; margin: 0 -14px; padding: 0 10px; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { padding: 10px 12px 12px; border-radius: 10px 10px 0 0; white-space: nowrap; gap: 8px; }
  .nav a .ic { width: 18px; height: 18px; }
  main { padding: 24px 18px 56px; }
  .grid2, .hall-body { grid-template-columns: minmax(0, 1fr); }
  .hero { padding: 24px 20px 22px; border-radius: 18px; }
  .hero-head { grid-template-columns: auto 1fr; }
  .hero-head .facts { grid-column: 1 / -1; }
  .next { grid-template-columns: 1fr; }
  .paper { padding: 26px 22px; border-radius: 18px; }
  .stage { background-size: 1100px auto; }
  .games, .tsteps { grid-template-columns: minmax(0, 1fr); }
  .helpdock { left: 16px; bottom: 16px; }
  .tlines td { display: block; padding: 4px 12px; }
  .tlines tr { display: block; padding: 8px 0; border-bottom: 1px solid var(--hair-2); }
  .arena { padding: 22px 20px 24px; border-radius: 18px; }
  .slide { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .gopts.n4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  h1 { font-size: 1.625rem; }
  .hero h1 { font-size: 1.625rem; }
  .hero .emblem.l { --s: 48px; }
  .next h2 { font-size: 1.25rem; }
  .sheet, .sheet.wide { padding: 26px 22px 24px; border-radius: 18px; }
  .stage-top { padding: 18px 20px 0; }
  .stage-body { padding: 18px 12px 30px; }
  .sheet .radar { grid-template-columns: minmax(0, 1fr); }
  .author { grid-template-columns: 1fr; }
  .cards { grid-template-columns: 1fr; }
  .station { grid-template-columns: 1fr; }
  .lineinfo { grid-template-columns: 1fr; }
  .lineinfo .emblem { display: none; }
  .reveal h1 { font-size: 2rem; }
  .btn.big, .wizbtns .btn { width: 100%; }
  .gopts, .gopts.n2, .gopts.n4, .gexplain, .gexplain.n2, .gexplain.n4, .deckrow { grid-template-columns: minmax(0, 1fr); }
  .gopt { min-height: 56px; }
  .mrow { grid-template-columns: 30px minmax(0, 1fr); }
  .mrow select { grid-column: 1 / -1; }
  .gopt kbd { display: none; }
  .gcard { padding: 26px 20px 22px; min-height: 170px; }
  .gq { font-size: 1.1875rem; }
  .slide-text h2 { font-size: 1.375rem; }
  .gresult h2 { font-size: 1.5rem; }
  .deck-nav .btn { flex: 1; }
  .deck-dots { order: -1; flex-basis: 100%; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
@media print {
  .rail, #toasts, .side { display: none; }
  .app { display: block; }
  body { background: #fff; }
  .paper, .panel { box-shadow: none; }
}
