/* ============================================================
   «Дорога в школу» — стили
   ============================================================ */

:root {
  --accent: #FF7A59;
  --accent2: #4EC5F1;
  --ok: #3BC97D;
  --bad: #FF5A6E;
  --ink: #2E2A4F;
  --card: #FFFFFF;
  --soft: #FFF3E9;
  /* фон, акцент и цвет дороги — переопределяются из game.js при смене темы */
  --bg1:#EAF6FF; --bg2:#F2F7E6; --bg3:#FFF4E0;
  --theme-accent:#3F8FCB;
  --road:#8D93A6;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; min-height: 100%; }

body {
  font-family: "Naukino Emoji", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 18px;
  color: var(--ink);
  background: linear-gradient(160deg, var(--bg1), var(--bg2) 55%, var(--bg3));
  transition: background .6s ease;
  background-attachment: fixed;
  padding: 72px 12px 40px;      /* сверху место для кнопок звука */
  -webkit-text-size-adjust: 100%;
}

/* Сумеречная тема: страница тёмная, а карточки остаются светлыми —
   читать текст ребёнку всё равно надо. */
body.night { color: var(--ink); }

.wrap {
  max-width: 980px;
  position: relative;
  z-index: 1;                   /* интерфейс поверх украшений темы */
  margin: 0 auto;
}

.hidden { display: none !important; }

/* ---------- Карточка-экран ---------- */
.card {
  background: var(--card);
  border-radius: 28px;
  padding: clamp(14px, 3.5vw, 30px);
  box-shadow: 0 14px 34px rgba(46, 42, 79, 0.14);
}

.title {
  font-size: clamp(28px, 6vw, 42px);
  margin: 0 0 10px;
  text-align: center;
  color: var(--accent);
}

.subtitle {
  font-size: clamp(17px, 3.4vw, 21px);
  line-height: 1.45;
  text-align: center;
  margin: 0 0 18px;
}

.section-title {
  font-size: clamp(19px, 3.6vw, 24px);
  text-align: center;
  margin: 20px 0 12px;
}

.hint-line {
  text-align: center;
  font-size: 15px;
  opacity: .7;
  margin: 12px 0 0;
}

.how-line {
  text-align: center;
  font-size: 14px;
  opacity: .65;
  margin: 12px 0 0;
}

/* ---------- Верхние кнопки звука ---------- */
.top-buttons {
  position: fixed;
  top: 10px; right: 10px;
  display: flex; gap: 8px;
  z-index: 30;
}

.icon-btn {
  font-size: 24px;
  width: 52px; height: 52px;
  border: none; border-radius: 18px;
  background: #fff;
  box-shadow: 0 5px 14px rgba(46, 42, 79, 0.18);
  cursor: pointer;
  transition: transform .12s ease, opacity .15s ease;
}
.icon-btn:hover { transform: translateY(-2px) scale(1.05); }
.icon-btn:active { transform: scale(0.94); }
.icon-btn.off { opacity: .45; }

/* ---------- Совёнок Наум ---------- */
.hero-panel {
  display: flex; align-items: center; gap: 12px;
  background: var(--soft);
  border-radius: 22px;
  padding: 12px 14px;
  margin: 14px 0;
}
.hero-panel.compact { padding: 8px 10px; margin: 0; }

.hero-art { font-size: clamp(34px, 7vw, 50px); line-height: 1; flex: 0 0 auto; }

.bubble {
  background: #fff;
  border-radius: 18px;
  padding: 10px 14px;
  font-size: clamp(15px, 3vw, 19px);
  line-height: 1.4;
  box-shadow: 0 3px 10px rgba(46, 42, 79, 0.10);
  flex: 1 1 auto;
  min-width: 0;
}

@keyframes jump {
  0%, 100% { transform: translateY(0) rotate(0); }
  30%      { transform: translateY(-16px) rotate(-8deg); }
  60%      { transform: translateY(-6px) rotate(6deg); }
}
@keyframes wobble {
  0%, 100% { transform: rotate(0); }
  25%      { transform: rotate(-11deg); }
  75%      { transform: rotate(11deg); }
}
.hero-jump  { animation: jump .6s ease; }
.hero-shake { animation: wobble .5s ease; }

/* ---------- Выбор сложности ---------- */
.levels {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.level-btn {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  border: 4px solid transparent;
  border-radius: 22px;
  background: var(--soft);
  padding: 14px 10px;
  cursor: pointer;
  font-family: inherit;
  color: var(--ink);
  transition: transform .14s ease, border-color .14s ease, background .14s ease;
}
.level-btn:hover { transform: translateY(-3px); background: #FFE9D8; }
.level-btn:active { transform: scale(.97); }
.level-btn.selected { border-color: var(--accent); background: #FFEDE6; }
.level-emoji { font-size: 34px; }
.level-name { font-size: 21px; font-weight: 700; }
.level-desc { font-size: 14px; opacity: .75; text-align: center; }

/* ---------- Большие кнопки ---------- */
.big-btn {
  display: block;
  width: 100%; max-width: 420px;
  margin: 16px auto 0;
  padding: 15px 20px;
  font-size: clamp(18px, 3.6vw, 23px);
  font-weight: 700;
  font-family: inherit;
  color: #fff;
  background: linear-gradient(160deg, #FF9A78, var(--accent));
  border: none; border-radius: 22px;
  box-shadow: 0 8px 18px rgba(255, 122, 89, .38);
  cursor: pointer;
  transition: transform .14s ease, box-shadow .14s ease;
}
.big-btn:hover { transform: translateY(-3px); box-shadow: 0 12px 22px rgba(255, 122, 89, .45); }
.big-btn:active { transform: scale(.97); }
.big-btn.ghost {
  background: #F2EFFF;
  color: var(--ink);
  box-shadow: 0 6px 14px rgba(46, 42, 79, .12);
}

.mini-btn {
  border: none;
  background: var(--soft);
  color: var(--ink);
  font-family: inherit;
  font-size: 15px;
  padding: 9px 13px;
  border-radius: 14px;
  cursor: pointer;
  white-space: nowrap;
}
.mini-btn:hover { background: #FFE0CC; }

/* Доступность с клавиатуры */
:focus-visible { outline: 4px solid var(--accent2); outline-offset: 3px; }

/* ---------- Шапка игры ---------- */
.game-head {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}

.progress-info { flex: 1 1 160px; min-width: 130px; font-size: 15px; font-weight: 600; }

.progress-bar {
  height: 12px;
  background: #F0ECFA;
  border-radius: 10px;
  overflow: hidden;
  margin-top: 5px;
}

.progress-fill {
  height: 100%; width: 0;
  border-radius: 10px;
  background: linear-gradient(90deg, var(--accent2), var(--ok));
  transition: width .35s ease;
}

.score-badge {
  background: #FFF6DA;
  border-radius: 14px;
  padding: 8px 12px;
  font-weight: 700; font-size: 17px;
  white-space: nowrap;
}

.task-title {
  text-align: center;
  font-size: clamp(20px, 4.4vw, 28px);
  margin: 12px 0 10px;
  color: var(--theme-accent);
}

/* ============================================================
   МАРШРУТ
   Полоска прогресса тут не абстрактная: это путь от дома до школы,
   и человечек на ней стоит там, где сейчас ребёнок.
   ============================================================ */
.route {
  display: flex; align-items: center; gap: 8px;
  margin: 12px 0 10px;
}
.route-end { font-size: clamp(22px, 5vw, 30px); line-height: 1; }
.route-line { flex: 1 1 auto; display: flex; align-items: center; gap: 4px; }
.route .dot {
  flex: 1 1 auto;
  height: 12px;
  border-radius: 8px;
  background: #ECE8F6;
  display: flex; align-items: center; justify-content: center;
  transition: background .3s ease;
}
.route .dot.done { background: var(--ok); }
.route .dot.now {
  height: 26px;
  background: #fff;
  border: 2px dashed var(--theme-accent);
  font-size: 16px;
  line-height: 1;
}

/* ============================================================
   СЦЕНА УЛИЦЫ
   Небо, дома, тротуары, дорога и всё, что на ней. Слои лежат
   процентами по высоте, поэтому сцена одинаково собирается
   и на телефоне, и на большом экране.
   ============================================================ */
.scene {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 46vh;
  min-height: 190px;
  border-radius: 22px;
  overflow: hidden;
  background: #CFE9FF;
  box-shadow: inset 0 0 0 3px rgba(46, 42, 79, .06);
  user-select: none;
}
.scene.shake { animation: wobble .45s ease; }

.sky {
  position: absolute; left: 0; right: 0; top: 0; height: 48%;
  background: linear-gradient(180deg, #BFE2FF, #E6F4FF);
}
.scene-night .sky { background: linear-gradient(180deg, #2B2F52, #4B4570); }
.scene-night { filter: saturate(.9); }
.scene-night .walk { background: #6E6A78; }
.scene-night .skyline span { filter: brightness(.8); }

.skyline {
  position: absolute; left: 0; right: 0; top: 0; height: 48%;
  display: flex; align-items: flex-end; justify-content: space-around;
  padding: 0 2%;
  font-size: clamp(26px, 7vw, 54px);
  line-height: 1;
}

.walk {
  position: absolute; left: 0; right: 0;
  background: #D9D3C6;
}
.walk-far  { top: 40%; height: 8%; }
.walk-near { top: 80%; height: 20%; }
.walk-verge { background: #C9BE9E; }        /* обочина: тротуара нет */

.road {
  position: absolute; left: 0; right: 0;
  top: 48%; height: 32%;
  background: var(--road);
}
.road-village { background: #A9997F; }

.mid-line {
  position: absolute; left: 0; right: 0; top: 50%;
  height: 4px; transform: translateY(-50%);
  background: repeating-linear-gradient(90deg, #FFF6D8 0 26px, transparent 26px 52px);
  opacity: .85;
}

/* Полосы зебры лежат вдоль дороги, по ходу машин: пешеход шагает через них,
   одну за другой. Полосы поперёк — самая частая ошибка в рисунках перехода. */
.zebra {
  position: absolute; top: 0; bottom: 0;
  left: 50%; width: 24%; transform: translateX(-50%);
  /* Пять целых полос с одинаковым отступом сверху и снизу. Шаг в 30%
     не делил высоту дороги нацело: верхняя и нижняя полосы обрывались
     по краю проезжей части и читались как обломки разметки. */
  background: repeating-linear-gradient(180deg,
    transparent 0 4%, rgba(255,255,255,.94) 4% 16%, transparent 16% 20%);
}

/* Железнодорожный переезд */
.rail {
  position: absolute; left: 0; right: 0; top: 50%;
  height: 26%; transform: translateY(-50%);
  background:
    repeating-linear-gradient(90deg, #8B6A4A 0 10px, transparent 10px 26px),
    linear-gradient(180deg, transparent 22%, #9AA0AA 22% 34%, transparent 34% 66%, #9AA0AA 66% 78%, transparent 78%);
}
.barrier {
  position: absolute; left: 6%; top: 30%;
  width: 42%; height: 8px; border-radius: 4px;
  background: repeating-linear-gradient(90deg, #E23B3B 0 18px, #FFF 18px 36px);
  transform: rotate(-22deg);
  transform-origin: left center;
}

/* ---------- машины ----------
   Машина нарисована SVG в профиль (game.js): эмодзи браузер рисует анфас,
   а мимо ребёнка машина едет боком. Базовый рисунок смотрит влево, едущая
   вправо отражается через --flip. */
.car {
  position: absolute; top: 60%;
  line-height: 0;
  transform: translate(-50%, -50%) scaleX(var(--flip, 1));
}
.car-svg { width: 100%; height: auto; display: block; }
.car-w-car   { width: clamp(66px, 17vw, 116px); }
.car-w-bus   { width: clamp(82px, 21vw, 146px); }
.car-w-truck { width: clamp(88px, 23vw, 156px); }
.car-right { --flip: -1; }
.car-go { animation: carGo 2.6s ease-in-out infinite alternate; }
@keyframes carGo {
  from { transform: translate(calc(-50% - 10px), -50%) scaleX(var(--flip, 1)); }
  to   { transform: translate(calc(-50% + 10px), -50%) scaleX(var(--flip, 1)); }
}
.car-stop { filter: drop-shadow(0 3px 4px rgba(0,0,0,.25)); }
/* Припаркованная машина стоит у самого тротуара, а не посреди дороги:
   колёса приходятся на край проезжей части. */
.car-park { top: 74%; }
.car-siren { animation: siren 1s steps(1) infinite; }
@keyframes siren {
  0%, 49%   { filter: drop-shadow(0 0 12px #4EA6FF); }
  50%, 100% { filter: drop-shadow(0 0 12px #FF5A6E); }
}

.bus-stopped { left: 26%; top: 58%; }

.ball {
  position: absolute; left: 44%; top: 66%;
  transform: translate(-50%, -50%);
  font-size: clamp(22px, 5.5vw, 36px);
  animation: ballRoll 1.8s ease-in-out infinite alternate;
}
@keyframes ballRoll {
  from { transform: translate(-50%, -50%) rotate(0); }
  to   { transform: translate(calc(-50% + 26px), -50%) rotate(180deg); }
}

/* ---------- светофор и знак ---------- */
.light-post {
  position: absolute; left: 7%; bottom: 2%;
  height: 70%;
  display: flex; align-items: flex-end;
}
.light-svg { height: 100%; width: auto; }
.lamp-blink { animation: lampBlink 1s steps(1) infinite; }
@keyframes lampBlink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: .18; } }

.sign-post {
  position: absolute; right: 7%; bottom: 4%;
  display: flex; flex-direction: column; align-items: center;
}
.sign-post .sign-svg { width: clamp(42px, 11vw, 74px); height: auto; }
.sign-post .pole {
  width: 6px; height: clamp(16px, 5vw, 34px);
  background: #9AA0AA; border-radius: 3px;
}
/* Крупный знак в задании «что говорит этот знак» стоит выше дороги,
   чтобы не накрывать собой ребёнка на тротуаре. */
.sign-post--big {
  right: auto; left: 50%; bottom: 20%;
  transform: translateX(-50%);
}
.sign-post--big .sign-svg { width: clamp(96px, 26vw, 150px); }

/* ---------- ребёнок и мелкие предметы ---------- */
.kid {
  position: absolute; left: 50%; top: 88%;
  transform: translate(-50%, -50%);
  font-size: clamp(28px, 7.5vw, 50px);
  transition: top .5s ease;
  z-index: 3;
}
.kid-mid { top: 62%; }
.kid-road { top: 70%; }

.obj {
  position: absolute;
  transform: translate(-50%, -50%);
  font-size: clamp(22px, 6vw, 40px);
}

/* ---------- шторки «пока не посмотрел — не видно» ---------- */
/* Шторка лежит на проезжей части, и только на ней: закрывать надо то, что
   видно, если посмотреть по сторонам. Прежняя шторка шла от неба до самого
   низа и прятала заодно тротуар под ногами, дома и школу — на телефоне от
   улицы оставалась щель между двумя плитами. Границы взяты чуть шире
   дороги (48…80%), чтобы не выглядывала припаркованная машина. */
.curtain {
  position: absolute; top: 44%; bottom: 12%;
  width: 34%;
  display: flex; align-items: center; justify-content: center;
  font-size: clamp(30px, 8vw, 54px); font-weight: 900; color: #fff;
  background: linear-gradient(180deg, rgba(52,56,78,.72), rgba(52,56,78,.86));
  backdrop-filter: blur(2px);
  transition: opacity .45s ease, transform .45s ease;
  z-index: 4;
}
.curtain-left { left: 0; border-radius: 0 22px 22px 0; }
.curtain-right { right: 0; border-radius: 22px 0 0 22px; }
.curtain.open { opacity: 0; transform: scale(1.06); pointer-events: none; }

.car-look { animation: lookIn .45s ease both; z-index: 3; }
.car-look.look-left  { left: 14%; }
.car-look.look-right { left: 86%; }
@keyframes lookIn {
  from { opacity: 0; transform: translate(-50%, -20%) scaleX(var(--flip, 1)); }
  to   { opacity: 1; transform: translate(-50%, -50%) scaleX(var(--flip, 1)); }
}

/* ---------- погода ---------- */
.weather { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.weather span {
  position: absolute; top: -12%;
  font-size: clamp(12px, 3vw, 20px);
  animation: drop 3.2s linear infinite;
}
.weather-snow span { animation-duration: 5.5s; }
@keyframes drop {
  from { transform: translateY(-20px); opacity: .9; }
  to   { transform: translateY(46vh); opacity: .2; }
}

/* ============================================================
   ВОПРОС И ОТВЕТЫ
   ============================================================ */
.quest {
  display: block; width: 100%;
  margin: 4px 0 12px;
  padding: 14px 16px;
  border: none; border-radius: 20px;
  background: #FFF8E7;
  font-family: inherit;
  font-size: clamp(19px, 3.8vw, 26px);
  font-weight: 700;
  line-height: 1.35;
  color: var(--ink);
  text-align: center;
  cursor: pointer;
  box-shadow: 0 4px 0 #F0DFB5;
}
.quest:hover { background: #FFF3D8; }
.quest:active { transform: translateY(2px); box-shadow: 0 2px 0 #F0DFB5; }

.answers { display: grid; gap: 10px; }

.answer {
  display: block; width: 100%;
  padding: 14px 16px;
  border: 3px solid transparent;
  border-radius: 20px;
  background: var(--soft);
  font-family: inherit;
  font-size: clamp(16px, 3.2vw, 20px);
  line-height: 1.35;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  animation: answer-in .3s ease both;
  transition: transform .12s ease, background .15s ease, border-color .15s ease;
}
.answer:hover { transform: translateY(-2px); background: #FFE9D8; }
.answer:active { transform: translateY(1px); }
.answer:disabled { cursor: default; }
.answer.right {
  background: #DFF7E8; border-color: var(--ok);
  animation: jump .6s ease;
}
.answer.wrong {
  background: #FFE2E6; border-color: var(--bad);
  animation: wobble .45s ease;
  opacity: .8;
}
@keyframes answer-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Выбор знака: три картинки вместо трёх строк текста. */
.answers-signs { grid-template-columns: repeat(3, 1fr); }
.answer-sign {
  display: flex; align-items: center; justify-content: center;
  padding: 12px 8px;
}
.answer-sign .sign-svg { width: 100%; max-width: 108px; height: auto; }

/* Осмотрись: четыре действия в две колонки. */
.answers-look { grid-template-columns: repeat(2, 1fr); }
.answer-look { text-align: center; font-weight: 700; }
.answer-look.looked { background: #E6F6EC; border-color: var(--ok); }
.answer-look.done-step { opacity: .5; }

/* ============================================================
   ПАМЯТКА
   Правило попадает сюда, когда встретилось ребёнку на дороге,
   и не пропадает: памятка только растёт.
   ============================================================ */
.coins-line {
  text-align: center;
  font-size: clamp(15px, 3.2vw, 18px);
  font-weight: 700;
  margin: 0 0 10px;
  opacity: .85;
}

.rules { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.rule {
  background: #F4F8FF;
  border-left: 6px solid var(--accent2);
  border-radius: 14px;
  padding: 10px 14px;
  font-size: clamp(15px, 3vw, 18px);
  line-height: 1.35;
}
.rule.fresh { background: #E9F9EF; border-left-color: var(--ok); animation: answer-in .5s ease both; }
.rule-empty { border-left-color: #D9D5EA; opacity: .7; }

/* ---------- Экран результатов ---------- */
.stars { display: flex; justify-content: center; gap: 10px; margin: 6px 0; }
.star { font-size: clamp(48px, 12vw, 74px); animation: star-pop .55s ease both; }
.star-off { opacity: .35; }

@keyframes star-pop {
  0%   { transform: scale(0) rotate(-90deg); opacity: 0; }
  70%  { transform: scale(1.35) rotate(10deg); opacity: 1; }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}

.result-score {
  text-align: center;
  font-size: clamp(18px, 3.8vw, 24px);
  font-weight: 700;
  margin: 6px 0;
}

.best-line { text-align: center; font-size: 16px; opacity: .75; margin: 6px 0 14px; }

.result-buttons {
  display: flex; flex-wrap: wrap; gap: 10px; justify-content: center;
  margin-top: 12px;
}
.result-buttons .big-btn { flex: 1 1 220px; margin: 0; }

/* Блок для родителей */
.parents {
  background: #F6F4FF;
  border-radius: 20px;
  padding: 12px 16px;
  margin-top: 14px;
}
.parents summary { cursor: pointer; font-weight: 700; font-size: 17px; padding: 4px 0; }
.parents-body { font-size: 16px; }
.parents-intro { margin: 8px 0; opacity: .8; }
.parents-list { list-style: none; padding: 0; margin: 0; }
.parents-list li {
  background: #fff;
  border-radius: 14px;
  padding: 10px 12px;
  margin-bottom: 9px;
  line-height: 1.4;
}
.pm-sentence { font-weight: 700; margin-bottom: 4px; }
.pm-row { font-size: 15px; opacity: .85; }
.ok-line { margin: 8px 0; }

/* ---------- Конфетти ---------- */
.confetti {
  position: fixed; inset: 0;
  pointer-events: none; overflow: hidden;
  z-index: 50;
}
.confetti i {
  position: absolute; top: -20px;
  width: 10px; height: 16px;
  border-radius: 3px;
  animation: fall linear both;
}
@keyframes fall {
  0%   { transform: translateY(-20px) rotate(0); opacity: 1; }
  100% { transform: translateY(105vh) rotate(540deg); opacity: .2; }
}

/* ---------- Адаптив ---------- */
@media (max-width: 560px) {
  body { padding: 58px 6px 26px; font-size: 17px; }
  .card { border-radius: 20px; padding: 12px 10px; }
  .top-buttons { top: 6px; right: 6px; }
  .icon-btn { width: 44px; height: 44px; font-size: 20px; }
  .levels { gap: 8px; }
  .level-btn { padding: 9px 6px; border-width: 3px; }
  .level-emoji { font-size: 26px; }
  .level-name { font-size: 18px; }
  .level-desc { font-size: 13px; }
  .hero-panel { padding: 9px; gap: 8px; }
  .scene { border-radius: 16px; min-height: 168px; }
  .answer { padding: 12px 13px; border-radius: 16px; }
  .answers-look { grid-template-columns: 1fr; }
  .route-line { gap: 3px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ================================================================
   ОФОРМЛЕНИЕ РАУНДА (темы)
   Сами темы описаны в game.js (массив THEMES) — здесь только то,
   как выглядят фоновые украшения и табличка с названием темы.
   ================================================================ */
.theme-deco {
  position: fixed; inset: 0; z-index: 0;
  pointer-events: none; overflow: hidden;
}
.theme-deco i {                     /* «гнездо»: только позиция */
  position: absolute; display: block;
  transform: translate(-50%, -50%);
  font-style: normal;
}
.theme-deco span {                  /* сам значок: только анимация */
  display: block;
  opacity: .45;
  will-change: transform;
  filter: drop-shadow(0 4px 10px rgba(46, 42, 79, .10));
}

@keyframes thFloat{0%,100%{transform:translateY(0)}50%{transform:translateY(-15px)}}
@keyframes thBob{0%,100%{transform:rotate(-8deg)}50%{transform:rotate(8deg)}}
@keyframes thDrift{0%{transform:translateX(-5vw)}100%{transform:translateX(5vw)}}
@keyframes thTwinkle{0%,100%{transform:scale(1);opacity:.30}50%{transform:scale(1.18);opacity:.62}}
.th-float{animation:thFloat 5s ease-in-out infinite}
.th-bob{animation:thBob 4.4s ease-in-out infinite}
.th-drift{animation:thDrift 15s ease-in-out infinite alternate}
.th-drift2{animation:thDrift 21s ease-in-out infinite alternate-reverse}
.th-twinkle{animation:thTwinkle 3.4s ease-in-out infinite}

/* табличка «где мы сейчас» */
.theme-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 999px;
  background: rgba(255,255,255,.82);
  border: 2px solid rgba(255,255,255,.92);
  box-shadow: 0 4px 12px rgba(46,42,79,.10);
  font-size: 15px; font-weight: 800; color: var(--ink);
  white-space: nowrap; vertical-align: middle;
}
.theme-chip .th-ico { font-size: 20px; line-height: 1; }
.theme-chip.is-new { animation: thPop .7s ease; }
@keyframes thPop{0%{transform:scale(.7);opacity:0}55%{transform:scale(1.14)}100%{transform:scale(1)}}

@media (max-width: 560px) {
  .theme-chip .th-name { display: none; }
  .theme-chip { padding: 5px 9px; }
  .theme-deco span { opacity: .32; }
}
@media (prefers-reduced-motion: reduce) {
  .theme-deco span { animation: none !important; }
  .theme-chip.is-new { animation: none; }
}

/* ---------- кнопка возврата на страницу игры ---------- */
/* Игра открыта в рамке сайта (docs/09-games.md), и эта кнопка — её выход:
   она просит страницу закрыть окно игры. Открытая отдельной вкладкой игра
   кнопку убирает — возвращаться неоткуда. */
.exit-btn{
  display:inline-flex; align-items:center; gap:6px;
  height:46px; padding:0 16px; flex:none;
  border:none; border-radius:16px;
  background:#fff; color:#3D3455;
  font:inherit; font-size:16px; font-weight:800; line-height:1;
  white-space:nowrap; cursor:pointer;
  box-shadow:0 3px 0 rgba(61,52,85,.12);
}
.exit-btn:hover{ background:#F2EFFF; }
.exit-btn:active{ transform:translateY(2px); box-shadow:0 1px 0 rgba(61,52,85,.12); }
.exit-btn:focus-visible{ outline:3px solid var(--accent2); outline-offset:2px; }
/* Вариант для игр без собственной верхней панели. */
.exit-btn--float{ position:fixed; top:10px; left:10px; z-index:60; }
@media (max-width:480px){
  .exit-btn{ height:40px; padding:0 12px; font-size:14px; }
  .exit-btn--float{ top:6px; left:6px; }
}

/* На окне ноутбука кнопки ответа уходили за нижний край: сцена занимала
   46vh, а под ней стоят и вопрос, и сами кнопки — выбрать «посмотреть
   налево» было нечем. Ужимаем сцену и подписи. */
@media (max-height: 800px) {
  .scene { max-height: 34vh; }
  .task-title { font-size: clamp(17px, 3.2vw, 21px); margin: 6px 0; }
  .quest { padding: 8px 12px; font-size: clamp(15px, 2.6vw, 18px); }
  .answers { gap: 7px; }
  .answer { padding: 8px 12px; font-size: clamp(14px, 2.6vw, 17px); }
  .route { margin: 6px 0; }
  .hero-panel { padding: 7px 11px; margin: 6px 0; }
  .hero-art { font-size: clamp(26px, 5vw, 34px); }
  .bubble { padding: 7px 11px; font-size: clamp(14px, 2.4vw, 16px); }
}
