/* StockGuessr — «биржевая сводка»: бумага в клетку, чернильные рамки с жёсткой тенью,
   жёлтый маркер для главного действия. Светлая и тёмная темы через переменные. */

@font-face {
  font-family: "Unbounded";
  font-weight: 500 900;
  font-display: swap;
  src: url("/fonts/unbounded-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Unbounded";
  font-weight: 500 900;
  font-display: swap;
  src: url("/fonts/unbounded-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: 400 800;
  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: 400 800;
  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: "JetBrains Mono";
  font-weight: 400 800;
  font-display: swap;
  src: url("/fonts/jetbrains-mono-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "JetBrains Mono";
  font-weight: 400 800;
  font-display: swap;
  src: url("/fonts/jetbrains-mono-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;
}

:root {
  --paper: #f3eee3;
  --paper-grid: rgba(21, 21, 21, 0.05);
  --card: #fffcf5;
  --card-2: #f6f0e3;
  --ink: #151515;
  --ink-2: #3a3833;
  --muted: #6b675e;
  --line: #151515;
  --line-soft: #ddd5c4;
  --accent: #ffd23f;
  --accent-2: #fff1b8;
  --accent-ink: #151515;
  --blue: #2450e5;
  --blue-soft: #e2e8ff;
  --up: #0b8a4f;
  --up-soft: #d9f1e4;
  --down: #dc2f27;
  --down-soft: #fbe0de;
  --amber: #e98f00;
  --forecast: #7a3cff;
  --usd: #2450e5;
  --brent: #8a4b0f;
  --gold: #c19a00;
  --radius: 12px;
  --shadow: 4px 4px 0 var(--ink);
  --shadow-sm: 2px 2px 0 var(--ink);
  --shadow-lg: 7px 7px 0 var(--ink);
  --font-display: "Unbounded", "Arial Black", system-ui, sans-serif;
  --font-body: "Onest", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #111111;
    --paper-grid: rgba(255, 255, 255, 0.04);
    --card: #1b1b1c;
    --card-2: #242425;
    --ink: #f3eee3;
    --ink-2: #d9d3c6;
    --muted: #a8a397;
    --line: #e9e3d6;
    --line-soft: #37363a;
    --accent: #ffd23f;
    --accent-2: #3b3418;
    --accent-ink: #151515;
    --blue: #7c9bff;
    --blue-soft: #1e2647;
    --up: #39c983;
    --up-soft: #133325;
    --down: #ff6b62;
    --down-soft: #3b1b19;
    --amber: #ffb02e;
    --forecast: #a98bff;
    --usd: #7c9bff;
    --brent: #e19a52;
    --gold: #f0c93a;
    --shadow: 4px 4px 0 #000;
    --shadow-sm: 2px 2px 0 #000;
    --shadow-lg: 7px 7px 0 #000;
    color-scheme: dark;
  }
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background-color: var(--paper);
  background-image: linear-gradient(var(--paper-grid) 1px, transparent 1px), linear-gradient(90deg, var(--paper-grid) 1px, transparent 1px);
  background-size: 24px 24px;
  color: var(--ink);
  font: 16px/1.55 var(--font-body);
}

a {
  color: var(--blue);
  text-underline-offset: 3px;
}

h1,
h2,
h3 {
  line-height: 1.12;
  margin: 0 0 0.5em;
}

h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(28px, 5vw, 48px);
  letter-spacing: -0.02em;
}

h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(18px, 2.4vw, 22px);
  letter-spacing: -0.01em;
}

h3 {
  font-size: 17px;
  font-weight: 700;
}

p {
  margin: 0 0 0.75em;
}

::selection {
  background: var(--accent);
  color: var(--accent-ink);
}

.container {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 16px;
}

.main {
  padding-top: 28px;
  padding-bottom: 48px;
  outline: none;
  min-height: 60vh;
}

.skip {
  position: absolute;
  left: -9999px;
}

.skip:focus {
  left: 16px;
  top: 8px;
  z-index: 100;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 8px 12px;
  border: 2px solid var(--line);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.mono {
  font-family: var(--font-mono);
}

/* ── Шапка и бегущая лента ─────────────────────────────── */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: #151515;
  color: #f3eee3;
  border-bottom: 2px solid #151515;
}

.topbar__inner {
  max-width: 1040px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 19px;
  color: #f3eee3;
  text-decoration: none;
  letter-spacing: -0.02em;
}

.brand__mark {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--marker, #ffd23f);
}

.brand span:last-child {
  color: var(--marker, #ffd23f);
}

.nav {
  display: flex;
  gap: 2px;
  flex-wrap: wrap;
  align-items: center;
}

.nav a {
  color: #d9d3c6;
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.nav a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.nav a.is-active {
  color: #151515;
  background: var(--marker, #ffd23f);
}

.nav__lock {
  font-size: 10px;
  font-family: var(--font-mono);
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--marker, #ffd23f);
  color: #151515;
}

.nav a.is-active .nav__lock {
  background: #151515;
  color: var(--marker, #ffd23f);
}

.topbar__right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.capital {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 8px;
  border: 1.5px solid rgba(243, 238, 227, 0.35);
  font-size: 13px;
  color: #d9d3c6;
  white-space: nowrap;
}

.capital[hidden] {
  display: none;
}

.capital strong {
  font-family: var(--font-mono);
  color: #fff;
  font-size: 14px;
}

.account-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  background: var(--marker, #ffd23f);
  color: #151515;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  max-width: 190px;
}

.account-btn span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ticker {
  overflow: hidden;
  background: var(--marker, #ffd23f);
  color: #151515;
  border-top: 2px solid #151515;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.ticker__track {
  display: inline-flex;
  gap: 28px;
  padding: 5px 0;
  animation: ticker 60s linear infinite;
}

.ticker__track > span::before {
  content: "◆ ";
}

@keyframes ticker {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

.footer {
  color: var(--muted);
  font-size: 13px;
  padding-top: 18px;
  padding-bottom: 36px;
  border-top: 2px solid var(--line);
}

.footer__row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.themes {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: var(--ink-2);
  font-weight: 600;
}

.themes .chip {
  font-size: 13px;
  padding: 4px 10px;
}

/* Советы новичку в первых раундах */

.coach {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: start;
  padding: 14px 16px;
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  background: var(--accent-2);
}

.coach__icon {
  font-size: 24px;
  line-height: 1;
}

.coach p {
  margin: 4px 0 0;
}

.coach__close {
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  background: none;
  border: 0;
  cursor: pointer;
  text-decoration: underline;
}

/* Задания «Проверь себя» в теории */

.quiz {
  display: grid;
  gap: 14px;
}

.quiz__q {
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  background: var(--card);
}

.quiz__q h3 {
  margin-bottom: 10px;
}

.quiz__options {
  display: grid;
  gap: 8px;
}

.quiz__option {
  text-align: left;
  font: inherit;
  padding: 10px 12px;
  border: 2px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
}

.quiz__option:hover:not(:disabled) {
  background: var(--card-2);
}

.quiz__option:disabled {
  cursor: default;
}

.quiz__option.is-right {
  background: var(--up-soft);
  border-color: var(--up);
  font-weight: 700;
}

.quiz__option.is-wrong {
  background: var(--down-soft);
  border-color: var(--down);
}

.quiz__why {
  margin-top: 10px;
  font-size: 15px;
}

.quiz__score {
  font-family: var(--font-mono);
  font-weight: 800;
}

/* ── Базовые блоки ─────────────────────────────────────── */

.stack > * + * {
  margin-top: 20px;
}

.stack-sm > * + * {
  margin-top: 8px;
}

.card {
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}

.card--flat {
  box-shadow: none;
  padding: 14px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 18px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin: 12px 0;
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.row--between {
  justify-content: space-between;
}

.eyebrow {
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 8px;
}

.lead {
  font-size: 18px;
  color: var(--ink-2);
  max-width: 720px;
}

.lead-sm {
  font-size: 17px;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 12px;
}

.caption {
  color: var(--muted);
  font-size: 13px;
  margin-top: 8px;
}

.callout {
  background: var(--accent-2);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 16px;
}

.up {
  color: var(--up);
}

.down {
  color: var(--down);
}

.up-bg {
  background: var(--up);
}

.down-bg {
  background: var(--down);
}

.plain {
  list-style: none;
  padding: 0;
  margin: 0;
}

.plain-link {
  color: inherit;
  text-decoration: none;
}

.is-locked {
  opacity: 0.55;
}

.pro-badge {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.06em;
  padding: 2px 7px;
  border-radius: 5px;
  background: var(--accent);
  color: var(--accent-ink);
  border: 1.5px solid var(--line);
  vertical-align: middle;
}

/* ── Кнопки и поля ─────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 10px 18px;
  border-radius: 10px;
  border: 2px solid var(--line);
  background: var(--card);
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.06s ease, box-shadow 0.06s ease, background 0.15s ease;
}

.btn:hover:not(:disabled) {
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 var(--ink);
}

.btn:active:not(:disabled) {
  transform: translate(2px, 2px);
  box-shadow: 0 0 0 var(--ink);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn--primary {
  background: var(--accent);
  color: var(--accent-ink);
}

.btn--dark {
  background: var(--ink);
  color: var(--paper);
}

.btn--ghost {
  background: transparent;
  box-shadow: none;
}

.btn--ghost:hover:not(:disabled) {
  background: var(--card-2);
  box-shadow: none;
  transform: none;
}

.btn--small {
  min-height: 36px;
  padding: 6px 12px;
  font-size: 14px;
}

.btn--lg {
  min-height: 54px;
  padding: 12px 24px;
  font-size: 17px;
}

.btn--xl {
  min-height: 76px;
  padding: 16px 34px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(20px, 3vw, 28px);
  border-width: 3px;
  box-shadow: var(--shadow-lg);
}

.btn--xl:hover:not(:disabled) {
  box-shadow: 9px 9px 0 var(--ink);
}

.chip {
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
  border: 2px solid var(--line);
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.chip:hover {
  background: var(--card-2);
}

.chip.is-on {
  background: var(--ink);
  color: var(--paper);
}

.chip__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
}

.chip--ghost {
  background: transparent;
}

input,
select,
textarea {
  font: inherit;
  color: var(--ink);
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  min-height: 46px;
}

input::placeholder,
textarea::placeholder {
  color: var(--muted);
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.btn:focus-visible,
.chip:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 2px;
}

textarea {
  width: 100%;
  resize: vertical;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 14px 0;
  font-size: 14px;
  font-weight: 600;
}

.field--inline {
  flex-direction: row;
  align-items: center;
  gap: 10px;
  margin: 8px 0 0;
}

.row--fields .field {
  flex: 1 1 160px;
  margin: 0;
}

.form__error {
  color: var(--down);
  font-weight: 600;
  min-height: 1em;
  margin: 8px 0;
}

.form__ok {
  color: var(--up);
  font-weight: 600;
  margin: 8px 0;
}

.hint {
  color: var(--muted);
  margin: 10px 0 0;
}

.check {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 12px;
  font-size: 14px;
  color: var(--ink-2);
}

.check input {
  min-height: 0;
  width: 18px;
  height: 18px;
  accent-color: var(--ink);
}

/* ── Главная: первый экран ─────────────────────────────── */

.hero {
  padding: 18px 0 6px;
}

.hero h1 {
  max-width: 820px;
}

.hero-xl {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 28px;
  align-items: center;
  padding: 20px 0 8px;
}

.hero-xl h1 {
  font-size: clamp(34px, 6.4vw, 66px);
  line-height: 1;
}

.hero-xl h1 mark {
  background: var(--accent);
  color: var(--accent-ink);
  padding: 0 0.12em;
  border-radius: 6px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.hero-xl__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
  margin-top: 26px;
}

.hero-xl__note {
  margin-top: 16px;
  font-size: 14px;
  color: var(--muted);
}

.hero-art {
  background: var(--card);
  border: 3px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  padding: 16px;
  transform: rotate(1.5deg);
}

.hero-art__head {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 8px;
}

.hero-art svg {
  display: block;
  width: 100%;
  height: auto;
}

.hero-art__q {
  font-family: var(--font-display);
  font-weight: 900;
  fill: var(--ink);
}

.steps-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--card);
  box-shadow: var(--shadow);
}

.steps-strip li {
  list-style: none;
  padding: 16px 18px;
  border-right: 2px solid var(--line);
}

.steps-strip li:last-child {
  border-right: 0;
}

.steps-strip b {
  display: block;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}

.steps-strip strong {
  display: block;
  font-family: var(--font-display);
  font-size: 16px;
  margin-bottom: 4px;
}

.steps-strip span {
  font-size: 14px;
  color: var(--ink-2);
}

/* ── Карточки игр ──────────────────────────────────────── */

.games {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 18px;
}

.game-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: inherit;
  text-decoration: none;
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}

a.game-card:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--ink);
}

.game-card__band {
  margin: -22px -22px 6px;
  padding: 10px 22px;
  border-bottom: 2px solid var(--line);
  border-radius: 10px 10px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--accent);
  color: var(--accent-ink);
}

.game-card--forecast .game-card__band {
  background: #c9b6ff;
}

.game-card--amber .game-card__band {
  background: #ffb86b;
}

.game-card p {
  color: var(--ink-2);
  flex: 1;
}

.game-card__tag {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.game-card__meta {
  font-size: 13px;
  font-family: var(--font-mono);
}

.game-card__go {
  font-weight: 800;
}

.link-card {
  display: block;
  color: inherit;
  text-decoration: none;
}

.link-card:hover {
  background: var(--card-2);
}

.link-card p {
  color: var(--ink-2);
}

/* ── Старт основной игры ───────────────────────────────── */

.start-form {
  margin-top: 18px;
  max-width: 640px;
}

.start-form > label,
.start-form .label {
  display: block;
  font-weight: 700;
  margin-bottom: 8px;
}

.start-form__row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.start-form__row input {
  flex: 1 1 220px;
}

.seg {
  border: 0;
  padding: 0;
  margin: 18px 0 6px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
}

.seg legend {
  font-weight: 700;
  margin-bottom: 8px;
}

.seg label {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 14px;
  border: 2px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  cursor: pointer;
}

.seg label strong {
  font-family: var(--font-display);
  font-size: 15px;
}

.seg label span {
  font-size: 13px;
  color: var(--muted);
}

.seg input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.seg label:has(input:checked) {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: var(--shadow-sm);
}

.seg label:has(input:checked) span {
  color: color-mix(in srgb, var(--accent-ink) 78%, transparent);
}

.seg label:has(input:focus-visible) {
  outline: 3px solid var(--blue);
}

.how {
  margin: 0;
  padding-left: 22px;
  display: grid;
  gap: 10px;
}

.how strong {
  display: block;
}

.how span {
  color: var(--ink-2);
}

.player-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 700;
  margin-top: 16px;
  max-width: 420px;
}

/* ── Прогресс партии ───────────────────────────────────── */

.progress__stats {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
  margin: 10px 0 14px;
}

.progress__stats div {
  display: flex;
  flex-direction: column;
}

.progress__stats strong {
  font-family: var(--font-mono);
  font-size: 24px;
}

.levels {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.level-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: var(--card);
}

.level-item__num {
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 2px solid var(--line);
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-weight: 800;
  background: var(--card-2);
}

.level-item__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.level-item.is-done .level-item__num {
  background: var(--up);
  color: #fff;
}

.level-item.is-current {
  background: var(--accent-2);
  box-shadow: var(--shadow-sm);
}

.level-item.is-current .level-item__num {
  background: var(--accent);
  color: var(--accent-ink);
}

.level-item.is-locked {
  opacity: 0.55;
}

/* ── Раунд ─────────────────────────────────────────────── */

.back {
  display: inline-block;
  margin-bottom: 10px;
  text-decoration: none;
  color: var(--muted);
  font-weight: 600;
}

.back:hover {
  color: var(--ink);
}

.level__head h1 {
  font-size: clamp(24px, 4vw, 40px);
}

.stepper {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  padding: 0;
  margin: 14px 0 0;
  border: 2px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  width: fit-content;
  max-width: 100%;
  background: var(--card);
}

.stepper li {
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  border-right: 2px solid var(--line);
}

.stepper li:last-child {
  border-right: 0;
}

.stepper li > span,
.stepper li > button {
  display: block;
  padding: 7px 14px;
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
}

.stepper li > button {
  cursor: pointer;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 3px;
}

.stepper li.is-done {
  color: var(--up);
  background: var(--up-soft);
}

.stepper li.is-done > *::before {
  content: "✓ ";
}

.stepper li.is-current {
  background: var(--accent);
  color: var(--accent-ink);
}

.panel {
  position: relative;
  border-radius: var(--radius);
  padding: 26px 22px 20px;
  border: 2px solid var(--line);
  background: var(--card);
  box-shadow: var(--shadow);
  margin-top: 30px;
}

.panel__tag {
  position: absolute;
  top: -15px;
  left: 18px;
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 4px 10px;
  border: 2px solid var(--line);
  border-radius: 6px;
  background: var(--ink);
  color: var(--paper);
  margin: 0;
}

.panel__tag--after {
  background: var(--accent);
  color: var(--accent-ink);
}

.briefing {
  font-size: 17px;
  max-width: 760px;
}

.step__num {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 6px;
}

.step__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 18px;
}

.quick {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
}

.options {
  border: 0;
  padding: 0;
  margin: 14px 0;
  display: grid;
  gap: 10px;
}

.options legend {
  font-weight: 700;
  margin-bottom: 10px;
}

.options--grid {
  grid-template-columns: repeat(auto-fill, minmax(165px, 1fr));
}

.option {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 14px;
  border: 2px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  background: var(--card);
  transition: background 0.12s ease;
}

.option:hover {
  background: var(--card-2);
}

.option:has(input:checked) {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: var(--shadow-sm);
}

.option:has(input:checked) .option__text {
  color: color-mix(in srgb, var(--accent-ink) 78%, transparent);
}

.option input {
  min-height: 0;
  margin-top: 4px;
  accent-color: var(--ink);
}

.option__body {
  display: flex;
  flex-direction: column;
}

.option__title {
  font-weight: 700;
}

.option__text {
  color: var(--muted);
  font-size: 14px;
}

/* Год и месяц — крупные кнопки, а не выпадающие списки */

.picker {
  border: 0;
  padding: 0;
  margin: 18px 0 0;
}

.picker legend {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  margin-bottom: 10px;
}

.picker__grid {
  display: grid;
  gap: 8px;
}

.picker__grid--years {
  grid-template-columns: repeat(auto-fill, minmax(86px, 1fr));
}

.picker__grid--months {
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
}

.pick {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 54px;
  padding: 8px;
  border: 2px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  cursor: pointer;
  font-weight: 700;
}

.picker__grid--years .pick {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 800;
}

.pick input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.pick:hover {
  background: var(--card-2);
}

.pick:has(input:checked) {
  background: var(--ink);
  color: var(--paper);
  box-shadow: 3px 3px 0 var(--accent);
}

.pick:has(input:focus-visible) {
  outline: 3px solid var(--blue);
}

.picked {
  margin-top: 14px;
  font-family: var(--font-mono);
  font-weight: 700;
}

.picked mark {
  background: var(--accent);
  color: var(--accent-ink);
  padding: 2px 8px;
  border-radius: 6px;
  border: 2px solid var(--line);
}

/* Подсказки за очки */

.hints {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 6px;
}

.hint-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
  padding: 14px;
  border: 2px dashed var(--line);
  border-radius: 10px;
  background: var(--card-2);
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.hint-card:hover:not(:disabled) {
  background: var(--accent-2);
}

.hint-card:disabled {
  cursor: default;
}

.hint-card__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}

