/* Сақ бол! — стили игры. Mobile-first: базовые стили для телефона,
   расширения для планшетов и компьютеров — в медиа-запросах внизу. */

:root {
  --sky: #00a3c4;
  --sky-600: #0083a1;
  --sky-50: #e5f6fa;
  --gold: #f5b800;
  --gold-600: #b98a00;
  --gold-50: #fff6d5;
  --navy: #0d1b3d;
  --ink: #1b2747;
  --ink-2: #4b587a;
  --muted: #7d88a6;
  --line: #e2e7f1;
  --bg: #f2f5fb;
  --surface: #ffffff;
  --ok: #129a57;
  --ok-50: #e4f6ec;
  --bad: #dc3d46;
  --bad-50: #fdecee;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 6px 22px rgba(13, 27, 61, 0.08);
  --shadow-lg: 0 18px 50px rgba(13, 27, 61, 0.18);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", Arial, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--bg);
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img, svg { display: block; max-width: 100%; }
h1, h2, h3 { margin: 0; line-height: 1.2; color: var(--navy); }
p { margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ─── Каркас ─────────────────────────────────────────────────────────── */

.shell {
  max-width: 560px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 56px;
  padding: 0 12px 0 14px;
  /* Без размытия подложки (backdrop-filter): на дешёвых телефонах оно пересчитывается
     в каждом кадре прокрутки */
  background: rgba(255, 255, 255, 0.97);
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 18px;
  color: var(--navy);
  text-decoration: none;
  background: none;
  border: 0;
  padding: 0;
}
.brand svg { width: 30px; height: 30px; }
.topbar .spacer { flex: 1; }
.xp-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--gold-50);
  color: var(--gold-600);
  font-weight: 800;
  font-size: 14px;
}
.lang-switch {
  display: inline-flex;
  flex: none;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  background: var(--surface);
}
.lang-switch button {
  min-height: 32px;
  padding: 4px 9px;
  border: 0;
  background: none;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.3px;
  color: var(--ink-2);
  touch-action: manipulation;
}
.lang-switch button[aria-pressed="true"] { background: var(--navy); color: #fff; }
.brand span, .xp-chip { white-space: nowrap; }
/* На телефоне в шапке остаются логотип, язык, очки и выход — название уже есть на главном экране */
@media (max-width: 430px) { .brand span { display: none; } }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 0;
  background: transparent;
  color: var(--ink-2);
}
.icon-btn:active { background: var(--line); }
.icon-btn svg { width: 22px; height: 22px; }

main#app {
  flex: 1;
  padding: 16px 16px calc(24px + var(--safe-b));
  outline: none;
}

.footer {
  padding: 18px 16px calc(18px + var(--safe-b));
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  border-top: 1px solid var(--line);
}
.footer strong { color: var(--ink-2); }
.footer .org { font-size: 11px; line-height: 1.35; opacity: 0.85; }

/* ─── Базовые элементы ───────────────────────────────────────────────── */

