/* «Лабиринт воспоминаний» — визуальный стиль.
   Светлая призма: жемчужно-белый → пудрово-розовый → персиковый.
   Контраст: чернильно-фиолетовый индиго + бирюзовый/пурпурный неон. */

:root {
  --ink: #1D1B4B;
  --ink-soft: rgba(29, 27, 75, 0.62);
  --paper: #F7F5F2;
  --teal: #00F2FE;
  --pink: #F355DA;
  --mint: #A8E6CF;
  --lav: #DED2F9;
  --line: rgba(29, 27, 75, 0.12);
  --radius: 26px;
  --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

body.is-playing { cursor: default; }

body.no-fx *, body.no-fx *::before, body.no-fx *::after {
  transition: none !important;
  animation: none !important;
}

#game-wrap { position: fixed; inset: 0; }
#game { display: block; width: 100%; height: 100%; }

/* ================= экраны ================= */
.screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: 32px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity .35s ease, transform .35s ease, visibility .35s;
  overflow: auto;
  background:
    radial-gradient(120% 95% at 8% 0%, #F6C9C4 0%, rgba(246, 201, 196, 0) 58%),
    radial-gradient(110% 95% at 94% 6%, #D6C7F6 0%, rgba(214, 199, 246, 0) 55%),
    linear-gradient(180deg, #FBE3DC 0%, #F8F1EA 48%, #F1F1F4 100%);
  z-index: 10;
}
.screen::before {
  content: "";
  position: absolute;
  inset: -10%;
  background:
    radial-gradient(40% 30% at 20% 20%, rgba(168, 230, 207, .5), transparent 70%),
    radial-gradient(45% 35% at 80% 30%, rgba(222, 210, 249, .55), transparent 70%);
  filter: blur(30px);
  animation: drift 30s ease-in-out infinite;
  pointer-events: none;
}
@keyframes drift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(2%, 3%) scale(1.08); }
}
.screen.is-active { opacity: 1; visibility: visible; transform: none; }
.screen > * { position: relative; z-index: 1; margin-top: auto; margin-bottom: auto; }
.screen--dim {
  background: rgba(250, 247, 244, .74);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.screen--splash { cursor: pointer; }

/* ================= логотип ================= */.logo { width: 100%; height: auto; display: block; overflow: visible; }
.logo--big { max-width: 720px; }
.logo__word text { paint-order: stroke; }
.logo__sparks circle { animation: spark 3.4s ease-in-out infinite; }
.logo__sparks circle:nth-child(2) { animation-delay: -1s; }
.logo__sparks circle:nth-child(3) { animation-delay: -2s; }
.logo__sparks circle:nth-child(4) { animation-delay: -2.6s; }
@keyframes spark { 0%, 100% { opacity: .25; } 50% { opacity: .95; } }

/* ================= заставка ================= */
/* заставка повторяет композицию меню: лого в верхней трети, слоган внизу справа */
.splash {
  position: relative;
  width: min(1100px, 96vw);
  height: min(760px, 92vh);
}
.splash__logo {
  position: absolute;
  left: 50%;
  top: 6%;
  transform: translateX(-50%);
  width: min(64vw, 660px);
}
.splash__hint {
  position: absolute;
  left: 50%;
  bottom: 8%;
  transform: translateX(-50%);
  font-size: 10px;
  letter-spacing: .42em;
  text-transform: uppercase;
  color: var(--ink-soft);
  animation: breathe 3s 2.2s ease-in-out infinite;
  opacity: 0;
  animation-fill-mode: forwards;
}
@keyframes fadeUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }
@keyframes breathe { 0%, 100% { opacity: .35; } 50% { opacity: .9; } }

/* ================= меню ================= */
/* композиционная сетка ТЗ: лого — верхняя треть, кнопки — нижняя */
.menu {
  position: relative;
  width: min(1100px, 96vw);
  height: min(760px, 92vh);
}
.menu__logo {
  position: absolute;
  left: 50%;
  top: 5%;
  transform: translateX(-50%);
  width: min(62vw, 640px);
  animation: fadeUp .8s .1s ease both;
}
.menu__tag {
  position: absolute;
  left: 50%;
  top: 40%;
  transform: translateX(-50%);
  width: 90%;
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  text-align: center;
  animation: fadeUp .8s .2s ease both;
}
.menu__buttons {
  position: absolute;
  left: 50%;
  bottom: 10%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: min(360px, 80vw);
  animation: fadeUp .8s .3s ease both;
}
.menu__settings {
  position: absolute; left: 0; bottom: 2%;
  display: inline-flex; align-items: center; gap: 9px;
  padding: 13px 22px;
  font-size: 10px;
  letter-spacing: .22em;
  color: rgba(29, 27, 75, .82);
  border-color: rgba(29, 27, 75, .18);
  background: rgba(255, 255, 255, .78);
}
.menu__settings:hover { border-color: rgba(0, 242, 254, .7); color: var(--ink); }
.menu__gear { font-size: 15px; line-height: 1; letter-spacing: 0; }
/* слоган: строгий матовый индиго, экстремально широкий трекинг, без свечения */
.slogan {
  position: absolute;
  right: 0;
  bottom: 3.5%;
  font-size: clamp(8px, .82vw, 11px);
  font-weight: 300;
  letter-spacing: .62em;
  text-transform: uppercase;
  color: #1D1B4B;
  opacity: .9;
  white-space: nowrap;
  text-shadow: none;
}
.slogan--splash {
  opacity: 0;
  animation: sloganIn .8s 2.5s ease forwards;
}
@keyframes sloganIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: .9; transform: none; }
}
@media (max-width: 860px) {
  .menu, .splash {
    height: auto;
    min-height: 86vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 26px 0 76px;
  }
  .menu__logo, .splash__logo, .menu__tag, .menu__buttons, .splash__hint, .slogan {
    position: static;
    transform: none;
    width: auto;
  }
  .menu__logo, .splash__logo { width: min(88vw, 560px); }
  .menu__tag { max-width: 86vw; }
  .menu__buttons { width: min(320px, 84vw); }
  .slogan { letter-spacing: .3em; margin-top: 14px; }
  .slogan--splash { animation-delay: 1.2s; }
  .menu__settings { position: fixed; left: 16px; bottom: 16px; }
}
@media (max-width: 720px) {
  .menu__settings { position: fixed; }
}