.hint-card__cost {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--down-soft);
  color: var(--down);
  white-space: nowrap;
}

.hint-card__cost--free {
  background: var(--up-soft);
  color: var(--up);
}

.hint-card.is-open {
  border-style: solid;
  background: var(--accent-2);
  cursor: default;
}

/* ── Графики ───────────────────────────────────────────── */

.figure {
  margin: 14px 0 0;
}

.chart {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.chart--draw {
  touch-action: none;
  cursor: crosshair;
  -webkit-user-select: none;
  user-select: none;
  outline: 2px dashed var(--line-soft);
  border-radius: 8px;
}

.chart__grid {
  stroke: var(--line-soft);
  stroke-width: 1;
  stroke-dasharray: 2 4;
}

.chart__label {
  fill: var(--muted);
  font-family: var(--font-mono);
  font-size: 13px;
}

.chart__label--decision {
  fill: var(--ink);
  font-weight: 800;
}

.chart__decision {
  stroke: var(--ink);
  stroke-width: 2.5;
}

.chart__flag-bg {
  fill: var(--ink);
}

.chart__flag-text {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 800;
}

.chart__zone {
  opacity: 0.9;
}

.chart__dot.line--actual {
  fill: var(--up);
}

.chart__dot.line--index {
  fill: var(--muted);
}

.chart__hatch-line {
  stroke: var(--line-soft);
  stroke-width: 2;
}

.chart__hint {
  fill: var(--ink);
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  opacity: 0.6;
}

.chart__anchor {
  fill: var(--forecast);
}

.chart__event circle {
  fill: var(--ink);
  stroke: var(--card);
  stroke-width: 2;
}

.chart__event text {
  fill: var(--paper);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 800;
}

.chart__event--after circle {
  fill: var(--accent);
  stroke: var(--ink);
}

.chart__event--after text {
  fill: var(--accent-ink);
}

.chart__event:hover circle {
  r: 12;
}

.chart__marker.line--up {
  fill: var(--up);
}

.chart__marker.line--down {
  fill: var(--down);
}

.line {
  fill: none;
  stroke-width: 3;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.line--history {
  stroke: var(--ink);
}

.line--forecast {
  stroke: var(--forecast);
  stroke-dasharray: 9 7;
}

.line--actual.line--up {
  stroke: var(--up);
  stroke-width: 3.5;
}

.line--actual.line--down {
  stroke: var(--down);
  stroke-width: 3.5;
}

.line--index {
  stroke: var(--muted);
  stroke-width: 2;
  stroke-dasharray: 3 5;
}

.line--usd {
  stroke: var(--usd);
  stroke-width: 2;
  opacity: 0.85;
}

.line--brent {
  stroke: var(--brent);
  stroke-width: 2;
  opacity: 0.85;
}

.line--gold {
  stroke: var(--gold);
  stroke-width: 2;
  opacity: 0.9;
}

.legend {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  padding: 0;
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--ink-2);
}

.legend li {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend__swatch {
  width: 22px;
  height: 0;
  border-top: 3px solid var(--ink);
}

.legend--forecast {
  border-top: 3px dashed var(--forecast);
}

.legend--actual {
  border-top-color: var(--up);
}

.legend--actual.legend--down,
.legend--actual.legend--decline {
  border-top-color: var(--down);
}

.legend--actual.legend--stable {
  border-top-color: var(--amber);
}

.legend--band {
  height: 10px;
  border-top: 0;
  border-radius: 3px;
  background: color-mix(in srgb, var(--amber) 22%, transparent);
}

.chart__band {
  fill: var(--amber);
  opacity: 0.16;
}

.chart__base {
  stroke: var(--ink);
  stroke-width: 1.5;
  opacity: 0.45;
}

.chart__band-label {
  fill: var(--muted);
  font-family: var(--font-mono);
  font-size: 12px;
}

.line--actual.line--flat {
  stroke: var(--amber);
  stroke-width: 3.5;
}

.chart__marker.line--flat {
  fill: var(--amber);
}

.legend--index {
  border-top: 3px dotted var(--muted);
}

.legend--usd {
  border-top-color: var(--usd);
}

.legend--brent {
  border-top-color: var(--brent);
}

.legend--gold {
  border-top-color: var(--gold);
}

.series-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 12px;
}

.series-toggles .muted {
  font-size: 13px;
}

.chip[data-series="IMOEX"] .chip__dot {
  background: var(--muted);
}

.chip[data-series="USDRUB"] .chip__dot {
  background: var(--usd);
}

.chip[data-series="BRENT"] .chip__dot {
  background: var(--brent);
}

.chip[data-series="GOLD"] .chip__dot {
  background: var(--gold);
}

.news {
  list-style: none;
  padding: 0;
  margin: 14px 0 0;
  display: grid;
  gap: 8px;
}

.news li {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  align-items: start;
  font-size: 15px;
}

.news__num {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 800;
}

.news__item--after .news__num {
  background: var(--accent);
  color: var(--accent-ink);
  border: 2px solid var(--line);
}

.news__date {
  display: block;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.tm__controls {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}

.tm__slider {
  flex: 1;
  min-height: 0;
  padding: 0;
  border: 0;
  accent-color: var(--ink);
}

.tm__readout {
  font-family: var(--font-mono);
  font-size: 13px;
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--card-2);
  border: 1.5px solid var(--line-soft);
}

/* ── Результат ─────────────────────────────────────────── */

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.fact {
  display: flex;
  flex-direction: column;
  padding: 12px 14px;
  border-radius: 10px;
  border: 2px solid var(--line);
  background: var(--card);
}

.fact__label {
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.fact__value {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
}

.fact__note {
  font-size: 13px;
  color: var(--muted);
}

.fact--up {
  background: var(--up-soft);
}

.fact--up .fact__value {
  color: var(--up);
}

.fact--down {
  background: var(--down-soft);
}

.fact--down .fact__value {
  color: var(--down);
}

.scores {
  display: grid;
  gap: 14px;
}

.score__head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
  margin-bottom: 4px;
}

.score__head strong {
  font-family: var(--font-mono);
  white-space: nowrap;
}

.bar {
  height: 14px;
  background: var(--card-2);
  border: 2px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
}

.bar > span {
  display: block;
  height: 100%;
  background: var(--accent);
  border-right: 2px solid var(--line);
}

.bar--progress {
  margin-bottom: 16px;
}

.total {
  margin-top: 16px;
  font-size: 18px;
}

.total strong {
  font-family: var(--font-mono);
}

.penalty {
  display: inline-block;
  margin-top: 6px;
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--down-soft);
  color: var(--down);
  font-weight: 700;
  font-size: 14px;
}