.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}
.stack > * + * { margin-top: 14px; }
.stack-sm > * + * { margin-top: 8px; }
.row { display: flex; gap: 10px; align-items: center; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.center { text-align: center; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 54px;
  padding: 12px 20px;
  border: 0;
  border-radius: 16px;
  background: var(--sky);
  color: #fff;
  font-weight: 800;
  font-size: 17px;
  text-decoration: none;
  box-shadow: 0 4px 0 var(--sky-600);
  transition: transform 0.08s, box-shadow 0.08s, opacity 0.2s;
  touch-action: manipulation;
}
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--sky-600); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.gold { background: var(--gold); color: var(--navy); box-shadow: 0 4px 0 var(--gold-600); }
.btn.gold:active { box-shadow: 0 1px 0 var(--gold-600); }
.btn.ghost { background: var(--surface); color: var(--ink); box-shadow: 0 0 0 2px var(--line) inset, 0 3px 0 var(--line); }
.btn.ghost:active { box-shadow: 0 0 0 2px var(--line) inset; }
.btn.ok { background: var(--ok); box-shadow: 0 4px 0 #0b7340; }
.btn.bad { background: var(--bad); box-shadow: 0 4px 0 #a8242c; }
.btn.small { min-height: 44px; font-size: 15px; border-radius: 13px; }
.btn-row { display: flex; gap: 10px; }
.btn-row > .btn { flex: 1; }
.link-btn { border: 0; background: none; color: var(--sky-600); font-weight: 700; padding: 8px; text-decoration: underline; text-underline-offset: 3px; }

.field { display: block; }
.field > span { display: block; font-weight: 700; font-size: 14px; color: var(--ink-2); margin-bottom: 6px; }
.field > span em { font-style: normal; font-weight: 500; color: var(--muted); }
.input {
  width: 100%;
  min-height: 52px;
  padding: 12px 14px;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  font-size: 17px;
  outline: none;
  transition: border-color 0.15s;
}
.input:focus { border-color: var(--sky); }
.input.invalid { border-color: var(--bad); }
.error-text { color: var(--bad); font-size: 14px; font-weight: 600; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  background: var(--sky-50);
  color: var(--sky-600);
}
.pill.gold { background: var(--gold-50); color: var(--gold-600); }
.pill.ok { background: var(--ok-50); color: var(--ok); }
.pill.bad { background: var(--bad-50); color: var(--bad); }

.progress { height: 10px; border-radius: 999px; background: var(--line); overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--sky), #34c6e0); transition: width 0.5s ease; }
.progress.gold > i { background: linear-gradient(90deg, var(--gold), #ffd451); }

.choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 8px; }
.choice-btn {
  min-height: 52px;
  border-radius: 14px;
  border: 2px solid var(--line);
  background: var(--surface);
  font-weight: 800;
  font-size: 18px;
  touch-action: manipulation;
}
.choice-btn[aria-pressed="true"] { border-color: var(--sky); background: var(--sky-50); color: var(--sky-600); }

.check {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 14px;
  color: var(--ink-2);
  cursor: pointer;
}
.check input { width: 24px; height: 24px; flex: none; margin: 0; accent-color: var(--sky); }

/* ─── Талисман и реплики ─────────────────────────────────────────────── */

.mascot-say { display: flex; gap: 10px; align-items: flex-end; }
.mascot-say .mascot { width: 64px; height: 64px; flex: none; }
.bubble {
  position: relative;
  flex: 1;
  background: var(--surface);
  border-radius: 18px 18px 18px 6px;
  padding: 12px 14px;
  box-shadow: var(--shadow);
  font-weight: 600;
}

/* ─── Приветствие ────────────────────────────────────────────────────── */

.hero {
  position: relative;
  overflow: hidden;
  border-radius: 26px;
  padding: 26px 20px 22px;
  color: #fff;
  background:
    radial-gradient(circle at 85% 10%, rgba(245, 184, 0, 0.45), transparent 40%),
    linear-gradient(160deg, #0aa8c9 0%, #0a6f9c 55%, #0d1b3d 100%);
  box-shadow: var(--shadow-lg);
}
.hero .mascot { width: 120px; height: 120px; margin: 0 auto 6px; filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.25)); animation: float 4s ease-in-out infinite; }
.hero h1 { color: #fff; font-size: 40px; font-weight: 900; text-align: center; letter-spacing: 0.5px; }
.hero .tagline { text-align: center; font-size: 17px; opacity: 0.95; margin-top: 8px; }
.hero .org { text-align: center; font-size: 11px; opacity: 0.7; margin-top: 12px; }
.hero-q { position: absolute; top: 14px; right: 14px; z-index: 1; width: 38px; height: 38px; display: grid; place-items: center; border: 0; border-radius: 50%; background: rgba(255, 255, 255, 0.18); color: #fff; font-size: 19px; font-weight: 900; touch-action: manipulation; }
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 18px; }
.features div {
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 14px;
  padding: 10px 6px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
}
.features b { display: block; font-size: 22px; margin-bottom: 2px; }
@keyframes float { 50% { transform: translateY(-8px) rotate(-2deg); } }

.topics { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.topic {
  background: var(--surface);
  border-radius: 16px;
  padding: 14px;
  box-shadow: var(--shadow);
  font-size: 14px;
  color: var(--ink-2);
}
.topic b { display: block; font-size: 15px; color: var(--navy); margin: 4px 0 2px; }
.topic .emo { font-size: 26px; }
/* Главный экран: миссии значками, без описаний */
.topics.compact { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.topics.compact .topic { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 6px; text-align: center; }
.topics.compact .topic .emo { font-size: 30px; line-height: 1; }
.topics.compact .topic b { margin: 0; font-size: 13px; line-height: 1.2; }

/* ─── Регистрация ────────────────────────────────────────────────────── */

.steps-dots { display: flex; gap: 6px; justify-content: center; }
.steps-dots i { width: 28px; height: 6px; border-radius: 999px; background: var(--line); }
.steps-dots i.on { background: var(--sky); }

.tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: none;
  height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  border: 2px solid var(--line);
  background: var(--surface);
  font-weight: 700;
  font-size: 14px;
  color: var(--ink-2);
}
.tab[aria-selected="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }

.inst-list { display: flex; flex-direction: column; gap: 8px; }
.inst {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 56px;
  padding: 10px 14px;
  border: 2px solid transparent;
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 1px 3px rgba(13, 27, 61, 0.06);
  text-align: left;
  font-weight: 600;
  touch-action: manipulation;
}
.inst .ico { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border-radius: 10px; background: var(--sky-50); font-size: 18px; }
.inst[aria-pressed="true"] { border-color: var(--sky); background: var(--sky-50); }
.inst.other { border: 2px dashed var(--line); background: transparent; box-shadow: none; color: var(--ink-2); }
.inst .sub { display: block; margin-top: 2px; font-size: 12px; font-weight: 500; color: var(--muted); }

.district-list { display: flex; flex-direction: column; gap: 8px; }
.district {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 64px;
  padding: 10px 12px 10px 14px;
  border: 0;
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 1px 3px rgba(13, 27, 61, 0.06);
  text-align: left;
  touch-action: manipulation;
}
.district:active { background: var(--sky-50); }
.district .ico { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 12px; background: var(--sky-50); font-size: 20px; }
.district .meta { flex: 1; min-width: 0; }
.district b { display: block; color: var(--navy); font-size: 16px; }
.district small { display: block; color: var(--muted); font-size: 13px; }
.district .count { flex: none; padding: 4px 8px; border-radius: 999px; background: var(--sky-50); color: var(--sky-600); font-size: 12px; font-weight: 800; white-space: nowrap; }
.district::after { content: "›"; flex: none; color: var(--muted); font-size: 24px; line-height: 1; }
.empty { padding: 24px 12px; text-align: center; color: var(--muted); }

.sticky-cta {
  position: sticky;
  bottom: 0;
  margin: 0 -16px;
  padding: 12px 16px calc(12px + var(--safe-b));
  background: linear-gradient(180deg, rgba(242, 245, 251, 0), var(--bg) 30%);
  z-index: 5;
}

/* ─── Карта миссий ───────────────────────────────────────────────────── */

.player-card { display: flex; flex-direction: column; gap: 12px; }
.player-card .who { display: flex; align-items: center; gap: 12px; }
.avatar {
  width: 52px;
  height: 52px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: linear-gradient(140deg, var(--sky), var(--navy));
  color: #fff;
  font-weight: 900;
  font-size: 20px;
}
.player-card h2 { font-size: 20px; }
.avatar.sm { width: 42px; height: 42px; border-radius: 13px; font-size: 16px; }
.rank { font-size: 14px; color: var(--ink-2); font-weight: 600; }
.xp-line { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); font-weight: 700; margin-bottom: 6px; }
.badges { display: flex; gap: 8px; }
.badge {
  flex: 1;
  aspect-ratio: 1;
  max-width: 64px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  font-size: 26px;
  background: var(--bg);
  filter: grayscale(1);
  opacity: 0.4;
}
.badge.on { filter: none; opacity: 1; background: var(--gold-50); box-shadow: 0 0 0 2px var(--gold) inset; }

.path { position: relative; display: flex; flex-direction: column; gap: 12px; }
.path::before {
  content: "";
  position: absolute;
  left: 39px;
  top: 30px;
  bottom: 30px;
  width: 4px;
  border-radius: 4px;
  background: repeating-linear-gradient(180deg, var(--line) 0 10px, transparent 10px 18px);
}
.mission {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px;
  border: 0;
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow);
  text-align: left;
  touch-action: manipulation;
}
.mission .num {
  position: relative;
  width: 52px;
  height: 52px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 26px;
  background: var(--sky-50);
  box-shadow: 0 0 0 4px var(--surface);
}
.mission .meta { flex: 1; min-width: 0; }
.mission h3 { font-size: 17px; }
.mission p { font-size: 14px; color: var(--muted); margin-top: 2px; }
.mission .state { font-size: 13px; font-weight: 800; margin-top: 6px; }
.mission.available { box-shadow: 0 0 0 3px var(--sky), var(--shadow); }
.mission.available .num { background: var(--sky); animation: pulse 1.8s infinite; }
.mission.available .state { color: var(--sky-600); }
.mission.done .num { background: var(--ok-50); }
.mission.done .state { color: var(--ok); }
.mission.locked { opacity: 0.6; }
.mission.locked .num { filter: grayscale(1); }
.mission.locked .state { color: var(--muted); }
.mission.final .num { background: var(--gold-50); }
.mission.final.available { box-shadow: 0 0 0 3px var(--gold), var(--shadow); }
.mission.final.available .num { background: var(--gold); }
.stars { letter-spacing: 1px; }
@keyframes pulse { 0% { box-shadow: 0 0 0 4px var(--surface), 0 0 0 4px rgba(0, 163, 196, 0.5); } 70% { box-shadow: 0 0 0 4px var(--surface), 0 0 0 14px rgba(0, 163, 196, 0); } 100% { box-shadow: 0 0 0 4px var(--surface), 0 0 0 4px rgba(0, 163, 196, 0); } }

/* ─── Миссия: общий каркас ───────────────────────────────────────────── */

.mission-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.mission-head .progress { flex: 1; }
.step-title { font-size: 22px; font-weight: 900; }
.step-kicker { font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.6px; color: var(--sky-600); }

.lesson { font-size: 16px; color: var(--ink-2); }
.lesson b, .lesson strong { color: var(--navy); }
.lesson ul { margin: 0; padding-left: 20px; }
.lesson li + li { margin-top: 6px; }
.rule {
  border-radius: 16px;
  padding: 14px 16px;
  background: var(--gold-50);
  border: 2px solid #ffe28a;
  color: var(--navy);
  font-weight: 700;
}
.rule.blue { background: var(--sky-50); border-color: #b5e7f2; }
.rule.red { background: var(--bad-50); border-color: #f8c6ca; }
.rule.green { background: var(--ok-50); border-color: #b6e6cb; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile { background: var(--surface); border-radius: 16px; padding: 12px; box-shadow: var(--shadow); font-size: 14px; }
.tile .emo { font-size: 26px; display: block; margin-bottom: 4px; }
.tile b { display: block; color: var(--navy); }

/* Схема дропперства */
.chain { display: flex; flex-direction: column; align-items: stretch; gap: 0; }
.chain .node { display: flex; align-items: center; gap: 12px; background: var(--surface); border-radius: 14px; padding: 10px 14px; box-shadow: var(--shadow); font-weight: 700; }
.chain .node .emo { font-size: 24px; }
.chain .node small { display: block; font-weight: 500; color: var(--muted); }
.chain .node.drop { box-shadow: 0 0 0 2px var(--bad) inset; background: var(--bad-50); }
.chain .arrow { text-align: center; color: var(--muted); font-size: 18px; line-height: 22px; }

/* Банковская карта */
.bank-card {
  position: relative;
  aspect-ratio: 1.586;
  border-radius: 18px;
  padding: 18px;
  color: #fff;
  background: linear-gradient(135deg, #0aa8c9, #0d1b3d);
  box-shadow: var(--shadow-lg);
  font-weight: 700;
  overflow: hidden;
}
.bank-card::after { content: ""; position: absolute; right: -40px; top: -40px; width: 160px; height: 160px; border-radius: 50%; background: rgba(245, 184, 0, 0.3); }
.bank-card .chip { width: 42px; height: 32px; border-radius: 7px; background: linear-gradient(135deg, #ffe08a, #c9a227); }
.bank-card .num { font-size: clamp(16px, 5.4vw, 22px); letter-spacing: 2px; margin-top: 18px; font-variant-numeric: tabular-nums; }
.bank-card .bottom { display: flex; justify-content: space-between; margin-top: 12px; font-size: 13px; opacity: 0.9; }
.bank-card .tag { position: absolute; font-size: 11px; font-weight: 800; padding: 3px 8px; border-radius: 999px; background: #fff; color: var(--navy); z-index: 2; }
.bank-card .tag.secret { background: var(--bad); color: #fff; }
.card-back { margin-top: 10px; border-radius: 14px; padding: 12px; background: #e9edf5; display: flex; align-items: center; gap: 10px; font-size: 14px; }
.card-back .cvv { background: #fff; border-radius: 6px; padding: 4px 10px; font-weight: 800; letter-spacing: 2px; font-style: italic; }

/* Адрес сайта: разбор */
.url-demo { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 15px; background: var(--surface); border-radius: 12px; padding: 10px 12px; box-shadow: var(--shadow); word-break: break-all; }
.url-demo .dom { background: var(--ok-50); color: var(--ok); border-radius: 4px; padding: 1px 3px; font-weight: 800; }
.url-demo.badurl .dom { background: var(--bad-50); color: var(--bad); }
.url-demo .dim { color: var(--muted); }
.url-demo + small { display: block; margin: 4px 2px 0; font-size: 13px; color: var(--ink-2); }

/* ─── Игра «Сортировка» ──────────────────────────────────────────────── */

.sort-stage { display: flex; flex-direction: column; gap: 14px; }
.sort-counter { display: flex; justify-content: space-between; font-weight: 800; font-size: 14px; color: var(--muted); }
.sort-item {
  min-height: 190px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  padding: 22px 18px;
  background: var(--surface);
  border-radius: 24px;
  box-shadow: var(--shadow-lg);
  font-size: 19px;
  font-weight: 800;
  color: var(--navy);
  animation: pop 0.35s ease;
}
.sort-item .emo { font-size: 50px; line-height: 1; }
.sort-item.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 17px; word-break: break-all; }
.bins { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.bin {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 92px;
  border-radius: 20px;
  border: 0;
  font-weight: 900;
  font-size: 16px;
  color: #fff;
  background: var(--sky);
  box-shadow: 0 5px 0 var(--sky-600);
  touch-action: manipulation;
}
.bin .emo { font-size: 30px; }
.bin:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--sky-600); }
.bin.tone-red { background: var(--bad); box-shadow: 0 5px 0 #a8242c; }
.bin.tone-green { background: var(--ok); box-shadow: 0 5px 0 #0b7340; }
.bin.tone-gold { background: var(--gold); color: var(--navy); box-shadow: 0 5px 0 var(--gold-600); }
@keyframes pop { from { transform: scale(0.92); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ─── Выбор ответа (вопрос внутри миссии и итоговый тест) ────────────── */

.options { display: flex; flex-direction: column; gap: 10px; }
.option {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 60px;
  padding: 12px 14px;
  border: 2px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  text-align: left;
  font-weight: 650;
  font-size: 16px;
  touch-action: manipulation;
  transition: border-color 0.15s, background 0.15s;
}
.option .key {
  width: 32px;
  height: 32px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--bg);
  font-weight: 900;
  font-size: 14px;
  color: var(--ink-2);
}
.option[aria-pressed="true"] { border-color: var(--sky); background: var(--sky-50); }
.option[aria-pressed="true"] .key { background: var(--sky); color: #fff; }
.option.right { border-color: var(--ok); background: var(--ok-50); }
.option.right .key { background: var(--ok); color: #fff; }
.option.wrong { border-color: var(--bad); background: var(--bad-50); }
.option.wrong .key { background: var(--bad); color: #fff; }
.option:disabled { cursor: default; }

/* ─── Нижняя шторка с обратной связью ────────────────────────────────── */

.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(13, 27, 61, 0.45);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fade 0.2s ease;
}
.sheet {
  width: 100%;
  max-width: 560px;
  max-height: 88vh;
  overflow-y: auto;
  background: var(--surface);
  border-radius: 26px 26px 0 0;
  padding: 22px 18px calc(18px + var(--safe-b));
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.28s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
.sheet .head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.sheet .head .emo { font-size: 38px; line-height: 1; }
.sheet .head h3 { font-size: 21px; }
.sheet.ok .head h3 { color: var(--ok); }
.sheet.bad .head h3 { color: var(--bad); }
.sheet .body { color: var(--ink-2); margin-bottom: 16px; }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(20px + var(--safe-b));
  z-index: 60;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 520px;
  padding: 12px 16px;
  border-radius: 14px;
  background: var(--navy);
  color: #fff;
  font-weight: 600;
  font-size: 15px;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.25s ease;
}
@keyframes toastIn { from { transform: translate(-50%, 30px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }
.toast.ok { background: var(--ok); }
.toast.bad { background: var(--bad); }

/* ─── Игра «Найди подвох» ────────────────────────────────────────────── */

.spot-hud { display: flex; justify-content: space-between; align-items: center; font-weight: 800; font-size: 14px; }
.spot-hud .found { color: var(--ok); }
.spot-hud .miss { color: var(--bad); }
.spot {
  cursor: pointer;
  border-radius: 6px;
  padding: 1px 2px;
  margin: -1px -2px;
  background-image: linear-gradient(90deg, rgba(0, 163, 196, 0.35) 50%, transparent 50%);
  background-size: 6px 2px;
  background-repeat: repeat-x;
  background-position: 0 100%;
  transition: background-color 0.2s;
  -webkit-user-select: none;
  user-select: none;
}
.spot.hit { background: rgba(220, 61, 70, 0.16); box-shadow: 0 0 0 2px var(--bad); }
.spot.revealed { background: rgba(245, 184, 0, 0.22); box-shadow: 0 0 0 2px var(--gold); }
.spot.nope { animation: shake 0.35s; background-color: rgba(125, 136, 166, 0.18); }
.spot .flag-n { display: inline-grid; place-items: center; width: 18px; height: 18px; margin-left: 3px; border-radius: 50%; background: var(--bad); color: #fff; font-size: 11px; font-weight: 900; vertical-align: 2px; }
.spot.revealed .flag-n { background: var(--gold-600); }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.flag-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.flag-list li { display: flex; gap: 10px; font-size: 14px; color: var(--ink-2); }
.flag-list li b { color: var(--navy); }
.flag-list .n { flex: none; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: var(--bad); color: #fff; font-size: 12px; font-weight: 900; }
.flag-list .n.missed { background: var(--gold-600); }

/* Макет телефона: SMS */
.phone {
  border-radius: 28px;
  background: #fff;
  box-shadow: 0 0 0 8px #1d2433, var(--shadow-lg);
  overflow: hidden;
  margin: 8px 6px;
}
.phone .bar { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: #f6f7f9; border-bottom: 1px solid #e6e8ee; }
.phone .bar .av { width: 36px; height: 36px; border-radius: 50%; background: #c9cfdb; display: grid; place-items: center; font-size: 18px; }
.phone .bar b { font-size: 15px; }
.phone .thread { padding: 14px; background: #fff; min-height: 220px; font-size: 15px; }
.phone .date { text-align: center; font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.phone .sms { background: #eceef3; border-radius: 18px 18px 18px 6px; padding: 10px 12px; max-width: 92%; line-height: 1.5; }
.phone .sms a, .phone .sms .lnk { color: #1a64d6; text-decoration: underline; word-break: break-all; }
.phone .time { font-size: 11px; color: var(--muted); margin-top: 4px; }
.phone .compose { margin: 0 12px 12px; padding: 10px 14px; border-radius: 999px; background: #f0f2f6; color: var(--muted); font-size: 14px; }

/* Макет браузера */
.browser { border-radius: 16px; background: #fff; box-shadow: var(--shadow-lg); overflow: hidden; font-size: 15px; }
.browser .addr { display: flex; align-items: center; gap: 8px; padding: 10px; background: #eef1f6; }
.browser .addr .url { flex: 1; background: #fff; border-radius: 999px; padding: 7px 12px; font-size: 13px; font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; word-break: break-all; }
.browser .site-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 14px; background: #0e5aa7; color: #fff; font-size: 13px; }
.browser .site-head .logo { font-weight: 900; font-size: 18px; }
.browser .site-body { padding: 16px 14px; }
.browser .promo { font-size: 20px; font-weight: 900; color: #0e3a75; line-height: 1.25; }
.browser .timer { display: inline-block; margin: 10px 0; padding: 4px 10px; border-radius: 8px; background: #ffe1e1; color: #c41f1f; font-weight: 800; font-size: 14px; }
.browser .fake-field { display: block; border: 1px solid #cdd3df; border-radius: 8px; padding: 9px 10px; margin-top: 8px; color: #9aa2b5; font-size: 14px; }
.browser .fake-btn { display: block; margin-top: 12px; padding: 12px; border-radius: 10px; background: #1fa64a; color: #fff; text-align: center; font-weight: 900; }
.browser .site-foot { padding: 10px 14px; font-size: 12px; color: #9aa2b5; border-top: 1px solid #eef1f6; }

/* ─── Мессенджер / звонок ────────────────────────────────────────────── */

.chat {
  display: flex;
  flex-direction: column;
  border-radius: 22px;
  overflow: hidden;
  background: #e7edf3;
  box-shadow: var(--shadow-lg);
  min-height: 62vh;
}
.chat-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: #fff; border-bottom: 1px solid #e3e7ee; }
.chat-head .av { width: 42px; height: 42px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: 22px; background: var(--sky-50); }
.chat-head b { display: block; font-size: 16px; color: var(--navy); }
.chat-head small { color: var(--ok); font-weight: 600; }
.chat-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 10px;
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.5) 0 2px, transparent 3px) 0 0 / 28px 28px,
    #dfe7ef;
  overflow-y: auto;
}
.msg { max-width: 84%; padding: 9px 12px; border-radius: 18px; font-size: 15px; line-height: 1.4; box-shadow: 0 1px 1px rgba(0, 0, 0, 0.06); animation: pop 0.25s ease; word-wrap: break-word; }
.msg.them { align-self: flex-start; background: #fff; border-bottom-left-radius: 6px; }
.msg.me { align-self: flex-end; background: #d6f5c8; border-bottom-right-radius: 6px; }
.msg.sys { align-self: center; max-width: 92%; background: rgba(13, 27, 61, 0.72); color: #fff; font-size: 13px; border-radius: 12px; text-align: center; }
.msg.link { color: #1a64d6; text-decoration: underline; word-break: break-all; }
.typing { align-self: flex-start; display: inline-flex; gap: 4px; padding: 12px 14px; border-radius: 18px; background: #fff; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: #9aa5bb; animation: blink 1s infinite; }
.typing i:nth-child(2) { animation-delay: 0.15s; }
.typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes blink { 50% { opacity: 0.25; transform: translateY(-2px); } }
.chat-choices { display: flex; flex-direction: column; gap: 8px; padding: 10px; background: #fff; border-top: 1px solid #e3e7ee; }
.chat-choices .lead { font-size: 12px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; padding: 0 4px; }
.reply {
  width: 100%;
  min-height: 52px;
  padding: 10px 14px;
  border-radius: 14px;
  border: 2px solid var(--sky);
  background: var(--sky-50);
  color: var(--navy);
  font-weight: 700;
  font-size: 15px;
  text-align: left;
  touch-action: manipulation;
}
.reply:active { background: #c9eef6; }

.chat.chat-call { background: linear-gradient(180deg, #13284f, #0b1530); }
.chat.chat-call .chat-head { flex-direction: column; text-align: center; background: transparent; border: 0; padding: 22px 14px 10px; color: #fff; }
.chat.chat-call .chat-head .av { width: 72px; height: 72px; font-size: 36px; background: rgba(255, 255, 255, 0.12); }
.chat.chat-call .chat-head b { color: #fff; font-size: 18px; }
.chat.chat-call .chat-head small { color: #9fd9ea; }
.chat.chat-call .chat-body { background: transparent; }
.chat.chat-call .msg.them { background: rgba(255, 255, 255, 0.12); color: #fff; box-shadow: none; }
.chat.chat-call .msg.me { background: var(--sky); color: #fff; }
.chat.chat-call .msg.sys { background: #fff; color: var(--navy); }
.chat.chat-call .typing { background: rgba(255, 255, 255, 0.12); }
.chat.chat-call .chat-choices { background: rgba(255, 255, 255, 0.06); border-top-color: rgba(255, 255, 255, 0.1); }
.chat.chat-call .chat-choices .lead { color: #9fb2d6; }
.chat.chat-call .reply { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.35); color: #fff; }
.call-timer { font-variant-numeric: tabular-nums; }

.chat.chat-tg .chat-head .av { background: #e3f1fb; }
.chat.chat-tg .chat-body { background: #cfe0c3; background-image: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.35) 0 2px, transparent 3px); background-size: 26px 26px; }
.chat.chat-tg .msg.me { background: #effdde; }
.post { align-self: stretch; background: #fff; border-radius: 14px; padding: 12px; font-size: 15px; box-shadow: 0 1px 1px rgba(0, 0, 0, 0.06); }
.post .ch { font-weight: 800; color: #1a8ad6; margin-bottom: 4px; }

/* ─── Пирамида ───────────────────────────────────────────────────────── */

.pyr-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pyr-stats div { background: var(--surface); border-radius: 16px; padding: 12px; box-shadow: var(--shadow); }
.pyr-stats small { display: block; font-size: 12px; font-weight: 800; color: var(--muted); text-transform: uppercase; }
.pyr-stats b { font-size: 22px; color: var(--navy); font-variant-numeric: tabular-nums; }
.pyramid { display: flex; flex-direction: column; align-items: center; gap: 4px; min-height: 260px; padding: 10px 0; }
.pyr-row {
  height: 14px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--gold), #ffd451);
  animation: pop 0.3s ease;
  transition: transform 1.2s cubic-bezier(0.5, 0, 0.75, 0), opacity 1.2s;
}
.pyr-row.base { background: linear-gradient(90deg, #ff8a8f, var(--bad)); }
.pyramid.collapse .pyr-row { opacity: 0; }
.pyr-msg { min-height: 48px; }

/* ─── Итог миссии ────────────────────────────────────────────────────── */

.finish { text-align: center; }
.finish .big-emo { font-size: 72px; line-height: 1; animation: pop 0.5s ease; }
.finish .stars-big { font-size: 40px; letter-spacing: 6px; margin: 6px 0; }
.finish .stars-big .off { filter: grayscale(1); opacity: 0.25; }
.badge-won { display: inline-flex; align-items: center; gap: 10px; padding: 10px 16px; border-radius: 16px; background: var(--gold-50); box-shadow: 0 0 0 2px var(--gold) inset; font-weight: 800; color: var(--navy); }
.badge-won .emo { font-size: 30px; }

/* ─── Тест ───────────────────────────────────────────────────────────── */

.quiz-dots { display: flex; gap: 4px; }
.quiz-dots i { flex: 1; height: 8px; border-radius: 999px; background: var(--line); }
.quiz-dots i.done { background: var(--sky); }
.quiz-dots i.cur { background: var(--navy); }
.q-text { font-size: 20px; font-weight: 800; color: var(--navy); }

.score-ring { position: relative; width: 160px; height: 160px; margin: 0 auto; }
.score-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.score-ring .val { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.score-ring .val b { display: block; font-size: 44px; line-height: 1; color: var(--navy); }
.score-ring .val small { color: var(--muted); font-weight: 700; }

.review { display: flex; flex-direction: column; gap: 10px; }
.review-item { background: var(--surface); border-radius: 16px; padding: 14px; box-shadow: var(--shadow); border-left: 5px solid var(--ok); }
.review-item.bad { border-left-color: var(--bad); }
.review-item .q { font-weight: 800; color: var(--navy); }
.review-item .a { font-size: 14px; margin-top: 6px; }
.review-item .a.your { color: var(--bad); }
.review-item .a.right { color: var(--ok); font-weight: 700; }
.review-item .ex { font-size: 14px; color: var(--ink-2); margin-top: 6px; }

/* ─── Сертификат ─────────────────────────────────────────────────────── */

.cert-preview { border-radius: 14px; overflow: hidden; box-shadow: var(--shadow-lg); background: #fff; }
.cert-preview canvas { display: block; width: 100%; height: auto; }

.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 70; overflow: hidden; }
.confetti i { position: absolute; top: -20px; width: 10px; height: 14px; border-radius: 2px; animation: fall linear forwards; }
@keyframes fall { to { transform: translate3d(var(--dx), 110vh, 0) rotate(var(--rot)); } }

/* ─── Карта-джунгли ──────────────────────────────────────────────────── */

.route-note { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 12px; background: #e8f8ec; color: #1d7a45; font-size: 13px; font-weight: 800; }
.jmap {
  position: relative;
  border-radius: 28px;
  overflow: hidden;
  background:
    radial-gradient(circle at 12px 12px, rgba(16, 90, 45, 0.1) 0 3px, transparent 4px) 0 0 / 34px 34px,
    radial-gradient(circle at 20% 8%, rgba(255, 255, 255, 0.45), transparent 32%),
    radial-gradient(circle at 85% 55%, rgba(255, 255, 255, 0.25), transparent 35%),
    linear-gradient(180deg, #b6ecae 0%, #79cf8b 40%, #48ad72 75%, #2f8c5c 100%);
  box-shadow: var(--shadow-lg);
}
.jtrail { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.jtrail path { fill: none; vector-effect: non-scaling-stroke; stroke-linecap: round; }
.trail-base { stroke: #f1dca6; stroke-width: 24; }
.trail-base.locked { stroke: rgba(241, 220, 166, 0.45); }
.trail-dash { stroke: #fff8e1; stroke-width: 4; stroke-dasharray: 1 14; }
.trail-dash.locked { stroke: rgba(70, 60, 30, 0.25); }
.jstart { position: absolute; left: 50%; transform: translate(-50%, -50%); text-align: center; font-size: 34px; line-height: 1; z-index: 2; }
.jstart small, .jlabel b {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--navy);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.25;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}
.jstart small { display: block; margin-top: 4px; font-size: 12px; }
.jnode {
  position: absolute;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 84px;
  height: 84px;
  border: 0;
  border-radius: 50%;
  font-size: 40px;
  line-height: 1;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle at 35% 30%, #ffffff, #e6f6ff);
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.2), 0 0 0 6px rgba(255, 255, 255, 0.9);
  touch-action: manipulation;
  transition: transform 0.15s;
}
.jnode:active { transform: translate(-50%, -50%) scale(0.94); }
/* Пульс доступной миссии — кольцом-псевдоэлементом (transform + opacity): видеокарта
   анимирует его сама, без перерисовки карты в каждом кадре. Анимация box-shadow
   на дешёвых телефонах занимала до 80% времени основного потока, и карта тормозила. */
.jnode.available { background: radial-gradient(circle at 35% 30%, #fff8d6, #ffcb2f); box-shadow: 0 6px 0 #c98f00, 0 0 0 6px #fff; }
.jnode.available::after {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  box-shadow: 0 0 0 10px rgba(255, 214, 81, 0.7);
  pointer-events: none;
  animation: ringPulse 1.6s ease-out infinite;
  will-change: transform, opacity;
}
@keyframes ringPulse { 0% { transform: scale(1); opacity: 1; } 70%, 100% { transform: scale(1.28); opacity: 0; } }
.jnode.done { background: radial-gradient(circle at 35% 30%, #effff4, #7ad69c); box-shadow: 0 6px 0 #2f8f57, 0 0 0 6px #fff; }
.jnode.locked { background: radial-gradient(circle at 35% 30%, #f3f5f9, #c9d0dc); box-shadow: 0 6px 0 #8e98ab, 0 0 0 6px rgba(255, 255, 255, 0.6); font-size: 30px; }
.jnode.locked .emo { filter: grayscale(1); opacity: 0.55; }
.jnode.final { width: 108px; height: 108px; font-size: 54px; }
.jnode.final.available { background: radial-gradient(circle at 35% 30%, #fff, #8fe3ff 60%, #3bb6e8); }
.jnode .lock { position: absolute; right: -2px; bottom: -2px; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: #fff; font-size: 16px; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); }
.jnode .check { position: absolute; right: -4px; top: -4px; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: var(--ok); color: #fff; font-size: 16px; font-weight: 900; box-shadow: 0 0 0 3px #fff; }
.jnode.final.done { background: radial-gradient(circle at 35% 30%, #fff8d6, #ffcb2f); box-shadow: 0 6px 0 #c98f00, 0 0 0 6px #fff; }
.jnode.waiting { animation: none; filter: grayscale(0.85); opacity: 0.85; }
.jnode.waiting::after { content: none; }
.jnode.unlock { animation: unlockPop 0.9s cubic-bezier(0.2, 1.6, 0.4, 1) both; }
.jnode.unlock::after { animation-delay: 0.9s; }
@keyframes unlockPop { 0% { transform: translate(-50%, -50%) scale(0.2) rotate(-25deg); } 100% { transform: translate(-50%, -50%) scale(1) rotate(0); } }
.jlabel { position: absolute; z-index: 2; width: 46%; max-width: 170px; text-align: center; transform: translate(-50%, 0); pointer-events: none; }
.jlabel .num { display: block; font-size: 11px; font-weight: 900; color: #fff; text-transform: uppercase; letter-spacing: 0.6px; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35); margin-bottom: 3px; }
.jlabel .stars { display: block; margin-top: 4px; font-size: 15px; letter-spacing: 1px; color: #ffd451; text-shadow: 0 1px 0 rgba(0, 0, 0, 0.35); }
.jdeco { position: absolute; z-index: 1; transform: translate(-50%, -50%); font-size: 34px; line-height: 1; pointer-events: none; filter: drop-shadow(0 4px 2px rgba(0, 0, 0, 0.15)); }
.jdeco.sway { animation: sway 4s ease-in-out infinite; }
.jdeco.big { font-size: 46px; }
@keyframes sway { 50% { transform: translate(-50%, -50%) rotate(7deg); } }
.jmascot { position: absolute; z-index: 3; width: 56px; height: 56px; transform: translate(-50%, -100%); transition: left 0.9s ease-in-out, top 0.9s ease-in-out; pointer-events: none; }
.jmascot .mascot { width: 56px; height: 56px; animation: hop 0.9s ease-in-out infinite; }
@keyframes hop { 50% { transform: translateY(-9px); } }
.spark { position: absolute; left: 50%; top: 50%; font-size: 18px; pointer-events: none; animation: spark 1.1s ease-out forwards; }
@keyframes spark { from { transform: translate(-50%, -50%) scale(0.4); opacity: 1; } to { transform: translate(calc(-50% + var(--sx)), calc(-50% + var(--sy))) scale(1.1); opacity: 0; } }

/* ─── Оперативная карта (7 класс и старше) ───────────────────────────── */

.jmap.ops {
  --ops-glow: #4fe0ff;
  --ops-ok: #2fd38a;
  --ops-panel: rgba(9, 21, 48, 0.9);
  background:
    linear-gradient(rgba(79, 224, 255, 0.07) 1px, transparent 1px) 0 0 / 28px 28px,
    linear-gradient(90deg, rgba(79, 224, 255, 0.07) 1px, transparent 1px) 0 0 / 28px 28px,
    radial-gradient(circle at 50% 0%, rgba(0, 163, 196, 0.32), transparent 55%),
    linear-gradient(180deg, #11244d 0%, #0b1733 55%, #070f24 100%);
  box-shadow: var(--shadow-lg), inset 0 0 0 1px rgba(79, 224, 255, 0.18);
}
.ops .trail-base { stroke: rgba(79, 224, 255, 0.16); stroke-width: 12; stroke-linejoin: round; }
.ops .trail-base.locked { stroke: rgba(148, 163, 196, 0.1); }
/* Бегущий пунктир двигает таймер в app.js (renderMap) — 5 шагов в секунду. CSS-анимация
   линии со свечением пересчитывалась и перерисовывалась в каждом кадре, и на слабых
   телефонах карта тормозила. Слой маршрута отдельный, чтобы с ним не перерисовывалась
   вся карта. */
.ops .jtrail { will-change: transform; }
.ops .trail-dash { stroke: var(--ops-glow); stroke-width: 2.5; stroke-dasharray: 10 8; stroke-dashoffset: var(--dash, 0px); stroke-linejoin: round; filter: drop-shadow(0 0 4px rgba(79, 224, 255, 0.9)); }
.ops .trail-dash.locked { stroke: rgba(160, 175, 205, 0.4); stroke-dasharray: 2 8; stroke-dashoffset: 0; filter: none; }

.ops-hud {
  position: absolute;
  top: 12px;
  left: 14px;
  right: 14px;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  font: 800 11px/1 ui-monospace, "SFMono-Regular", Consolas, monospace;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--ops-glow);
  pointer-events: none;
}
.ops-hud span:first-child { opacity: 0.85; }
.ops-hq .hq {
  display: block;
  width: 26px;
  height: 26px;
  margin: 0 auto;
  border-radius: 50%;
  background: radial-gradient(circle, var(--ops-glow) 0 4px, #0b1733 5px 8px, var(--ops-glow) 9px 10px, transparent 11px);
  box-shadow: 0 0 14px rgba(79, 224, 255, 0.7);
}
.ops .jstart small, .ops .jlabel b { background: var(--ops-panel); color: #e6f7ff; box-shadow: 0 0 0 1px rgba(79, 224, 255, 0.3); }
.ops .jstart small { margin-top: 6px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.6px; }
.ops .jlabel .num { color: var(--ops-glow); text-shadow: none; font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; }

.ops .jnode {
  background: radial-gradient(circle at 35% 30%, #1d3a6b, #0f2147);
  box-shadow: 0 0 0 2px rgba(79, 224, 255, 0.55), 0 0 0 7px rgba(79, 224, 255, 0.08), 0 8px 18px rgba(0, 0, 0, 0.45);
}
.ops .jnode.available { background: radial-gradient(circle at 35% 30%, #22568f, #12305e); box-shadow: 0 0 0 2px var(--ops-glow), 0 8px 18px rgba(0, 0, 0, 0.45); }
.ops .jnode.available::after { inset: -2px; box-shadow: 0 0 0 8px rgba(79, 224, 255, 0.55); animation-duration: 1.8s; }
.ops .jnode.done { background: radial-gradient(circle at 35% 30%, #1b4d5a, #0f2f3d); box-shadow: 0 0 0 2px var(--ops-ok), 0 0 0 7px rgba(47, 211, 138, 0.12), 0 8px 18px rgba(0, 0, 0, 0.45); }
.ops .jnode.locked { background: #13203f; box-shadow: 0 0 0 2px rgba(148, 163, 196, 0.35), 0 8px 18px rgba(0, 0, 0, 0.4); }
.ops .jnode.locked .emo { opacity: 0.35; }
.ops .jnode.final.available { background: radial-gradient(circle at 35% 30%, #2a6fb0, #12305e); }
.ops .jnode.final.done { background: radial-gradient(circle at 35% 30%, #5c4710, #241c06); box-shadow: 0 0 0 2px #ffcb2f, 0 0 26px rgba(255, 203, 47, 0.45), 0 8px 18px rgba(0, 0, 0, 0.45); }
.ops .jnode .lock { background: #0f2147; box-shadow: 0 0 0 2px rgba(148, 163, 196, 0.5); }
.ops .jnode .check { background: var(--ops-ok); box-shadow: 0 0 0 3px #0b1733; }
.ops .jnode.unlock { animation: unlockPop 0.9s cubic-bezier(0.2, 1.6, 0.4, 1) both; }

.jmascot.ops-pin { width: auto; height: auto; padding-bottom: 8px; }
.ops-pin .pin-label {
  position: relative;
  display: block;
  padding: 5px 9px;
  border-radius: 6px;
  background: var(--ops-glow);
  color: #06263a;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  white-space: nowrap;
  box-shadow: 0 0 14px rgba(79, 224, 255, 0.6);
  animation: bob 1.6s ease-in-out infinite;
}
.ops-pin .pin-label::after { content: ""; position: absolute; left: 50%; bottom: -5px; margin-left: -5px; border: 5px solid transparent; border-bottom: 0; border-top-color: var(--ops-glow); }
@keyframes bob { 50% { transform: translateY(-4px); } }

/* ─── Праздничный экран ──────────────────────────────────────────────── */

body.no-scroll { overflow: hidden; }
.celebrate {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px 20px calc(20px + var(--safe-b));
  overflow: hidden;
  background: radial-gradient(circle at 50% 38%, #1f6aa8 0%, #12346b 45%, #0b1630 100%);
  animation: fade 0.25s ease;
}
.celebrate.leaving { opacity: 0; transition: opacity 0.25s; }
.celebrate canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.celebrate .rays {
  position: absolute;
  left: 50%;
  top: 38%;
  width: 190vmax;
  height: 190vmax;
  transform: translate(-50%, -50%);
  background: repeating-conic-gradient(from 0deg, rgba(255, 214, 81, 0.16) 0deg 9deg, transparent 9deg 18deg);
  -webkit-mask-image: radial-gradient(circle, #000 0 22%, transparent 55%);
  mask-image: radial-gradient(circle, #000 0 22%, transparent 55%);
  animation: raysSpin 22s linear infinite;
}
@keyframes raysSpin { to { transform: translate(-50%, -50%) rotate(360deg); } }
.cele-card { position: relative; z-index: 1; width: 100%; max-width: 420px; text-align: center; color: #fff; }
.cele-badge {
  display: inline-block;
  font-size: 112px;
  line-height: 1;
  filter: drop-shadow(0 0 28px rgba(255, 214, 81, 0.85));
  animation: badgeIn 0.9s cubic-bezier(0.2, 1.6, 0.4, 1) both, badgeWobble 2.6s ease-in-out 1.1s infinite;
}
@keyframes badgeIn { from { transform: scale(0) rotate(-35deg); opacity: 0; } to { transform: scale(1) rotate(0); opacity: 1; } }
@keyframes badgeWobble { 50% { transform: scale(1.07) rotate(5deg); } }
.cele-title { margin-top: 14px; color: #fff; font-size: clamp(28px, 8vw, 38px); font-weight: 900; line-height: 1.15; text-shadow: 0 4px 0 rgba(0, 0, 0, 0.25); }
.cele-title span { display: inline-block; animation: letterUp 0.55s cubic-bezier(0.2, 1.7, 0.4, 1) both; }
@keyframes letterUp { from { transform: translateY(30px) scale(0.4); opacity: 0; } to { transform: none; opacity: 1; } }
.cele-sub { margin-top: 6px; font-size: 16px; font-weight: 700; opacity: 0.9; animation: fadeUp 0.5s 0.6s both; }
.cele-stars { margin: 16px 0 8px; font-size: 54px; letter-spacing: 8px; line-height: 1; }
.cele-stars span { display: inline-block; opacity: 0.22; filter: grayscale(1); transform: scale(0.6); transition: transform 0.4s cubic-bezier(0.2, 1.8, 0.4, 1), opacity 0.2s, filter 0.2s; }
.cele-stars span.on { opacity: 1; filter: drop-shadow(0 0 12px rgba(255, 214, 81, 0.9)); transform: scale(1.18); }
.cele-xp { display: inline-block; margin-top: 6px; padding: 8px 20px; border-radius: 999px; background: linear-gradient(90deg, #f5b800, #ffd451); color: #0d1b3d; font-size: 24px; font-weight: 900; box-shadow: 0 8px 24px rgba(245, 184, 0, 0.45); animation: celePop 0.45s cubic-bezier(0.2, 1.6, 0.4, 1) 0.55s both; }
@keyframes celePop { from { transform: scale(0); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.cele-badge-name { margin-top: 16px; padding: 10px 14px; border-radius: 14px; background: rgba(255, 255, 255, 0.13); font-weight: 800; animation: fadeUp 0.4s 0.7s both; }
.cele-btn { margin-top: 24px; animation: fadeUp 0.35s 0.8s both; }
.cele-sound { position: absolute; top: calc(14px + env(safe-area-inset-top, 0px)); right: 14px; z-index: 2; width: 46px; height: 46px; border: 0; border-radius: 14px; background: rgba(255, 255, 255, 0.16); color: #fff; font-size: 22px; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

.cele-bonus { display: inline-block; margin-top: 12px; padding: 8px 14px; border-radius: 14px; background: rgba(124, 255, 155, 0.16); border: 1px solid rgba(124, 255, 155, 0.4); color: #c9ffd6; font-weight: 800; animation: fadeUp 0.4s 0.75s both; }

/* ─── Облегчённая версия для 1–6 классов: крупнее, больше картинок ───── */

.pics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pics.n1 { grid-template-columns: 1fr; }
.pics.n2, .pics.n4 { grid-template-columns: repeat(2, 1fr); }
.pic {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 6px 14px;
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow);
  text-align: center;
  animation: pop 0.4s ease both;
}
.pic .emo { font-size: 54px; line-height: 1; }
.pic b { font-size: 16px; line-height: 1.2; color: var(--navy); overflow-wrap: anywhere; }
.rule.big { font-size: 19px; text-align: center; }
.listen {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 46px;
  min-height: 46px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 2px solid #b5e7f2;
  background: var(--sky-50);
  color: var(--sky-600);
  font-weight: 800;
  font-size: 15px;
  touch-action: manipulation;
}
.listen:active { transform: scale(0.97); }
.listen { font-size: 20px; }
/* Согласие: короткая строка + «подробнее» с полным текстом */
.consent .consent-more { margin: 6px 0 0 36px; font-size: 13px; color: var(--ink-2); }
.consent-more summary { cursor: pointer; color: var(--sky-600); font-weight: 700; }
.consent-more p { margin-top: 6px; line-height: 1.45; }
/* Тест: правила значками, подробно — по «?» */
.q-btn { flex: none; width: 40px; height: 40px; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--sky-50); color: var(--sky-600); font-size: 20px; font-weight: 900; touch-action: manipulation; }
.quiz-chips { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.quiz-chips span { display: grid; place-items: center; min-height: 58px; padding: 6px; border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); font-size: 20px; font-weight: 900; color: var(--navy); font-variant-numeric: tabular-nums; }
.spin-hint { align-items: center; }

body.junior { font-size: 18px; }
body.junior .step-title { font-size: 26px; }
body.junior .step-kicker { font-size: 14px; }
body.junior .bubble { font-size: 19px; }
body.junior .mascot-say .mascot { width: 76px; height: 76px; }
body.junior .lesson { font-size: 19px; }
body.junior .q-text { font-size: 22px; }
body.junior .option { min-height: 70px; font-size: 19px; font-weight: 750; }
body.junior .option .key { width: 36px; height: 36px; font-size: 16px; }
body.junior .sort-counter { font-size: 15px; }
body.junior .sort-item { min-height: 220px; font-size: 24px; }
body.junior .sort-item .emo { font-size: 80px; }
body.junior .bin { min-height: 110px; font-size: 20px; }
body.junior .bin .emo { font-size: 42px; }
body.junior .btn { min-height: 58px; font-size: 19px; }
body.junior .btn.small { min-height: 46px; font-size: 16px; }
body.junior .rule { font-size: 18px; }
body.junior .sheet .head .emo { font-size: 46px; }
body.junior .sheet .head h3 { font-size: 24px; }
body.junior .sheet .body { font-size: 19px; }
body.junior .msg { font-size: 18px; }
body.junior .reply { min-height: 56px; font-size: 18px; }
body.junior .chat-choices .lead { font-size: 16px; }
body.junior .memo-list .card { font-size: 19px; }
body.junior .finish .lesson { font-size: 19px; }

/* Макет «сообщение в игровом чате» (миссия 2 младшей версии) */
.kid-ad { border-radius: 24px; overflow: hidden; background: linear-gradient(160deg, #47238f, #1b0f3d); color: #fff; box-shadow: var(--shadow-lg); }
.kid-ad-head { padding: 12px 16px; background: rgba(255, 255, 255, 0.1); font-weight: 800; font-size: 16px; }
.kid-ad-body { display: flex; flex-direction: column; gap: 16px; padding: 18px 16px 20px; font-size: 19px; font-weight: 800; line-height: 1.3; }
.kid-ad-body .big { font-size: 23px; font-weight: 900; color: #ffd451; }
.kid-ad-body .hot { color: #ffb1b7; }
.kid-ad .spot {
  display: inline-block;
  padding: 6px 8px;
  margin: -6px -8px;
  border-radius: 12px;
  background-image: linear-gradient(90deg, rgba(255, 255, 255, 0.5) 50%, transparent 50%);
}
.kid-ad .spot.hit { background: rgba(239, 85, 96, 0.32); box-shadow: 0 0 0 2px #ff8a93; }
.kid-ad .spot.revealed { background: rgba(245, 184, 0, 0.3); box-shadow: 0 0 0 2px var(--gold); }

/* ─── Мини-игра «Сейф-пазл» ──────────────────────────────────────────── */

.game-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border: 0;
  border-radius: 20px;
  text-align: left;
  color: #fff;
  background:
    radial-gradient(circle at 90% 0%, rgba(245, 184, 0, 0.35), transparent 45%),
    linear-gradient(135deg, #13284f, #0a6f9c);
  box-shadow: var(--shadow-lg);
  touch-action: manipulation;
  transition: transform 0.1s;
}
.game-card:active { transform: scale(0.98); }
.game-card .gc-logo { width: 54px; height: 54px; flex: none; }
.game-card .gc-logo svg { width: 100%; height: 100%; }
.game-card .gc-meta { flex: 1; min-width: 0; }
.game-card .gc-meta b { display: block; font-size: 17px; font-weight: 900; color: #fff; }
.game-card .gc-meta small { display: block; margin-top: 2px; font-size: 13px; font-weight: 700; opacity: 0.88; }
.game-card .gc-side { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.game-card .gc-play { padding: 6px 12px; border-radius: 999px; background: var(--gold); color: var(--navy); font-size: 14px; font-weight: 900; white-space: nowrap; }
.game-card .gc-rounds { font-size: 13px; font-weight: 800; opacity: 0.9; white-space: nowrap; }
.game-card.locked { background: linear-gradient(135deg, #626e88, #3c4762); }
.game-card.locked .gc-logo { filter: grayscale(1); opacity: 0.6; }
body.junior .game-card .gc-meta b { font-size: 19px; }

/* Вход в игру: рейтинг первым, «Играть» — внизу экрана */
.g-head { gap: 8px; }
.g-head .g-logo-sm { width: 44px; height: 44px; flex: none; }
.g-head .g-logo-sm svg { width: 100%; height: 100%; }
.g-head .g-mode { display: block; margin-top: 3px; }
.g-head-title { flex: 1; min-width: 0; }
.g-q, .g-info { flex: none; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--sky-50); color: var(--sky-600); font-weight: 900; touch-action: manipulation; }
.g-q { width: 40px; height: 40px; font-size: 20px; }
.g-info { width: 26px; height: 26px; font-size: 14px; font-style: italic; font-family: Georgia, serif; }
.g-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.g-stats div { min-width: 0; display: flex; align-items: center; justify-content: center; gap: 6px; background: var(--surface); border-radius: 16px; box-shadow: var(--shadow); padding: 10px 6px; }
.g-stats .ico { font-size: 20px; line-height: 1; }
.g-stats b { font-size: 22px; font-weight: 900; color: var(--navy); font-variant-numeric: tabular-nums; }
.g-rating-meta { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.g-chip { padding: 3px 10px; border-radius: 999px; background: var(--bg); color: var(--ink-2); font-size: 12px; font-weight: 800; }
.g-up { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: var(--ok-50); color: var(--ok); font-size: 12px; font-weight: 900; vertical-align: 1px; }
.g-up.new { background: var(--sky-50); color: var(--sky-600); }
/* Экран после проигрыша */
.g-res { text-align: center; padding: 16px 12px; border-radius: 22px; background: var(--surface); box-shadow: var(--shadow-lg); }
.g-res.best { background: linear-gradient(180deg, var(--gold-50), var(--surface)); }
.g-res-badge { display: inline-block; margin-bottom: 4px; padding: 4px 12px; border-radius: 999px; background: var(--gold); color: var(--navy); font-weight: 900; font-size: 14px; animation: celePop 0.45s cubic-bezier(0.2, 1.6, 0.4, 1) both; }
.g-res-score { display: block; font-size: 56px; line-height: 1.05; font-weight: 900; color: var(--navy); font-variant-numeric: tabular-nums; }
.g-res-sub { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 6px 14px; margin-top: 6px; font-size: 18px; font-weight: 900; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.g-tipline { font-size: 14px; color: var(--ink-2); }
.g-rules-list { display: flex; flex-direction: column; gap: 10px; }
.g-rule { display: flex; align-items: center; gap: 12px; font-size: 17px; font-weight: 700; color: var(--navy); }
.g-rule .ico { flex: none; min-width: 52px; text-align: center; font-size: 22px; }
.g-seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 14px; background: var(--line); }
.g-seg-btn { min-height: 42px; padding: 6px 8px; border: 0; border-radius: 11px; background: none; font-size: 14px; font-weight: 800; color: var(--ink-2); line-height: 1.15; touch-action: manipulation; }
.g-seg-btn[aria-selected="true"] { background: var(--surface); color: var(--navy); box-shadow: 0 2px 6px rgba(13, 27, 61, 0.12); }
.g-list-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 2px 10px; padding-bottom: 6px; font-size: 14px; }
.g-list-head b { min-width: 0; color: var(--navy); }
.g-list-head span { font-weight: 800; color: var(--sky-600); }
.g-list-head + .g-row { border-top: 0; }
.g-gap { text-align: center; color: var(--muted); font-weight: 900; letter-spacing: 2px; line-height: 1; padding: 2px 0; }
.g-row.mate .n { background: var(--gold-50); color: var(--gold-600); }
.g-refresh.none { opacity: 0.6; }
.g-refresh.none .g-count { background: var(--muted); }

.g-screen {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
.g-hud { width: 100%; display: flex; align-items: center; gap: 6px; min-height: 48px; }
.g-score b, .g-best b { display: block; font-weight: 900; font-variant-numeric: tabular-nums; line-height: 1.1; }
.g-score b { font-size: 30px; color: var(--navy); }
.g-score b.bump { animation: gBump 0.25s ease; }
@keyframes gBump { 50% { transform: scale(1.15); } }
.g-best { margin-left: auto; display: flex; align-items: center; gap: 4px; font-size: 16px; }
.g-best b { font-size: 18px; color: var(--gold-600); }
.g-combo { flex: 1; min-width: 0; text-align: center; font-weight: 900; font-size: 15px; color: #e8650a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-sound { font-size: 20px; }
.g-board-wrap { position: relative; flex: none; }
.g-board { display: block; border-radius: 20px; box-shadow: var(--shadow-lg); touch-action: none; }
.g-fx { position: absolute; inset: 0; pointer-events: none; }
.g-pop {
  position: absolute;
  font-size: 24px;
  font-weight: 900;
  color: #fff;
  white-space: nowrap;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.4), 0 0 12px rgba(255, 214, 81, 0.9);
  animation: gPop 0.9s ease-out forwards;
}
@keyframes gPop {
  0% { transform: translate(-50%, -30%) scale(0.6); opacity: 0; }
  20% { transform: translate(-50%, -50%) scale(1.15); opacity: 1; }
  100% { transform: translate(-50%, -170%) scale(1); opacity: 0; }
}
.g-banner {
  position: absolute;
  left: 50%;
  top: 40%;
  max-width: 92%;
  padding: 8px 16px;
  border-radius: 14px;
  background: linear-gradient(90deg, #f5b800, #ffd451);
  color: var(--navy);
  font-size: 20px;
  font-weight: 900;
  text-align: center;
  box-shadow: 0 8px 24px rgba(245, 184, 0, 0.45);
  animation: gBanner 1.15s cubic-bezier(0.2, 1.5, 0.4, 1) forwards;
}
@keyframes gBanner {
  0% { transform: translate(-50%, -50%) scale(0.3); opacity: 0; }
  18% { transform: translate(-50%, -50%) scale(1.08); opacity: 1; }
  75% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  100% { transform: translate(-50%, -80%) scale(0.95); opacity: 0; }
}
.g-tray-wrap { position: relative; }
.g-tray { display: flex; gap: 8px; }
.g-slot {
  flex: 1;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
  touch-action: none;
  cursor: grab;
}
.g-slot canvas { display: block; }
.g-slot.lifted canvas, .g-slot.empty canvas { opacity: 0; }
.g-slot.dim canvas { opacity: 0.35; filter: grayscale(0.7); }
.g-float { position: fixed; left: 0; top: 0; z-index: 90; pointer-events: none; will-change: transform; }
.g-float-in { transform-origin: 50% 50%; }
.g-float canvas { display: block; }
/* Подсказка при первом запуске: палец тянет фигуру из лотка на поле (без слов) */
.g-hint { position: absolute; left: 0; top: 0; z-index: 3; pointer-events: none; animation: gHint 2.2s ease-in-out infinite; }
.g-hint.off { display: none; }
.g-hint-piece { position: absolute; left: calc(var(--cell, 36px) * -1); top: calc(var(--cell, 36px) * -1.6); width: calc(var(--cell, 36px) * 2); height: var(--cell, 36px); border-radius: 8px; background: linear-gradient(90deg, rgba(245, 184, 0, 0.85) 0 48%, transparent 48% 52%, rgba(245, 184, 0, 0.85) 52%); box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25); }
.g-hint-hand { position: absolute; left: -10px; top: -6px; font-size: 38px; line-height: 1; filter: drop-shadow(0 3px 3px rgba(0, 0, 0, 0.3)); }
@keyframes gHint {
  0% { transform: translate(var(--x0), var(--y0)); opacity: 0; }
  12% { transform: translate(var(--x0), var(--y0)); opacity: 1; }
  70% { transform: translate(var(--x1), var(--y1)); opacity: 1; }
  90%, 100% { transform: translate(var(--x1), var(--y1)); opacity: 0; }
}
.g-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; max-width: 440px; }
.g-refresh { flex: none; width: auto; min-width: 84px; gap: 8px; font-size: 20px; }
.g-refresh .g-count { display: inline-grid; place-items: center; min-width: 26px; height: 26px; padding: 0 6px; border-radius: 999px; background: var(--sky); color: #fff; font-size: 14px; }
.g-refresh.pulse { animation: gPulse 1s ease-in-out infinite; }
@keyframes gPulse { 50% { transform: scale(1.05); } }
.g-rounds { flex: none; font-weight: 900; color: var(--ink-2); }
/* Рейтинг: «догони соперника», общий рекорд, обгон */
.g-race { display: flex; align-items: center; gap: 8px; min-height: 26px; font-size: 13px; font-weight: 800; color: var(--ink-2); }
.g-chase { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-world { flex: none; padding: 3px 9px; border-radius: 999px; background: var(--sky-50); color: var(--sky-600); font-variant-numeric: tabular-nums; }
.g-overtake {
  position: absolute;
  left: 50%;
  top: 10px;
  z-index: 2;
  width: max-content;
  max-width: 94%;
  padding: 8px 14px;
  border-radius: 14px;
  background: rgba(13, 27, 61, 0.92);
  color: #fff;
  font-size: 15px;
  font-weight: 900;
  text-align: center;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.3);
  animation: gOvertake 2.5s ease forwards;
}
.g-overtake.world { background: linear-gradient(90deg, #f5b800, #ffd451); color: var(--navy); }
@keyframes gOvertake {
  0% { transform: translate(-50%, -24px); opacity: 0; }
  12% { transform: translate(-50%, 0); opacity: 1; }
  82% { transform: translate(-50%, 0); opacity: 1; }
  100% { transform: translate(-50%, -12px); opacity: 0; }
}
.g-list { background: var(--surface); border-radius: 18px; box-shadow: var(--shadow); padding: 12px 14px; }
.g-list > p { margin-top: 6px; }
.g-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-top: 1px solid var(--line); font-size: 15px; }
.g-row .n { flex: none; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; background: var(--bg); font-size: 12px; font-weight: 900; color: var(--ink-2); }
.g-row .who { flex: 1; min-width: 0; font-weight: 700; color: var(--navy); }
.g-row .who small { display: block; font-size: 12px; font-weight: 600; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-row b { flex: none; font-variant-numeric: tabular-nums; color: var(--navy); }
.g-row.you .who, .g-row.you b { color: var(--sky-600); }
.g-row.you .n { background: var(--sky); color: #fff; }

/* Оперативный режим (7+ классы): строгий вид, как у оперативной карты */
.g-mode { align-self: center; font: 800 11px/1 ui-monospace, "SFMono-Regular", Consolas, monospace; letter-spacing: 0.8px; text-transform: uppercase; color: #4fe0ff; }
.g-intro.ops .g-head .g-mode { color: #0a8fb0; }
.g-intro.ops .g-stats div, .g-intro.ops .g-list { border-radius: 12px; box-shadow: var(--shadow), inset 0 0 0 1px rgba(10, 143, 176, 0.18); }
.g-intro.ops .g-seg { border-radius: 10px; background: #11244d; }
.g-intro.ops .g-seg-btn { border-radius: 7px; color: #9fdcf2; font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; text-transform: uppercase; font-size: 12px; letter-spacing: 0.4px; }
.g-intro.ops .g-seg-btn[aria-selected="true"] { background: #4fe0ff; color: #07122a; box-shadow: none; }
.g-intro.ops .g-row .n { border-radius: 6px; }
.g-intro.ops .g-q, .g-intro.ops .g-info { border-radius: 10px; background: #11244d; color: #4fe0ff; }
.g-intro.ops .g-chip { border-radius: 6px; font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; }
.g-intro.ops .g-res { border-radius: 14px; box-shadow: var(--shadow), inset 0 0 0 1px rgba(10, 143, 176, 0.18); }
.g-intro.ops .g-res.best { background: linear-gradient(180deg, #e3f9ff, var(--surface)); }
.g-intro.ops .g-res-badge { border-radius: 8px; background: #4fe0ff; color: #07122a; }
.g-screen.ops {
  padding: 10px;
  border-radius: 20px;
  color: #cfe8ff;
  background:
    linear-gradient(rgba(79, 224, 255, 0.05) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(90deg, rgba(79, 224, 255, 0.05) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(180deg, #11244d 0%, #070f24 100%);
  box-shadow: var(--shadow-lg), inset 0 0 0 1px rgba(79, 224, 255, 0.18);
}
.g-screen.ops .icon-btn { color: #9fdcf2; }
.g-screen.ops .g-score b { color: #fff; }
.g-screen.ops .g-best b { color: #ffd451; }
.g-screen.ops .g-combo { color: #4fe0ff; }
.g-screen.ops .g-race { color: #9fdcf2; }
.g-screen.ops .g-world { background: rgba(79, 224, 255, 0.12); color: #4fe0ff; }
.g-screen.ops .g-board { border-radius: 12px; box-shadow: 0 0 0 1px rgba(79, 224, 255, 0.25); }
.g-screen.ops .g-slot { background: rgba(9, 21, 48, 0.9); box-shadow: inset 0 0 0 1px rgba(79, 224, 255, 0.22); border-radius: 12px; }
.g-screen.ops .g-refresh { background: rgba(9, 21, 48, 0.9); color: #cfe8ff; box-shadow: 0 0 0 1.5px rgba(79, 224, 255, 0.45) inset; }
.g-screen.ops .g-refresh .g-count { background: #14b4d6; }
.g-screen.ops .g-rounds { color: #9fdcf2; }
.g-screen.ops .g-hint-piece { border-radius: 4px; background: linear-gradient(90deg, rgba(79, 224, 255, 0.85) 0 48%, transparent 48% 52%, rgba(79, 224, 255, 0.85) 52%); }
.g-screen.ops .g-banner { background: rgba(9, 21, 48, 0.95); color: #4fe0ff; border-radius: 8px; box-shadow: 0 0 0 1px #4fe0ff, 0 8px 24px rgba(0, 0, 0, 0.4); font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; letter-spacing: 0.5px; text-transform: uppercase; font-size: 17px; }
.g-screen.ops .g-pop { text-shadow: 0 2px 0 rgba(0, 0, 0, 0.5), 0 0 10px rgba(79, 224, 255, 0.9); }
.g-screen.ops .g-overtake { background: rgba(9, 21, 48, 0.95); box-shadow: 0 0 0 1px rgba(79, 224, 255, 0.6), 0 8px 22px rgba(0, 0, 0, 0.4); }
.g-screen.ops .g-overtake.world { background: #ffd451; color: #0b1733; }
.game-card.ops {
  border-radius: 16px;
  background:
    linear-gradient(rgba(79, 224, 255, 0.07) 1px, transparent 1px) 0 0 / 20px 20px,
    linear-gradient(90deg, rgba(79, 224, 255, 0.07) 1px, transparent 1px) 0 0 / 20px 20px,
    linear-gradient(135deg, #11244d, #070f24);
  box-shadow: var(--shadow-lg), inset 0 0 0 1px rgba(79, 224, 255, 0.3);
}
.game-card.ops .gc-play { background: #4fe0ff; color: #07122a; border-radius: 8px; }
.game-card.ops .gc-mode { display: block; margin-top: 2px; font: 800 10px/1.2 ui-monospace, "SFMono-Regular", Consolas, monospace; letter-spacing: 0.8px; text-transform: uppercase; color: #4fe0ff; }
.game-card.ops.locked { background: linear-gradient(135deg, #2a3550, #161e33); }



/* ─── Доступность и большие экраны ───────────────────────────────────── */

:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

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

@media (min-width: 600px) {
  body {
    background:
      radial-gradient(circle at 10% 0%, rgba(0, 163, 196, 0.16), transparent 40%),
      radial-gradient(circle at 90% 100%, rgba(245, 184, 0, 0.16), transparent 40%),
      #e9eef7;
  }
  .shell { box-shadow: 0 0 60px rgba(13, 27, 61, 0.1); }
  main#app { padding: 22px 24px 32px; }
  .hero { padding: 34px 28px 26px; }
  .hero h1 { font-size: 48px; }
  .sticky-cta, .tabs { margin: 0 -24px; padding-left: 24px; padding-right: 24px; }
}
