/* atlas.css — «Атлас страхов», marabond.
   Дизайн: макеты из atlas-strahov/img/ + интерактивный прототип
   atlas_screen_prototype.html (токены: индиго #090d24, панель rgba(22,23,66,.9),
   лайм #d9ff76, золото #f1eba6, границы rgba(183,143,255,.55), радиус 28).
   Иллюстрации — WebP из atlas/bg/ (сборка build/make-assets.py). */

:root {
  --bg: #090d24;
  --bg-deep: #05040f;
  --panel-hi: rgba(62, 40, 138, 0.62);
  --panel-lo: rgba(20, 13, 50, 0.88);
  --panel: linear-gradient(180deg, var(--panel-hi), var(--panel-lo));
  --panel-border: rgba(168, 138, 255, 0.42);
  --panel-border-hi: rgba(196, 170, 255, 0.65);
  --ink: #f6f2ff;
  --muted: #b9b3dd;
  --dim: #8f88b5;
  --title: #f1eba6;
  --lime: #d9ff76;
  --lime-hi: #e8ffa8;
  --lime-ink: #1a1638;
  --gold: #e9bc74;
  --magenta: #ef69bc;
  --danger: #ff9d9d;
  --focus: #ffffff;

  --serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --sans: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  --r-panel: 28px;
  --r-panel-sm: 22px;
  --r-btn: 999px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --wrap: 1360px;
  --pad: clamp(16px, 3vw, 48px);
  --shadow: 0 30px 60px rgba(4, 2, 20, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg-deep);
  color: var(--ink);
  font: 16px/1.55 var(--sans);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
b, strong { font-weight: 700; }
a { color: var(--lime); }
button { font: inherit; color: inherit; }

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: 8px;
}

.a-sr {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: absolute;
  left: 16px; top: -60px;
  z-index: 60;
  padding: 12px 18px;
  border-radius: 12px;
  background: var(--lime);
  color: var(--lime-ink);
  font-weight: 700;
  text-decoration: none;
  transition: top 0.18s var(--ease);
}
.skip:focus { top: 16px; }

/* --------------------------------------------------------------- сцена */

.a-screen {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  /* Высоту задаёт содержимое: под экраном сразу идёт подвал сайта, а не
     полоса пустоты на весь экран. Фон всё равно во весь вьюпорт (.a-bg). */
  min-height: 100dvh;
  isolation: isolate;
}

/* Экран занимает ровно один вьюпорт: иллюстрация — во всю высоту, подвал
   сайта виден уже ниже, при прокрутке. */
.atlas .a-screen { min-height: 100dvh; }

.a-bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image: var(--art, none);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transform: scale(1.03);
  filter: saturate(1.06);
}

.a-bg--flat {
  background-image:
    radial-gradient(60% 45% at 76% 12%, rgba(122, 84, 214, 0.45), transparent 70%),
    radial-gradient(50% 40% at 14% 84%, rgba(38, 59, 139, 0.5), transparent 70%),
    linear-gradient(160deg, #0a0b26 0%, #14103c 55%, #07061b 100%);
}

.a-veil {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  /* По умолчанию не затемняем: картинки показываем яркими. Силу задаёт
     настройка «Затемнение фона» через --veil (0 = выключено). */
  opacity: var(--veil, 0);
  transition: opacity 0.35s var(--ease);
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(20, 10, 60, 0.15), rgba(5, 4, 15, 0.72) 70%),
    linear-gradient(180deg, rgba(6, 5, 22, 0.5) 0%, rgba(6, 5, 22, 0.22) 38%, rgba(6, 5, 22, 0.86) 100%);
}

/* --------------------------------------------------------------- шапка */

.a-bar {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 52px;
  align-items: center;
  gap: 12px;
  padding: 16px var(--pad) 6px;
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
}

.a-bar__mid {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-width: 0;
}

/* Словесный знак в шапке не нужен: название уже в заголовке экрана. */
.a-bar__title {
  font-family: var(--serif);
  font-size: clamp(17px, 1.7vw, 24px);
  color: rgba(246, 242, 255, 0.9);
  text-shadow: 0 2px 12px rgba(6, 4, 22, 0.9), 0 0 26px rgba(6, 4, 22, 0.7);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.a-bar__right { display: flex; justify-content: flex-end; }

.a-rnd {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(180, 150, 255, 0.5);
  background: radial-gradient(circle at 50% 30%, rgba(112, 74, 200, 0.85), rgba(40, 24, 96, 0.9));
  color: var(--ink);
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(8, 4, 30, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  transition: transform 0.16s var(--ease), border-color 0.16s, background 0.16s;
}
.a-rnd:hover { transform: translateY(-1px); border-color: var(--panel-border-hi); }
.a-rnd:active { transform: none; }
.a-rnd svg { width: 20px; height: 20px; }
.a-rnd--sm { width: 38px; height: 38px; }
.a-rnd--sm svg { width: 14px; height: 14px; }
.a-rnd--empty { border-color: transparent; background: transparent; box-shadow: none; pointer-events: none; }

/* --------------------------------------------------------------- тело */

.a-body {
  position: relative;
  z-index: 2;
  flex: 1 0 auto;
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: clamp(8px, 1.6vh, 22px) var(--pad) clamp(16px, 2.6vh, 32px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.a-body--wide { max-width: 1440px; }
/* Карта: острова занимают всю ширину страницы — кадр от края до края. */
.a-body--flush { max-width: none; padding-left: 0; padding-right: 0; }

.a-app { flex: 1 0 auto; display: flex; flex-direction: column; }
.a-app > .a-screen { flex: 1 0 auto; }

/* Атлас: экран — во всю высоту вьюпорта, подвал сайта идёт следом. */

/* Общий подвал сайта (site_footer.php) встаёт вплотную к экрану и поверх
   фиксированного фона: иначе position:fixed у .a-bg накрывает подвал при
   прокрутке, и кажется, что подвала нет вовсе. */
body.atlas #mbf-footer { position: relative; z-index: 3; margin-top: 0; }
/* Согласие, настройки, «Атлас открывается»: панель держится по центру экрана. */
.atlas .a-center { min-height: min(52vh, 480px); align-content: center; }

.a-center { display: grid; place-items: center; }

/* --------------------------------------------------------------- тексты */

.a-eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #d9c9ff;
}

.a-h1 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(56px, 8vw, 104px);
  line-height: 0.92;
  letter-spacing: -0.02em;
  margin: 10px 0 0;
  color: #fbf7ff;
  text-shadow: 0 4px 40px rgba(140, 96, 255, 0.5), 0 1px 0 rgba(255, 255, 255, 0.25);
  outline: none;
}
.a-h1 em {
  font-style: italic;
  color: var(--title);
}
.a-h1--sm { font-size: clamp(34px, 4vw, 58px); line-height: 0.98; }

.a-h2 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(28px, 3.2vw, 46px);
  line-height: 1.06;
  color: #fbf7ff;
  margin: 10px 0 0;
  outline: none;
}
.a-h2--sm { font-size: clamp(24px, 2.4vw, 34px); }

.a-h3 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(20px, 1.9vw, 27px);
  line-height: 1.15;
  color: var(--title);
  margin-top: 22px;
}