.money {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
  display: grid;
  gap: 8px;
}

.money__row {
  display: grid;
  grid-template-columns: 150px 1fr 120px;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 10px;
  border: 2px solid transparent;
}

.money__row.is-selected {
  border-color: var(--line);
  background: var(--accent-2);
  font-weight: 700;
}

.money__track {
  position: relative;
  height: 14px;
  background: var(--card-2);
  border-radius: 999px;
}

.money__track::after {
  content: "";
  position: absolute;
  left: 50%;
  top: -3px;
  bottom: -3px;
  width: 2px;
  background: var(--ink);
}

.money__bar {
  position: absolute;
  top: 0;
  bottom: 0;
  border-radius: 999px;
}

.money__value {
  text-align: right;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.balance-note {
  margin-top: 12px;
  font-weight: 700;
}

.badge {
  align-self: flex-start;
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--line-soft);
  margin-bottom: 4px;
}

.xray {
  border-left-width: 8px;
  border-left-color: var(--forecast);
}

.xray__bars {
  display: grid;
  gap: 8px;
  margin: 10px 0;
}

.xray__row {
  display: grid;
  grid-template-columns: 90px 1fr 80px;
  gap: 10px;
  align-items: center;
}

.xray__row strong {
  font-family: var(--font-mono);
}