/* ================= кнопки ================= */
.btn {
  appearance: none;
  border: 1px solid rgba(29, 27, 75, .1);
  background: rgba(255, 255, 255, .72);
  color: var(--ink);
  font: 600 12px/1 var(--font);
  letter-spacing: .26em;
  text-transform: uppercase;
  padding: 19px 34px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(29, 27, 75, .07);
  transition: transform .2s ease, box-shadow .25s ease, background .25s ease, border-color .25s;
  backdrop-filter: blur(6px);
}
.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 36px rgba(0, 242, 254, .2), 0 0 0 1px rgba(0, 242, 254, .45) inset;
  border-color: rgba(0, 242, 254, .5);
}
.btn:active { transform: translateY(0) scale(.99); }
.btn--primary {
  background: linear-gradient(120deg, rgba(0, 242, 254, .26), rgba(243, 85, 218, .24));
  border-color: rgba(139, 123, 255, .45);
  box-shadow: 0 14px 34px rgba(139, 123, 255, .18), 0 0 0 1px rgba(255, 255, 255, .6) inset;
}
.btn--primary:hover { box-shadow: 0 18px 44px rgba(243, 85, 218, .25), 0 0 0 1px rgba(255, 255, 255, .8) inset; }
.btn--ghost { background: transparent; box-shadow: none; border-color: rgba(29, 27, 75, .18); }
.btn--danger { border-color: rgba(255, 77, 109, .4); color: #A3163A; }
.btn--danger:hover { box-shadow: 0 12px 26px rgba(255, 77, 109, .18); border-color: rgba(255, 77, 109, .7); }

.icon-btn {
  width: 42px; height: 42px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .7);
  color: var(--ink);
  font-size: 15px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: .2s;
  backdrop-filter: blur(6px);
}
.icon-btn:hover { border-color: rgba(0, 242, 254, .6); box-shadow: 0 0 18px rgba(0, 242, 254, .3); }