.a-lead {
  margin-top: 14px;
  font-size: clamp(17px, 1.5vw, 20px);
  color: rgba(246, 242, 255, 0.9);
  max-width: 46ch;
}
.a-lead--sm { font-size: 16px; color: var(--muted); }

.a-fact { margin-top: 10px; font-size: 14px; color: var(--muted); letter-spacing: 0.02em; }
.a-note { margin-top: 10px; font-size: 14px; line-height: 1.5; color: var(--muted); }
.a-micro { margin-top: 10px; font-size: 12.5px; line-height: 1.55; color: var(--dim); }
.a-micra-placeholder { color: inherit; }
.a-center-text { text-align: center; }

/* Текст поверх яркой иллюстрации: картинку не затемняем, тексту даём мягкий
   тёмный ореол — так он остаётся читаемым. */
.atlas .a-micro,
.atlas .a-note,
.atlas .a-disclaimer,
.atlas .a-fact { text-shadow: 0 1px 12px rgba(6, 4, 22, 0.9), 0 0 3px rgba(6, 4, 22, 0.75); }

.a-keeper {
  margin-top: 12px;
  font-family: var(--serif);
  font-size: clamp(19px, 1.9vw, 26px);
  line-height: 1.28;
  color: var(--title);
  max-width: 44ch;
}
.a-keeper--sm { font-size: clamp(17px, 1.5vw, 20px); margin-top: 8px; }

.a-disclaimer {
  margin-top: 16px;
  padding: 12px 16px;
  border-radius: 16px;
  border: 1px solid rgba(168, 138, 255, 0.24);
  background: rgba(10, 7, 30, 0.5);
  font-size: 13px;
  line-height: 1.55;
  color: var(--muted);
}

/* --------------------------------------------------------------- кнопки */

.a-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 56px;
  padding: 0 26px;
  border: 1px solid transparent;
  border-radius: var(--r-btn);
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.16s var(--ease), box-shadow 0.16s, background 0.16s, border-color 0.16s;
}
.a-btn svg { width: 18px; height: 18px; flex: 0 0 auto; }
.a-btn:hover:not(:disabled) { transform: translateY(-2px); }
.a-btn:disabled { opacity: 0.42; cursor: not-allowed; }