.xray__track {
  height: 14px;
  background: var(--card-2);
  border-radius: 999px;
  overflow: hidden;
}

.xray__track span {
  display: block;
  height: 100%;
  border-radius: 999px;
}

.analysis h3 {
  margin-top: 20px;
}

.timeline,
.events {
  list-style: none;
  padding: 0;
  margin: 8px 0;
  display: grid;
  gap: 10px;
}

.timeline li,
.events li {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1.5px solid var(--line-soft);
  background: var(--card-2);
}

.timeline__date {
  font-family: var(--font-mono);
  font-weight: 800;
  min-width: 150px;
}

.src {
  font-size: 13px;
  text-decoration: none;
  font-family: var(--font-mono);
}

.interpretation {
  border-left: 4px dashed var(--amber);
  padding-left: 12px;
}

.predict {
  padding: 12px 14px;
  border-radius: 10px;
  margin-top: 14px;
  border: 2px solid var(--line);
  border-left-width: 8px;
  background: var(--card-2);
}

.predict--up {
  border-left-color: var(--up);
}

.predict--amber {
  border-left-color: var(--amber);
}

.predict--down {
  border-left-color: var(--down);
}

.lesson {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 2px solid var(--line);
  background: var(--accent-2);
}

.sources {
  padding-left: 22px;
  font-size: 14px;
}

.quote {
  font-style: italic;
  color: var(--ink-2);
  margin-top: 10px;
}

.note-box summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--ink-2);
}

.note-box[open] summary {
  margin-bottom: 8px;
}

/* ── Итоги, лидеры, теория ─────────────────────────────── */

.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
}

