/* Web City — тест-драйв Aroken. Оболочка на UI-ките сайта: графитовый холст, бумажные карточки, лайм — один акцент, Inter.
   Ощущение игры — только в ключевых точках: тихий «фон движа» за входом (field.js: чеки, интервью, сайты, выпускники), загрузка после входа, титр миссии,
   «МИССИЯ ПРОЙДЕНА» (trainer.css); в строгом HUD — звёзды розыска (миссии), жизни, таймер, кулак «голыми руками»; словесный знак «Web City»
   (Yellowtail) и тонкая закатная линия прогресса. Никаких неоновых обводок, свечений и пёстрых фонов. Одна главная кнопка на экран:
   на бумаге — графитовая .btn--fill (заливка лаймом при наведении, как на сайте), на графите — лаймовая .btn--primary.
   Шапка в одну строку: прогресс миссий (выпадающий список шагов), жизни и таймер, кнопка «Бот» (лента выезжает справа), профиль.
   Тренажёр стилизует себя сам (trainer.css) и занимает всю высоту под шапкой. */

:root {
  --canvas: #0B0B0C;
  --panel: #101114;
  --elev: #17191D;
  --line: #1F2126;
  --line-2: #2A2D33;
  --text: #FFFFFF;
  --muted: #96999F;
  --muted-2: rgba(255, 255, 255, .66);
  --paper-1: #FEFDF9;
  --paper-2: #F9F6EF;
  --paper-3: #ECE6DB;
  --paper: linear-gradient(135deg, var(--paper-1) 2%, var(--paper-2) 55%, var(--paper-3) 96%);
  --ink: #131417;
  --ink-2: #5B5C63;
  --ink-line: rgba(19, 20, 23, .1);
  --graphite: #131417;
  --lime: #C7FF2E;
  --lime-2: #D7FF45;
  --lime-3: #E7FF8A;
  --violet: #B8A3FF;
  --cobalt: #73D6FF;
  --coral: #FF6661;
  --orange: #FF9B42;
  --sunset: linear-gradient(90deg, #B8A3FF 0%, #FF6661 55%, #FF9B42 100%); /* единственный градиент: линия прогресса под шапкой */
  --font: Inter, -apple-system, "SF Pro Text", system-ui, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --script: Yellowtail, "Brush Script MT", cursive;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --spring: cubic-bezier(.34, 1.3, .5, 1);
  --hdr: 60px;
  --gut: 32px;
}

/* ---------- База (из css/main.css сайта) ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--canvas); color-scheme: dark; }
body { margin: 0; min-height: 100vh; min-height: 100dvh; background: var(--canvas); color: var(--text); font: 400 16px/1.5 var(--font); letter-spacing: -.005em; -webkit-font-smoothing: antialiased; overflow-x: clip; }
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--lime); outline-offset: 3px; border-radius: 6px; }
[tabindex="-1"]:focus, [tabindex="-1"]:focus-visible { outline: none; } /* заголовок сцены получает фокус программно (для экранного диктора) — рамка вокруг него выглядит как баг */
::selection { background: rgba(199, 255, 46, .9); color: #131417; }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; left: 16px; top: -60px; z-index: 200; padding: 10px 14px; background: var(--lime); color: var(--ink); border-radius: 10px; font-weight: 600; text-decoration: none; transition: top .2s; }
.skip-link:focus { top: 16px; }
code { font: 500 .9em/1 var(--mono); padding: 2px 5px; border-radius: 5px; background: rgba(255, 255, 255, .08); }

/* ---------- Кнопки (как на сайте) ---------- */
.btn { display: inline-flex; align-items: center; gap: 14px; height: 56px; padding: 8px 9px 8px 20px; border: 0; border-radius: 14px; font-size: 16px; font-weight: 600; letter-spacing: -.01em; text-decoration: none; white-space: nowrap; cursor: pointer; transition: transform .25s var(--ease), box-shadow .25s var(--ease), background .25s, border-color .25s, color .25s; }
.btn:active { transform: translateY(1px) scale(.99); }
.btn__arrow { width: 38px; height: 38px; flex: none; border-radius: 50%; display: grid; place-items: center; transition: transform .3s var(--spring); }
.btn:hover .btn__arrow { transform: translateX(3px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; transform: none; }
.btn:disabled .btn__arrow { transform: none; }
/* Главная на графите — лайм */
.btn--primary { background: linear-gradient(90deg, var(--lime-2), var(--lime-3)); color: #000; }
.btn--primary .btn__arrow { background: #000; color: var(--lime-2); }
.btn--primary:hover:not(:disabled) { box-shadow: 0 6px 22px -6px rgba(215, 255, 69, .45); transform: translateY(-1px); }
/* Главная на бумаге — графит, кружок-заливка лаймом (стайлгайд 5.1) */
.btn--fill { position: relative; overflow: hidden; isolation: isolate; background: var(--graphite); color: #fff; box-shadow: 0 10px 26px -12px rgba(0, 0, 0, .55); }
.btn--fill .btn__fill { position: absolute; z-index: 0; top: 9px; right: 9px; width: 38px; height: 38px; border-radius: 50%; background: var(--lime); transition: transform 600ms cubic-bezier(.4, 0, .2, 1); }
.btn--fill .btn__label, .btn--fill .btn__arrow { position: relative; z-index: 1; }
.btn--fill .btn__arrow { color: var(--graphite); }
.btn--fill .btn__label { transition: color 200ms ease 220ms; }
.btn--fill:is(:hover, :focus-visible):not(:disabled) .btn__label { color: var(--graphite); transition: color 100ms ease 100ms; }
.btn--fill:is(:hover, :focus-visible):not(:disabled) .btn__fill { transform: scale(20); }
.btn--fill:is(:hover, :focus-visible):not(:disabled) .btn__arrow { transform: translateX(5px); }
/* Вторичные */
.btn--ghost { height: 48px; padding: 0 18px; gap: 10px; border: 1px solid var(--line-2); background: transparent; color: #fff; font-size: 15px; }
.btn--ghost:hover:not(:disabled) { background: rgba(255, 255, 255, .06); border-color: #3A3E47; }
.btn--ghost svg { flex: none; }
.btn--ghost.is-on { border-color: rgba(199, 255, 46, .45); color: var(--lime); }
.td-paper .btn--ghost { border-color: rgba(19, 20, 23, .16); color: var(--ink); }
.td-paper .btn--ghost:hover:not(:disabled) { background: rgba(19, 20, 23, .05); border-color: rgba(19, 20, 23, .3); }
.td-paper .btn--ghost.is-on { border-color: rgba(19, 20, 23, .3); background: rgba(199, 255, 46, .35); color: var(--ink); }
.td-link { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0; border: 0; background: none; color: var(--muted-2); font-size: 15px; font-weight: 500; text-decoration: underline; text-decoration-color: rgba(255, 255, 255, .3); text-underline-offset: 4px; cursor: pointer; }
.td-link:hover { color: #fff; text-decoration-color: currentColor; }

/* ---------- Бумага ---------- */
.td-paper { position: relative; border-radius: 28px; background: var(--paper); color: var(--ink); box-shadow: 0 30px 80px -40px rgba(0, 0, 0, .6); }
.td-paper :focus-visible { outline-color: var(--ink); }

/* ================= Шапка: одна строка ================= */
.td-nav { position: sticky; top: 0; z-index: 60; display: flex; align-items: center; gap: 20px; height: var(--hdr); padding: 0 var(--gut); background: rgba(11, 11, 12, .92); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.td-nav__line { position: absolute; left: 0; bottom: -1px; height: 2px; width: var(--p, 0%); background: var(--sunset); transition: width .8s var(--ease); pointer-events: none; }
body[data-view="welcome"] .td-nav { background: transparent; border-bottom-color: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; }
body[data-view="welcome"] .td-nav__line { display: none; }
.td-brand { display: inline-flex; align-items: center; gap: 12px; flex: none; min-height: 44px; text-decoration: none; }
.td-brand__logo { width: 30px; height: 30px; }
/* Вывеска «Web / CITY» (владелец 22.09: «вывеска в духе Vice City»): рукописное «Web» с наклоном над строгим CITY
   разрядкой, пальма — внутри знака справа. --s масштабирует всё сразу: шапка 1, загрузка 2.4 */
.td-sign { --s: 1; position: relative; display: inline-grid; grid-template-columns: auto auto; align-items: end; justify-items: start; color: #fff; white-space: nowrap; line-height: 1; }
.td-sign__web { grid-column: 1; grid-row: 1; position: relative; z-index: 1; margin: 0 0 calc(-5px * var(--s)) calc(-1px * var(--s)); font: 400 calc(25px * var(--s))/.9 var(--script); letter-spacing: .01em; transform: rotate(-7deg); transform-origin: 0 100%; }
.td-sign__city { grid-column: 1; grid-row: 2; padding-left: calc(9px * var(--s)); font: 800 calc(9.5px * var(--s))/1 var(--font); letter-spacing: .5em; text-transform: uppercase; background: var(--sunset); -webkit-background-clip: text; background-clip: text; color: transparent; }
.td-sign .td-sign__palm { grid-column: 2; grid-row: 1 / span 2; align-self: end; height: calc(36px * var(--s)); margin: 0 0 calc(-1px * var(--s)) calc(-2px * var(--s)); color: rgba(255, 236, 210, .55); }
.td-sign--xl { --s: 2.4; }
.td-brand__city { transform: translateY(-1px); }
.td-nav__mid { flex: 1; min-width: 0; display: flex; align-items: center; }
.td-nav__end { position: relative; display: flex; align-items: center; gap: 8px; flex: none; }
.td-nav__back { display: inline-flex; align-items: center; min-height: 44px; padding: 0 4px; color: var(--muted-2); font-size: 15px; font-weight: 500; text-decoration: none; }
.td-nav__back:hover { color: #fff; }

/* Прогресс: «Миссия 1 из 3 · шаг» → выпадающий список шагов */
.td-prog { position: relative; display: inline-flex; align-items: center; gap: 12px; min-width: 0; max-width: 460px; min-height: 44px; margin-left: 8px; padding: 4px 12px 4px 20px; border: 0; border-left: 1px solid var(--line-2); border-radius: 0 10px 10px 0; background: none; text-align: left; cursor: pointer; }
.td-prog:hover .td-prog__txt b, .td-prog[aria-expanded="true"] .td-prog__txt b { color: #fff; }
.td-prog__txt { min-width: 0; display: flex; flex-direction: column; }
.td-prog__txt small { overflow: hidden; font-size: 12.5px; line-height: 16px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; text-overflow: ellipsis; }
.td-prog__txt b { overflow: hidden; font-size: 14.5px; line-height: 20px; font-weight: 600; color: rgba(255, 255, 255, .88); text-overflow: ellipsis; white-space: nowrap; }
.td-prog__chev { flex: none; width: 16px; height: 16px; color: var(--muted); transition: transform .2s; }
.td-prog[aria-expanded="true"] .td-prog__chev { transform: rotate(180deg); }

.td-steps { position: absolute; top: calc(100% + 8px); left: var(--steps-x, 0); z-index: 70; width: 400px; max-height: calc(100dvh - var(--hdr) - 24px); overflow: auto; padding: 8px; border-radius: 16px; background: var(--elev); box-shadow: inset 0 0 0 1px var(--line-2), 0 24px 48px -12px rgba(0, 0, 0, .7); overscroll-behavior: contain; }
.td-steps__hud { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px 12px; border-bottom: 1px solid var(--line-2); margin-bottom: 4px; font-size: 13.5px; color: var(--muted-2); }
.td-steps__m { padding: 14px 12px 6px; font-size: 12.5px; font-weight: 600; letter-spacing: .02em; color: var(--muted); }
.td-step { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 8px 12px; border: 0; border-radius: 10px; background: none; text-align: left; cursor: pointer; }
.td-step:hover { background: rgba(255, 255, 255, .05); }
.td-step[aria-disabled="true"] { cursor: default; }
.td-step[aria-disabled="true"]:hover { background: none; }
.td-step__ico { flex: none; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: rgba(255, 255, 255, .06); color: var(--muted-2); }
.td-step__txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.td-step__txt small { font-size: 12.5px; line-height: 16px; color: var(--muted); }
.td-step__txt b { font-size: 14.5px; line-height: 20px; font-weight: 600; color: #fff; }
.td-step__st { flex: none; font-size: 12.5px; color: var(--muted); }
.td-step.is-done .td-step__ico { background: rgba(199, 255, 46, .12); color: var(--lime); }
.td-step.is-current .td-step__ico { background: var(--lime); color: var(--ink); }
.td-step.is-current .td-step__st { color: var(--lime); }
.td-step.is-viewing { background: rgba(255, 255, 255, .06); }
.td-step.is-locked .td-step__txt b { color: rgba(255, 255, 255, .42); }
.td-step.is-locked .td-step__ico { color: rgba(255, 255, 255, .35); }
.td-step.is-shake { animation: td-shake .32s; }
@keyframes td-shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }

/* HUD: жизни и таймер */
.td-hud { display: inline-flex; align-items: center; gap: 12px; height: 40px; padding: 0 14px; border-radius: 12px; background: var(--panel); box-shadow: inset 0 0 0 1px var(--line); }
.td-hearts { display: inline-flex; gap: 4px; }
.td-heart { width: 16px; height: 15px; fill: none; stroke: rgba(255, 255, 255, .28); stroke-width: 1.4; }
.td-heart.is-on { fill: var(--coral); stroke: var(--coral); }
.td-hud__clock { font: 500 13.5px/1 var(--mono); color: rgba(255, 255, 255, .86); font-variant-numeric: tabular-nums; white-space: nowrap; }
.td-hud__clock:empty { display: none; }
.td-hud__clock.is-paused { color: var(--muted); font-family: var(--font); font-weight: 500; }
.td-hud.is-hit { animation: td-hit .6s ease; }
@keyframes td-hit { 30% { box-shadow: inset 0 0 0 1px var(--coral); } }

/* Кнопка «Бот» с бейджем */
.td-botbtn { position: relative; display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px 0 11px; border: 0; border-radius: 12px; background: var(--panel); box-shadow: inset 0 0 0 1px var(--line); color: #fff; font-size: 14.5px; font-weight: 600; cursor: pointer; transition: background .2s; }
.td-botbtn:hover, .td-botbtn[aria-expanded="true"] { background: var(--elev); }
.td-botbtn svg { width: 18px; height: 18px; color: var(--cobalt); }
.td-botbtn__badge { position: absolute; top: -5px; right: -5px; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--lime); box-shadow: 0 0 0 3px var(--canvas); color: var(--ink); font: 700 12px/20px var(--font); text-align: center; font-variant-numeric: tabular-nums; }
.td-botbtn__badge.is-new { animation: td-badge .5s var(--spring); }
@keyframes td-badge { from { transform: scale(.4); } }

/* Профиль */
.td-chip { display: inline-flex; align-items: center; gap: 10px; height: 44px; padding: 0 6px; border: 0; border-radius: 12px; background: none; color: #fff; font-size: 14.5px; font-weight: 600; cursor: pointer; }
.td-chip:hover, .td-chip[aria-expanded="true"] { background: rgba(255, 255, 255, .06); }
.td-chip__ava { width: 32px; height: 32px; font-size: 14px; }
.td-chip__name { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.td-menu { position: absolute; right: 0; top: calc(100% + 10px); z-index: 80; width: 264px; padding: 8px; border-radius: 16px; background: var(--elev); box-shadow: inset 0 0 0 1px var(--line-2), 0 24px 48px -12px rgba(0, 0, 0, .7); }
.td-menu__who { display: flex; align-items: center; gap: 12px; padding: 10px 12px 12px; }
.td-menu__who span { min-width: 0; display: flex; flex-direction: column; }
.td-menu__who b { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.td-menu__who small { font-size: 13px; color: var(--muted); }
.td-menu__hr { height: 1px; margin: 6px 4px; background: var(--line-2); }
.td-menu__btn { display: block; width: 100%; min-height: 44px; padding: 10px 12px; border: 0; border-radius: 10px; background: none; text-align: left; font-size: 14.5px; font-weight: 500; color: #fff; cursor: pointer; }
.td-menu__btn:hover { background: rgba(255, 255, 255, .06); }
.td-menu__btn.is-armed { color: var(--orange); background: rgba(255, 155, 66, .1); }
.td-menu__btn--out { color: var(--muted-2); }

/* Аватар: фото или буква на градиенте */
.td-ava { flex: none; width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.td-ava--letter { display: grid; place-items: center; background: linear-gradient(135deg, var(--a1), var(--a2)); color: #0B0B0C; font: 700 17px/1 var(--font); }

/* ================= «Фон движа» (field.js): чеки, интервью, сайты, выпускники — тихо, приглушённо, мимо текста ================= */
.td-field { overflow: hidden; pointer-events: none; }
.td-fc { position: absolute; margin: 0; padding: 8px; border-radius: 14px; background: #121316; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06); color: rgba(255, 255, 255, .8); font-size: 12px; line-height: 16px; opacity: 0; transform: rotate(var(--tilt, 0deg)); filter: saturate(.55); animation: td-fc-life var(--life, 9s) ease-in-out both; }
.td-fc.is-still { animation: none; opacity: var(--fc-o, .34); }
.td-fc.is-wait { visibility: hidden; animation-play-state: paused; } /* картинка карточки ещё грузится — карточка ждёт, пустой рамкой не мелькает */
@keyframes td-fc-life { 0% { opacity: 0; transform: translateY(12px) rotate(var(--tilt, 0deg)); } 20%, 78% { opacity: var(--fc-o, .34); } 100% { opacity: 0; transform: translateY(-14px) rotate(var(--tilt, 0deg)); } }
.td-fc img { width: 100%; height: auto; border-radius: 8px; }
.td-fc figcaption { display: -webkit-box; margin-top: 7px; padding: 0 2px; overflow: hidden; -webkit-line-clamp: 2; -webkit-box-orient: vertical; color: rgba(255, 255, 255, .62); }
.td-fc figcaption b { display: block; font-weight: 600; color: #fff; }
.td-fc--check figcaption b { color: #6BD88B; }
.td-fc__cover { position: relative; display: block; }
.td-fc__play { position: absolute; left: 50%; top: 50%; width: 30px; height: 30px; margin: -15px 0 0 -15px; border-radius: 50%; background: rgba(0, 0, 0, .6); }
.td-fc__play::after { content: ""; position: absolute; left: 12px; top: 9px; border-left: 9px solid #fff; border-top: 6px solid transparent; border-bottom: 6px solid transparent; }
.td-fc__bar { display: block; height: 3px; margin-top: 7px; border-radius: 2px; background: rgba(255, 255, 255, .12); overflow: hidden; }
.td-fc__bar i { display: block; height: 100%; background: rgba(255, 255, 255, .5); }
.td-fc__shot { display: block; aspect-ratio: 16 / 10; overflow: hidden; border-radius: 8px; }
.td-fc__shot img { height: 100%; object-fit: cover; object-position: top; border-radius: 0; }
.td-fc--person { display: flex; align-items: center; gap: 10px; padding: 8px 12px 8px 8px; border-radius: 999px; }
.td-fc--person span { min-width: 0; display: flex; flex-direction: column; }
.td-fc--person b { font-size: 13px; font-weight: 600; color: #fff; }
.td-fc--person small { font-size: 12px; color: rgba(255, 255, 255, .6); white-space: nowrap; }
.td-fc__ava { flex: none; width: 40px !important; height: 40px; border-radius: 50% !important; object-fit: cover; object-position: top; }

/* Звёзды розыска: прогресс по трём миссиям */
.td-wanted { display: inline-flex; align-items: center; gap: 3px; }
.td-star { width: 16px; height: 16px; fill: none; stroke: rgba(255, 255, 255, .42); stroke-width: 1.4; stroke-linejoin: round; }
.td-star.is-on { fill: #fff; stroke: #fff; }
.td-star.is-new { animation: td-star .7s var(--spring); }
@keyframes td-star { 0% { transform: scale(.3); } 60% { transform: scale(1.35); } }
.td-wanted small { margin-left: 8px; font-size: 13px; font-weight: 500; color: rgba(255, 255, 255, .7); font-variant-numeric: tabular-nums; }

/* ================= Экран входа ================= */
.td-welcome { position: relative; min-height: calc(100dvh - var(--hdr)); }
.td-welcome__field { position: fixed; inset: 0; z-index: 0; }
.td-welcome__in { position: relative; z-index: 1; width: min(100% - 96px, 1440px); min-height: calc(100dvh - var(--hdr)); margin: 0 auto; padding: 24px 0 56px; display: grid; grid-template-columns: minmax(0, 640px) minmax(0, 1fr) 400px; grid-template-areas: "card . missions"; align-items: end; gap: 32px; }
.td-welcome__card { grid-area: card; align-self: center; padding: 48px 48px 0; overflow: hidden; }
.td-eyebrow { font-size: 15px; font-weight: 500; color: var(--ink-2); }
.td-welcome__title { margin-top: 14px; font-size: 52px; line-height: 56px; font-weight: 700; letter-spacing: -.035em; text-wrap: balance; }
.td-welcome__lead { margin-top: 18px; font-size: 17px; line-height: 26px; color: var(--ink-2); }
.td-welcome__cta { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; margin-top: 30px; }
.td-welcome__fine { max-width: 260px; font-size: 14px; line-height: 20px; color: var(--ink-2); }
.td-welcome__fine b { font-weight: 600; color: var(--ink); }
.td-login-error { margin-top: 14px; color: #C2322D; }
.td-rules { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 36px -48px 0; border-top: 1px solid var(--ink-line); }
.td-rules li { display: flex; flex-direction: column; gap: 2px; padding: 16px 24px 18px 48px; }
.td-rules li:nth-child(even) { padding-left: 24px; border-left: 1px solid var(--ink-line); }
.td-rules li:nth-child(n + 3) { border-top: 1px solid var(--ink-line); }
.td-rules b { font-size: 15.5px; line-height: 21px; font-weight: 700; letter-spacing: -.01em; }
.td-rules span { font-size: 13.5px; line-height: 19px; color: var(--ink-2); }

/* Список миссий как в игре: тёмная плашка, выбранная строка — белая, у закрытых замок */
.td-missions { grid-area: missions; padding: 6px; border-radius: 16px; background: #0F1012; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08); }
.td-missions__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px 12px; }
.td-missions__h { font-size: 13px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: #fff; }
.td-missions__list li { display: flex; align-items: center; gap: 14px; min-height: 60px; padding: 10px 14px; border-radius: 10px; color: rgba(255, 255, 255, .5); }
.td-missions__list li + li { margin-top: 2px; }
.td-missions__no { flex: none; width: 24px; font: 500 13px/1 var(--mono); color: inherit; }
.td-missions__t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.td-missions__t b { font-size: 15.5px; line-height: 21px; font-weight: 600; color: rgba(255, 255, 255, .78); }
.td-missions__t small { font-size: 13px; line-height: 18px; }
.td-missions__t a { color: inherit; text-underline-offset: 3px; }
.td-missions__st { flex: none; display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 500; }
.td-missions__list li.is-open { background: #fff; color: var(--ink-2); }
.td-missions__list li.is-open .td-missions__t b { color: var(--ink); }
.td-missions__list li.is-open .td-missions__st { color: var(--ink); font-weight: 600; }
.td-missions__list li.is-fin .td-missions__no { font-family: var(--font); font-size: 15px; }

@media (max-width: 1279px) {
  .td-welcome__in { width: min(100% - 64px, 1440px); grid-template-columns: minmax(0, 560px) minmax(0, 1fr) 360px; gap: 24px; }
  .td-welcome__card { padding: 40px 40px 0; }
  .td-welcome__title { font-size: 44px; line-height: 48px; }
  .td-rules { margin-inline: -40px; }
  .td-rules li { padding-left: 40px; }
}
@media (max-width: 1023px) {
  .td-welcome__in { grid-template-columns: minmax(0, 640px); grid-template-areas: "card" "missions"; justify-content: center; align-content: center; align-items: start; }
}
@media (max-width: 767px) {
  .td-welcome { min-height: 0; }
  .td-welcome__field { display: none; }
  .td-welcome__in { width: calc(100% - 24px); min-height: 0; padding: 4px 0 32px; grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .td-welcome__card { padding: 26px 20px 0; border-radius: 22px; }
  .td-eyebrow { font-size: 14px; }
  .td-welcome__title { margin-top: 10px; font-size: 32px; line-height: 36px; letter-spacing: -.03em; }
  .td-welcome__lead { margin-top: 12px; font-size: 16px; line-height: 24px; }
  .td-welcome__cta { margin-top: 22px; }
  .td-welcome__cta .btn { width: 100%; justify-content: space-between; }
  .td-welcome__fine { max-width: none; }
  .td-rules { margin: 24px -20px 0; }
  .td-rules li { padding: 14px 14px 16px 20px; }
  .td-rules li:nth-child(even) { padding-left: 14px; }
  .td-missions__list li { gap: 12px; padding: 10px 12px; }
  .td-missions__st { font-size: 0; }
  .td-missions__list li.is-open .td-missions__st { font-size: 12px; }
}

/* ---------- Окно входа в стиле Telegram (демо) ---------- */
.td-tg { width: min(400px, calc(100% - 32px)); max-height: calc(100dvh - 32px); padding: 0; border: 0; border-radius: 20px; background: transparent; color: #000; overflow: auto; }
.td-tg::backdrop { background: rgba(0, 0, 0, .6); }
.td-tg[open] { animation: td-pop .28s var(--ease); }
.td-tg.is-closing { animation: td-out .16s ease forwards; }
@keyframes td-pop { from { opacity: 0; transform: translateY(10px); } }
@keyframes td-out { to { opacity: 0; transform: translateY(6px); } }
.td-tg__panel { padding: 24px 24px 18px; border-radius: 20px; background: #fff; box-shadow: 0 30px 60px -12px rgba(0, 0, 0, .5); font-family: -apple-system, "SF Pro Text", Roboto, "Segoe UI", Inter, sans-serif; }
.td-tg__head { display: flex; align-items: center; gap: 12px; }
.td-tg__logo { flex: none; }
.td-tg__brand { font-size: 17px; font-weight: 600; letter-spacing: -.01em; color: #000; }
.td-tg__title { margin-top: 20px; font-size: 20px; line-height: 26px; font-weight: 600; letter-spacing: -.015em; }
.td-tg__title b { color: #2AABEE; font-weight: 600; }
.td-tg__text { margin-top: 6px; font-size: 15px; line-height: 21px; color: #707579; }
.td-tg__text b { color: #000; font-weight: 500; }
.td-tg__acc { margin-top: 18px; padding: 12px; border-radius: 14px; background: #F4F4F5; display: flex; align-items: center; gap: 12px; }
.td-tg__who { min-width: 0; display: flex; flex-direction: column; }
.td-tg__who b { font-size: 16px; line-height: 21px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.td-tg__who span { font-size: 14px; line-height: 19px; color: #707579; }
.td-tg__check { margin-top: 14px; display: flex; align-items: flex-start; gap: 12px; font-size: 14.5px; line-height: 20px; color: #000; cursor: pointer; }
.td-tg__check input { flex: none; width: 20px; height: 20px; margin: 0; accent-color: #2AABEE; }
.td-tg__check b { font-weight: 500; }
.td-tg__actions { margin-top: 20px; display: flex; justify-content: flex-end; gap: 8px; }
.td-tg__btn { min-height: 44px; padding: 0 18px; border: 0; border-radius: 12px; background: none; font-family: inherit; font-size: 15px; font-weight: 600; color: #2AABEE; text-transform: uppercase; letter-spacing: .02em; cursor: pointer; transition: background .2s; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.td-tg__btn:hover { background: rgba(42, 171, 238, .1); }
.td-tg__btn:focus-visible { outline: 2px solid #2AABEE; outline-offset: 2px; }
.td-tg__btn--ok { background: #2AABEE; color: #fff; }
.td-tg__btn--ok:hover { background: #229ED9; }
.td-tg__open { width: 100%; margin-top: 18px; }
.td-tg__open[aria-disabled="true"] { opacity: .5; pointer-events: none; }
.td-tg__status { margin-top: 12px; font-size: 14px; line-height: 20px; color: #707579; }
.td-tg__status:empty { display: none; }
.td-tg__widget { margin-top: 18px; min-height: 44px; display: flex; justify-content: center; }
.td-tg__demo { margin-top: 12px; padding-top: 12px; border-top: 1px solid #EFEFF0; font-size: 12.5px; line-height: 17px; color: #9A9DA1; text-align: center; }

/* ================= Сцены ================= */
.td-stage { min-height: calc(100dvh - var(--hdr)); outline: none; }
.td-screen { width: min(100% - 2 * var(--gut), 1120px); margin: 0 auto; padding: 48px 0 96px; }
.td-screen--lesson { width: min(100% - 2 * var(--gut), 1040px); }
.td-screen--narrow { width: min(100% - 2 * var(--gut), 720px); }
.td-kicker { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 14.5px; line-height: 20px; font-weight: 500; color: var(--muted); }
.td-kicker b { font-weight: 600; color: #fff; }
.td-kicker i { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: .7; }
.td-paper .td-kicker { color: var(--ink-2); }
.td-paper .td-kicker b { color: var(--ink); }
.td-h1 { margin-top: 10px; font-size: 40px; line-height: 46px; font-weight: 700; letter-spacing: -.03em; text-wrap: balance; }
.td-sub { max-width: 720px; margin-top: 12px; font-size: 17px; line-height: 26px; color: var(--muted-2); }
.td-paper .td-sub { color: var(--ink-2); }
.td-h2 { font-size: 20px; line-height: 26px; font-weight: 700; letter-spacing: -.015em; }
.td-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }

/* ---------- Приветствие ---------- */
.td-stage[data-screen="greet"] { position: relative; display: grid; align-items: center; overflow: hidden; }
.td-greet-wrap { position: relative; z-index: 1; }
.td-greet { display: grid; grid-template-columns: minmax(0, 1fr); justify-items: start; max-width: 720px; }
.td-greet__ava { width: 64px; height: 64px; font-size: 26px; }
.td-greet .td-h1 { margin-top: 24px; font-size: 44px; line-height: 50px; }
.td-greet .td-sub { margin-top: 14px; }
.td-greet__hud { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; margin-top: 28px; padding: 16px 0; width: 100%; border-block: 1px solid var(--line-2); font-size: 14.5px; color: var(--muted-2); }
.td-greet__hud > span { display: inline-flex; align-items: center; gap: 10px; }
.td-greet__hud [data-clock] { font: 500 14px/1 var(--mono); color: #fff; }
.td-greet__hud [data-clock].is-paused { font-family: var(--font); color: var(--muted-2); }
.td-next { display: flex; flex-direction: column; gap: 2px; margin-top: 24px; }
.td-next small { font-size: 13.5px; color: var(--muted); }
.td-next b { font-size: 18px; line-height: 24px; font-weight: 600; letter-spacing: -.01em; }
.td-greet .td-actions { margin-top: 28px; }

/* ---------- Видео ---------- */
.td-player { position: relative; margin-top: 28px; aspect-ratio: 16 / 9; border-radius: 20px; overflow: hidden; background: #000; box-shadow: inset 0 0 0 1px var(--line); }
.td-player__stub { position: absolute; inset: 0; }
.td-player__poster { position: absolute; inset: 0; display: flex; justify-content: flex-end; align-items: flex-end; background: radial-gradient(80% 90% at 75% 60%, #1B1D22, var(--panel) 70%); }
.td-player__max { height: 94%; width: auto; max-width: none; margin-right: 7%; }
.td-player__cap { position: absolute; left: 40px; top: 0; bottom: 0; width: 46%; display: flex; flex-direction: column; justify-content: center; gap: 10px; }
.td-player__cap small { font-size: 14px; color: var(--muted); }
.td-player__name { font-size: clamp(22px, 2.6vw, 36px); line-height: 1.12; font-weight: 700; letter-spacing: -.025em; text-wrap: balance; }
.td-player__go { display: flex; align-items: center; gap: 14px; margin-top: 12px; }
.td-player__play { flex: none; width: 64px; height: 64px; display: grid; place-items: center; border: 0; border-radius: 50%; background: #fff; color: var(--ink); cursor: pointer; transition: transform .25s var(--spring); }
.td-player__play svg { margin-left: 3px; }
.td-player__play:hover { transform: scale(1.07); }
.td-player__dur { font-size: 15px; font-weight: 600; color: #fff; font-variant-numeric: tabular-nums; }
.td-player__frame { position: absolute; inset: 0; }
.td-player__frame iframe, .td-player__frame > * { width: 100%; height: 100%; border: 0; display: block; }
.td-player__bar { position: absolute; left: 20px; right: 20px; bottom: 16px; display: none; align-items: center; gap: 12px; }
.td-player__stub.is-playing .td-player__bar { display: flex; }
.td-player__stub.is-playing .td-player__cap { display: none; }
.td-player__mini { width: 36px; height: 36px; display: grid; place-items: center; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .14); color: #fff; cursor: pointer; }
.td-player__track { flex: 1; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .18); overflow: hidden; }
.td-player__track i { display: block; height: 100%; width: 0; background: var(--lime); }
.td-player__time { font: 500 13px/1 var(--mono); color: var(--muted-2); }
.td-player__stubnote { position: absolute; left: 20px; top: 18px; font-size: 13px; color: var(--muted); }
.td-lesson__below { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px 48px; align-items: start; margin-top: 28px; }
.td-points { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 32px; counter-reset: pt; }
.td-points li { position: relative; padding-left: 32px; font-size: 16px; line-height: 23px; color: rgba(255, 255, 255, .86); counter-increment: pt; }
.td-points li::before { content: counter(pt); position: absolute; left: 0; top: 1px; width: 21px; height: 21px; display: grid; place-items: center; border-radius: 50%; box-shadow: inset 0 0 0 1px var(--line-2); font-size: 12px; font-weight: 600; color: var(--muted); }
.td-lesson__act { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; min-width: 240px; }
.td-gatenote { max-width: 260px; font-size: 13.5px; line-height: 19px; color: var(--muted); text-align: right; }
.td-done-note { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--lime); }

/* Сайты и кейсы студентов — под видео, спокойно */
.td-extra { margin-top: 64px; padding-top: 28px; border-top: 1px solid var(--line); }
.td-extra__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 20px; }
.td-extra__note { font-size: 14.5px; color: var(--muted); }
.td-sites { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(260px, 30%); gap: 16px; margin-top: 18px; padding-bottom: 12px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: thin; scrollbar-color: #2A2D33 transparent; }
.td-site { scroll-snap-align: start; }
.td-site__shot { display: block; aspect-ratio: 16 / 10; border-radius: 12px; overflow: hidden; background: var(--panel); box-shadow: inset 0 0 0 1px var(--line); }
.td-site__shot img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.td-site figcaption { display: flex; flex-direction: column; margin-top: 10px; }
.td-site figcaption b { font-size: 15px; font-weight: 600; }
.td-site figcaption small { font-size: 13.5px; color: var(--muted); }
.td-cases { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 32px; margin-top: 12px; }
.td-case { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); text-decoration: none; }
.td-case img { flex: none; width: 44px; height: 44px; border-radius: 50%; object-fit: cover; object-position: top; }
.td-case > span { min-width: 0; display: flex; flex-direction: column; }
.td-case b { font-size: 15px; font-weight: 600; }
.td-case small { font-size: 13.5px; color: var(--muted); }
.td-case__money { margin-top: 2px; font-size: 14px; color: var(--muted-2); font-variant-numeric: tabular-nums; }
.td-case__money strong { color: #fff; font-weight: 600; }
.td-case:hover b { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Задание: тренажёр на всю высоту под шапкой ---------- */
.td-stage[data-kind="trainer"][data-screen="step"] { height: calc(100dvh - var(--hdr)); min-height: 520px; }
.td-trainer { height: 100%; }
.td-trainer__err { margin: 48px auto; width: min(100% - 32px, 560px); padding: 24px; border-radius: 16px; background: var(--panel); color: var(--muted-2); }

/* Заглушка тренажёра (trainer-stub.js) */
.td-stub { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; width: min(100% - 2 * var(--gut), 1120px); margin: 32px auto; }
.td-stub__code { border-radius: 16px; background: var(--panel); box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; }
.td-stub__tab { padding: 12px 16px; border-bottom: 1px solid var(--line); font: 500 13px/1 var(--mono); color: var(--muted-2); }
.td-stub__code pre { margin: 0; padding: 16px; font: 400 14px/1.7 var(--mono); white-space: pre-wrap; }
.td-stub__ln { display: inline-block; width: 28px; color: rgba(255, 255, 255, .28); }
.td-stub__note { color: var(--muted-2); }
.td-stub__steps { margin: 16px 0; display: grid; gap: 8px; }
.td-stub__steps li { padding: 10px 14px; border-radius: 10px; background: var(--panel); }
.td-stub__steps li.is-done { color: var(--lime); }
.td-stub__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.td-stub__btn { min-height: 44px; padding: 0 16px; border: 1px solid var(--line-2); border-radius: 12px; background: none; font-weight: 600; cursor: pointer; }

/* ---------- «МИССИЯ ПРОЙДЕНА» (запасной экран — только с заглушкой тренажёра; у движка своя, trainer.css) ---------- */
.td-passed { display: grid; place-items: center; min-height: calc(100dvh - var(--hdr)); padding: 48px var(--gut); text-align: center; }
.td-passed__band { width: 100%; padding: 40px 0 44px; background: rgba(0, 0, 0, .6); border-block: 1px solid rgba(255, 233, 168, .18); }
.td-passed__title { font-size: clamp(40px, 7vw, 96px); line-height: .95; font-weight: 900; letter-spacing: .01em; text-transform: uppercase; color: #FFE7A0; text-shadow: 0 2px 0 rgba(0, 0, 0, .4); }
.td-passed__text { max-width: 620px; margin: 18px auto 0; font-size: 17px; line-height: 26px; color: var(--muted-2); }
.td-passed__text b { color: #fff; font-weight: 600; }
.td-passed__stats { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 22px; margin-top: 16px; font-size: 14.5px; color: var(--muted); }
.td-passed__stats b { color: #fff; font-weight: 600; margin-right: 6px; }
.td-passed .td-actions { justify-content: center; margin-top: 28px; }
.td-passed__band { animation: td-band .55s var(--ease) both; }
@keyframes td-band { from { transform: scaleY(0); } }
.td-wasted .td-passed__band { border-color: rgba(255, 102, 97, .18); }
.td-wasted__title { color: transparent; background: linear-gradient(180deg, #FFD9D6 8%, #FF8A85 55%, #E0453F 100%); -webkit-background-clip: text; background-clip: text; animation: td-mt .7s var(--ease) .12s both; }
.td-wasted__h { margin-top: 14px; font-size: 24px; line-height: 30px; }
.td-wasted__note { margin-top: 18px; font-size: 13px; color: var(--muted); }

/* ---------- Домашка и кодовое слово: одна карточка по центру ---------- */
.td-gate { padding: 40px 44px 36px; }
.td-gate__lock { width: 32px; height: 38px; color: var(--ink); }
.td-gate__lock .td-lock__shackle { transform-origin: 66px 46px; transition: transform .5s var(--spring); }
.td-gate.is-open .td-gate__lock .td-lock__shackle { transform: translateY(-9px) rotate(28deg); }
.td-gate__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.td-gate .td-h1 { margin-top: 8px; font-size: 34px; line-height: 40px; }
.td-gate .td-sub { font-size: 16px; line-height: 24px; }
.td-gate__parts { margin-top: 28px; counter-reset: part; }
.td-part { position: relative; padding: 22px 0 22px 44px; border-top: 1px solid var(--ink-line); counter-increment: part; }
.td-part::before { content: counter(part); position: absolute; left: 0; top: 22px; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: var(--graphite); color: #fff; font-size: 13.5px; font-weight: 700; }
.td-part.is-done::before { content: "✓"; background: var(--lime); color: var(--ink); }
.td-part__title { font-size: 17px; line-height: 26px; font-weight: 600; letter-spacing: -.01em; }
.td-part__text { margin-top: 4px; font-size: 15px; line-height: 22px; color: var(--ink-2); }
.td-part__text b { color: var(--ink); font-weight: 600; }
.td-form { margin-top: 12px; display: grid; gap: 6px; counter-reset: q; }
.td-form li { position: relative; padding-left: 24px; font-size: 16px; line-height: 23px; counter-increment: q; }
.td-form li::before { content: counter(q) "."; position: absolute; left: 0; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.td-gate__btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.td-code { margin-top: 12px; }
.td-code__row { display: flex; gap: 10px; }
.td-code__input { flex: 1; min-width: 0; height: 56px; padding: 0 18px; border: 1px solid rgba(19, 20, 23, .18); border-radius: 14px; background: #fff; color: var(--ink); font: 600 18px/1 var(--font); letter-spacing: .06em; text-transform: uppercase; outline: none; transition: border-color .2s, box-shadow .2s; }
.td-code__input::placeholder { color: rgba(19, 20, 23, .38); text-transform: none; letter-spacing: 0; font-weight: 500; }
.td-code__input:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(199, 255, 46, .6); }
.td-code__input.is-bad { border-color: #D8453F; animation: td-shake .32s; }
.td-code__input:disabled { background: rgba(199, 255, 46, .3); border-color: transparent; }
.td-code__msg { min-height: 22px; margin-top: 8px; font-size: 14.5px; line-height: 20px; color: var(--ink-2); }
.td-code__msg.is-bad { color: #C2322D; }
.td-code__msg.is-ok { color: var(--ink); font-weight: 600; }
.td-code__demo { margin-top: 4px; font-size: 13px; line-height: 18px; color: var(--ink-2); }
.td-code__demo em { margin-right: 8px; padding: 2px 7px; border-radius: 6px; background: rgba(19, 20, 23, .07); font-style: normal; font-weight: 600; font-size: 12px; }
.td-gate__timer { flex: none; display: grid; grid-template-columns: auto auto; grid-template-rows: auto auto; column-gap: 12px; align-items: center; padding-top: 4px; font-size: 13px; color: var(--ink-2); text-align: right; }
.td-gate__timer .td-gate__lock { grid-row: 1 / 3; grid-column: 2; }
.td-gate__timer span:empty, .td-gate__timer b:empty { display: none; }
.td-gate__timer b { font: 500 15px/1 var(--mono); color: var(--ink); font-variant-numeric: tabular-nums; }
.td-gate__timer b.is-paused { font-family: var(--font); font-weight: 600; }

/* ---------- Жизни кончились (временный экран) ---------- */
.td-out { text-align: center; }
.td-out .td-hearts { justify-content: center; gap: 8px; }
.td-out .td-heart { width: 30px; height: 28px; }
.td-out .td-sub { margin-inline: auto; }
.td-out .td-actions { justify-content: center; margin-top: 28px; }
.td-out .td-kicker { justify-content: center; margin-top: 28px; }

/* ---------- Финал: план до 100к+ ---------- */
.td-fin .td-h1 { max-width: 900px; }
.td-fin__top { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; margin-top: 28px; }
.td-fin__top .td-player { margin-top: 0; }
.td-deal { padding: 28px; border-radius: 20px; overflow: hidden; }
.td-deal > :not(.td-deal__palm) { position: relative; z-index: 1; }
.td-deal__palm { position: absolute; right: -34px; bottom: -26px; height: 230px; color: rgba(19, 20, 23, .06); pointer-events: none; }
.td-deal__label { font-size: 14.5px; font-weight: 500; color: var(--ink-2); }
.td-deal__left { display: block; margin-top: 6px; font: 600 40px/1 var(--mono); letter-spacing: -.02em; color: var(--ink); font-variant-numeric: tabular-nums; }
.td-deal__note { display: block; margin-top: 8px; font-size: 13.5px; line-height: 19px; color: var(--ink-2); }
.td-deal__cta { margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--ink-line); display: flex; flex-direction: column; align-items: flex-start; gap: 16px; }
.td-deal__text { font-size: 15.5px; line-height: 23px; color: var(--ink); }
.td-deal__text b { font-weight: 600; }
.td-deal__done { display: flex; gap: 10px; font-size: 15px; line-height: 22px; color: var(--ink); }
.td-deal__done svg { flex: none; margin-top: 3px; }
.td-fin__sec { margin-top: 64px; }
.td-fin__sec > .td-extra__head { margin-bottom: 20px; }
.td-road { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--line-2); }
.td-road__m { display: flex; flex-direction: column; padding: 20px 24px 0 0; }
.td-road__m + .td-road__m { padding-left: 24px; border-left: 1px solid var(--line); }
.td-road__bar { position: relative; height: 150px; display: flex; flex-direction: column; justify-content: flex-end; }
.td-road__bar i { display: block; width: 100%; max-width: 120px; height: calc(var(--h) * 1.1px); border-radius: 8px 8px 0 0; background: #24272D; }
.td-road__m:last-child .td-road__bar i { background: var(--lime); }
.td-road__money { margin-bottom: 8px; font-size: 22px; line-height: 26px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.td-road__m--learn .td-road__money { color: var(--muted); font-weight: 600; font-size: 18px; }
.td-road__card { padding-top: 16px; border-top: 1px solid var(--line-2); }
.td-road__card small { font-size: 13px; color: var(--muted); }
.td-road__card b { display: block; margin-top: 2px; font-size: 16px; line-height: 22px; font-weight: 600; }
.td-road__card p { margin-top: 6px; font-size: 14.5px; line-height: 21px; color: var(--muted-2); }
.td-fin__honest { margin-top: 20px; font-size: 13.5px; line-height: 19px; color: var(--muted); }
.td-fin__row { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 48px; margin-top: 64px; align-items: start; }
.td-alumni { margin-top: 12px; }
.td-alumni__row { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); text-decoration: none; }
.td-alumni__ava { flex: none; width: 40px; height: 40px; border-radius: 50%; object-fit: cover; object-position: top; }
.td-alumni__who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.td-alumni__who b { font-size: 15px; font-weight: 600; }
.td-alumni__who small { font-size: 13.5px; color: var(--muted); }
.td-alumni__money { flex: none; display: flex; align-items: baseline; gap: 10px; font-variant-numeric: tabular-nums; }
.td-alumni__money s { font-size: 14px; color: var(--muted); }
.td-alumni__money b { font-size: 16px; font-weight: 700; }
.td-alumni__money small { font-size: 12.5px; color: var(--muted); }
.td-alumni__row:hover .td-alumni__who b { text-decoration: underline; text-underline-offset: 3px; }
.td-fin__note { margin-top: 14px; font-size: 14.5px; line-height: 21px; color: var(--muted-2); }
.td-caches__list { margin-top: 12px; }
.td-caches__list li { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.td-caches__list i { flex: none; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: rgba(199, 255, 46, .12); color: var(--lime); }
.td-caches__list span { display: flex; flex-direction: column; font-size: 15.5px; font-weight: 600; }
.td-caches__list small { font-size: 12.5px; font-weight: 500; color: var(--muted); }

/* ================= Бот: лента выезжает справа из шапки ================= */
.td-drawer { position: fixed; inset: var(--hdr) 0 0 0; z-index: 55; }
.td-drawer__scrim { position: absolute; inset: 0; background: rgba(0, 0, 0, .45); animation: td-fade .2s ease; }
@keyframes td-fade { from { opacity: 0; } }
.td-bot { position: absolute; top: 0; right: 0; bottom: 0; width: min(420px, 100%); display: flex; flex-direction: column; background: var(--panel); border-left: 1px solid var(--line-2); animation: td-slide .28s var(--ease); }
@keyframes td-slide { from { transform: translateX(24px); opacity: 0; } }
.td-bot__head { display: flex; align-items: center; gap: 12px; padding: 14px 16px 14px 20px; border-bottom: 1px solid var(--line); }
.td-bot__ava { flex: none; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: var(--elev); box-shadow: inset 0 0 0 1px var(--line-2); }
.td-bot__who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.td-bot__who b { font-size: 15.5px; font-weight: 600; }
.td-bot__who small { font-size: 13px; color: var(--muted); }
.td-bot__x { flex: none; width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 10px; background: none; color: var(--muted-2); cursor: pointer; }
.td-bot__x:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.td-bot__feed { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 20px 20px 24px; overscroll-behavior: contain; }
.td-bot__empty { margin: auto; font-size: 14.5px; color: var(--muted); }
.td-msg { align-self: flex-start; max-width: 92%; display: flex; flex-direction: column; gap: 6px; }
.td-msg.is-new { animation: td-msg .35s var(--ease); }
@keyframes td-msg { from { opacity: 0; transform: translateY(6px); } }
.td-msg__tag { align-self: flex-start; padding: 2px 8px; border-radius: 6px; background: rgba(255, 255, 255, .06); font-size: 12px; font-weight: 600; color: var(--muted); }
.td-msg__text { position: relative; display: block; padding: 11px 14px 22px; border-radius: 4px 16px 16px 16px; background: var(--elev); font-size: 15px; line-height: 22px; color: rgba(255, 255, 255, .92); }
.td-msg__text b { font-weight: 600; color: #fff; }
.td-msg--warn .td-msg__text { box-shadow: inset 3px 0 0 var(--coral); }
.td-msg__ok { display: inline-block; vertical-align: -3px; margin-right: 6px; color: var(--lime); }
.td-msg__list { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; color: var(--muted-2); }
.td-msg__time { position: absolute; right: 12px; bottom: 5px; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.td-msg__card { display: flex; flex-direction: column; padding: 10px 14px; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--line-2); }
.td-msg__card-top { font-size: 12.5px; color: var(--muted); }
.td-msg__card b { font-size: 15px; font-weight: 600; }
.td-msg__btn { min-height: 44px; padding: 0 16px; border: 0; border-radius: 12px; background: rgba(115, 214, 255, .1); color: var(--cobalt); font-size: 14.5px; font-weight: 600; cursor: pointer; transition: background .2s; }
.td-msg__btn:hover { background: rgba(115, 214, 255, .18); }
.td-msg__btn--hot { background: var(--lime); color: var(--ink); }
.td-msg__btn--hot:hover { background: var(--lime-2); }
.td-msg__btn:disabled { opacity: .55; cursor: default; }
.td-bot__open { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 56px; border-top: 1px solid var(--line); color: var(--cobalt); font-size: 15px; font-weight: 600; text-decoration: none; }
.td-bot__open:hover { background: rgba(255, 255, 255, .03); }
body.td-lock { overflow: hidden; }

/* ---------- Панель разработчика (?debug=1) ---------- */
.td-dev { position: fixed; left: 12px; bottom: 12px; z-index: 150; display: flex; flex-wrap: wrap; gap: 6px; max-width: 260px; padding: 8px; border-radius: 12px; background: rgba(23, 25, 29, .96); box-shadow: inset 0 0 0 1px var(--line-2); font-size: 12.5px; }
.td-dev summary { width: 100%; cursor: pointer; color: var(--muted); font: 500 12px/1.4 var(--mono); }
.td-dev button { min-height: 32px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: 8px; background: none; color: #fff; font-size: 12.5px; cursor: pointer; }
.td-dev button:hover { background: rgba(255, 255, 255, .06); }

/* ================= Ощущение игры: HUD-детали, загрузка, титр миссии, переходы ================= */
/* HUD: кулак «голыми руками», жизни, таймер | звёзды розыска */
.td-hud__arm { display: grid; place-items: center; width: 20px; height: 20px; color: rgba(255, 255, 255, .72); }
.td-fist { width: 20px; height: 20px; }
.td-hud__sep { width: 1px; height: 18px; background: var(--line-2); }
.td-hud .td-star { width: 15px; height: 15px; }
.td-wanted--mini { display: none; margin-right: 6px; vertical-align: -1px; }
.td-wanted--mini .td-star { width: 11px; height: 11px; }
.td-palm { width: auto; height: 1em; color: currentColor; }

/* Загрузка после входа — как в GTA V: кадр во весь экран, знак слева внизу, кружок и совет справа */
.td-load { position: fixed; inset: 0; z-index: 180; background: var(--canvas); opacity: 0; transition: opacity .35s ease; cursor: pointer; }
.td-load.is-in { opacity: 1; }
.td-load.is-now:not(.is-out) { transition: none; }
.td-boot body > :not(.td-load) { visibility: hidden; animation: td-unboot 0s 4s forwards; } /* повторный вход: до первого рендера не показываем экран входа — сразу лоудер; упал скрипт — через 4 с покажем как есть */
@keyframes td-unboot { to { visibility: visible; } }
.td-load.is-out { opacity: 0; transition-duration: .5s; pointer-events: none; }
.td-load__field { position: absolute; inset: 0; }
.td-load__field .td-fc { --fc-o: .5; }
.td-load__brand { position: absolute; left: 48px; bottom: 40px; z-index: 5; display: flex; align-items: flex-end; gap: 14px; color: #fff; }
.td-load__brand img { width: 36px; height: 36px; margin-bottom: 8px; }

.td-load__tip { position: absolute; right: 48px; bottom: 44px; z-index: 5; display: flex; align-items: center; gap: 16px; max-width: min(520px, 50vw); }
.td-load__tiptext { padding: 12px 16px; border-radius: 10px; background: #121316; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08); font-size: 15px; line-height: 22px; color: rgba(255, 255, 255, .88); text-wrap: pretty; }
.td-load__tiptext b { font-weight: 700; color: #fff; }
.td-load__tiptext span.is-in { animation: td-fade .4s ease; }
.td-load__spin { flex: none; width: 28px; height: 28px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .22); border-top-color: #fff; animation: td-spin .9s linear infinite; }
@keyframes td-spin { to { transform: rotate(360deg); } }
.td-load__skip { position: absolute; right: 32px; top: 24px; z-index: 5; min-height: 44px; padding: 0 16px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--canvas); color: #fff; font-size: 14.5px; font-weight: 600; cursor: pointer; }
.td-load__skip:hover { background: var(--elev); }

/* Титр начала миссии */
.td-mtitle { position: fixed; inset: 0; z-index: 170; display: grid; place-items: center; padding: 24px; background: rgba(0, 0, 0, .72); opacity: 0; transition: opacity .25s ease; cursor: pointer; }
.td-mtitle.is-in { opacity: 1; }
.td-mtitle.is-out { opacity: 0; transition-duration: .4s; }
.td-mtitle__in { text-align: center; }
.td-mtitle__k { font-size: 14px; font-weight: 700; letter-spacing: .24em; text-transform: uppercase; color: rgba(255, 255, 255, .7); }
.td-mtitle__t { margin-top: 12px; font-size: clamp(36px, 5.4vw, 76px); line-height: 1.02; font-weight: 800; letter-spacing: -.03em; color: #fff; text-wrap: balance; }
.td-mtitle__line { display: block; width: 0; height: 2px; margin: 22px auto 0; background: var(--sunset); }
.td-mtitle.is-in .td-mtitle__t { animation: td-mt .6s var(--ease) both; }
.td-mtitle.is-in .td-mtitle__line { animation: td-mtl 1.2s var(--ease) .1s both; }
@keyframes td-mt { from { opacity: 0; transform: translateY(14px); letter-spacing: .01em; } }
@keyframes td-mtl { to { width: min(420px, 60vw); } }

/* Переходы между экранами */
.td-stage { view-transition-name: td-stage; }
::view-transition-old(td-stage) { animation: td-vt-out .2s ease both; }
::view-transition-new(td-stage) { animation: td-vt-in .36s var(--ease) .06s both; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .2s; }
.td-stage.is-enter { animation: td-vt-in .36s var(--ease) both; }
@keyframes td-vt-out { to { opacity: 0; transform: translateY(-8px); filter: brightness(.4); } }
@keyframes td-vt-in { from { opacity: 0; transform: translateY(14px); } }

@media (max-width: 1279px) {
  .td-hud__arm { display: none; }
}
@media (max-width: 767px) {
  .td-hud__sep, .td-hud .td-wanted { display: none; }
  .td-wanted--mini { display: inline-flex; }
  .td-prog__m { display: none; }
  .td-load__brand { left: 20px; bottom: 124px; gap: 10px; }
  .td-load__brand img { width: 28px; height: 28px; margin-bottom: 4px; }
  .td-sign--xl { --s: 1.7; }
  .td-load__tip { left: 16px; right: 16px; bottom: 24px; max-width: none; }
  .td-load__tiptext { font-size: 14px; line-height: 20px; }
  .td-load__skip { right: 12px; top: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .td-load__spin { animation: none; border-top-color: rgba(255, 255, 255, .22); }
}

/* ================= Адаптив ================= */
@media (max-width: 1279px) {
  .td-fin__top { grid-template-columns: minmax(0, 1fr) 320px; }
  .td-hud { padding: 0 12px; }
}
@media (max-width: 1023px) {
  :root { --gut: 24px; }
  .td-brand__city { display: none; }
  .td-prog { margin-left: 0; }
  .td-botbtn__label { display: none; }
  .td-botbtn { padding: 0 11px; }
  .td-chip__name { display: none; }
  .td-fin__top { grid-template-columns: minmax(0, 1fr); }
  .td-fin__row { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .td-cases { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .td-road { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 28px; }
  .td-road__m:nth-child(3) { padding-left: 0; border-left: 0; }
}
@media (max-width: 767px) {
  :root { --hdr: 56px; --gut: 16px; }
  .td-nav { gap: 8px; }
  .td-brand { gap: 0; min-width: 44px; justify-content: center; }
  .td-brand__logo { width: 28px; height: 28px; }
  .td-prog { flex: 1; gap: 6px; max-width: none; padding: 4px 6px 4px 12px; }
  .td-prog__txt small { font-size: 11.5px; line-height: 14px; }
  .td-prog__txt b { font-size: 13.5px; line-height: 18px; }
  .td-nav__end { gap: 4px; }
  .td-hud { flex-direction: column; justify-content: center; gap: 4px; height: 44px; padding: 0 8px; background: none; box-shadow: none; }
  .td-heart { width: 12px; height: 11px; }
  .td-hearts { gap: 3px; }
  .td-hud__clock { font-size: 11px; }
  .td-botbtn { width: 44px; height: 44px; padding: 0; justify-content: center; }
  .td-chip { width: 44px; padding: 0; justify-content: center; }
  .td-chip__ava { width: 30px; height: 30px; }
  .td-steps { position: fixed; top: var(--hdr); left: 0; right: 0; width: auto; max-height: calc(100dvh - var(--hdr)); border-radius: 0 0 16px 16px; }
  .td-menu { position: fixed; top: calc(var(--hdr) + 4px); right: 8px; }


  .td-screen { padding: 28px 0 64px; }
  .td-h1 { font-size: 30px; line-height: 35px; }
  .td-sub { font-size: 16px; line-height: 24px; }
  .td-greet .td-h1 { font-size: 32px; line-height: 37px; }
  .td-actions .btn--primary, .td-actions .btn--fill { width: 100%; justify-content: space-between; }
  .td-player { margin-top: 20px; border-radius: 14px; margin-inline: calc(-1 * var(--gut)); border-radius: 0; }
  .td-player__cap { left: 16px; width: 58%; gap: 6px; }
  .td-player__name { font-size: 18px; }
  .td-player__cap small { font-size: 12.5px; }
  .td-player__go { margin-top: 6px; gap: 10px; }
  .td-player__play { width: 48px; height: 48px; }
  .td-player__dur { font-size: 13.5px; }
  .td-player__max { margin-right: -4%; height: 90%; }
  .td-lesson__below { grid-template-columns: minmax(0, 1fr); }
  .td-points { grid-template-columns: minmax(0, 1fr); }
  .td-lesson__act { align-items: stretch; min-width: 0; }
  .td-lesson__act .btn { justify-content: space-between; }
  .td-gatenote { max-width: none; text-align: left; }
  .td-sites { grid-auto-columns: 78%; margin-inline: calc(-1 * var(--gut)); padding-inline: var(--gut); scroll-padding-inline: var(--gut); }
  .td-cases { grid-template-columns: minmax(0, 1fr); }

  .td-gate { padding: 24px 20px; margin-inline: -4px; border-radius: 22px; }
  .td-gate .td-h1 { font-size: 27px; line-height: 32px; }
  .td-gate__head { flex-direction: column; gap: 12px; }
  .td-gate__timer { align-items: flex-start; text-align: left; }
  .td-part { padding-left: 40px; }
  .td-gate__btns .btn { flex: 1 1 100%; justify-content: center; }
  .td-code__row { flex-direction: column; }
  .td-code__input { flex: none; } /* в колонке flex: 1 давал flex-basis 0 — поле сжималось до 23 px */
  .td-code__row .btn { justify-content: space-between; }

  .td-deal { padding: 22px 20px; }
  .td-deal__left { font-size: 34px; }
  .td-deal__cta .btn { width: 100%; justify-content: space-between; }
  .td-road { grid-template-columns: minmax(0, 1fr); }
  .td-road__m, .td-road__m + .td-road__m { padding: 16px 0 0; border-left: 0; }
  .td-road__bar { height: auto; }
  .td-road__bar i { display: none; }
  .td-road__money { margin: 0; }
  .td-road__card { padding-top: 8px; border-top: 0; }
  .td-alumni__money { flex-direction: column; align-items: flex-end; gap: 0; }
  .td-alumni__money small { display: none; }

  .td-drawer { inset: 0; z-index: 90; }
  .td-bot { width: 100%; border-left: 0; }
  .td-stub { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 379px) {
  .td-prog__txt small { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* Касание: зоны нажатия 44 px у мелких ссылок и строки согласия в окне Telegram (QA 22.09) */
@media (pointer: coarse), (max-width: 767px) {
  .td-tg__check { min-height: 44px; align-items: center; }
  .td-missions__t small a { padding: 14px 0; margin: -14px 0; }
}

/* финал без видео (владелец 22.09): скидка — широкой бумажной полосой: слева срок, справа «Написать плюс» */
.td-fin__top--solo { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) {
  .td-fin__top--solo .td-deal { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); column-gap: 40px; align-items: center; }
  .td-fin__top--solo .td-deal__label, .td-fin__top--solo .td-deal__left, .td-fin__top--solo .td-deal__note { grid-column: 1; }
  .td-fin__top--solo .td-deal__cta { grid-column: 2; grid-row: 1 / span 3; margin-top: 0; padding-top: 0; padding-left: 40px; border-top: 0; border-left: 1px solid var(--ink-line); }
}