.a-btn--lime {
  background: linear-gradient(180deg, var(--lime-hi), #c6f35a);
  color: var(--lime-ink);
  box-shadow: 0 14px 34px rgba(198, 243, 90, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.65);
}
.a-btn--lime:hover:not(:disabled) { box-shadow: 0 18px 40px rgba(198, 243, 90, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.7); }

.a-btn--primary {
  background: linear-gradient(180deg, rgba(122, 78, 226, 0.95), rgba(74, 42, 168, 0.95));
  border-color: rgba(196, 170, 255, 0.55);
  color: #fff;
  box-shadow: 0 16px 34px rgba(84, 44, 190, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.a-btn--ghost {
  background: rgba(34, 22, 78, 0.55);
  border-color: rgba(178, 150, 255, 0.42);
  color: var(--ink);
  backdrop-filter: blur(6px);
}
.a-btn--ghost:hover:not(:disabled) { background: rgba(52, 34, 112, 0.7); border-color: var(--panel-border-hi); }

.a-btn--gold {
  background: linear-gradient(180deg, #f8e2b2, #e9bc74);
  color: #3a2500;
  box-shadow: 0 12px 26px rgba(242, 206, 138, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.a-btn--danger { color: var(--danger); border-color: rgba(255, 157, 157, 0.4); }
/* «Да, стереть»: светлая плашка и тёмный текст — кнопка читается сразу. */
.a-btn--danger-fill {
  background: linear-gradient(180deg, #ffdeda, #ffb3ad);
  border-color: rgba(255, 220, 214, 0.7);
  color: #43101c;
  box-shadow: 0 14px 30px rgba(255, 140, 140, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.65);
}
.a-btn--danger-fill:hover:not(:disabled) { background: linear-gradient(180deg, #ffe9e6, #ffc0ba); }
.a-btn--sm { min-height: 46px; padding: 0 20px; font-size: 14.5px; }
.a-btn--wide { width: 100%; }

.a-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 22px;
}
.a-cta--center { justify-content: center; }
.a-cta--col { flex-direction: column; align-items: stretch; }
.a-cta--col .a-btn { width: 100%; }

/* --------------------------------------------------------------- панели */

.a-glass {
  position: relative;
  width: min(660px, 100%);
  padding: clamp(22px, 3vw, 34px);
  border-radius: var(--r-panel);
  background: var(--panel);
  border: 1px solid var(--panel-border);
  box-shadow: var(--shadow), 0 0 60px rgba(120, 70, 220, 0.18);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.a-glass--narrow { width: min(560px, 100%); }
.a-glass--wide { width: min(820px, 100%); }
.a-glass--card { width: min(720px, 100%); display: grid; gap: 14px; justify-items: start; }
.a-glass p { margin-top: 10px; color: rgba(246, 242, 255, 0.88); }

.a-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid rgba(196, 170, 255, 0.55);
  background: rgba(58, 38, 130, 0.6);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #e7ddff;
}
.a-chip--lime { border-color: rgba(217, 255, 118, 0.6); background: rgba(46, 62, 20, 0.55); color: var(--lime); }
.a-chip--gold { border-color: rgba(233, 188, 116, 0.6); background: rgba(58, 40, 14, 0.5); color: var(--gold); }

.a-check {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 12px;
  padding: 12px 16px;
  border-radius: 16px;
  border: 1px solid rgba(168, 138, 255, 0.3);
  background: rgba(12, 8, 32, 0.5);
  font-size: 15px;
  line-height: 1.45;
  cursor: pointer;
}
.a-check input {
  flex: 0 0 auto;
  width: 22px; height: 22px;
  margin: 1px 0 0;
  accent-color: var(--lime);
  cursor: pointer;
}
.a-check:has(input:checked) { border-color: rgba(217, 255, 118, 0.55); background: rgba(34, 46, 18, 0.5); }

.a-field { border: 0; padding: 0; margin: 16px 0 0; }
.a-field legend {
  padding: 0 0 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Поле внутри поля: громкость живёт под галочкой «Включить звук глав». */
.a-field--inner { margin: 10px 0 0; }

/* Кнопка звука главы: чип на титуле и на завершении главы. Выключенная —
   призрачная, включённая — лаймовая, с живыми полосками эквалайзера. */
.a-soundrow { display: flex; margin-top: 14px; }
.a-sound {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 15px 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(196, 170, 255, 0.45);
  background: rgba(24, 16, 52, 0.55);
  color: #e7ddff;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: border-color 0.16s, background 0.16s, color 0.16s, transform 0.16s var(--ease);
}
.a-sound:hover { border-color: rgba(217, 255, 118, 0.55); transform: translateY(-1px); }
.a-sound .a-sound__ico { display: grid; place-items: center; }
.a-sound .a-sound__ico svg { width: 17px; height: 17px; }
.a-sound.is-on { border-color: rgba(217, 255, 118, 0.65); background: rgba(38, 52, 16, 0.6); color: var(--lime); }
.a-sound:focus-visible { outline: 2px solid var(--lime-hi); outline-offset: 3px; }

/* Эквалайзер: три полоски, которые дышат только при включённом звуке.
   В покое высоты разные — это читается как замершие полоски, а не как «…». */
.a-sound__bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 14px; }
.a-sound__bars i {
  width: 2.5px;
  height: 6px;
  border-radius: 2px;
  background: currentColor;
  opacity: 0.45;
  transform-origin: bottom;
}
.a-sound__bars i:nth-child(2) { height: 11px; }
.a-sound__bars i:nth-child(3) { height: 8px; }
.a-sound.is-on .a-sound__bars i { opacity: 0.9; animation: a-eq 1.15s ease-in-out infinite; }
.a-sound.is-on .a-sound__bars i:nth-child(2) { animation-delay: 0.18s; }
.a-sound.is-on .a-sound__bars i:nth-child(3) { animation-delay: 0.36s; }
@keyframes a-eq {
  0%, 100% { transform: scaleY(0.7); }
  50% { transform: scaleY(2.4); }
}

/* Та же кнопка в шапке вопроса: круглая, рядом с «Паузой». */
.a-qhead__tools { display: inline-flex; align-items: center; gap: 8px; }
.a-rnd--sound.is-on { border-color: rgba(217, 255, 118, 0.7); color: var(--lime); }

.a-danger { margin-top: 22px; padding-top: 16px; border-top: 1px solid rgba(168, 138, 255, 0.2); }

/* --------------------------------------------------------- титул */

/* Главная — по макету: заголовок и кнопки слева, хранительница книги справа.
   Текст живёт на свободной части иллюстрации: без плашки и без тёмного пятна,
   читаемость держит только мягкое свечение вокруг букв. */
.a-hero {
  flex: 1;
  display: grid;
  place-items: center start;
  text-align: left;
  padding: clamp(4px, 2vh, 24px) 0 clamp(8px, 2vh, 24px);
  overflow: clip;
}
.a-hero__in {
  position: relative;
  display: grid;
  justify-items: start;
  gap: 0;
  width: min(520px, 100%);
}
.a-h1--title {
  font-size: clamp(46px, 7vw, 104px);
  line-height: 0.9;
  letter-spacing: -0.012em;
  text-transform: uppercase;
  color: #f2ecb4;
  text-shadow: 0 6px 44px rgba(140, 96, 255, 0.55), 0 2px 18px rgba(6, 4, 22, 0.6), 0 1px 0 rgba(255, 255, 255, 0.22);
}
.a-h1--title .a-h1__l { display: block; }
.a-hero__sub {
  margin-top: 14px;
  max-width: 32ch;
  font-size: clamp(16px, 1.4vw, 20px);
  line-height: 1.38;
  color: rgba(246, 242, 255, 0.96);
  text-shadow: 0 2px 16px rgba(6, 4, 22, 0.95), 0 0 4px rgba(6, 4, 22, 0.8);
}
.a-hero__facts {
  margin-top: 10px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #e6d9ff;
  text-shadow: 0 2px 14px rgba(6, 4, 22, 0.95);
}
.a-hero .a-cta { margin-top: 24px; width: min(310px, 100%); }
.a-hero .a-note {
  margin-top: 14px;
  font-size: 13px;
  text-shadow: 0 2px 14px rgba(6, 4, 22, 0.95), 0 0 4px rgba(6, 4, 22, 0.8);
}

/* --------------------------------------------------------- загрузка */

.a-boot { display: grid; justify-items: center; text-align: center; gap: 12px; position: relative; }
.a-boot__halo {
  width: 210px;
  height: 210px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(217, 255, 118, 0.35), rgba(106, 76, 192, 0.2) 45%, transparent 70%);
  filter: blur(2px);
  animation: a-pulse 3.2s ease-in-out infinite;
}
.a-boot .a-h1 { margin: -120px 0 60px; }
.a-prog--boot { width: min(320px, 70vw); }

@keyframes a-pulse {
  0%, 100% { transform: scale(0.94); opacity: 0.75; }
  50% { transform: scale(1.04); opacity: 1; }
}

/* --------------------------------------------------------- прогресс */

.a-prog {
  position: relative;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(96, 72, 180, 0.34);
  border: 1px solid rgba(190, 165, 255, 0.42);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.45);
}
.a-prog i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #b6f23f, var(--lime));
  box-shadow: 0 0 14px rgba(198, 243, 90, 0.7);
  transition: width 0.32s var(--ease);
}
.a-prog-row {
  display: grid;
  gap: 8px;
  max-width: 560px;
  margin: 14px auto 0;
  width: 100%;
}
.a-prog-row .a-micro { margin: 0; text-align: center; }

/* --------------------------------------------------------- карта */

/* Карта — один нарисованный кадр во весь экран. Сверху, поверх рисунка, стоят
   «назад», «справка», название и шкала; у островов — живые подписи, потому что
   в самом рисунке названий нет. Подвал сайта идёт ниже, при прокрутке. */
.a-screen[data-screen='S05'] .a-bar {
  position: absolute;
  inset: 0 0 auto;
  z-index: 6;
}
.a-screen[data-screen='S05'] .a-body {
  max-width: none;
  padding: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

/* Кадр никогда не обрезается: вписываем его по ширине. Если места по высоте
   не хватает — страница просто прокручивается, низ карты остаётся виден. */
.a-map--full {
  position: relative;
  flex: 1 1 auto;
  width: 100%;
  min-height: 100dvh;
  overflow: hidden;
}

/* Подложка: тот же кадр, размытый и притушенный, — закрывает остатки экрана
   на нестандартных пропорциях, чтобы карта читалась одним полотном. */
.a-map__wash {
  position: absolute;
  inset: -30px;
  background-image: var(--map);
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  filter: blur(34px) saturate(1.05) brightness(0.5);
  transform: scale(1.04);
  pointer-events: none;
}

/* Размер кадра и подписей считает скрипт (fitMap). На вертикальных экранах
   кадр не мельчает: он тянется по высоте и листается вбок. */
.a-world-scroll {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}
.a-world-scroll::-webkit-scrollbar { width: 0; height: 0; }

/* Кадр подрезан снизу (высоту ставит fitMap): прижимаем его к верхнему краю,
   иначе центрирование поднимало рисунок ещё на пол-разницы и острова
   подходили к заголовку ближе, чем рассчитано. */
.a-map--full .a-world-scroll { align-items: flex-start; }

.a-world {
  position: relative;
  flex: 0 0 auto;
  width: 100%;
  aspect-ratio: 2729 / 1536;
}

.a-map--full.is-pan .a-world-scroll { overflow-x: auto; justify-content: flex-start; }

.a-world__art {
  position: absolute;
  inset: 0;
  background-image: var(--map);
  background-position: center;
  background-size: 100% 100%;
  background-repeat: no-repeat;
  /* Нижний край кадра растворяется: под ним та же карта, только размытая. */
  -webkit-mask-image: linear-gradient(180deg, #000 0, #000 95.5%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 0, #000 95.5%, transparent 100%);
}

/* Шапка карты: название и «пройдено» — поверх неба рисунка, по центру. */
.a-map__head {
  position: absolute;
  left: 0;
  right: 0;
  top: clamp(10px, 2.2vh, 28px);
  z-index: 4;
  display: grid;
  justify-items: center;
  gap: clamp(6px, 1vh, 12px);
  padding: 0 clamp(58px, 11vw, 132px);
  text-align: center;
  pointer-events: none;
}
.a-map__head > * { pointer-events: auto; }

.a-map__title {
  margin: 0;
  max-width: 100%;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(26px, 3.4vw, 54px);
  line-height: 1;
  letter-spacing: -0.01em;
  color: #f2ecb4;
  outline: none;
  text-shadow: 0 6px 30px rgba(6, 4, 22, 0.95), 0 0 42px rgba(140, 96, 255, 0.5), 0 1px 0 rgba(255, 255, 255, 0.2);
}

.a-map__row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(8px, 1.4vw, 16px);
  flex-wrap: wrap;
}

.a-map__done {
  font-size: clamp(10px, 0.86vw, 13px);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(246, 242, 255, 0.9);
  white-space: nowrap;
  text-shadow: 0 2px 12px rgba(4, 2, 16, 0.95);
}

/* Восемь делений — восемь территорий: заполняется каждое своим прогрессом. */
.a-prog--segs {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 4px;
  width: clamp(140px, 22vw, 300px);
  height: 6px;
  border: 0;
  overflow: visible;
  background: none;
  box-shadow: none;
}
.a-prog--segs b {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: rgba(10, 8, 30, 0.62);
  box-shadow: inset 0 0 0 1px rgba(190, 165, 255, 0.28);
  overflow: hidden;
}
.a-prog--segs i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #b6f23f, var(--lime));
  box-shadow: 0 0 10px rgba(198, 243, 90, 0.75);
  transition: width 0.32s var(--ease);
}

.a-map__row .a-btn { min-height: 40px; padding: 0 16px; font-size: 13.5px; }

/* --- остров: невидимая кнопка по силуэту, состояние — свечение ---------- */
.a-spot {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--w);
  height: var(--h);
  padding: 0;
  border: 0;
  border-radius: 46% 46% 40% 40% / 42% 42% 34% 34%;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: box-shadow 0.2s var(--ease);
}

.a-spot::before {
  content: '';
  position: absolute;
  inset: -4%;
  border-radius: inherit;
  background: radial-gradient(58% 58% at 50% 56%, rgba(217, 255, 118, 0.28), rgba(168, 138, 255, 0.16) 56%, transparent 76%);
  opacity: 0;
  transition: opacity 0.22s var(--ease);
  pointer-events: none;
}

.a-spot:hover::before { opacity: 0.9; }
.a-spot.is-locked::before { display: none; }

/* Рисунок не перекрываем: подсветка только при наведении (и фокусе с клавиатуры).
   Состояние территории читается по её подписи. */
.a-spot.is-locked { cursor: not-allowed; }
.a-spot:disabled { cursor: not-allowed; }

/* --- подписи территорий: плашка с номером и названием поверх рисунка --- */
/* Размер плашки задан в «исходных» пикселях макета и масштабируется
   коэффициентом --k, который выставляет fitMap вместе с размером кадра. */
.a-world__labels { position: absolute; inset: 0; pointer-events: none; }

.a-label {
  position: absolute;
  left: var(--x);
  top: var(--y);
  transform: translate(-50%, -50%);
  pointer-events: auto;
  display: inline-flex;
  align-items: baseline;
  gap: calc(11px * var(--k, 0.6));
  padding: calc(9px * var(--k, 0.6)) calc(20px * var(--k, 0.6)) calc(10px * var(--k, 0.6));
  border-radius: 999px;
  border: max(1px, calc(1.4px * var(--k, 0.6))) solid rgba(178, 150, 255, 0.5);
  background: rgba(10, 7, 30, 0.76);
  -webkit-backdrop-filter: blur(7px);
  backdrop-filter: blur(7px);
  color: var(--ink);
  font-size: calc(31px * var(--k, 0.6));
  font-weight: 700;
  line-height: 1.1;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 calc(10px * var(--k, 0.6)) calc(26px * var(--k, 0.6)) rgba(3, 2, 14, 0.55);
  transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease), background 0.18s var(--ease);
}
.a-label:hover,
.a-label:focus-visible { border-color: var(--panel-border-hi); background: rgba(16, 11, 44, 0.86); }
.a-label__n { color: var(--title); font-variant-numeric: tabular-nums; }
.a-label__t { color: rgba(246, 242, 255, 0.96); }
.a-label__p { color: rgba(202, 192, 242, 0.88); font-size: 0.78em; letter-spacing: 0.02em; }
.a-label.is-current {
  border-color: rgba(217, 255, 118, 0.88);
  box-shadow: 0 0 calc(34px * var(--k, 0.6)) rgba(198, 243, 90, 0.32), 0 calc(10px * var(--k, 0.6)) calc(26px * var(--k, 0.6)) rgba(3, 2, 14, 0.55);
}
.a-label.is-current .a-label__n { color: var(--lime-hi); }
.a-label.is-done { border-color: rgba(119, 230, 255, 0.5); }
.a-label.is-done .a-label__n { color: #cdf4ff; }
.a-label.is-locked { opacity: 0.55; cursor: not-allowed; }

/* ползунок яркости в настройках */
.a-range { display: grid; gap: 4px; margin-top: 2px; }
.a-range__top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: 13.5px; }
.a-range__val { font-variant-numeric: tabular-nums; color: var(--lime-hi); font-weight: 700; }
.a-range input[type='range'] {
  width: 100%;
  height: 26px;
  margin: 0;
  accent-color: var(--lime);
  cursor: pointer;
}

/* --------------------------------------------------------- глава */

/* Пролог держится внизу кадра, но без пустого экрана над панелью. */
.a-bottom {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding-top: clamp(24px, 8vh, 110px);
}
.a-chapter { max-width: 720px; }
.a-chapter .a-cta { margin-top: 26px; }

/* Переход к новой главе и её финал: весь текст — в полупрозрачной панели
   справа, там же, где потом встанут вопросы и ответы. Слева остаётся сцена. */
.a-flow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(380px, 560px);
  gap: clamp(16px, 3vw, 44px);
  align-items: center;
  /* Сцена главы — во всю высоту экрана: подвал сайта идёт ниже, при прокрутке. */
  flex: 1 1 auto;
  min-height: min(62dvh, 580px);
  padding: clamp(4px, 1.6vh, 18px) 0;
}
.a-flow__art { align-self: stretch; min-height: 200px; }
.a-flow__panel {
  width: 100%;
  padding: clamp(20px, 2.6vw, 32px);
  background: var(--panel);
  border-color: var(--panel-border-hi);
}
.a-flow__panel .a-h1--sm { font-size: clamp(32px, 3.2vw, 46px); }
.a-flow__panel .a-cta { margin-top: 24px; }

/* --------------------------------------------------------- вопрос */

.a-question {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(420px, 620px);
  gap: clamp(20px, 3vw, 46px);
  align-items: center;
  padding-top: clamp(8px, 3vh, 32px);
}
.a-question__art { position: relative; align-self: stretch; min-height: 240px; display: flex; align-items: flex-start; }

/* Название острова — крупно, как заголовок главной, над сценой территории. */
.a-chapter-mark {
  margin: 0;
  max-width: 100%;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(30px, 3.6vw, 58px);
  line-height: 1.02;
  letter-spacing: -0.005em;
  color: #f2ecb4;
  white-space: nowrap;
  text-shadow: 0 4px 30px rgba(140, 96, 255, 0.5), 0 2px 18px rgba(6, 4, 22, 0.9), 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* Мягкое затемнение сверху: заголовку хватает только верхней полосы кадра. */
body[data-screen='S06'] .a-screen::before,
body[data-screen='S07'] .a-screen::before {
  content: '';
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 0;
  height: min(38vh, 320px);
  pointer-events: none;
  background: linear-gradient(180deg, rgba(6, 4, 22, 0.66), rgba(6, 4, 22, 0.28) 52%, transparent 100%);
}
.a-question__side {
  padding: clamp(18px, 2.4vw, 28px);
  border-radius: var(--r-panel);
  background: var(--panel);
  border: 1px solid var(--panel-border);
  box-shadow: var(--shadow), 0 0 60px rgba(120, 70, 220, 0.2);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.a-qhead { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.a-qhead__n { font-size: 14px; color: var(--muted); letter-spacing: 0.04em; }

.a-qform { margin: 0; }
.a-qfield { border: 0; margin: 0; padding: 0; }
.a-qlegend { display: grid; gap: 5px; padding: 0; margin: 13px 0 0; }
.a-qlegend__ask {
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #cfc4f5;
  outline: none;
}
.a-qlegend__text {
  font-family: var(--serif);
  font-size: clamp(24px, 2.4vw, 32px);
  line-height: 1.15;
  color: #fbf7ff;
}

.a-opts { display: grid; gap: 6px; margin-top: 13px; }

.a-opt {
  display: grid;
  grid-template-columns: 22px 34px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 49px;
  padding: 5px 17px;
  border-radius: 999px;
  border: 1px solid rgba(160, 130, 245, 0.42);
  background: linear-gradient(180deg, rgba(58, 38, 128, 0.55), rgba(30, 19, 74, 0.7));
  cursor: pointer;
  transition: border-color 0.14s, background 0.14s, transform 0.14s;
}
.a-opt:hover { border-color: rgba(196, 170, 255, 0.8); background: linear-gradient(180deg, rgba(76, 50, 160, 0.7), rgba(40, 26, 92, 0.8)); }
.a-opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }

.a-opt__dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(210, 196, 255, 0.75);
  transition: border-color 0.14s, background 0.14s, box-shadow 0.14s;
}
.a-opt__n { font-weight: 800; font-size: 15px; color: #fff; }
.a-opt__t { font-size: 15.5px; line-height: 1.3; color: rgba(246, 242, 255, 0.92); }

.a-opt:has(input:checked) {
  border-color: var(--lime);
  background: linear-gradient(180deg, rgba(64, 84, 30, 0.75), rgba(38, 48, 16, 0.85));
  box-shadow: 0 0 0 1px rgba(217, 255, 118, 0.35), 0 10px 26px rgba(0, 0, 0, 0.3);
}
.a-opt:has(input:checked) .a-opt__dot {
  border-color: var(--lime);
  background: radial-gradient(circle, var(--lime) 0 45%, transparent 50%);
  box-shadow: 0 0 12px rgba(217, 255, 118, 0.8);
}
.a-opt:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }

.a-qfoot { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }

/* --------------------------------------------------------- итоги */

.a-results,
.a-details {
  display: grid;
  grid-template-columns: minmax(240px, 300px) minmax(0, 1fr) minmax(280px, 340px);
  gap: clamp(14px, 2vw, 26px);
  align-items: start;
}

.a-side,
.a-list,
.a-key {
  padding: clamp(16px, 2vw, 24px);
  border-radius: var(--r-panel);
  background: var(--panel);
  border: 1px solid var(--panel-border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.a-side__d { margin-top: 12px; font-size: 14.5px; line-height: 1.55; color: rgba(246, 242, 255, 0.82); }

.a-nums { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.a-nums__i {
  display: grid;
  gap: 2px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(168, 138, 255, 0.26);
  background: rgba(10, 7, 30, 0.5);
}
.a-nums__i b {
  font-family: var(--sans);
  font-size: clamp(24px, 2.4vw, 32px);
  font-weight: 800;
  font-variant-numeric: tabular-nums lining-nums;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--lime);
}
.a-nums__i span { font-size: 11.5px; color: var(--muted); }

.a-rows { display: grid; gap: 6px; margin-top: 14px; }
.a-row__b {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 16px;
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background 0.14s, border-color 0.14s;
}
.a-row__b:hover { background: rgba(255, 255, 255, 0.05); border-color: rgba(168, 138, 255, 0.3); }
.a-row.is-on .a-row__b { border-color: rgba(217, 255, 118, 0.55); background: rgba(46, 62, 20, 0.35); }

.a-row__art {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background-color: rgba(20, 12, 48, 0.9);
  background-size: cover;
  background-position: center;
  border: 1px solid rgba(196, 170, 255, 0.4);
  box-shadow: inset 0 0 18px rgba(150, 110, 255, 0.35);
}
.a-row__main { display: grid; gap: 6px; min-width: 0; }
.a-row__name { font-size: 14.5px; font-weight: 600; line-height: 1.2; color: #fbf7ff; }
.a-row__track {
  display: block;
  height: 9px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(96, 72, 180, 0.32);
  border: 1px solid rgba(190, 165, 255, 0.38);
}
.a-row__track i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #a9e83a, var(--lime));
  box-shadow: 0 0 10px rgba(198, 243, 90, 0.6);
}
.a-row__sub { font-size: 12px; color: var(--muted); }
.a-row__pct {
  font-size: clamp(22px, 2.2vw, 28px);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #fbf7ff;
  letter-spacing: -0.02em;
}
.a-row__chev { display: none; color: var(--muted); }
.a-details .a-row__chev { display: grid; place-items: center; width: 18px; }
.a-details .a-row__b { grid-template-columns: 52px minmax(0, 1fr) auto 18px; }
.a-details .a-row__art { width: 52px; height: 52px; }

.a-top { display: grid; gap: 4px; margin-top: 10px; }
.a-top__i {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 12px;
  background: rgba(10, 7, 30, 0.45);
  border: 1px solid rgba(168, 138, 255, 0.16);
}
.a-top__n, .a-item__n {
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--title);
  opacity: 0.75;
  text-align: right;
}
.a-top__t, .a-item__t { font-size: 13.5px; line-height: 1.35; }

.a-score {
  display: inline-grid;
  place-items: center;
  min-width: 34px;
  height: 28px;
  padding: 0 8px;
  border-radius: 9px;
  background: rgba(217, 255, 118, 0.14);
  border: 1px solid rgba(217, 255, 118, 0.4);
  color: var(--lime);
  font-weight: 800;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.a-key { display: grid; gap: 8px; align-content: start; }
.a-key__t {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(24px, 2.4vw, 32px);
  line-height: 1.05;
  color: #fbf7ff;
  margin-top: 4px;
}
.a-key__band { font-size: 12.5px; color: var(--lime); letter-spacing: 0.02em; }
.a-key__d { font-size: 14px; line-height: 1.55; color: rgba(246, 242, 255, 0.82); }
.a-key .a-btn { margin-top: 6px; }

.a-key--detail {
  max-height: calc(100dvh - 190px);
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(196, 170, 255, 0.5) transparent;
}
.a-key--detail p { font-size: 14px; line-height: 1.55; color: rgba(246, 242, 255, 0.85); }
/* название территории в разборе остаётся крупным: правило выше его не перебивает */
.a-key--detail .a-key__t {
  font-family: var(--serif);
  font-size: clamp(24px, 2.4vw, 32px);
  line-height: 1.05;
  color: #fbf7ff;
}
.a-key--detail .a-key__band { font-size: 12.5px; color: var(--lime); }

/* заголовки в узкой левой колонке не должны вылезать за панель */
.a-details .a-side, .a-results .a-side { overflow-wrap: anywhere; }
.a-details .a-side .a-h1--sm { font-size: clamp(24px, 2.3vw, 32px); line-height: 1.02; }

.a-results__foot { grid-column: 1 / -1; display: grid; gap: 4px; margin-top: 6px; }

/* «Как читать эти числа» и сочетания территорий */
.a-howto {
  margin-top: 18px;
  padding: clamp(18px, 2vw, 26px);
  border-radius: var(--r-panel);
  border: 1px solid var(--panel-border);
  background: var(--panel);
  text-align: left;
}
.a-howto__grid { columns: 2 340px; column-gap: 34px; margin-top: 10px; }
.a-howto__grid p {
  margin: 0 0 10px;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--muted);
  break-inside: avoid;
}
.a-combos { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; margin-top: 4px; }
.a-combo {
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(178, 150, 255, 0.3);
  background: rgba(24, 15, 56, 0.55);
}
.a-combo b { display: block; margin-bottom: 6px; font-size: 14.5px; color: var(--lime-hi); }
.a-combo p { margin: 0; font-size: 13.5px; line-height: 1.55; color: var(--muted); }

/* --------------------------------------------------------- разбор */

.a-level { display: grid; gap: 6px; margin-top: 18px; }
.a-level__l { font-size: 12.5px; color: var(--muted); }
.a-level__v {
  font-size: clamp(26px, 2.6vw, 34px);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--lime);
  letter-spacing: -0.02em;
}
.a-level__v small { font-size: 14px; color: var(--muted); font-weight: 600; }
.a-level__track {
  display: block;
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(96, 72, 180, 0.32);
  border: 1px solid rgba(190, 165, 255, 0.38);
}
.a-level__track i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #a9e83a, var(--lime));
  box-shadow: 0 0 12px rgba(198, 243, 90, 0.6);
}

.a-items { display: grid; gap: 4px; margin-top: 10px; }
.a-item {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 10px;
  background: rgba(10, 7, 30, 0.4);
  border: 1px solid rgba(168, 138, 255, 0.14);
}

/* --------------------------------------------------------- источники */

.a-srcs { display: grid; gap: 8px; margin-top: 10px; }
.a-src {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(10, 7, 30, 0.42);
  border: 1px solid rgba(168, 138, 255, 0.18);
}
.a-src__id {
  display: grid;
  place-items: center;
  height: 24px;
  border-radius: 8px;
  background: rgba(217, 255, 118, 0.14);
  border: 1px solid rgba(217, 255, 118, 0.35);
  color: var(--lime);
  font-size: 11.5px;
  font-weight: 800;
}
.a-src__t { display: grid; gap: 2px; font-size: 12.5px; line-height: 1.45; color: rgba(246, 242, 255, 0.82); }
.a-src__t b { color: #fff; }
.a-src__t small { color: var(--dim); font-size: 11.5px; line-height: 1.45; }
.a-src__t a { color: var(--lime); text-decoration: underline; text-underline-offset: 2px; }

/* --------------------------------------------------------- методика */

.a-about__s { margin-top: 18px; padding-top: 14px; border-top: 1px solid rgba(168, 138, 255, 0.18); }
.a-about__s p { margin-top: 6px; color: rgba(246, 242, 255, 0.82); max-width: 78ch; }

/* --------------------------------------------------------- карточка */

.a-cardpage {
  display: grid;
  gap: 14px;
  width: min(720px, 100%);
  margin: 0 auto;
}
.a-cardpage .a-glass--card { width: 100%; }
.a-cardwrap { width: 100%; display: grid; place-items: center; padding: 6px 0; }
#aCard {
  width: min(340px, 78vw);
  height: auto;
  border-radius: 20px;
  border: 1px solid rgba(196, 170, 255, 0.4);
  box-shadow: var(--shadow);
}

/* --------------------------------------------------------- промо */

.a-promo {
  position: relative;
  display: block;
  margin-top: 14px;
  min-height: clamp(160px, 18vw, 220px);
  border-radius: var(--r-panel);
  overflow: hidden;
  border: 1px solid rgba(242, 206, 138, 0.34);
  background-image: url('/oracle/img/promo/code-2027.webp'), linear-gradient(120deg, #2b1a56, #1a0f36);
  background-size: cover, auto;
  background-position: right center, center;
  background-repeat: no-repeat;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  text-decoration: none;
  color: inherit;
  transition: transform 0.22s var(--ease), box-shadow 0.22s, border-color 0.22s;
}
.a-promo::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(18, 9, 40, 0.9) 0%, rgba(18, 9, 40, 0.62) 48%, rgba(18, 9, 40, 0.05) 78%);
}
.a-promo:hover { transform: translateY(-3px); border-color: rgba(242, 206, 138, 0.6); }

/* витрина «Код 2027» до выхода книги: блок не кликается, кнопка погашена */
.a-promo--soon { cursor: default; }
.a-promo--soon:hover { transform: none; border-color: rgba(242, 206, 138, 0.34); }
.a-promo__btn.is-off {
  opacity: 0.72;
  filter: saturate(0.45) brightness(0.9);
  cursor: default;
  box-shadow: none;
}

.a-promo__in {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: clamp(16px, 2.4vw, 28px);
  max-width: min(560px, 92%);
}
.a-promo__k { font-size: 10.5px; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase; color: #e9bc74; }
.a-promo__t {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(24px, 2.6vw, 34px);
  line-height: 1.04;
  color: #fbf3df;
}
.a-promo__d { font-size: 13.5px; line-height: 1.5; color: #dccff7; }
.a-promo__n { font-size: 11.5px; color: rgba(220, 207, 247, 0.65); }
.a-promo__btn { margin-top: 4px; pointer-events: none; }

/* --------------------------------------------------------- модалки */

.a-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(4, 3, 16, 0.74);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: a-fade 0.2s var(--ease) both;
}

.a-modal__in {
  position: relative;
  width: min(460px, 100%);
  padding: 26px;
  border-radius: 24px;
  background: var(--panel);
  border: 1px solid var(--panel-border-hi);
  box-shadow: var(--shadow);
}
.a-modal__in .a-h3 { margin-top: 0; }

.a-close {
  position: absolute;
  top: 10px; right: 10px;
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(180, 150, 255, 0.34);
  background: rgba(20, 12, 48, 0.7);
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.a-close:hover { color: var(--ink); border-color: var(--panel-border-hi); }

/* --------------------------------------------------------- тост */

.a-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 50;
  transform: translate(-50%, 12px);
  padding: 12px 20px;
  border-radius: 999px;
  background: rgba(30, 22, 72, 0.96);
  border: 1px solid var(--panel-border-hi);
  color: var(--ink);
  font-size: 14px;
  box-shadow: var(--shadow);
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
}
.a-toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* --------------------------------------------------------- краевые */

.a-jumps { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.a-jump {
  min-width: 40px;
  min-height: 38px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid rgba(168, 138, 255, 0.4);
  background: rgba(30, 20, 70, 0.6);
  color: var(--ink);
  font-weight: 700;
  cursor: pointer;
}
.a-jump:hover { border-color: var(--lime); }

.a-btn--danger.a-btn--ghost:hover { background: rgba(90, 26, 40, 0.5); }

/* --------------------------------------------------------- мягкий режим */

body[data-soft='on'] .a-bg { filter: saturate(0.5) brightness(0.9); }

/* --------------------------------------------------------- анимация входа */

.a-body > * { animation: a-fade 0.34s var(--ease) both; }

@keyframes a-fade {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

/* «дыхание» острова, на котором остановился человек */
@keyframes a-breath {
  0%, 100% { opacity: 0.45; transform: scale(0.985); }
  50% { opacity: 0.95; transform: scale(1.01); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

body[data-motion='off'] *,
body[data-motion='off'] *::before,
body[data-motion='off'] *::after {
  animation: none !important;
  transition: none !important;
}

/* --------------------------------------------------------- адаптив */

@media (max-width: 1180px) {
  .a-results,
  .a-details { grid-template-columns: minmax(200px, 240px) minmax(0, 1fr); }
  .a-key { grid-column: 1 / -1; }
  .a-key--detail { max-height: none; }
  .a-results__foot { grid-column: 1 / -1; }
  .a-question { grid-template-columns: minmax(0, 1fr) minmax(380px, 520px); }
}

@media (max-width: 900px) {
  .a-bar { grid-template-columns: 46px minmax(0, 1fr) 46px; padding: 12px var(--pad) 4px; }
  .a-bar__title { display: none; }
  /* на карте заголовок — единственное, что стоит в шапке, поэтому оставляем */
  .a-screen[data-screen='S05'] .a-bar__title { display: block; }

  .a-question {
    grid-template-columns: 1fr;
    gap: 12px;
    padding-top: 0;
  }
  .a-question__art { min-height: 22vh; }
  .a-chapter-mark { max-width: 100%; white-space: normal; font-size: clamp(30px, 6.2vw, 42px); }
  .a-question__side { padding: 16px; border-radius: var(--r-panel-sm); }

  /* переход главы: панель встаёт под сцену во всю ширину */
  .a-flow { grid-template-columns: 1fr; min-height: 0; gap: 12px; }
  .a-flow__art { display: none; }

  .a-results,
  .a-details { grid-template-columns: 1fr; }
  .a-key { grid-column: auto; }
  .a-side, .a-list, .a-key { padding: 16px; border-radius: var(--r-panel-sm); }
  .a-side .a-h1--sm { font-size: clamp(30px, 7vw, 40px); }

  .a-bottom { padding-top: clamp(20px, 6vh, 80px); }
  .a-hero { padding: 8px 0 16px; }
}

/* Ноутбук с невысоким экраном (≈1440×760 и ниже): семь вариантов и кнопки
   должны влезть целиком, с небольшим запасом под панелью. Широкие экраны
   остаются просторными. */
@media (min-width: 621px) and (max-height: 800px) {
  .a-question { padding-top: 2px; }
  .a-question__side { padding: 18px 20px; }
  .a-qhead { margin-bottom: 4px; }
  .a-qlegend { margin-top: 9px; gap: 4px; }
  .a-qlegend__text { font-size: clamp(22px, 2.1vw, 27px); }
  .a-opts { gap: 5px; margin-top: 10px; }
  .a-opt { min-height: 43px; padding: 3px 16px; }
  .a-opt__n { font-size: 14px; }
  .a-opt__t { font-size: 15px; }
  .a-qfoot { margin-top: 11px; }
  .a-qfoot .a-btn { min-height: 46px; }
}

@media (max-width: 620px) {
  :root { --pad: 16px; }
  body { font-size: 15.5px; }
  .a-h1 { font-size: clamp(42px, 12vw, 56px); }
  .a-h1--sm { font-size: clamp(30px, 8.5vw, 40px); }
  .a-h2 { font-size: clamp(24px, 7vw, 30px); }
  .a-hero .a-cta .a-btn { width: 100%; }
  .a-cta .a-btn { width: 100%; }
  .a-qfoot { grid-template-columns: 1fr 1fr; }
  .a-qfoot .a-btn { width: auto; }
  /* на телефоне семь вариантов и кнопки должны уместиться в один экран */
  .a-opt { min-height: 46px; padding: 5px 14px; grid-template-columns: 20px 30px minmax(0, 1fr); }
  .a-opt__t { font-size: 14.5px; }
  .a-opts { gap: 5px; margin-top: 12px; }
  .a-qlegend__text { font-size: 24px; }
  .a-qhead { margin-bottom: 4px; }
  .a-qfoot { margin-top: 12px; }
  .a-qfoot .a-btn { min-height: 50px; }
  .a-nums { grid-template-columns: 1fr 1fr; }
  .a-row__b { grid-template-columns: 48px minmax(0, 1fr) auto; gap: 10px; }
  .a-row__art { width: 48px; height: 48px; border-radius: 12px; }
  .a-row__pct { font-size: 22px; }
  .a-details .a-row__b { grid-template-columns: 48px minmax(0, 1fr) auto 14px; }
  .a-details .a-row__art { width: 48px; height: 48px; }
  /* карта на телефоне: кадр ведут вбок, подпись — внизу экрана */
  .a-chipx { font-size: 11px; padding: 2px 8px; }
  .a-map__title { font-size: clamp(22px, 6.4vw, 30px); white-space: normal; }
  .a-map__row { flex-direction: column; gap: 8px; }
  .a-map__done { font-size: 11px; }
  .a-prog--segs { width: min(300px, 74vw); }
  .a-map__row .a-btn { width: auto; }
  .a-modal__in { padding: 22px 18px; }
  .a-glass--card { padding: 18px; }
  .a-key--detail { padding: 14px; }
  .a-promo__in { max-width: 100%; }
  .a-bar { min-height: 56px; }
}