.metric {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.metric__label {
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  color: var(--muted);
}

.metric__value {
  font-family: var(--font-display);
  font-size: 28px;
}

.profile {
  border-left-width: 8px;
  border-left-color: var(--forecast);
}

.profile__list {
  padding-left: 18px;
}

.table-wrap {
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

.table th,
.table td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1.5px solid var(--line-soft);
  white-space: nowrap;
}

.table th {
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  font-weight: 700;
  border-bottom: 2px solid var(--line);
}

.table .num {
  text-align: right;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.table tr.is-me td {
  background: var(--accent-2);
  font-weight: 700;
}

.table tr.is-perfect td:first-child {
  color: var(--up);
}

.star {
  color: var(--amber);
  font-weight: 800;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tab {
  padding: 8px 14px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--ink);
  background: var(--card);
  border: 2px solid var(--line);
  font-weight: 700;
  font-size: 15px;
}

.tab:hover {
  background: var(--card-2);
}

.tab.is-active {
  background: var(--ink);
  color: var(--paper);
  box-shadow: 3px 3px 0 var(--accent);
}

.tabs--small .tab {
  padding: 5px 11px;
  font-size: 14px;
}

.rule {
  font-size: 14px;
  padding: 10px 12px;
  border: 2px dashed var(--line);
  border-radius: 10px;
  background: var(--card-2);
}

.term p {
  color: var(--ink-2);
}

.term__example {
  font-size: 14px;
}

/* ── Аккаунт и подписка ────────────────────────────────── */

.auth {
  max-width: 520px;
}

.auth form {
  display: grid;
  gap: 4px;
}

.plans {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}

/* Тарифы Pro: три карточки как в окне «Перейти на Pro» */

.plans--3 {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  align-items: stretch;
  gap: 18px;
  padding-top: 14px;
}

.plan-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 26px 20px 20px;
  border: 2px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  text-align: center;
}

.plan-card--best {
  background: var(--accent-2);
  box-shadow: var(--shadow);
  border-width: 3px;
}

.plan-card__badge {
  position: absolute;
  top: -15px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 999px;
  border: 2px solid var(--line);
  background: var(--ink);
  color: var(--paper);
}

.plan-card__badge--save {
  background: var(--up);
  color: #fff;
}

.plan-card__title {
  font-family: var(--font-display);
  font-size: 18px;
  margin: 0;
}

.plan-card__desc {
  color: var(--muted);
  font-size: 14px;
  min-height: 2.6em;
  margin: 0;
}

.plan-card__price {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 800;
  margin: 4px 0;
}

.plan-card__price small {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
}

.plan-card .perks {
  text-align: left;
  flex: 1;
  font-size: 14px;
}

.plan-card__buy {
  width: 100%;
  margin-top: 6px;
}

.dialog.pro-dialog {
  max-width: 980px;
  width: calc(100% - 24px);
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  padding: 26px 24px 20px;
}

.pro-dialog__title {
  text-align: center;
  font-size: clamp(22px, 3.4vw, 30px);
  margin-bottom: 4px;
}

.pro-dialog__lead {
  text-align: center;
  color: var(--muted);
  margin-bottom: 18px;
}

.pro-dialog__note {
  text-align: center;
}

.pro-dialog__done {
  display: grid;
  justify-items: center;
  gap: 8px;
  text-align: center;
  padding: 24px 0 8px;
}

.dialog__close {
  position: absolute;
  top: 10px;
  right: 14px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}

.dialog__close:hover {
  background: var(--card-2);
  color: var(--ink);
}

.dialog {
  position: relative;
}

.plan {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.plan__price {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 800;
}

.plan__price small {
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  color: var(--muted);
}

.plan--best {
  background: var(--accent-2);
}

.perks {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}

.perks li::before {
  content: "✓ ";
  font-weight: 800;
  color: var(--up);
}

.paywall {
  border-width: 3px;
  box-shadow: var(--shadow-lg);
  background: var(--card);
}

.paywall__badge {
  display: inline-block;
  margin-bottom: 10px;
}

.invite {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.invite code {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 800;
  padding: 6px 12px;
  border: 2px dashed var(--line);
  border-radius: 8px;
  background: var(--accent-2);
}

.timer {
  font-family: var(--font-mono);
  font-weight: 800;
  padding: 4px 10px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: var(--card);
}

/* ── Служебное ─────────────────────────────────────────── */

.notice {
  text-align: center;
  padding: 40px 22px;
}

.notice--error h1 {
  color: var(--down);
}

.notice .row {
  justify-content: center;
}

.loading {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  padding: 48px 0;
  justify-content: center;
  font-family: var(--font-mono);
}

.spinner {
  width: 22px;
  height: 22px;
  border: 3px solid var(--line-soft);
  border-top-color: var(--ink);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.dialog {
  border: 3px solid var(--line);
  border-radius: 14px;
  padding: 24px;
  max-width: 460px;
  width: calc(100% - 32px);
  background: var(--card);
  color: var(--ink);
  box-shadow: var(--shadow-lg);
}

.dialog::backdrop {
  background: rgba(10, 10, 10, 0.55);
}

.dialog__actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

/* ── Мини-игра и песочница ─────────────────────────────── */

.directions {
  border: 0;
  padding: 0;
  margin: 14px 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
}

.direction {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
  padding: 16px 12px;
  border: 2px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
  background: var(--card);
}

.direction input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.direction__icon {
  font-size: 34px;
  line-height: 1;
  font-weight: 800;
}

.direction--growth .direction__icon {
  color: var(--up);
}

.direction--decline .direction__icon {
  color: var(--down);
}

.direction:hover {
  background: var(--card-2);
}

.direction:has(input:checked) {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: var(--shadow-sm);
}

.direction:has(input:checked) .muted {
  color: color-mix(in srgb, var(--accent-ink) 78%, transparent);
}

.direction:has(input:focus-visible) {
  outline: 3px solid var(--blue);
}

.mini-chart {
  margin: 0;
  border: 2px solid var(--line);
  border-radius: 10px;
  padding: 6px;
  text-align: center;
  font-weight: 800;
  background: var(--card);
}

.pill {
  padding: 8px 12px;
  border-radius: 10px;
  border: 2px solid var(--line);
}

.pill--ok {
  background: var(--up-soft);
}

.pill--bad {
  background: var(--down-soft);
}

.share {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
}

.share__chip {
  padding: 4px 10px;
  font-size: 13px;
}

.table--alloc .share__custom {
  width: 70px;
}

.table--alloc input {
  width: 84px;
  min-height: 38px;
  padding: 6px 8px;
  text-align: right;
  font-family: var(--font-mono);
}

.table--alloc tr.is-locked td {
  opacity: 0.5;
}

/* ── Адаптивность ──────────────────────────────────────── */

@media (max-width: 820px) {
  .hero-xl {
    grid-template-columns: 1fr;
  }

  .hero-art {
    transform: none;
    max-width: 520px;
  }

  .steps-strip li {
    border-right: 0;
    border-bottom: 2px solid var(--line);
  }

  .steps-strip li:last-child {
    border-bottom: 0;
  }
}

@media (max-width: 640px) {
  .card,
  .panel {
    padding: 16px;
  }

  .panel {
    padding-top: 24px;
  }

  .game-card__band {
    margin: -16px -16px 6px;
    padding: 10px 16px;
  }

  .topbar__inner {
    gap: 10px;
  }

  .nav {
    order: 3;
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .nav a {
    flex: none;
    font-size: 14px;
    padding: 6px 8px;
  }

  .capital {
    display: none;
  }

  .money__row {
    grid-template-columns: 1fr 104px;
  }

  .money__track {
    grid-column: 1 / -1;
    order: 3;
  }

  .stepper li {
    font-size: 13px;
  }

  .stepper li > span,
  .stepper li > button {
    padding: 6px 9px;
  }

  .table--alloc input {
    width: 64px;
  }

  .timeline__date {
    min-width: 0;
    width: 100%;
  }

  .btn--xl {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition: none !important;
  }
}

/* ── Вариант оформления «Терминал»: тёмный биржевой терминал ── */

:root[data-theme="terminal"] {
  --paper: #0a0c0b;
  --paper-grid: rgba(255, 176, 0, 0.045);
  --card: #101311;
  --card-2: #161a17;
  --ink: #ffb000;
  --ink-2: #f0cc7a;
  --muted: #a8955f;
  --line: #ffb000;
  --line-soft: #3b3320;
  --accent: #ffb000;
  --accent-2: #2a2108;
  --accent-ink: #0a0c0b;
  --blue: #63d4ff;
  --blue-soft: #0f2630;
  --up: #2bff88;
  --up-soft: #0c2a1a;
  --down: #ff5252;
  --down-soft: #2e1010;
  --amber: #ffb000;
  --forecast: #c792ff;
  --usd: #63d4ff;
  --brent: #ff8a3d;
  --gold: #ffe14d;
  --flag-text: #0a0c0b;
  --radius: 3px;
  --shadow: 0 0 0 1px rgba(255, 176, 0, 0.35), 0 0 18px rgba(255, 176, 0, 0.1);
  --shadow-sm: 0 0 10px rgba(255, 176, 0, 0.15);
  --shadow-lg: 0 0 0 1px rgba(255, 176, 0, 0.5), 0 0 30px rgba(255, 176, 0, 0.16);
  --font-display: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --font-body: "JetBrains Mono", ui-monospace, Consolas, monospace;
  color-scheme: dark;
}

:root[data-theme="terminal"] body {
  font-size: 15px;
}

:root[data-theme="terminal"] :is(h1, h2) {
  text-transform: uppercase;
  letter-spacing: 0.01em;
}

:root[data-theme="terminal"] .topbar {
  background: #000;
  border-bottom-color: #ffb000;
}

:root[data-theme="terminal"] .brand__mark,
:root[data-theme="terminal"] .nav a.is-active,
:root[data-theme="terminal"] .account-btn,
:root[data-theme="terminal"] .ticker {
  background: #ffb000;
}

:root[data-theme="terminal"] .brand span:last-child {
  color: #ffb000;
}

:root[data-theme="terminal"] .ticker {
  border-top-color: #000;
}

:root[data-theme="terminal"] .hero-art {
  transform: none;
}

:root[data-theme="terminal"] :is(.option, .direction, .seg label):has(input:checked) :is(.option__text, .muted, span) {
  color: rgba(10, 12, 11, 0.78);
}

:root[data-theme="terminal"] .btn:hover:not(:disabled) {
  box-shadow: 0 0 14px rgba(255, 176, 0, 0.35);
}

/* ── Вариант оформления «Журнал»: деловой журнал, антиква и тонкие линейки ── */

:root[data-theme="journal"] {
  --paper: #f6f1e7;
  --paper-grid: transparent;
  --card: #fffdf8;
  --card-2: #f2eadb;
  --ink: #1d1a17;
  --ink-2: #4a433b;
  --muted: #7a7064;
  --line: #2a2520;
  --line-soft: #e0d5c2;
  --accent: #7a1f2b;
  --accent-2: #f5e3e1;
  --accent-ink: #fffdf8;
  --blue: #1e4f8a;
  --blue-soft: #e2ebf6;
  --up: #1d6b45;
  --up-soft: #e2efe6;
  --down: #a3262a;
  --down-soft: #f6e0df;
  --amber: #b5761b;
  --forecast: #5b3fa8;
  --usd: #1e4f8a;
  --brent: #7a4a1d;
  --gold: #9c7a10;
  --flag-text: #fffdf8;
  --radius: 4px;
  --shadow: 0 1px 0 rgba(29, 26, 23, 0.06);
  --shadow-sm: none;
  --shadow-lg: 0 18px 40px rgba(29, 26, 23, 0.12);
  --font-display: Georgia, "PT Serif", "Times New Roman", serif;
  color-scheme: light;
}

:root[data-theme="journal"] :is(h1, h2) {
  font-weight: 700;
  letter-spacing: -0.01em;
}

:root[data-theme="journal"] h1 {
  font-size: clamp(30px, 5.2vw, 54px);
}

:root[data-theme="journal"] .hero-xl h1 {
  font-style: italic;
}

:root[data-theme="journal"] :is(.card, .panel, .btn, .chip, .option, .pick, .fact, .direction, .seg label, .tab, .level-item, .hint-card, .quiz__q, .quiz__option, input, select, textarea, .stepper, .steps-strip, .bar, .callout, .coach, .hero-art, .paywall, .dialog, .predict, .lesson) {
  border-width: 1px;
}

:root[data-theme="journal"] .btn:hover:not(:disabled),
:root[data-theme="journal"] a.game-card:hover {
  transform: none;
  box-shadow: 0 6px 16px rgba(29, 26, 23, 0.12);
}

:root[data-theme="journal"] .topbar {
  background: #7a1f2b;
  border-bottom-color: #2a2520;
}

:root[data-theme="journal"] .brand {
  font-family: Georgia, "PT Serif", serif;
  font-style: italic;
}

:root[data-theme="journal"] .brand__mark,
:root[data-theme="journal"] .account-btn,
:root[data-theme="journal"] .nav a.is-active {
  background: #fffdf8;
  color: #7a1f2b;
}

:root[data-theme="journal"] .brand span:last-child {
  color: #f5d7a8;
}

:root[data-theme="journal"] .ticker {
  background: #fffdf8;
  color: #7a1f2b;
  border-top: 1px solid #2a2520;
}

:root[data-theme="journal"] .game-card__band {
  background: var(--card-2);
  color: var(--accent);
  border-bottom-width: 1px;
}

:root[data-theme="journal"] .hero-art {
  transform: none;
}

:root[data-theme="journal"] :is(.option, .direction, .seg label):has(input:checked) {
  background: var(--accent-2);
  color: var(--ink);
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

:root[data-theme="journal"] :is(.option, .direction, .seg label):has(input:checked) :is(.option__text, .muted, span) {
  color: var(--ink-2);
}

:root[data-theme="journal"] .panel__tag {
  border-width: 1px;
  font-family: Georgia, "PT Serif", serif;
  font-style: italic;
  text-transform: none;
  letter-spacing: 0;
  font-size: 14px;
}

.chart__flag-text {
  fill: var(--flag-text, var(--accent));
}

/* ── Вариант оформления «Банк» (по умолчанию): светлый фон, белые скруглённые карточки
   без рамок и жёлтые кнопки — в духе T-Банка, организатора олимпиады ── */

:root[data-theme="bank"] {
  --paper: #f6f7f8;
  --paper-grid: transparent;
  --card: #ffffff;
  --card-2: #f6f7f8;
  --ink: #333333;
  --ink-2: #4d4f53;
  --muted: #6b7079;
  --line: #e7e8ea;
  --line-soft: #eceef0;
  --accent: #ffdd2d;
  --accent-2: #fff6c7;
  --accent-ink: #333333;
  --blue: #336fee;
  --blue-soft: #e8efff;
  --up: #0a8f2a;
  --up-soft: #e3f7e8;
  --down: #f52222;
  --down-soft: #feeaea;
  --amber: #ff9a2d;
  --forecast: #8a5cf6;
  --usd: #336fee;
  --brent: #a0622d;
  --gold: #d9a400;
  --flag-text: #ffdd2d;
  --radius: 24px;
  --shadow: none;
  --shadow-sm: none;
  --shadow-lg: 0 16px 48px rgba(0, 16, 36, 0.12);
  --font-display: "Onest", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color-scheme: light;
}

:root[data-theme="bank"] :is(h1, h2) {
  font-weight: 800;
  letter-spacing: -0.02em;
}

:root[data-theme="bank"] :is(.card, .panel, .fact, .level-item, .steps-strip, .callout, .coach, .quiz__q, .hero-art, .paywall, .plan-card, .dialog) {
  border: 0;
  box-shadow: none;
}

:root[data-theme="bank"] :is(.card, .panel) {
  padding: 28px;
}

:root[data-theme="bank"] .fact {
  background: var(--card-2);
  border-radius: 16px;
}

:root[data-theme="bank"] :is(.btn, .chip, .tab, .option, .pick, .direction, .seg label, .hint-card, .quiz__option, input, select, textarea, .stepper) {
  border: 0;
  box-shadow: none;
  border-radius: 16px;
  background: rgba(0, 16, 36, 0.05);
}

:root[data-theme="bank"] .btn {
  font-weight: 600;
}

:root[data-theme="bank"] .btn:hover:not(:disabled),
:root[data-theme="bank"] a.game-card:hover {
  transform: none;
  box-shadow: none;
  filter: brightness(0.97);
}

:root[data-theme="bank"] .btn:active:not(:disabled) {
  transform: scale(0.98);
}

:root[data-theme="bank"] .btn.btn--primary {
  background: var(--accent);
}

:root[data-theme="bank"] .btn.btn--ghost {
  background: transparent;
}

:root[data-theme="bank"] .btn--xl {
  border-radius: 20px;
  font-family: var(--font-body);
}

:root[data-theme="bank"] :is(.option, .direction, .seg label, .pick):has(input:checked),
:root[data-theme="bank"] .chip.is-on,
:root[data-theme="bank"] .tab.is-active {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: none;
}

:root[data-theme="bank"] :is(.option, .direction, .seg label):has(input:checked) :is(.option__text, .muted, span) {
  color: var(--ink-2);
}

:root[data-theme="bank"] .stepper {
  padding: 4px;
  gap: 4px;
}

:root[data-theme="bank"] .stepper li {
  border: 0;
  border-radius: 12px;
}

:root[data-theme="bank"] .stepper li.is-done {
  background: transparent;
}

:root[data-theme="bank"] .panel__tag {
  border: 0;
  border-radius: 10px;
  background: var(--ink);
  color: #fff;
}

:root[data-theme="bank"] .panel__tag--after {
  background: var(--accent);
  color: var(--accent-ink);
}

:root[data-theme="bank"] .topbar {
  background: #ffffff;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
}

:root[data-theme="bank"] .brand {
  color: var(--ink);
}

:root[data-theme="bank"] .brand span:last-child {
  color: var(--ink);
}

:root[data-theme="bank"] .brand__mark {
  border-radius: 10px;
  background: var(--accent);
}

:root[data-theme="bank"] .nav a {
  color: var(--ink-2);
  border-radius: 12px;
}

:root[data-theme="bank"] .nav a:hover {
  color: var(--ink);
  background: rgba(0, 16, 36, 0.05);
}

:root[data-theme="bank"] .nav a.is-active {
  background: rgba(0, 16, 36, 0.08);
  color: var(--ink);
}

:root[data-theme="bank"] .nav__lock,
:root[data-theme="bank"] .nav a.is-active .nav__lock {
  background: var(--accent);
  color: var(--accent-ink);
}

:root[data-theme="bank"] .capital {
  border: 0;
  border-radius: 12px;
  background: rgba(0, 16, 36, 0.05);
  color: var(--muted);
}

:root[data-theme="bank"] .capital strong {
  color: var(--ink);
}

:root[data-theme="bank"] .account-btn {
  border-radius: 12px;
  background: var(--accent);
  color: var(--accent-ink);
}

:root[data-theme="bank"] .ticker {
  background: var(--card-2);
  color: var(--muted);
  border-top: 0;
  border-bottom: 1px solid var(--line);
}

:root[data-theme="bank"] .game-card__band {
  border-bottom: 0;
  border-radius: 24px 24px 0 0;
  margin: -28px -28px 6px;
  padding: 12px 28px;
}

:root[data-theme="bank"] .game-card--forecast .game-card__band {
  background: #e8e1ff;
}

:root[data-theme="bank"] .game-card--amber .game-card__band {
  background: #ffe9d1;
}

:root[data-theme="bank"] .hero-art {
  transform: none;
  border-radius: 24px;
  box-shadow: var(--shadow-lg);
}

:root[data-theme="bank"] .hero-xl h1 mark {
  border-radius: 10px;
}

:root[data-theme="bank"] .bar {
  border: 0;
  background: rgba(0, 16, 36, 0.06);
}

:root[data-theme="bank"] .bar > span {
  border-right: 0;
  border-radius: 999px;
}

:root[data-theme="bank"] .plan-card--best {
  background: var(--accent-2);
  box-shadow: inset 0 0 0 2px var(--accent);
}

:root[data-theme="bank"] .plan-card__badge {
  border: 0;
}

:root[data-theme="bank"] .hint-card {
  border: 0;
}

:root[data-theme="bank"] .pro-badge {
  border: 0;
  border-radius: 8px;
}

:root[data-theme="bank"] .table th {
  border-bottom-color: var(--line);
}

:root[data-theme="bank"] .chart__decision {
  stroke: var(--ink);
}

:root[data-theme="bank"] .dialog {
  border-radius: 28px;
  box-shadow: var(--shadow-lg);
}

:root[data-theme="bank"] .footer {
  border-top: 1px solid var(--line);
}

.section-title {
  margin-top: 36px;
}

/* ── Анимации: появление экранов и карточек, «рисование» графиков, рост полос очков.
   Только если пользователь не просил уменьшить движение. ── */

@media (prefers-reduced-motion: no-preference) {
  @keyframes rise {
    from {
      opacity: 0;
      transform: translateY(14px);
    }
    to {
      opacity: 1;
      transform: none;
    }
  }

  @keyframes reveal {
    from {
      clip-path: inset(0 100% 0 0);
    }
    to {
      clip-path: inset(0 0 0 0);
    }
  }

  @keyframes grow {
    from {
      transform: scaleX(0);
    }
    to {
      transform: scaleX(1);
    }
  }

  @keyframes pop {
    0% {
      transform: scale(0.94);
      opacity: 0;
    }
    70% {
      transform: scale(1.02);
      opacity: 1;
    }
    100% {
      transform: none;
    }
  }

  @keyframes nudge {
    0%,
    100% {
      transform: none;
    }
    50% {
      transform: translateX(4px);
    }
  }

  #view > .stack > *,
  #view > .level > * {
    animation: rise 0.45s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  }

  #view > .stack > :nth-child(2),
  #view > .level > :nth-child(2) {
    animation-delay: 0.06s;
  }

  #view > .stack > :nth-child(3),
  #view > .level > :nth-child(3) {
    animation-delay: 0.12s;
  }

  #view > .stack > :nth-child(n + 4),
  #view > .level > :nth-child(n + 4) {
    animation-delay: 0.18s;
  }

  .games > *,
  .plans--3 > *,
  .steps-strip li,
  .hints > *,
  .quiz__q {
    animation: rise 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  }

  :is(.games, .plans--3, .steps-strip, .hints) > :nth-child(2) {
    animation-delay: 0.08s;
  }

  :is(.games, .plans--3, .steps-strip, .hints) > :nth-child(3) {
    animation-delay: 0.16s;
  }

  :is(.games, .plans--3, .steps-strip, .hints) > :nth-child(4) {
    animation-delay: 0.24s;
  }

  .chart:not(.chart--draw) {
    animation: reveal 1.1s cubic-bezier(0.3, 0.6, 0.2, 1) both;
  }

  /* график на главной: короткое проявление без задержки — раньше карточка долго стояла пустой */
  .hero-art svg {
    animation: hero-fade 0.5s ease-out;
  }

  @keyframes hero-fade {
    from {
      opacity: 0.15;
    }
  }

  .bar > span,
  .money__bar,
  .xray__track span {
    transform-origin: left center;
    animation: grow 0.9s 0.2s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  }

  .money__bar[style*="right"] {
    transform-origin: right center;
  }

  .hint-card.is-open,
  .quiz__why:not([hidden]),
  .pro-dialog__done,
  .coach {
    animation: pop 0.4s ease-out both;
  }

  .dialog[open] {
    animation: pop 0.25s ease-out both;
  }

  :is(.option, .direction, .pick, .seg label):has(input:checked) {
    animation: pop 0.25s ease-out;
  }

  .btn--xl:hover:not(:disabled) {
    animation: nudge 0.6s ease-in-out infinite;
  }

  .chart__event circle {
    transition: r 0.15s ease;
  }
}

.ticker__item b {
  font-weight: 800;
}

.ticker__item .up,
.ticker__item .down {
  font-weight: 800;
}

.tiers {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.tier.is-current {
  box-shadow: inset 0 0 0 3px var(--accent);
}

.tier__levels {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 800;
  margin: 4px 0 10px;
}

.tier-switch {
  justify-content: center;
  margin-bottom: 8px;
}

/* «Черновик» — рисование поверх графика */

.sketch-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

.chart.is-sketching {
  cursor: crosshair;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  outline: 2px dashed var(--forecast);
  border-radius: 8px;
}

.chart__sketch polyline {
  fill: none;
  stroke: var(--forecast);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.85;
}

#view > .no-anim > *,
#view > .no-anim .chart {
  animation: none !important;
}

/* ── Однородный шрифт в теме «Банк»: один Onest для текста, заголовков и чисел ── */

:root[data-theme="bank"] {
  --font-mono: "Onest", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

body {
  font-variant-numeric: tabular-nums;
}

:root[data-theme="bank"] :is(.eyebrow, .step__num, .fact__label, .metric__label, .table th, .panel__tag, .game-card__band, .game-card__tag) {
  letter-spacing: 0.02em;
}

/* ── Бегущая строка — только на главной ── */

body:not([data-route="home"]) .ticker {
  display: none;
}

/* ── Настройки оформления в подвале ── */

.appearance {
  display: grid;
  gap: 8px;
}

.appearance .chip__dot {
  border: 1px solid rgba(0, 0, 0, 0.2);
}

/* ── Бургер-меню на телефоне ── */

.burger {
  display: none;
  width: 42px;
  height: 42px;
  padding: 10px;
  border: 0;
  border-radius: 12px;
  background: rgba(127, 127, 127, 0.12);
  cursor: pointer;
  flex-direction: column;
  justify-content: space-between;
}

.burger span {
  display: block;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.topbar.is-open .burger span:nth-child(1) {
  transform: translateY(9px) rotate(45deg);
}

.topbar.is-open .burger span:nth-child(2) {
  opacity: 0;
}

.topbar.is-open .burger span:nth-child(3) {
  transform: translateY(-9px) rotate(-45deg);
}

@media (max-width: 760px) {
  .burger {
    display: flex;
    order: 3;
    color: inherit;
  }

  .brand {
    order: 1;
  }

  .topbar__right {
    order: 2;
    margin-left: auto;
  }

  .topbar__inner {
    flex-wrap: wrap;
    gap: 10px;
  }

  .topbar .nav {
    order: 4;
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 8px 0 12px;
    overflow: visible;
  }

  .topbar.is-open .nav {
    display: flex;
  }

  .topbar .nav a {
    padding: 12px 14px;
    font-size: 16px;
  }

  .capital {
    display: none;
  }

  .account-btn {
    max-width: 140px;
  }
}

/* Подсветка того, что забыли выбрать */

fieldset.is-missing {
  border-radius: 16px;
  outline: 2px solid var(--down);
  outline-offset: 6px;
  animation: shake 0.35s ease-in-out;
}

fieldset.is-missing legend {
  color: var(--down);
}

@keyframes shake {
  0%,
  100% {
    transform: none;
  }
  25% {
    transform: translateX(-4px);
  }
  75% {
    transform: translateX(4px);
  }
}

@media (prefers-reduced-motion: reduce) {
  fieldset.is-missing {
    animation: none;
  }
}

.live-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.live-option {
  justify-content: flex-start;
  text-align: left;
}

.stepper li.is-wrong {
  background: var(--down-soft);
  color: var(--down);
}

/* В тёмной теме цвет фона не выбирается — фон задаёт сама тема. */
:root[data-scheme="dark"] .appearance__bg {
  display: none;
}

.callout--ok {
  background: var(--up-soft);
  border-color: var(--up);
}

.callout--bad {
  background: var(--down-soft);
  border-color: var(--down);
}

.live-feedback {
  font-size: 16px;
  color: var(--ink);
}

/* Рост/падение в жёлтой (янтарной) бегущей строке — всегда тёмные: светлые цвета тёмных тем на жёлтом не читаются. */
:root:not([data-theme="bank"]):not([data-theme="journal"]) .ticker__item .up {
  color: #0a6b3c;
}

:root:not([data-theme="bank"]):not([data-theme="journal"]) .ticker__item .down {
  color: #b0231c;
}

/* Бейдж «Экономия»: белый текст на светло-зелёном тёмной темы не читался. */
.plan-card__badge--save {
  background: var(--up-soft);
  color: var(--up);
  border-color: var(--up);
}

/* Телефон: кнопка «Скрыть совет» — под текстом, а не отдельной колонкой (иначе текст в 2 слова в строке). */
@media (max-width: 600px) {
  .coach {
    grid-template-columns: auto 1fr;
  }

  .coach__close {
    grid-column: 2;
    justify-self: start;
  }
}

/* Телефон: мелкие ссылки и вкладки — не меньше 40px в высоту, чтобы попадать пальцем. */
@media (max-width: 760px) {
  .back,
  .coach__close,
  .tabs--small .tab,
  .tab {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
  }
}

/* Сетевые аркады */
.arcade-games {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.arcade-code {
  font-family: var(--font-mono);
  font-size: 32px;
  font-weight: 800;
  letter-spacing: 0.12em;
  padding: 6px 16px;
  border-radius: 12px;
  background: var(--accent-2);
  color: var(--ink);
}

.arcade-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.arcade-canvas {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  border: 2px solid var(--line);
  touch-action: none;
}

.arcade-canvas--arena {
  max-width: min(600px, 70vh);
  margin: 0 auto;
  border: 0;
}

.arcade-score {
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 16px;
  text-align: center;
}

.arcade-pads {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.arcade-btn {
  min-width: 88px;
  min-height: 56px;
  font-size: 22px;
  user-select: none;
  touch-action: none;
}

/* Доля в песочнице: поле видно всегда, рядом −5 / +5 вместо стрелочек */
.share {
  flex-wrap: wrap;
}

.share__field {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.table--alloc .share__custom {
  width: 52px;
  text-align: center;
}

.share__pct {
  color: var(--muted);
  font-weight: 700;
}

.share__step {
  padding: 4px 9px;
  font-size: 13px;
  font-family: var(--font-mono);
}

/* Дуэль: клетчатый фон — поле крестиков-ноликов */
.board-layer {
  position: absolute;
  z-index: 0;
  pointer-events: none;
  background-image: linear-gradient(color-mix(in srgb, var(--ink) 13%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--ink) 13%, transparent) 1px, transparent 1px);
  background-size: var(--cell) var(--cell);
}

.board-layer.is-closed {
  opacity: 0.55;
}

body.has-board #view {
  position: relative;
  z-index: 1;
}

body.has-board {
  padding-bottom: 72px; /* место под строкой состояния поля */
}

body.board-can-place {
  cursor: pointer;
}

.board-mark {
  position: absolute;
  display: grid;
  place-items: center;
  font-weight: 800;
  line-height: 1;
}

.board-ghost {
  opacity: 0.35;
}

.board-mark.is-last {
  border-radius: 6px;
  box-shadow: inset 0 0 0 2px currentColor;
}

.board-mark.is-win {
  background: color-mix(in srgb, var(--accent) 60%, transparent);
  border-radius: 4px;
}

.board-bar {
  position: fixed;
  z-index: 20;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 14px;
  justify-content: center;
  max-width: calc(100vw - 24px);
  padding: 8px 16px;
  border-radius: 14px;
  background: var(--card);
  color: var(--ink);
  border: 2px solid var(--line);
  box-shadow: var(--shadow-sm);
  font-size: 14px;
  pointer-events: none;
}

.board-bar__players {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  font-weight: 700;
}

.board-bar__players .is-turn {
  text-decoration: underline;
  text-underline-offset: 3px;
}

@media (prefers-reduced-motion: no-preference) {
  .board-mark.is-last {
    animation: board-pop 0.35s ease-out;
  }

  @keyframes board-pop {
    from {
      transform: scale(1.6);
      opacity: 0;
    }
  }
}

@media (max-width: 600px) {
  .board-bar {
    font-size: 12px;
    padding: 6px 10px;
    gap: 2px 8px;
  }
}

.back--button {
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  cursor: pointer;
}

/* Песочница: заметная кнопка к другим годам */
.eras-btn,
.eras-btn:hover:not(:disabled) {
  white-space: nowrap;
  font-weight: 800;
  background: var(--accent);
  color: var(--accent-ink);
  border: 2px solid color-mix(in srgb, var(--accent-ink) 25%, var(--accent));
}

/* Доля акции: −5, поле, +5 */
.share {
  flex-wrap: nowrap;
  gap: 6px;
}

.share__step {
  min-width: 42px;
  justify-content: center;
}

.share__step:disabled {
  opacity: 0.4;
}

/* Подписи дней под графиком: каждые 3 дня */
.chart__tick {
  stroke: var(--muted);
  stroke-width: 1;
}

.chart__day {
  fill: var(--muted);
  font-family: var(--font-mono);
  font-size: 10.5px;
}

.chart__label--axis {
  font-size: 11px;
}

@media (max-width: 600px) {
  .chart__day--minor {
    display: none;
  }

  .chart__day {
    font-size: 16px;
  }

  .chart__label--axis,
  .chart__label--decision {
    font-size: 17px;
  }
}

.alloc__sector {
  display: block;
}

/* Песочница на телефоне: строка таблицы — карточка, кнопки доли без прокрутки вбок */
@media (max-width: 600px) {
  .table--alloc thead {
    display: none;
  }

  .table--alloc,
  .table--alloc tbody {
    display: block;
    width: 100%;
  }

  .table--alloc tr {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 4px 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--line-soft);
  }

  .table--alloc td {
    display: block;
    padding: 0;
    border: 0;
    text-align: left;
  }

  .table--alloc td:nth-child(2) {
    grid-area: 1 / 2;
    text-align: right;
  }

  .table--alloc td:nth-child(3) {
    grid-area: 2 / 2;
    text-align: right;
  }

  .table--alloc td:nth-child(4) {
    grid-area: 2 / 1;
  }

  .table--alloc td:nth-child(5) {
    grid-column: 1 / -1;
  }

  .table--alloc td[data-label]::before {
    content: attr(data-label) ": ";
    color: var(--muted);
    font-size: 12px;
  }
}

/* Узкий телефон: бейдж тарифа в шапке прячем, имя сокращаем — бургер остаётся в первой строке */
@media (max-width: 420px) {
  .account-btn .nav__lock {
    display: none;
  }

  .account-btn {
    max-width: 120px;
  }

  .account-btn span:first-child {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

@media (max-width: 600px) {
  .table--alloc td.num:nth-child(4) {
    text-align: left;
  }
}

@media (max-width: 360px) {
  .topbar__inner {
    column-gap: 8px;
  }

  .brand span:last-child {
    font-size: 15px;
  }

  .account-btn {
    max-width: 84px;
  }
}

/* Админка */
.admin-users {
  display: grid;
  gap: 12px;
}

.admin-user.is-banned {
  opacity: 0.75;
}

.admin-actions {
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.admin-tier select {
  min-height: 36px;
}

.admin-danger {
  color: var(--down);
}

.admin-sessions {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line-soft);
}

.admin-session {
  flex-wrap: wrap;
  gap: 8px;
}

.admin-skip {
  border: 2px dashed var(--line);
}

/* История на графике «Дорисуй»: участки роста и падения */
.line.line--rise {
  stroke: var(--up);
}

.line.line--fall {
  stroke: var(--down);
}

.mini-company {
  margin: 0 0 8px;
  font-size: clamp(26px, 4vw, 36px);
}

/* Песочница: название акции открывает её график */
.alloc__name {
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.alloc__name strong {
  text-decoration: underline dotted;
  text-underline-offset: 3px;
}

@media (max-width: 600px) {
  .table--alloc tr.alloc__chart {
    display: block;
  }
}

/* Аркады: игроки и боты в лобби */
.arcade-player {
  align-items: center;
  gap: 8px;
}

.arcade-bots {
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

/* Реклама (РСЯ): только у игроков без подписки */
.ad-slot {
  position: relative;
  margin: 24px 0;
  padding: 18px 16px 14px;
  border: 1px dashed var(--line-soft);
  border-radius: var(--radius);
  background: var(--card);
  min-height: 110px;
}

.ad-slot__label {
  position: absolute;
  top: 6px;
  left: 12px;
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.ad-slot__stub {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  justify-content: center;
  align-items: center;
  min-height: 80px;
  color: var(--muted);
}

#ad-footer:empty {
  display: none;
}

/* Согласие на обработку ПДн и cookie */
.consent {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 14px;
  line-height: 1.4;
}

.consent input {
  width: 20px;
  height: 20px;
  min-height: 0;
  margin-top: 1px;
  flex: none;
}

.cookie-banner {
  position: fixed;
  z-index: 50;
  left: 16px;
  right: 16px;
  bottom: 16px;
  max-width: 720px;
  margin: 0 auto;
  padding: 14px 18px;
  border-radius: var(--radius);
  background: var(--card);
  color: var(--ink);
  border: 2px solid var(--line);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  justify-content: space-between;
}

.cookie-banner p {
  margin: 0;
  flex: 1 1 320px;
  font-size: 14px;
}

.footer__links {
  font-size: 13px;
}

.linklike {
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  color: inherit;
  text-decoration: underline;
  cursor: pointer;
}

.policy h2 {
  font-size: 20px;
  margin-top: 18px;
}