/* ================= панели ================= */
.panel {
  width: min(1080px, 96vw);
  background: rgba(255, 255, 255, .58);
  border: 1px solid rgba(255, 255, 255, .8);
  border-radius: var(--radius);
  padding: clamp(22px, 3vw, 44px);
  box-shadow: 0 30px 80px rgba(29, 27, 75, .1);
  backdrop-filter: blur(16px);
  animation: fadeUp .5s ease both;
}
.panel--narrow { width: min(720px, 94vw); }
.panel--center { text-align: center; }
.panel__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 26px; flex-wrap: wrap; }
.panel__title {
  margin: 6px 0 0;
  font-size: clamp(26px, 3.4vw, 40px);
  font-weight: 300;
  letter-spacing: -.01em;
  line-height: 1.1;
}
.kicker {
  font-size: 10px;
  letter-spacing: .4em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.panel__actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }

/* ================= города ================= */
.cities {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
}
.city-card {
  position: relative;
  text-align: left;
  border: 1px solid rgba(255, 255, 255, .95);
  background: rgba(255, 255, 255, .82);
  border-radius: 20px;
  box-shadow: 0 10px 26px rgba(29, 27, 75, .06);
  padding: 20px 20px 22px;
  cursor: pointer;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-family: var(--font);
  color: var(--ink);
  transition: transform .2s, box-shadow .25s, background .25s;
}
.city-card__line {
  position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px;
  background: linear-gradient(180deg, var(--c1), var(--c2));
  border-radius: 3px;
  box-shadow: 0 0 14px var(--c1);
}
.city-card:hover { transform: translateY(-3px); background: #fff; box-shadow: 0 18px 40px rgba(29, 27, 75, .12); }
.city-card__num { font-size: 10px; letter-spacing: .3em; color: var(--ink-soft); }
.city-card__city { font-size: 19px; font-weight: 600; letter-spacing: -.01em; }
.city-card__title { font-size: 12px; color: var(--ink-soft); line-height: 1.4; }
.city-card__meta { font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: rgba(29, 27, 75, .45); margin-top: 8px; }
.city-card.is-done .city-card__meta { color: #128C63; }
.city-card.is-locked { opacity: .58; cursor: not-allowed; background: rgba(255,255,255,.45); box-shadow: none; }
.city-card.is-locked:hover { transform: none; box-shadow: none; }

/* ================= интро ================= */
.intro__city { font-size: 12px; letter-spacing: .2em; text-transform: uppercase; color: var(--ink-soft); margin-top: 12px; }
.intro__text { font-size: 15px; line-height: 1.65; color: rgba(29, 27, 75, .8); margin: 18px 0; }
.intro__route { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-soft); }
.intro__rules {
  margin-top: 22px;
  padding: 18px 20px;
  border-radius: 16px;
  background: rgba(255, 255, 255, .6);
  border: 1px solid rgba(29, 27, 75, .07);
  display: grid;
  gap: 8px;
  font-size: 13px;
  color: rgba(29, 27, 75, .78);
}
.intro__rules b { color: var(--ink); font-weight: 600; }

/* ================= викторина ================= */
.quiz {
  width: min(760px, 94vw);
  background: rgba(255, 255, 255, .95);
  border-radius: 28px;
  padding: clamp(22px, 3vw, 40px);
  box-shadow: 0 40px 100px rgba(29, 27, 75, .18);
  border: 1px solid rgba(255, 255, 255, .9);
  animation: fadeUp .35s ease both;
  position: relative;
  overflow: hidden;
}
.quiz__kicker { font-size: 10px; letter-spacing: .34em; text-transform: uppercase; color: #8A6BE8; }
.quiz__question { font-family: var(--font); font-size: clamp(17px, 2vw, 22px); font-weight: 500; line-height: 1.45; margin: 14px 0 12px; letter-spacing: -.01em; }
.quiz__hint {
  font-size: 13px; line-height: 1.55; color: rgba(29, 27, 75, .62);
  padding: 12px 16px; border-radius: 12px; background: rgba(222, 210, 249, .25);
  border-left: 2px solid rgba(139, 123, 255, .5);
}
.quiz__options { display: grid; gap: 9px; margin-top: 20px; }
.quiz-opt {
  display: flex; align-items: center; gap: 14px;
  text-align: left;
  padding: 14px 18px;
  border-radius: 14px;
  border: 1px solid rgba(29, 27, 75, .1);
  background: rgba(255, 255, 255, .8);
  font: 400 14px/1.35 var(--font);
  color: var(--ink);
  cursor: pointer;
  transition: .18s;
}
.quiz-opt:hover:not(:disabled) { border-color: rgba(0, 242, 254, .7); box-shadow: 0 8px 22px rgba(0, 242, 254, .14); transform: translateX(2px); }
.quiz-opt__letter {
  flex: 0 0 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 11px; font-weight: 700; letter-spacing: .05em;
  background: rgba(29, 27, 75, .06);
  color: var(--ink);
}
.quiz-opt--joke .quiz-opt__text { font-style: italic; opacity: .85; }
.quiz-opt.is-correct { border-color: #21B573; background: rgba(63, 226, 155, .16); box-shadow: 0 0 0 1px #21B573 inset; }
.quiz-opt.is-correct .quiz-opt__letter { background: #21B573; color: #fff; }
.quiz-opt.is-wrong { border-color: #E23A57; background: rgba(255, 77, 109, .12); }
.quiz-opt.is-wrong .quiz-opt__letter { background: #E23A57; color: #fff; }
.quiz-opt:disabled { cursor: default; }
.quiz__fact {
  margin-top: 16px; padding: 0 16px; max-height: 0; overflow: hidden;
  border-radius: 12px; background: rgba(255, 77, 109, .08);
  transition: max-height .35s ease, padding .35s ease;
  font-size: 13px; line-height: 1.55; color: rgba(29, 27, 75, .82);
}
.quiz__fact.is-visible { max-height: 220px; padding: 14px 16px; }
.quiz__fact b { display: block; font-size: 10px; letter-spacing: .28em; text-transform: uppercase; color: #C22A46; margin-bottom: 6px; }
.quiz__fact p { margin: 0; }
.quiz__bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(29, 27, 75, .06); }
.quiz__bar span { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, var(--teal), var(--pink)); transform-origin: left; }
.quiz__bar span { animation: shrink 3.4s linear forwards; }
@keyframes shrink { from { transform: scaleX(1); } to { transform: scaleX(0); } }

/* ================= грамота ================= */
.gramota {
  position: relative;
  width: min(720px, 94vw);
  background: linear-gradient(160deg, #FFFDF8, #FBF6EC 60%, #FFFDF9);
  border-radius: 14px;
  padding: clamp(28px, 4vw, 52px);
  text-align: center;
  box-shadow: 0 40px 90px rgba(29, 27, 75, .18);
  border: 1px solid rgba(190, 165, 110, .45);
  outline: 1px solid rgba(190, 165, 110, .3);
  outline-offset: -10px;
  box-shadow: 0 40px 90px rgba(29, 27, 75, .18), 0 0 0 5px rgba(255, 255, 255, .55) inset;
  animation: fadeUp .5s ease both;
}
.gramota--gold { background: linear-gradient(160deg, #FFFCF2, #FFF4D6 55%, #FFFDF6); }
.gramota__seal {
  position: absolute; right: 26px; top: 26px;
  width: 80px; height: 80px; border-radius: 50%;
  display: grid; place-items: center; text-align: center;
  font-size: 9px; font-weight: 600; letter-spacing: .08em; color: #fff; line-height: 1.2;
  background: radial-gradient(circle at 35% 30%, #7FE7FF, #6B5BE0 60%, #F355DA);
  box-shadow: 0 8px 22px rgba(107, 91, 224, .35);
  transform: rotate(-8deg);
}
.gramota__seal--gold { font-size: 26px; background: radial-gradient(circle at 35% 30%, #FFE9A8, #E0A93C 60%, #B57A18); }
.gramota__kicker { font-size: 10px; letter-spacing: .42em; text-transform: uppercase; color: #9A7B3F; }
.gramota__title { font-family: Georgia, "Times New Roman", serif; font-style: italic; font-size: clamp(26px, 3.6vw, 40px); margin: 12px 0 6px; font-weight: 500; }
.gramota__city { font-size: 11px; letter-spacing: .26em; text-transform: uppercase; color: var(--ink-soft); }
.gramota__stars { font-size: 22px; letter-spacing: .3em; color: #E0A93C; margin: 16px 0 4px; }
.gramota__stars .dim { color: rgba(29, 27, 75, .12); }
.gramota__text { font-size: 14px; line-height: 1.65; max-width: 46ch; margin: 12px auto 0; color: rgba(29, 27, 75, .8); }
.gramota__stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 24px 0 8px; }
.gramota__stats div { display: flex; flex-direction: column; gap: 4px; }
.gramota__stats span { font-size: 20px; font-weight: 600; letter-spacing: -.01em; }
.gramota__stats small { font-size: 9px; letter-spacing: .22em; text-transform: uppercase; color: var(--ink-soft); }
.gramota__badge {
  display: inline-block; margin: 6px 0 0;
  font-size: 9px; letter-spacing: .28em; text-transform: uppercase;
  padding: 7px 14px; border-radius: 999px;
  background: rgba(33, 181, 115, .12); color: #128C63;
}
.gramota__fact { font-size: 12.5px; line-height: 1.6; color: rgba(29, 27, 75, .64); max-width: 52ch; margin: 18px auto 0; }
.gramota__hint { font-size: 10px; letter-spacing: .2em; text-transform: uppercase; color: rgba(29, 27, 75, .4); margin-top: 12px; }
.gramota__rank { font-family: Georgia, serif; font-style: italic; font-size: 20px; color: #8A6B22; margin: 4px 0 8px; }
.gramota__total { margin: 18px 0 6px; display: flex; flex-direction: column; gap: 4px; align-items: center; }
.gramota__total span { font-size: 38px; font-weight: 300; letter-spacing: -.02em; }
.gramota__total small { font-size: 9px; letter-spacing: .24em; text-transform: uppercase; color: var(--ink-soft); }
.final__list { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 6px; }
.final__list li { display: flex; justify-content: space-between; font-size: 12.5px; padding: 7px 2px; border-bottom: 1px dashed rgba(29, 27, 75, .12); }
.final__list b { font-weight: 600; }
.gramota .panel__actions { justify-content: center; }

/* ================= зал славы ================= */
.hall { display: grid; gap: 20px; }
.hall__total { text-align: center; padding: 10px 0 18px; border-bottom: 1px solid rgba(29, 27, 75, .08); }
.hall__score { font-size: clamp(40px, 6vw, 64px); font-weight: 200; letter-spacing: -.03em; line-height: 1; }
.hall__rank { font-family: Georgia, serif; font-style: italic; font-size: 18px; color: #6B5BE0; margin-top: 8px; }
.hall__note { font-size: 12px; color: var(--ink-soft); margin-top: 6px; }
.hall__list { display: grid; gap: 2px; }
.hall-row {
  display: grid; grid-template-columns: 1fr 110px 80px 70px;
  gap: 10px; align-items: center;
  padding: 12px 4px;
  border-bottom: 1px solid rgba(29, 27, 75, .07);
  font-size: 14px;
}
.hall-row__city small { display: block; font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft); margin-top: 3px; }
.hall-row__score { text-align: right; font-weight: 600; }
.hall-row__time { text-align: right; color: var(--ink-soft); font-size: 12px; }
.hall-row__stars { text-align: right; color: #E0A93C; letter-spacing: .1em; }
.hall-row.is-empty { opacity: .45; }

/* ================= HUD ================= */
.hud {
  position: fixed; inset: 0;
  pointer-events: none;
  opacity: 0; visibility: hidden;
  transition: opacity .3s;
  z-index: 5;
  font-family: var(--font);
}
.hud.is-active { opacity: 1; visibility: visible; }
.hud > * { pointer-events: auto; }

.hud__topleft { position: absolute; left: 22px; top: 20px; }
.hud__city { font-size: 15px; font-weight: 600; letter-spacing: .02em; text-shadow: 0 1px 12px rgba(255,255,255,.9); }
.hud__level { font-size: 9px; letter-spacing: .28em; text-transform: uppercase; color: var(--ink-soft); margin-top: 3px; }
.hud__dots { display: flex; gap: 5px; margin-top: 8px; }
.dot { width: 6px; height: 6px; border-radius: 50%; background: rgba(29, 27, 75, .18); }
.dot--done { background: #21B573; }
.dot--now { background: var(--pink); box-shadow: 0 0 8px var(--pink); }

.hud__topcenter {
  position: absolute; left: 50%; top: 14px; transform: translateX(-50%);
  text-align: center;
  min-width: 186px;
  padding: 9px 24px 10px;
  border-radius: 24px;
  background: rgba(255, 255, 255, .88);
  border: 1px solid rgba(29, 27, 75, .10);
  box-shadow: 0 10px 30px rgba(29, 27, 75, .12);
}
.timer {
  font-size: clamp(38px, 4.2vw, 56px); font-weight: 600; letter-spacing: -.01em; line-height: .95;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 10px rgba(255, 255, 255, .9);
}
.timer.is-low { color: #D2183B; animation: pulseLow 1s ease-in-out infinite; }
@keyframes pulseLow { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
.score { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft); margin-top: 5px; }
.score b { color: var(--ink); font-weight: 700; }

.hud__topright { position: absolute; right: 22px; top: 18px; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.energy {
  position: relative;
  width: 190px; height: 26px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .6);
  border: 1px solid rgba(29, 27, 75, .12);
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(29, 27, 75, .07);
}
.energy__fill {
  position: absolute; left: 0; top: 0; bottom: 0;
  width: var(--e, 0%);
  background: linear-gradient(90deg, rgba(0, 242, 254, .85), rgba(243, 85, 218, .8));
  transition: width .12s linear;
}
.energy__label { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font-size: 8px; letter-spacing: .26em; color: var(--ink); }
.energy__num { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font-size: 9px; font-weight: 600; color: var(--ink); }
.hud__tools { display: flex; gap: 8px; }

.minimap {
  position: absolute; left: 22px; bottom: 22px;
  width: 232px; height: 232px;
  border-radius: 50%;
  box-shadow: 0 16px 40px rgba(29, 27, 75, .22);
}

/* панель ручного управления: ← ↑ → */
.drive {
  position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%);
  display: flex; align-items: center; justify-content: center; gap: 14px;
  padding-bottom: 26px;
}
.drive__btn {
  appearance: none;
  width: 74px; height: 74px; border-radius: 50%;
  border: 1px solid rgba(29, 27, 75, .16);
  background: rgba(255, 255, 255, .9);
  color: var(--ink);
  font: 600 28px/1 var(--font);
  cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  box-shadow: 0 12px 28px rgba(29, 27, 75, .14);
  transition: transform .12s, box-shadow .18s, background .18s;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
/* подпись под стрелкой: чтобы было понятно, что кнопка делает */
.drive__glyph { font-size: inherit; line-height: .95; }
.drive__cap {
  font-size: 8px; font-weight: 700; line-height: 1;
  letter-spacing: .08em; text-transform: uppercase; opacity: .58;
}
.drive__btn--main {
  width: 92px; height: 92px;
  font-size: 34px;
  background: linear-gradient(140deg, rgba(0, 242, 254, .30), rgba(243, 85, 218, .26));
  border-color: rgba(139, 123, 255, .55);
}
.drive__btn.is-held { transform: scale(.94); box-shadow: 0 6px 16px rgba(29, 27, 75, .2); }
/* «Назад»: та же панель, но тише — это не основной ход */
.drive__btn--back {
  margin-left: 2px;
  background: rgba(255, 255, 255, .72);
  border-color: rgba(29, 27, 75, .12);
  color: #4A4480;
  font-size: 24px;
}
.drive__btn:active { transform: scale(.94); }
.drive__hint {
  position: absolute; left: 50%; bottom: 0; transform: translateX(-50%);
  white-space: nowrap; font-size: 10px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--ink-soft); text-shadow: 0 1px 10px rgba(255, 255, 255, 1);
}
.drive.need-turn .drive__btn:not(.drive__btn--main) {
  box-shadow: 0 0 0 3px rgba(243, 85, 218, .55), 0 12px 28px rgba(29, 27, 75, .14);
}
.drive.need-turn .drive__hint { color: #B02A6E; }

.options {
  position: absolute; left: 50%; bottom: 130px; transform: translateX(-50%);
  display: flex; gap: 10px; flex-wrap: wrap; justify-content: center;
  max-width: min(92vw, 720px);
}
.opt {
  appearance: none;
  border: 1px solid rgba(29, 27, 75, .12);
  background: rgba(255, 255, 255, .88);
  color: var(--ink);
  border-radius: 999px;
  padding: 14px 22px;
  font: 700 13px/1 var(--font);
  letter-spacing: .16em;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 9px;
  box-shadow: 0 10px 26px rgba(29, 27, 75, .12);
  transition: .18s;
}
.opt__key { font-size: 17px; opacity: .6; line-height: 1; }
.opt:hover { border-color: rgba(0, 242, 254, .6); }
.opt.is-active {
  background: linear-gradient(120deg, rgba(0, 242, 254, .34), rgba(243, 85, 218, .3));
  border-color: rgba(139, 123, 255, .8);
  box-shadow: 0 12px 30px rgba(139, 123, 255, .34), 0 0 0 3px rgba(255, 255, 255, .55);
  transform: translateY(-3px) scale(1.04);
}
.opt--exit { border-color: rgba(224, 169, 60, .65); color: #8A6B22; }
.opt--break { border-style: dashed; }

.impulse {
  position: absolute; right: 30px; bottom: 30px;
  width: 96px; height: 96px; border-radius: 50%;
  border: 1px solid rgba(29, 27, 75, .14);
  background: rgba(255, 255, 255, .72);
  color: var(--ink);
  cursor: pointer;
  display: grid; place-items: center;
  box-shadow: 0 14px 36px rgba(29, 27, 75, .14);
  transition: .25s;
  overflow: hidden;
}
.impulse__text { font-size: 9px; font-weight: 700; letter-spacing: .12em; }
.impulse__ring {
  position: absolute; inset: 6px; border-radius: 50%;
  background: conic-gradient(var(--teal) var(--e, 0%), rgba(29, 27, 75, .08) 0);
  mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 5px));
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 5px));
}
.impulse.is-ready { box-shadow: 0 0 0 2px rgba(0, 242, 254, .5), 0 0 34px rgba(243, 85, 218, .45); }
.impulse:hover { transform: scale(1.04); }

.toast {
  position: absolute; left: 50%; top: 104px; transform: translate(-50%, -8px);
  background: rgba(29, 27, 75, .86);
  color: #fff;
  font-size: 12px; letter-spacing: .04em;
  padding: 10px 18px; border-radius: 999px;
  opacity: 0; transition: .25s; pointer-events: none;
  max-width: 80vw; text-align: center;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* на время вопроса убираем компас, импульс и подсказки, чтобы не мешали */
body.is-quiz .minimap,
body.is-quiz .impulse,
body.is-quiz .options,
body.is-quiz .drive { opacity: 0; visibility: hidden; }

/* ================= переключатели ================= */
.switch {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 0;
  font-size: 14px;
  color: rgba(29, 27, 75, .85);
  cursor: pointer;
  border-bottom: 1px solid rgba(29, 27, 75, .07);
}
.switch input { display: none; }
.switch span {
  width: 46px; height: 26px; border-radius: 999px;
  background: rgba(29, 27, 75, .14);
  position: relative; transition: .25s; flex: 0 0 auto;
}
.switch span::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 20px; height: 20px; border-radius: 50%; background: #fff;
  box-shadow: 0 2px 6px rgba(29, 27, 75, .2); transition: .25s;
}
.switch input:checked + span { background: linear-gradient(90deg, var(--teal), var(--pink)); }
.switch input:checked + span::after { transform: translateX(20px); }
.settings__total { margin-top: 22px; font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--ink-soft); }
.fail__icon { font-size: 44px; margin-bottom: 10px; }

/* ================= адаптив ================= */
@media (max-width: 760px) {
  .screen { padding: 16px; }
  .hud__topleft { left: 14px; top: 12px; }
  .hud__topright { right: 14px; top: 12px; }
  .energy { width: 130px; height: 22px; }
  .timer { font-size: 34px; }
  .minimap { width: 150px; height: 150px; left: 12px; bottom: 12px; }
  .impulse { width: 78px; height: 78px; right: 16px; bottom: 16px; }
  .options { bottom: 104px; }
  .drive { bottom: 14px; gap: 10px; padding-bottom: 22px; }
  .drive__btn { width: 62px; height: 62px; font-size: 24px; }
  .drive__btn--main { width: 76px; height: 76px; font-size: 28px; }
  .drive__hint { font-size: 8px; letter-spacing: .1em; }
  .opt { padding: 11px 15px; font-size: 11px; }
  .gramota__stats { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .hall-row { grid-template-columns: 1fr 80px 60px; }
  .hall-row__stars { display: none; }
  .logo--big { max-width: 92vw; }
}


/* ================= анимация логотипа (заставка) ================= */
@keyframes lgDraw { to { stroke-dashoffset: 0; } }
@keyframes lgIn { from { opacity: 0; } to { opacity: 1; } }

.logo--anim .lg-outline {
  stroke-dasharray: 1500;
  stroke-dashoffset: 1500;
  animation: lgDraw 1.8s .15s ease forwards;
}
.logo--anim .lg-fill { opacity: 0; animation: lgIn .5s 1.75s ease forwards; }
.logo--anim .lg-glow-teal { opacity: 0; animation: lgIn .6s 1.85s ease forwards; }
.logo--anim .lg-glow-pink { opacity: 0; animation: lgIn .9s 2s ease forwards; }
.logo--anim .logo__swash { opacity: 0; animation: lgIn .9s 1.25s ease forwards; }
.logo--anim .logo__ballerina { opacity: 0; animation: lgIn 1s 1.45s ease forwards; }
.logo--anim .logo__sparks circle { opacity: 0; animation: lgIn 1.4s 2.3s ease forwards; }

/* ---- 2026-11-09: мобильная читаемость HUD и экранов ---- */
@media (max-width: 760px) {
  .hud__topleft { left: 12px; top: 10px; max-width: 30vw; }
  .hud__city { font-size: 11px; line-height: 1.2; }
  .hud__level { font-size: 7px; letter-spacing: .18em; margin-top: 2px; }
  .hud__dots { gap: 4px; margin-top: 5px; }
  .dot { width: 5px; height: 5px; }
  .hud__topcenter { top: 8px; min-width: 128px; padding: 4px 12px 5px; border-radius: 18px; }
  .timer { font-size: 30px; }
  .score { font-size: 9px; letter-spacing: .08em; margin-top: 2px; }
  .hud__topright { right: 10px; top: 10px; gap: 6px; }
  .energy { width: 108px; height: 20px; }
  .minimap { width: 118px; height: 118px; left: 10px; bottom: 158px; }
  .impulse { width: 66px; height: 66px; right: 10px; bottom: 118px; }
  .impulse__text { font-size: 7px; letter-spacing: .08em; }
  .drive { bottom: 14px; gap: 8px; padding-bottom: 20px; }
  .drive__btn { width: 60px; height: 60px; font-size: 22px; }
  .drive__btn--main { width: 78px; height: 78px; font-size: 30px; }
  .drive__hint { font-size: 8px; letter-spacing: .08em; }
}
