/* «Сказочный букварь» — ночной сказочный лес. Гласные красные, согласные синие, как в школе. */
:root {
  --night-0: #0e0b26;
  --night-1: #16123d;
  --night-2: #221b5c;
  --night-3: #312677;
  --gold: #ffc94a;
  --gold-deep: #d98e0b;
  --gold-ink: #5a3a00;
  --vowel: #ff5a5f;
  --vowel-deep: #b42e37;
  --cons: #4b8dff;
  --cons-deep: #2450b3;
  --sign: #a79fe0;
  --sign-deep: #6b63a8;
  --mint: #3ddc97;
  --mint-deep: #1e9e66;
  --moon: #fbf8ff;
  --ink: #2a2350;
  --muted: rgba(251, 248, 255, 0.72);
  --tile: #fff1cc;
  --tile-edge: #f2b84b;
  --tile-deep: #d9932a;
  --read: 'Andika', 'Nunito', sans-serif;
  --ui: 'Nunito', system-ui, sans-serif;
  --tale: 'Ruslan Display', 'Nunito', serif;
  --top: max(env(safe-area-inset-top, 0px), var(--tg-top, 0px));
  --bottom: max(env(safe-area-inset-bottom, 0px), var(--tg-bottom, 0px));
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--night-1);
  color: var(--moon);
  font-family: var(--ui);
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
}
button { font: inherit; color: inherit; border: none; background: none; padding: 0; cursor: pointer; }
button:focus-visible, a:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
img { -webkit-user-drag: none; user-select: none; }

#sky {
  position: fixed; inset: 0; z-index: 0;
  background:
    radial-gradient(1.6px 1.6px at 12% 6%, #fff 50%, transparent 52%),
    radial-gradient(1.2px 1.2px at 31% 13%, #fff 50%, transparent 52%),
    radial-gradient(2px 2px at 77% 8%, #ffe9b0 50%, transparent 52%),
    radial-gradient(1.2px 1.2px at 90% 21%, #fff 50%, transparent 52%),
    radial-gradient(1.6px 1.6px at 18% 28%, #fff 50%, transparent 52%),
    radial-gradient(1.4px 1.4px at 66% 37%, #fff 50%, transparent 52%),
    radial-gradient(1.8px 1.8px at 94% 55%, #ffe9b0 50%, transparent 52%),
    radial-gradient(1.2px 1.2px at 40% 62%, #fff 50%, transparent 52%),
    radial-gradient(1.4px 1.4px at 8% 81%, #fff 50%, transparent 52%),
    radial-gradient(1.2px 1.2px at 84% 90%, #fff 50%, transparent 52%),
    linear-gradient(180deg, var(--night-1) 0%, var(--night-2) 55%, var(--night-3) 100%);
}
#app { position: fixed; inset: 0; z-index: 1; overflow: hidden; }
#fx { position: fixed; inset: 0; z-index: 50; pointer-events: none; width: 100%; height: 100%; }

.screen {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  animation: screen-in 0.35s ease-out both;
}
@keyframes screen-in { from { opacity: 0; transform: translateY(10px); } }

/* ---------- кнопки ---------- */
.btn-round {
  width: 48px; height: 48px; border-radius: 50%;
  display: grid; place-items: center; flex: none;
  background: rgba(255, 255, 255, 0.12);
  border: 2px solid rgba(255, 255, 255, 0.18);
  transition: transform 0.15s;
}
.btn-round:active { transform: scale(0.9); }
.btn-round svg { width: 24px; height: 24px; }
.btn-gold {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 64px; padding: 0 34px; border-radius: 34px;
  background: var(--gold); color: var(--gold-ink);
  font-weight: 900; font-size: 22px;
  box-shadow: 0 6px 0 var(--gold-deep), 0 10px 26px rgba(255, 201, 74, 0.35);
  transition: transform 0.12s, box-shadow 0.12s;
}
.btn-gold:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--gold-deep); }
.btn-gold svg { width: 28px; height: 28px; }
.btn-next {
  position: absolute; right: 18px; bottom: calc(22px + var(--bottom)); z-index: 6;
  width: 80px; height: 80px; border-radius: 50%;
  background: var(--gold); display: grid; place-items: center;
  box-shadow: 0 6px 0 var(--gold-deep), 0 0 0 8px rgba(255, 201, 74, 0.16), 0 10px 30px rgba(255, 201, 74, 0.45);
  animation: pop-in 0.4s cubic-bezier(.3, 1.6, .5, 1) both, breathe 1.8s 0.6s ease-in-out infinite;
}
.btn-next svg { width: 38px; height: 38px; }
.btn-next:active { transform: translateY(4px) scale(0.96); }
@keyframes pop-in { from { transform: scale(0); } }
@keyframes breathe { 50% { box-shadow: 0 6px 0 var(--gold-deep), 0 0 0 14px rgba(255, 201, 74, 0.1), 0 10px 40px rgba(255, 201, 74, 0.6); } }

/* ---------- живые буквы ---------- */
.ll {
  --c: var(--cons); --cd: var(--cons-deep);
  position: relative; display: inline-grid; place-items: center;
  font-family: var(--read); font-weight: 700; line-height: 1;
  font-size: var(--s, 100px);
  color: var(--c);
}
.ll.v { --c: var(--vowel); --cd: var(--vowel-deep); }
.ll.s { --c: var(--sign); --cd: var(--sign-deep); }
.ll-g {
  text-shadow: 0 0.035em 0 var(--cd), 0 0.08em 0.12em rgba(8, 6, 30, 0.45);
  transition: color 0.4s, text-shadow 0.4s;
}
.ll.outline .ll-g {
  text-shadow:
    0 0.03em 0 var(--cd),
    0.06em 0 0 #fff, -0.06em 0 0 #fff, 0 0.06em 0 #fff, 0 -0.06em 0 #fff,
    0.045em 0.045em 0 #fff, -0.045em 0.045em 0 #fff, 0.045em -0.045em 0 #fff, -0.045em -0.045em 0 #fff,
    0 0.12em 0.12em rgba(8, 6, 30, 0.5);
}
.ll-g { position: relative; z-index: 1; }
/* Глазки выглядывают из-за верхнего края буквы: сама буква всегда видна целиком */
.ll-eyes {
  position: absolute; left: 50%; top: -0.05em; z-index: 0;
  transform: translateX(-50%);
  display: flex; gap: 0.04em; pointer-events: none;
  animation: peek 4s ease-in-out infinite; animation-delay: var(--bob, 0s);
}
@keyframes peek { 0%, 100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, -0.03em); } }
.ll-eyes i {
  display: block; width: max(9px, 0.16em); height: max(10px, 0.18em); border-radius: 50%;
  background: #fff; border: max(2px, 0.016em) solid #1b1640;
  position: relative;
  animation: blink 5s infinite; animation-delay: var(--blink, 0s);
}
.ll-eyes i::after {
  content: ''; position: absolute; left: 50%; top: 40%;
  width: max(4px, 0.075em); height: max(5px, 0.085em); border-radius: 50%;
  background: #1b1640; transform: translate(-50%, -50%);
}
@keyframes blink { 0%, 94%, 100% { transform: scaleY(1); } 97% { transform: scaleY(0.1); } }
.ll.asleep { --c: #5c5491; --cd: #3a3370; }
.ll.asleep .ll-eyes { animation: none; top: -0.02em; }
.ll.tall .ll-eyes { top: -0.24em; }
.ll.tall.asleep .ll-eyes { top: -0.2em; }
.ll.asleep .ll-eyes i {
  height: max(4px, 0.07em); background: none; border: none; border-bottom: max(3px, 0.028em) solid #b9b3e8;
  border-radius: 0 0 0.2em 0.2em; animation: none;
}
.ll.asleep .ll-eyes i::after { display: none; }
.ll.asleep::after {
  content: 'z'; position: absolute; right: -0.14em; top: -0.08em; z-index: 2;
  font-family: var(--ui); font-weight: 900; font-size: 0.22em; color: #b9b3e8;
  animation: zz 2.4s ease-in-out infinite;
}
@keyframes zz { 0% { opacity: 0; transform: translate(0, 0.2em) scale(0.6); } 40% { opacity: 1; } 100% { opacity: 0; transform: translate(0.3em, -0.6em) scale(1.1); } }
.ll.asleep .ll-g { animation: snore 3.2s ease-in-out infinite; }
@keyframes snore { 50% { transform: scale(1.03, 0.97); } }
/* проснувшаяся буква без глаз живёт движением: мягко «дышит» */
.ll.awake:not(.has-eyes) .ll-g { animation: alive 3.6s ease-in-out infinite; animation-delay: var(--bob, 0s); display: inline-block; }
@keyframes alive { 0%, 100% { transform: translateY(0) rotate(0); } 30% { transform: translateY(-0.02em) rotate(-1.5deg); } 60% { transform: translateY(0) rotate(1.5deg); } }
.ll.glow .ll-g { text-shadow: 0 0.035em 0 var(--cd), 0 0 0.3em rgba(255, 201, 74, 0.55), 0 0.08em 0.12em rgba(8, 6, 30, 0.45); }
.ll.wake { animation: wake 0.8s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes wake { 0% { transform: scale(0.9) rotate(-6deg); } 40% { transform: scale(1.18) rotate(5deg); } 100% { transform: none; } }
.ll.jump { animation: jump 0.5s ease; }
@keyframes jump { 40% { transform: translateY(-14%) scale(1.06); } }

/* ---------- картинки-наклейки ---------- */
.pic { display: block; object-fit: contain; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.25)); }
.pic-emoji { display: grid; place-items: center; line-height: 1; }

/* ---------- заставка ---------- */
.splash { background: #211a5b; }
.splash-art { position: absolute; left: 0; right: 0; top: 0; height: 71%; overflow: hidden; container-type: size; }
/* «сцена» в пропорциях картинки, закрывает весь блок (как object-fit: cover, прижата к верху) —
   чтобы анимация (js/shimmer.js) легла ровно поверх картинки */
.splash-stage {
  position: absolute; top: 0; left: 50%; translate: -50% 0;
  width: 100%; width: max(100cqw, 100cqh * 780 / 1170); aspect-ratio: 780 / 1170;
  animation: art-in 1.4s ease-out both;
}
.splash-stage img { width: 100%; height: 100%; display: block; }
@keyframes art-in { from { transform: scale(1.06); opacity: 0; } }
/* живая заставка сменяет заставку без кода из index.html — без повторного появления, чтобы ничего не мигнуло */
.screen.splash.instant, .screen.splash.instant .splash-stage { animation: none; }
.splash-art::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 26%;
  background: linear-gradient(180deg, rgba(33, 26, 91, 0) 0%, rgba(33, 26, 91, 0.8) 60%, #211a5b 100%);
}
.splash-bottom {
  position: absolute; left: 0; right: 0; bottom: 0; top: 64%;
  display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  padding: 0 16px calc(18px + var(--bottom));
}
.splash h1 {
  margin: 0; font-family: var(--tale); font-weight: 400; font-size: clamp(30px, 9vw, 40px); line-height: 1.05;
  color: var(--gold); text-align: center;
  text-shadow: 0 3px 0 #7a4a00, 0 0 24px rgba(255, 201, 74, 0.45);
}
.splash .tagline { margin: 6px 0 0; font-weight: 800; font-size: 16px; color: var(--muted); text-align: center; }
.splash .btn-gold { min-height: 76px; font-size: 26px; padding: 0 40px 0 30px; animation: breathe-btn 2s ease-in-out infinite; }
@keyframes breathe-btn { 50% { transform: scale(1.04); } }
/* место кнопки «Начать»: пока скачивается игра (js/assets.js) — золотая полоска; высота та же, чтобы ничего не прыгало */
.splash-go { width: 100%; min-height: 92px; display: flex; align-items: center; justify-content: center; }
.splash-go [hidden] { display: none !important; }
.splash .btn-gold.pop-in { animation: pop-in 0.5s cubic-bezier(0.3, 1.6, 0.5, 1) both, breathe-btn 2s ease-in-out 0.5s infinite; }
.splash-load { width: min(320px, 86%); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.sl-bar { width: 100%; height: 14px; border-radius: 7px; background: rgba(255, 255, 255, 0.1); overflow: hidden;
  box-shadow: inset 0 0 0 1.5px rgba(255, 201, 74, 0.45); }
.sl-bar i { display: block; height: 100%; width: 0; border-radius: 7px; transition: width 0.35s ease-out;
  background: linear-gradient(90deg, #f5b73b, #ffe08a 60%, #fff3c4); box-shadow: 0 0 14px rgba(255, 201, 74, 0.8); }
.sl-text { display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; }
.sl-text span { color: var(--moon); font-weight: 800; font-size: 16px; }
.sl-text small { color: var(--muted); font-weight: 700; font-size: 13px; min-height: 1.2em; }
.sl-now { margin-top: 2px; padding: 6px 10px; background: none; border: 0; color: var(--gold); font-weight: 800; font-size: 14px; text-decoration: underline; text-underline-offset: 3px; }
.link-parents { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 800; color: rgba(251, 248, 255, 0.6); padding: 8px; }
.link-parents svg { width: 16px; height: 16px; }

/* ---------- карта ---------- */
.topbar {
  position: relative; z-index: 5; flex: none;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 10px;
  padding: calc(10px + var(--top)) 14px 10px;
  background: linear-gradient(180deg, rgba(22, 18, 61, 0.96) 60%, rgba(22, 18, 61, 0));
}
.topbar .group { display: flex; gap: 8px; }
/* звёзды и кнопки разделов — в стиле кружков карты: тёмно-фиолетовый круг, тонкая светлая обводка, «ступенька» тени */
.pill-stars {
  display: flex; align-items: center; gap: 6px; height: 48px; padding: 0 16px 0 10px; border-radius: 24px;
  background: #2a2463; border: 2px solid rgba(255, 255, 255, 0.12); box-shadow: 0 4px 0 #1a1548;
  font-weight: 900; font-size: 20px;
}
.pill-stars svg { width: 24px; height: 24px; }
.pill-stars img { width: 30px; height: 30px; margin-left: -2px; }
/* пробный день: плашка под верхней панелью, по центру, сколько часов осталось (js/screens.js, trialPill) */
.trial-pill {
  position: absolute; top: calc(100% - 6px); left: 50%; transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 15px;
  background: rgba(42, 36, 99, 0.94); border: 1.5px solid rgba(255, 201, 74, 0.55); box-shadow: 0 3px 0 #1a1548;
  color: var(--gold); font-weight: 800; font-size: 13px; white-space: nowrap; -webkit-tap-highlight-color: transparent;
}
.trial-pill svg { width: 15px; height: 15px; }
.trial-pill:active { transform: translateX(-50%) translateY(2px); box-shadow: 0 1px 0 #1a1548; }
/* главные разделы: одинаковые кнопки с подписями, текущий раздел — цветной значок в золотом кольце */
.nav { display: flex; gap: 6px; }
.nav-btn { display: flex; flex-direction: column; align-items: center; gap: 7px; width: 58px; padding: 0; background: none; border: 0; color: inherit; -webkit-tap-highlight-color: transparent; }
.nav-btn .c { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: #2a2463;
  border: 2px solid rgba(255, 255, 255, 0.12); box-shadow: 0 4px 0 #1a1548; transition: transform 0.12s, box-shadow 0.12s; }
.nav-btn img { width: 32px; height: 32px; pointer-events: none; opacity: 0.85; } /* приглушённые, как спящие буквы на карте */
/* подписи — в колонке одинаковой ширины, по центру под кружком, мягким полужирным: между словами всегда есть воздух */
.nav-btn .t { display: block; width: 100%; text-align: center; font-weight: 700; font-size: 10.5px; line-height: 1.1; color: #b9b2e6; white-space: nowrap; }
.nav-btn:active .c { transform: translateY(3px); box-shadow: 0 1px 0 #1a1548; }
/* где ребёнок сейчас — как текущий кружок на карте: золотое кольцо, мягкое свечение, цветной значок */
.nav-btn.on .c { background: radial-gradient(circle at 50% 40%, #3d347f 0%, #2a2366 100%); border: 3px solid var(--gold);
  box-shadow: 0 4px 0 #1a1548, 0 0 18px rgba(255, 201, 74, 0.55); }
.nav-btn.on img { opacity: 1; }
.nav-btn.on .t { color: var(--gold); }
/* стрелка «назад» рядом с панелью — того же вида */
.page-head.with-nav .btn-round { background: #2a2463; border: 2px solid rgba(255, 255, 255, 0.12); box-shadow: 0 4px 0 #1a1548; }
.page-head.with-nav .btn-round:active { transform: translateY(3px); box-shadow: 0 1px 0 #1a1548; }
.page-head.with-nav { flex-wrap: wrap; align-items: flex-start; justify-content: space-between; row-gap: 8px; }
.page-head.with-nav h1 { flex-basis: 100%; }
/* узкие телефоны (до 370 px): кнопки разделов чуть меньше, чтобы панель влезала рядом со звёздами и кнопкой «назад» */
@media (max-width: 370px) {
  .nav { gap: 3px; } .nav-btn { width: 51px; } .nav-btn .c { width: 42px; height: 42px; } .nav-btn img { width: 28px; height: 28px; } .nav-btn .t { font-size: 9.5px; }
  .topbar { padding-left: 10px; padding-right: 10px; gap: 6px; } .pill-stars { padding: 0 10px 0 8px; }
  .page-head.with-nav { padding-left: 10px; padding-right: 10px; gap: 8px; }
}
.map-scroll { flex: 1; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; padding-bottom: calc(60px + var(--bottom)); }
.chapter { position: relative; padding: 6px 16px 10px; }
.chapter-banner {
  position: relative; height: 190px; border-radius: 26px; overflow: hidden;
  border: 2px solid rgba(255, 201, 74, 0.35); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  background: var(--night-2);
}
.chapter-banner img { width: 100%; height: 100%; object-fit: cover; display: block; }
.chapter-banner .cap {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 44px 18px 14px;
  background: linear-gradient(180deg, rgba(22, 18, 61, 0) 0%, rgba(22, 18, 61, 0.88) 70%);
}
.chapter-banner .eyebrow { font-size: 13px; font-weight: 900; letter-spacing: 0.08em; text-transform: uppercase; color: var(--gold); }
.chapter-banner h2 { margin: 2px 0 0; font-family: var(--tale); font-weight: 400; font-size: 28px; line-height: 1.1; }
.chapter.locked .chapter-banner img { filter: grayscale(0.5) brightness(0.55); }
.chapter.locked .chapter-banner .eyebrow::before { content: '🔒 '; }
.trail { position: relative; }
.trail svg.path { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.node {
  position: absolute; width: 84px; height: 84px; margin: -42px 0 0 -42px; border-radius: 50%;
  display: grid; place-items: center;
  background: #2a2463; border: 3px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 6px 0 #1a1548;
  transition: transform 0.15s;
}
.node:active { transform: scale(0.92); }
.node.done {
  border: none;
  background: radial-gradient(circle at 50% 40%, #fff3c9 0%, var(--gold) 60%, #e79a10 100%);
  box-shadow: 0 6px 0 #b9740a, 0 0 26px rgba(255, 201, 74, 0.55);
}
.node.current {
  background: radial-gradient(circle at 50% 40%, #3d347f 0%, #2a2366 100%);
  border: 4px solid var(--gold);
  animation: node-pulse 1.8s ease-in-out infinite;
}
@keyframes node-pulse {
  0%, 100% { box-shadow: 0 0 0 8px rgba(255, 201, 74, 0.18), 0 0 30px rgba(255, 201, 74, 0.6); }
  50% { box-shadow: 0 0 0 16px rgba(255, 201, 74, 0.08), 0 0 44px rgba(255, 201, 74, 0.85); }
}
.node.locked { opacity: 0.75; }
.node .icon svg { width: 34px; height: 34px; }
.node.done .icon svg { color: #7a4a00; }
.node.locked .icon svg { color: rgba(255, 255, 255, 0.35); }
.node.current .icon svg { color: var(--gold); }
.node .stars { position: absolute; top: 88px; left: 50%; transform: translateX(-50%); display: flex; gap: 1px; }
.node .stars svg { width: 16px; height: 16px; }
.node .word { font-family: var(--read); font-weight: 700; font-size: 24px; color: #7a4a00; }
.node.shake { animation: shake 0.45s; }
.map-ugu {
  position: absolute; width: 112px; pointer-events: none; z-index: 2;
  filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.4));
  animation: bob 2.6s ease-in-out infinite;
}
.map-ugu.mirror { transform: scaleX(-1); animation-name: bob-flip; }
@keyframes bob { 50% { transform: translateY(-6px) rotate(-2deg); } }
@keyframes bob-flip { 0%, 100% { transform: scaleX(-1); } 50% { transform: scaleX(-1) translateY(-6px) rotate(-2deg); } }
.map-end { text-align: center; padding: 30px 20px 10px; color: var(--muted); font-weight: 800; }

/* ---------- урок ---------- */
.lesson-top {
  position: relative; z-index: 5; flex: none;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: calc(12px + var(--top)) 14px 6px;
}
.dots { display: flex; gap: 9px; align-items: center; }
.dots i {
  display: block; width: 12px; height: 12px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.18); transition: all 0.3s;
}
.dots i.done { background: var(--gold); box-shadow: 0 0 10px rgba(255, 201, 74, 0.8); }
.dots i.now { width: 16px; height: 16px; background: #ffe29a; box-shadow: 0 0 14px rgba(255, 201, 74, 0.9); }
.stage { position: relative; flex: 1; min-height: 0; overflow: hidden; }
.ugu-corner {
  position: absolute; left: 6px; bottom: calc(10px + var(--bottom)); z-index: 6;
  display: flex; align-items: flex-end; gap: 2px; max-width: calc(100% - 110px);
  pointer-events: none;
}
.ugu-corner img { width: 96px; flex: none; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.35)); transition: transform 0.3s; }
.ugu-corner img.hop { animation: jump 0.5s ease; }
.bubble-say {
  margin-bottom: 58px; background: var(--moon); color: var(--ink);
  border-radius: 20px 20px 20px 6px; padding: 9px 13px;
  font-weight: 800; font-size: 15px; line-height: 1.3;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
  transform-origin: 0 100%; transition: opacity 0.3s, transform 0.3s;
}
.bubble-say.hidden { opacity: 0; transform: scale(0.7); }

/* общие элементы игр */
.game { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; padding: 8px 16px calc(120px + var(--bottom)); }
.game-title { display: flex; align-items: center; gap: 10px; background: rgba(255, 255, 255, 0.1); border-radius: 26px; padding: 6px 18px 6px 14px; font-weight: 900; font-size: 18px; }
.card {
  background: var(--moon); color: var(--ink); border-radius: 28px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.3);
}
.shake { animation: shake 0.45s; }
@keyframes shake { 20% { transform: translateX(-10px) rotate(-3deg); } 40% { transform: translateX(9px) rotate(3deg); } 60% { transform: translateX(-6px); } 80% { transform: translateX(4px); } }
.right { animation: right 0.6s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes right { 40% { transform: scale(1.12); } }
.ok-ring { outline: 4px solid var(--mint); box-shadow: 0 0 26px rgba(61, 220, 151, 0.6) !important; }
.hint-pulse { animation: hint 1s ease-in-out infinite; }
@keyframes hint { 50% { transform: scale(1.08); box-shadow: 0 0 0 6px rgba(255, 201, 74, 0.5); } }

/* знакомство */
.intro-letter { position: relative; display: flex; align-items: flex-end; gap: 4px; margin-top: 4vh; }
.intro-letter .lower { font-family: var(--read); font-weight: 700; font-size: 0.52em; color: var(--c); opacity: 0.85; margin-bottom: 0.1em; }
.intro-card { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 12px 18px; margin-top: 4vh; max-width: 100%; transition: transform 0.5s cubic-bezier(.3, 1.4, .5, 1), opacity 0.4s; }
.intro-card.hidden { opacity: 0; transform: translateY(40px) scale(0.8); pointer-events: none; }
.intro-card .pic { width: 104px; height: 104px; }
.word-big { font-family: var(--read); font-weight: 700; font-size: clamp(30px, 10vw, 44px); letter-spacing: 0.02em; color: var(--ink); white-space: nowrap; }
.word-big .hl { color: var(--hl, var(--cons)); }
.tap-hint { position: absolute; width: 56px; height: 56px; pointer-events: none; animation: tap 1.4s ease-in-out infinite; z-index: 4; }
@keyframes tap { 0%, 100% { transform: translate(0, 0) scale(1); } 50% { transform: translate(6px, 8px) scale(0.92); } }

/* обведи */
.trace-wrap { position: relative; margin-top: 2vh; border-radius: 30px; background: rgba(255, 255, 255, 0.06); border: 2px dashed rgba(255, 255, 255, 0.18); touch-action: none; }
.trace-wrap canvas { display: block; width: 100%; height: 100%; touch-action: none; }
.trace-meter { margin-top: 12px; width: min(260px, 70%); height: 12px; border-radius: 6px; background: rgba(255, 255, 255, 0.12); overflow: hidden; }
.trace-meter i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--gold), #ffe29a); border-radius: 6px; transition: width 0.2s; }

/* шарики */
.bubbles-area { position: absolute; inset: 64px 0 0; overflow: hidden; touch-action: manipulation; }
.bub {
  position: absolute; left: 0; top: 0; border-radius: 50%;
  display: grid; place-items: center;
  border: 3px solid rgba(255, 255, 255, 0.55);
  background: radial-gradient(circle at 34% 28%, rgba(255, 255, 255, 0.8) 0 7%, rgba(170, 205, 255, 0.2) 28%, rgba(120, 150, 255, 0.1) 70%);
  box-shadow: inset 0 -6px 16px rgba(120, 160, 255, 0.25), 0 0 18px rgba(140, 170, 255, 0.25);
  font-family: var(--read); font-weight: 700;
  will-change: transform;
}
.bub span { text-shadow: 0 3px 0 var(--cd); color: var(--c); }
.bub.pop { animation: bub-pop 0.35s ease-out forwards; pointer-events: none; }
@keyframes bub-pop { to { opacity: 0; transform: var(--t) scale(1.6); } }
.bub.wobble span { display: inline-block; animation: shake 0.45s; }
.counter { display: flex; gap: 6px; margin-top: 6px; }
.counter i { width: 14px; height: 14px; border-radius: 50%; background: rgba(255, 255, 255, 0.18); transition: all 0.3s; }
.counter i.on { background: var(--gold); box-shadow: 0 0 10px rgba(255, 201, 74, 0.9); }

/* выбор (на слух, картинки) */
.ear-btn {
  width: 96px; height: 96px; border-radius: 50%; display: grid; place-items: center; margin-top: 3vh;
  background: rgba(255, 255, 255, 0.12); border: 3px solid rgba(255, 201, 74, 0.6);
  box-shadow: 0 0 30px rgba(255, 201, 74, 0.3);
}
.ear-btn svg { width: 46px; height: 46px; color: var(--gold); }
.ear-btn.playing { animation: hint 0.8s ease-in-out infinite; }
.choices { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin-top: 5vh; }
.choice {
  min-width: 100px; height: 120px; padding: 0 12px; border-radius: 28px;
  background: var(--moon); display: grid; place-items: center;
  box-shadow: 0 8px 0 #cfc8ea, 0 12px 24px rgba(0, 0, 0, 0.3);
  transition: transform 0.12s;
}
.choice:active { transform: translateY(4px); }
.choice .syl { font-family: var(--read); font-weight: 700; font-size: 46px; }
.choice.pic-choice { width: 104px; padding: 8px; }
.choice.pic-choice .pic { width: 86px; height: 86px; }
.choice.ok-ring { position: relative; }
.choice .check { position: absolute; right: -8px; top: -8px; width: 34px; height: 34px; border-radius: 50%; background: var(--mint); display: grid; place-items: center; animation: pop-in 0.3s both; }
.choice .check svg { width: 20px; height: 20px; color: #0e3b27; }
/* «Похожие слова»: слово сверху, картинки снизу; после ответа под картинками их слова, отличная буква — золотом */
.tw-word { padding: 14px 18px 8px; margin-top: 3vh; }
.tw-choices { margin-top: 6vh; row-gap: 46px; }
.tw-choices .choice { position: relative; overflow: visible; }
.tw-label { position: absolute; left: -10px; right: -10px; top: calc(100% + 6px); text-align: center; font-family: var(--read); font-weight: 700; font-size: 22px; color: #fbf8ff; animation: pop-in 0.35s both; }
.tw-label .d { color: var(--gold); text-shadow: 0 0 10px rgba(255, 201, 74, 0.8); }
.reading .lt.diff { animation: tw-diff 0.9s ease-in-out infinite; }
/* «Где спрятался звук»: буква сверху, картинка, слово (после ответа), три «вагончика» — начало, середина, конец */
.wh-game { gap: 10px; padding-bottom: calc(160px + var(--bottom)); } /* вагончики выше облачка Угу */
.wh-target { display: grid; place-items: center; margin-top: 1vh; }
.wh-pic { width: min(46vw, 180px); aspect-ratio: 1; padding: 0; border-radius: 28px; display: grid; place-items: center;
  background: radial-gradient(circle at 50% 35%, #fffdf6 0%, #fbeccb 100%); border: 3px solid #e8c98a; box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35); }
.wh-pic .pic { width: 84%; height: 84%; object-fit: contain; }
.wh-caption { min-height: 42px; font-family: var(--read); font-weight: 700; font-size: 32px; line-height: 42px; color: #fbf8ff; letter-spacing: 0.04em; }
.wh-caption .on { color: var(--gold); text-shadow: 0 0 12px rgba(255, 201, 74, 0.9); }
.wh-track { position: relative; display: flex; gap: 8px; width: min(330px, 94%); margin-top: auto; }
.wh-track::after { content: ""; position: absolute; left: 8%; right: 4%; bottom: -14px; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, 0.35); } /* рельсы: слово идёт слева направо */
.wh-box { flex: 1; height: 72px; border-radius: 14px; background: rgba(255, 255, 255, 0.1); border: 3px solid rgba(255, 255, 255, 0.4);
  display: grid; place-items: center; font-family: var(--read); font-weight: 700; font-size: 44px; transition: background 0.2s, border-color 0.2s; }
.wh-box:first-child { border-radius: 32px 14px 14px 32px; }
.wh-box:last-child { border-radius: 14px 32px 32px 14px; }
.wh-box.lit { background: rgba(255, 226, 140, 0.4); border-color: var(--gold); }
.wh-box.ok { background: #fbf8ff; border-color: var(--mint); box-shadow: 0 0 0 3px var(--mint), 0 0 22px rgba(61, 220, 151, 0.7); }
.wh-box.hint { animation: hint 1s ease-in-out infinite; border-color: var(--gold); }
/* «Дорожка по буквам»: поле камешков, герой внизу, цель наверху */
.pt-game { gap: 12px; padding-bottom: calc(150px + var(--bottom)); }
.pt-head { margin-top: 1vh; }
.pt-wrap { --cell: 70px; --gap: 10px; position: relative; padding: calc(var(--cell) + var(--gap)) 0; }
.pt-board { display: grid; grid-template-columns: repeat(4, var(--cell)); gap: var(--gap); }
.pt-stone {
  width: var(--cell); height: var(--cell); padding: 0; display: grid; place-items: center;
  border-radius: 46% 54% 50% 50% / 55% 50% 50% 45%; font-family: var(--read); font-weight: 700; font-size: calc(var(--cell) * 0.5); line-height: 1;
  background: radial-gradient(circle at 40% 32%, #fffaf0 0%, #eadfc8 60%, #cdbb98 100%);
  box-shadow: 0 5px 0 rgba(60, 45, 20, 0.55), 0 10px 16px rgba(0, 0, 0, 0.3);
  animation: pt-in 0.4s var(--d, 0s) cubic-bezier(.3, 1.5, .5, 1) both; transition: transform 0.15s, box-shadow 0.25s, background 0.25s;
}
@keyframes pt-in { from { transform: scale(0.4); opacity: 0; } }
.pt-stone:active { transform: translateY(3px); }
.pt-stone.step { background: radial-gradient(circle at 40% 32%, #fff6d1 0%, #ffd66e 70%, #e8a92a 100%); box-shadow: 0 0 0 3px var(--gold), 0 0 22px rgba(255, 201, 74, 0.85); }
.pt-stone.nope { animation: shake 0.45s; }
.pt-stone.hint { animation: hint 1s ease-in-out infinite; box-shadow: 0 0 0 4px var(--gold), 0 0 24px rgba(255, 201, 74, 0.9); }
.pt-hero, .pt-goal { position: absolute; left: 0; top: 0; width: var(--cell); height: var(--cell); pointer-events: none; z-index: 2;
  transition: transform 0.35s cubic-bezier(.3, 1.4, .5, 1); }
.pt-hero .pic, .pt-goal .pic { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 6px 6px rgba(0, 0, 0, 0.45)); }
.pt-hero.hop .pic { animation: jump 0.4s ease; }
.pt-goal { z-index: 1; }
.pt-goal .pic { animation: mb-aura 2.4s ease-in-out infinite; }
.pt-goal.got .pic { animation: pop-in 0.5s cubic-bezier(.3, 1.6, .5, 1) both; }
@keyframes tw-diff { 50% { color: #e0a100; text-shadow: 0 0 14px rgba(255, 201, 74, 0.95); } }

/* слова с дужками */
.reading { display: flex; justify-content: center; gap: 0.18em; margin-top: 4vh; font-family: var(--read); font-weight: 700; font-size: clamp(44px, 15vw, 72px); line-height: 1; flex-wrap: wrap; }
.syl-block { display: flex; flex-direction: column; align-items: center; }
.syl-block svg { width: 100%; height: 0.22em; margin-top: 0.06em; }
.syl-block.sounding { animation: right 0.5s; }
.syl-block.sounding .lt { text-shadow: 0 0 0.25em rgba(255, 201, 74, 0.9); }
.lt.v { color: var(--vowel); } .lt.c { color: var(--cons); } .lt.s { color: var(--sign); }
.on-card .lt.v { color: #e23d44; } .on-card .lt.c { color: #2f6fe4; }

/* горка слогов */
.slide-area { position: absolute; inset: 0 0 calc(230px + var(--bottom)); }
.slide-area svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.slide-letter { position: absolute; left: 0; top: 0; transform: translate(-50%, -50%); touch-action: none; z-index: 3; cursor: grab; }
.slide-letter .ll { --s: 84px; }
.slide-home {
  position: absolute; transform: translate(-50%, -50%); width: 104px; height: 104px; border-radius: 50%;
  display: grid; place-items: center; z-index: 2;
  background: rgba(255, 90, 95, 0.14); border: 3px solid rgba(255, 90, 95, 0.5);
}
.slide-home.c { background: rgba(75, 141, 255, 0.14); border-color: rgba(75, 141, 255, 0.5); }
.slide-home .ll { --s: 66px; }
.slide-home.merged { background: var(--moon); border: none; box-shadow: 0 0 30px rgba(255, 201, 74, 0.7); width: auto; height: auto; padding: 8px 16px 4px; border-radius: 22px; animation: right 0.6s; }
.syl-card { display: inline-flex; flex-direction: column; align-items: center; padding: 6px 14px 8px; border-radius: 20px; background: var(--moon); box-shadow: 0 0 22px rgba(255, 201, 74, 0.5); font-family: var(--read); font-weight: 700; font-size: 40px; line-height: 1; }
.syl-card svg { width: 64px; height: 12px; }
.syl-row { position: absolute; left: 0; right: 0; bottom: calc(150px + var(--bottom)); display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; padding: 0 12px; z-index: 4; }
/* четыре слога (обратный и прямой через один) — карточки поменьше и в одну строку, чтобы не налезать на дорожку */
.syl-row.many { gap: 8px; }
.syl-row.many .syl-card { font-size: 32px; padding: 5px 10px 7px; border-radius: 16px; }
.syl-row.many .syl-card svg { width: 50px; height: 10px; }
/* «Гласная или согласная»: буква посередине, внизу красный поющий и синий тихий домики */
.vc-game { justify-content: space-evenly; gap: 10px; padding: 16px 12px calc(205px + var(--bottom)); } /* снизу место облачку Угу */
.vc-letter { margin-top: 0; display: grid; place-items: center; width: 150px; height: 150px; border-radius: 50%;
  background: radial-gradient(circle at 50% 40%, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.04)); box-shadow: 0 0 40px rgba(255, 201, 74, 0.25); }
.vc-letter.in { animation: pt-in 0.4s cubic-bezier(.3, 1.5, .5, 1); }
.vc-letter.fly { transition: transform 0.5s cubic-bezier(.5, -0.2, .7, 1), opacity 0.5s; transform: translate(var(--dx), var(--dy)) scale(0.25); opacity: 0.2; }
.vc-homes { display: flex; gap: 12px; width: min(100%, 380px); }
.vc-home { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.vc-house { position: relative; width: 100%; padding: 0; background: none; border: 0; display: flex; flex-direction: column; align-items: center; transition: transform 0.15s; -webkit-tap-highlight-color: transparent; }
.vc-house:active { transform: scale(0.96); }
.vc-img { width: 100%; max-width: 165px; aspect-ratio: 0.85; object-fit: contain; filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.35)); pointer-events: none; }
.vc-house.nope { animation: shake 0.45s; }
.vc-house.got { animation: jump 0.45s ease; }
.vc-house.hint .vc-img { animation: hint 1s ease-in-out infinite; filter: drop-shadow(0 0 16px rgba(255, 201, 74, 0.95)); }
.vc-shelf { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; min-height: 30px; }
.vc-mini { font-family: var(--read); font-weight: 700; font-size: 24px; line-height: 1; padding: 2px 6px; border-radius: 8px; background: var(--moon); animation: pt-in 0.35s; }
.vc-mini.v { color: var(--vowel); } .vc-mini.c { color: var(--cons); }
/* «Один — много»: одна картинка или три, слова отличаются концом — он светится */
.pl-game { gap: 16px; padding-top: 14px; }
.pl-cards { display: flex; gap: 16px; margin-top: 6vh; }
.choice.pl-card { width: 140px; height: 140px; padding: 0; position: relative; }
/* «Где банты?»: после ответа слово появляется под своей картинкой; место под него оставлено заранее, без скачков */
.pl-col { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.card.pl-cap { display: grid; place-items: center; min-width: 124px; min-height: 60px; padding: 6px 12px 2px;
  opacity: 0; transform: translateY(8px); transition: opacity 0.3s, transform 0.3s; }
.card.pl-cap.on { opacity: 1; transform: none; }
.pl-cap .reading { margin: 0; font-size: clamp(26px, 7.4vw, 36px); }
.pl-one { display: grid; place-items: center; } .pl-one .pic { width: 104px; height: 104px; }
.pl-one.big .pic { width: 150px; height: 150px; } .pl-one.small .pic { width: 70px; height: 70px; }
.pl-many { position: relative; width: 124px; height: 124px; }
.pl-many .pic { position: absolute; width: 66px; height: 66px; }
.pl-many .pic:nth-child(1) { left: 0; top: 6px; } .pl-many .pic:nth-child(2) { right: 0; top: 12px; } .pl-many .pic:nth-child(3) { left: 28px; bottom: 0; width: 70px; height: 70px; }
.pl-many.big { width: 190px; height: 170px; } .pl-many.big .pic { width: 96px; height: 96px; } .pl-many.big .pic:nth-child(3) { left: 46px; width: 100px; height: 100px; }
.card.pl-big { padding: 10px 14px; margin-top: 2vh; display: grid; place-items: center; min-height: 190px; min-width: 200px; }
.pl-words { display: flex; gap: 14px; margin-top: 2vh; }
.choice.pl-wordbtn { height: auto; padding: 10px 14px 6px; }
.choice.pl-wordbtn .reading { margin: 0; font-size: clamp(34px, 10vw, 46px); }
.pl-top { display: flex; align-items: center; gap: 10px; margin-top: 2vh; }
.pl-top .card { padding: 8px; display: grid; place-items: center; }
.pl-top .card.pl-one { width: 92px; height: 92px; }
.pl-top .pl-many { width: 104px; height: 100px; } .pl-top .pl-many .pic { width: 56px; height: 56px; } .pl-top .pl-many .pic:nth-child(3) { left: 22px; width: 60px; height: 60px; }
.pl-arrow { color: var(--gold); font-weight: 900; font-size: 32px; }
.card.pl-make { padding: 10px 20px 6px; }
.card.pl-make .reading { margin: 0; }
.pl-slot { display: inline-block; min-width: 0.7em; height: 0.95em; margin-left: 0.04em; border: 3px dashed var(--gold); border-radius: 10px; vertical-align: -0.08em; }
.pl-slot.full { border-color: transparent; animation: right 0.5s; }
.pl-tiles { display: flex; gap: 12px; }
.choice.pl-tile { min-width: 74px; width: 74px; height: 84px; font-family: var(--read); font-weight: 700; font-size: 48px; }
.choice.pl-tile .lt.v { color: #e23d44; } .choice.pl-tile .lt.c { color: #2f6fe4; }
.pl-gone { opacity: 0.25; transform: scale(0.9); }
.pl-pair { display: flex; align-items: center; gap: 10px; padding: 8px 16px 4px; opacity: 0; transform: translateY(10px); transition: opacity 0.3s, transform 0.3s; margin-top: 2vh; }
.pl-pair.on { opacity: 1; transform: none; }
.pl-pair .reading { margin: 0; font-size: clamp(30px, 9vw, 40px); }
.pl-dash { color: #8a83b0; font-weight: 900; font-size: 26px; }
.lt.pl-end { border-radius: 8px; background: rgba(255, 201, 74, 0.4); box-shadow: 0 0 0 3px var(--gold); }

/* «Твёрдый или мягкий»: синий квадрат — твёрдый звук, зелёный — мягкий (как в тетради к букварю) */
.sh-game { gap: 10px; padding-bottom: calc(190px + var(--bottom)); } /* квадраты выше облачка Угу */
.sh-pic { margin-top: 2vh; }
.sh-boxes { display: flex; gap: 24px; margin-top: auto; }
.sh-box { width: 96px; height: 96px; padding: 0; border-radius: 22px; display: grid; place-items: center; font-family: var(--read); font-weight: 700; font-size: 54px; line-height: 1; color: #fff;
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.3); transition: transform 0.15s, box-shadow 0.25s; }
.sh-box.hard { background: linear-gradient(180deg, #5e9bff 0%, #2f6fe4 100%); }
.sh-box.soft { background: linear-gradient(180deg, #4fe3a3 0%, #1fb877 100%); }
.sh-box:active { transform: translateY(3px); }
.sh-box.lit { transform: scale(1.12); box-shadow: 0 0 0 4px #fff, 0 0 28px rgba(255, 255, 255, 0.85); }
.sh-box.ok { box-shadow: 0 0 0 4px var(--gold), 0 0 26px rgba(255, 201, 74, 0.9); }
.sh-box.hint { animation: hint 1s ease-in-out infinite; }
.wh-caption .sh-h { color: #5e9bff; } .wh-caption .sh-s { color: #3ddc97; }
/* «Читаем вместе»: картинка, три слога (их читает ребёнок) и продолжение (читает Угу) */
.ch-game { justify-content: center; gap: 18px; padding-bottom: calc(160px + var(--bottom)); }
.ch-pic { width: min(40vw, 150px); aspect-ratio: 1; opacity: 0; transform: scale(0.6); transition: opacity 0.35s, transform 0.45s cubic-bezier(.3, 1.6, .5, 1); }
.ch-pic.show { opacity: 1; transform: none; }
.ch-pic .pic { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.4)); }
.ch-line { display: flex; align-items: center; justify-content: center; gap: 6px; }
.ch-chip { min-width: 82px; height: 78px; padding: 0 10px; border-radius: 20px; display: flex; align-items: center; justify-content: center; background: var(--moon);
  font-family: var(--read); font-weight: 700; font-size: 38px; line-height: 1; box-shadow: 0 6px 0 rgba(0, 0, 0, 0.25); transition: transform 0.15s, box-shadow 0.25s; }
.ch-chip.next { animation: hint 1s ease-in-out infinite; box-shadow: 0 0 0 4px var(--gold), 0 0 22px rgba(255, 201, 74, 0.8); }
.ch-chip.read { box-shadow: 0 0 0 4px var(--gold), 0 0 26px rgba(255, 201, 74, 0.9); transform: translateY(-3px); }
.ch-dash { color: rgba(255, 255, 255, 0.6); font-size: 30px; font-weight: 900; }
.ch-rest { max-width: 330px; text-align: center; font-family: var(--read); font-weight: 700; font-size: 28px; line-height: 1.25; color: rgba(251, 248, 255, 0.45); transition: color 0.3s, text-shadow 0.3s; }
.ch-rest.on { color: #fbf8ff; text-shadow: 0 0 14px rgba(255, 201, 74, 0.7); }
/* «Волшебная раскраска»: большая яблоня, на ней серые яблоки с буквами — нужные краснеют */
.pa-game { gap: 6px; padding-bottom: calc(140px + var(--bottom)); }
.pa-board { --S: min(460px, calc(100vw - 2px), calc(100dvh - 275px)); position: relative; width: var(--S); height: var(--S); flex: none; }
.pa-tree { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; filter: saturate(0.8); transition: filter 0.8s; pointer-events: none; }
.pa-board.done .pa-tree { filter: saturate(1.15); }
.pa-obj { position: absolute; width: 20%; aspect-ratio: 1; padding: 0; background: none; border: 0; transform: translate(-50%, -50%); animation: pa-in 0.4s var(--d, 0s) both; -webkit-tap-highlight-color: transparent; }
.pa-pic { width: 100%; height: 100%; object-fit: contain; filter: grayscale(1) brightness(1.5) contrast(0.7); transition: filter 0.5s; pointer-events: none; }
.pa-lt { position: absolute; left: 50%; top: 56%; width: 46%; height: 46%; transform: translate(-50%, -50%); border-radius: 50%; display: grid; place-items: center;
  background: rgba(255, 255, 255, 0.92); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25); font-family: var(--read); font-weight: 700; font-size: calc(var(--S) / 17); line-height: 1; transition: background 0.35s, color 0.35s, box-shadow 0.35s; pointer-events: none; }
.pa-lt.v { color: #e5484d; } .pa-lt.c { color: #3a6fd8; }
.pa-obj.on { animation: pa-pop 0.5s; z-index: 2; }
.pa-obj.on .pa-pic { filter: none; }
.pa-obj.on .pa-lt { background: none; box-shadow: none; color: #fff; text-shadow: 0 2px 4px rgba(120, 0, 0, 0.6); }
.pa-obj.nope { animation: pa-nope 0.45s; }
.pa-obj.nope .pa-lt { background: #ffe1e1; }
.pa-obj.hint .pa-lt { animation: hint 1s ease-in-out infinite; box-shadow: 0 0 0 3px var(--gold), 0 0 14px rgba(255, 201, 74, 0.9); }
.pa-board.done .pa-obj:not(.on) { animation: pa-fall 0.8s ease-in forwards; pointer-events: none; }
.pa-board.done .pa-obj.on { animation: pa-dance 0.9s ease-in-out 2; }
.pa-drop { position: absolute; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; pointer-events: none; z-index: 3; background: #ff4d4d;
  box-shadow: inset -2px -2px 0 rgba(0, 0, 0, 0.15); animation: pa-drop 0.6s ease-out forwards; }
@keyframes pa-drop { from { transform: translate(0, 0) scale(var(--s)); opacity: 1; } to { transform: translate(var(--dx), var(--dy)) scale(0); opacity: 0.6; } }
@keyframes pa-in { from { transform: translate(-50%, -50%) scale(0.3); opacity: 0; } }
@keyframes pa-pop { 40% { transform: translate(-50%, -50%) scale(1.3); } }
@keyframes pa-nope { 20% { transform: translate(calc(-50% - 9px), -50%) rotate(-5deg); } 50% { transform: translate(calc(-50% + 8px), -50%) rotate(5deg); } 80% { transform: translate(calc(-50% - 4px), -50%); } }
@keyframes pa-fall { to { transform: translate(-50%, calc(-50% + 260px)) rotate(40deg); opacity: 0; } }
@keyframes pa-dance { 50% { transform: translate(-50%, calc(-50% - 9px)) rotate(6deg); } }
/* «Найди букву в стишке»: стишок крупно, найденные буквы золотые, огоньки наверху — сколько осталось */
.pm-game { justify-content: center; gap: 18px; padding-bottom: calc(150px + var(--bottom)); }
.pm-text { display: flex; flex-direction: column; gap: 14px; align-items: center; max-width: 340px; }
.pm-line { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 12px; }
.pm-word { display: inline-flex; font-family: var(--read); font-weight: 700; font-size: 32px; line-height: 1.45; color: var(--moon); }
.pm-ch { display: inline-block; border-radius: 8px; padding: 2px 3px; transition: color 0.25s, background 0.25s, transform 0.25s; }
.pm-ch.lt { cursor: pointer; }
.pm-ch.found { color: var(--gold-ink); background: var(--gold); transform: scale(1.12); box-shadow: 0 0 14px rgba(255, 201, 74, 0.8); }
.pm-ch.nope { animation: shake 0.45s; color: var(--vowel); }
.pm-ch.hint { animation: hint 1s ease-in-out infinite; box-shadow: 0 0 0 3px var(--gold), 0 0 14px rgba(255, 201, 74, 0.9); }
.pm-dots { display: flex; gap: 5px; margin-top: 5px; }
.pm-dot { width: 9px; height: 9px; border-radius: 50%; background: rgba(251, 248, 255, 0.25); transition: background 0.3s, box-shadow 0.3s; }
.pm-dot.on { background: var(--gold); box-shadow: 0 0 8px rgba(255, 201, 74, 0.9); }
.syl-row .ghost { background: transparent; box-shadow: none; border: 3px dashed rgba(255, 255, 255, 0.25); color: rgba(255, 255, 255, 0.3); }
.syl-row .ghost .lt { color: rgba(255, 255, 255, 0.3) !important; }

/* собери слово */
.build-pic { width: min(200px, 46vw); height: min(200px, 46vw); border-radius: 36px; display: grid; place-items: center; margin-top: 1vh; }
.build-pic .pic { width: 82%; height: 82%; }
.slots { display: flex; gap: 8px; margin-top: 3vh; flex-wrap: wrap; justify-content: center; }
.slot { min-width: 72px; height: 78px; padding: 0 12px; border-radius: 22px; border: 3px dashed rgba(255, 255, 255, 0.4); background: rgba(255, 255, 255, 0.05); display: grid; place-items: center; }
.slot.filled { border: 3px solid var(--mint); background: var(--tile); box-shadow: 0 0 18px rgba(61, 220, 151, 0.45); }
.tiles { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; margin-top: 4vh; max-width: 360px; }
.tile {
  min-width: 76px; height: 74px; padding: 0 14px; border-radius: 22px;
  background: var(--tile); border: 3px solid var(--tile-edge); box-shadow: 0 6px 0 var(--tile-deep);
  display: grid; place-items: center; touch-action: none;
  font-family: var(--read); font-weight: 700; font-size: 38px; color: var(--ink);
  transition: transform 0.15s;
}
.tile.dragging { z-index: 20; box-shadow: 0 16px 30px rgba(0, 0, 0, 0.35); transition: none; }
.tile.used { visibility: hidden; }
.slot .tile-text { font-family: var(--read); font-weight: 700; font-size: 38px; color: var(--ink); }
.word-done { animation: right 0.6s; }
/* собранное слово читается по слогам: звучащий слог приподнимается и светится */
.slot.sounding { transform: translateY(-6px); border-color: var(--gold, #ffc94a); box-shadow: 0 0 22px rgba(255, 201, 74, 0.75); transition: transform 0.15s, box-shadow 0.15s; }
.mb-slot.sounding { transform: translateY(-5px); border-color: #e0a83a; background: #fff3c9; box-shadow: 0 0 16px rgba(255, 190, 60, 0.9); transition: transform 0.15s, box-shadow 0.15s; }

/* корзинка */
.basket-items { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 2vh; width: min(360px, 100%); }
.basket-item { aspect-ratio: 1; border-radius: 24px; background: rgba(255, 255, 255, 0.08); display: grid; place-items: center; touch-action: none; transition: transform 0.15s, opacity 0.3s; }
.basket-item .pic { width: 82%; height: 82%; }
.basket-item.selected { background: rgba(255, 201, 74, 0.25); outline: 3px solid var(--gold); }
.basket-item.gone { opacity: 0; transform: scale(0.3); pointer-events: none; }
.basket-item.dragging { z-index: 20; transition: none; }
.basket {
  position: relative; margin-top: auto; width: 190px; height: 132px; display: grid; place-items: center;
}
.basket svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.basket .ll { --s: 64px; position: relative; top: 14px; }
.basket.hit { animation: right 0.5s; }

/* найди пару */
.pairs-grid { display: grid; grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); gap: 12px; margin-top: 3vh; width: min(380px, 100%); perspective: 800px; }
.flip { aspect-ratio: 3 / 4; position: relative; transform-style: preserve-3d; transition: transform 0.45s; }
.flip.open { transform: rotateY(180deg); }
.flip .face { position: absolute; inset: 0; border-radius: 20px; backface-visibility: hidden; display: grid; place-items: center; }
.flip .back { background: radial-gradient(circle at 50% 40%, #4a3f9a 0%, #2a2366 100%); border: 3px solid rgba(255, 201, 74, 0.5); }
.flip .back svg { width: 40%; color: var(--gold); opacity: 0.8; }
.flip .front { background: var(--moon); transform: rotateY(180deg); font-family: var(--read); font-weight: 700; font-size: clamp(44px, 13vw, 60px); }
.flip.matched .front { box-shadow: 0 0 0 4px var(--mint), 0 0 22px rgba(61, 220, 151, 0.6); }

/* предложение и сказка */
.sentence { padding: 16px 18px; margin-top: 3vh; font-family: var(--read); font-weight: 700; font-size: clamp(28px, 8.5vw, 38px); line-height: 1.4; text-align: center; max-width: 100%; }
.sentence .w { border-radius: 10px; padding: 0 4px; transition: background 0.15s, box-shadow 0.15s; }
.sentence .w.on { background: rgba(255, 201, 74, 0.35); box-shadow: inset 0 -4px 0 var(--gold); }
.story-pic { width: min(320px, 86%); height: 30vh; border-radius: 30px; margin-top: 1vh; display: flex; align-items: flex-end; justify-content: center; gap: 4px; padding: 10px; background: radial-gradient(circle at 50% 70%, #4a3f9a 0%, #241d5e 80%); border: 2px solid rgba(255, 201, 74, 0.35); }
.story-pic .pic { height: 92%; max-width: 60%; }
.story-pic .pic.small { height: 46%; }
.story-title { font-family: var(--tale); font-size: 30px; color: var(--gold); text-align: center; margin-top: 2vh; }
.story-ctrl { display: flex; gap: 14px; margin-top: 2vh; }
.story-ctrl .btn-round { width: 62px; height: 62px; }
.story-ctrl .btn-round svg { width: 30px; height: 30px; }
.page-dots { display: flex; gap: 6px; margin-top: 12px; }
.page-dots i { width: 8px; height: 8px; border-radius: 4px; background: rgba(255, 255, 255, 0.3); transition: width 0.3s; }
.page-dots i.on { width: 26px; background: var(--gold); }

/* ---------- награда ---------- */
.reward { align-items: center; padding: calc(30px + var(--top)) 20px calc(24px + var(--bottom)); }
.reward h1 { margin: 0; font-family: var(--tale); font-weight: 400; font-size: 54px; color: var(--gold); text-shadow: 0 4px 0 #7a4a00, 0 0 30px rgba(255, 201, 74, 0.5); animation: pop-in 0.5s cubic-bezier(.3, 1.6, .5, 1) both; }
.reward-stars { display: flex; align-items: flex-start; gap: 8px; margin-top: 8px; }
.reward-stars svg { width: 64px; height: 64px; color: rgba(255, 255, 255, 0.2); transition: color 0.3s; }
.reward-stars svg:nth-child(2) { width: 80px; height: 80px; margin-top: -14px; }
.reward-stars svg.on { color: var(--gold); animation: star-in 0.5s cubic-bezier(.3, 1.8, .5, 1); filter: drop-shadow(0 0 12px rgba(255, 201, 74, 0.7)); }
@keyframes star-in { from { transform: scale(0) rotate(-90deg); } }
.reward-card { margin-top: 3vh; display: flex; align-items: center; gap: 18px; padding: 16px 22px; border-radius: 28px; background: rgba(255, 255, 255, 0.08); border: 2px solid rgba(255, 255, 255, 0.14); font-size: 22px; font-weight: 900; line-height: 1.25; }
.sticker-reveal { margin-top: 3vh; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.sticker-box { width: 180px; height: 180px; border-radius: 30px; display: grid; place-items: center; background: radial-gradient(circle at 50% 40%, #4a3f9a 0%, #2a2366 100%); border: 3px solid var(--gold); box-shadow: 0 0 40px rgba(255, 201, 74, 0.5); animation: sticker-in 0.9s 0.6s cubic-bezier(.3, 1.4, .5, 1) both; }
.sticker-box img { width: 150px; height: 150px; object-fit: contain; }
@keyframes sticker-in { from { transform: rotateY(180deg) scale(0.4); opacity: 0; } to { transform: rotate(-4deg); } }
.sticker-reveal .eyebrow { font-size: 15px; font-weight: 900; letter-spacing: 0.06em; text-transform: uppercase; color: var(--gold); }
.sticker-reveal .name { font-size: 22px; font-weight: 900; }
.reward .bottom { margin-top: auto; width: 100%; display: flex; align-items: flex-end; justify-content: space-between; }
.reward .bottom img { width: 104px; animation: bob 2s ease-in-out infinite; }
.reward .bottom img.talking { animation: owl-talk 0.45s ease-in-out 6 alternate; } /* Угу зовёт дальше */
@keyframes owl-talk { from { transform: translateY(0) rotate(0); } to { transform: translateY(-8px) rotate(-4deg); } }

/* ---------- книга букв, альбом, взрослые ---------- */
.page-head { display: flex; align-items: center; gap: 12px; padding: calc(12px + var(--top)) 14px 6px; flex: none; }
.page-head h1 { margin: 0; font-family: var(--tale); font-weight: 400; font-size: 26px; color: var(--gold); line-height: 1.1; }
.page-sub { padding: 0 16px; color: var(--muted); font-weight: 800; font-size: 15px; flex: none; }
.page-body { flex: 1; overflow-y: auto; padding: 14px 14px calc(30px + var(--bottom)); }
.album-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.sticker-cell { border-radius: 22px; padding: 10px 6px 8px; background: rgba(255, 255, 255, 0.06); border: 2px solid rgba(255, 255, 255, 0.08); display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.sticker-cell img { width: 84%; aspect-ratio: 1; object-fit: contain; }
.sticker-cell.missing img { filter: brightness(0) invert(0.25); opacity: 0.35; }
.sticker-cell span { font-size: 13px; font-weight: 800; color: var(--muted); min-height: 2.4em; }
.sticker-cell.owned { background: rgba(255, 201, 74, 0.1); border-color: rgba(255, 201, 74, 0.35); }
.parents-card { background: var(--moon); color: var(--ink); border-radius: 26px; padding: 18px; }
.parents-card h3 { margin: 18px 0 8px; font-size: 13px; font-weight: 900; letter-spacing: 0.08em; text-transform: uppercase; color: #6b62b0; }
.parents-card h3:first-child { margin-top: 0; }
.parents-card .tips { margin: 0; padding-left: 20px; display: grid; gap: 8px; font-size: 14px; font-weight: 700; line-height: 1.4; color: #3b3366; }
.parents-card .tips li::marker { color: var(--gold-deep, #d98e0b); }
.row { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid #e6e1f5; font-size: 16px; }
.row span { font-weight: 700; color: #5b5480; } .row b { font-weight: 900; }
.bar { height: 12px; border-radius: 6px; background: #ece8f8; overflow: hidden; margin: 6px 0 4px; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--vowel), var(--gold)); }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button { height: 42px; padding: 0 14px; border-radius: 21px; border: 2px solid #ddd7f2; background: #fff; color: var(--ink); font-weight: 800; font-size: 15px; }
.seg button.on { background: #5b4bd6; border-color: #5b4bd6; color: #fff; }
.toggle { display: flex; justify-content: space-between; align-items: center; width: 100%; padding: 12px 0; font-size: 16px; font-weight: 800; color: var(--ink); text-align: left; }
.toggle .sw { width: 52px; height: 30px; border-radius: 15px; background: #d5d0e8; position: relative; flex: none; transition: background 0.2s; }
.toggle .sw::after { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform 0.2s; }
.toggle.on .sw { background: #3dba7e; }
.toggle.on .sw::after { transform: translateX(22px); }
.note { margin-top: 12px; padding: 12px 14px; border-radius: 16px; background: #f1eefc; font-size: 14px; font-weight: 700; line-height: 1.45; color: #4a4370; }
.danger { margin-top: 14px; color: #c2364a; font-weight: 800; font-size: 15px; padding: 6px 0; }

/* ворота для взрослых, диалоги */
.overlay { position: absolute; inset: 0; z-index: 40; display: grid; place-items: center; padding: 20px; background: rgba(10, 8, 30, 0.72); animation: screen-in 0.25s both; }
.dialog { width: min(360px, 100%); background: var(--moon); color: var(--ink); border-radius: 28px; padding: 22px 20px; text-align: center; }
.dialog h2 { margin: 0 0 6px; font-size: 22px; font-weight: 900; }
.dialog p { margin: 0 0 16px; color: #5b5480; font-weight: 700; }
.dialog .opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.dialog .opts button { height: 58px; border-radius: 18px; background: #efeafd; font-size: 22px; font-weight: 900; color: var(--ink); }
.dialog .cancel { margin-top: 14px; font-weight: 800; color: #6b62b0; padding: 6px; }
/* условия покупки за звёзды (js/terms.js): длинный текст листается внутри окна */
.dialog.terms { width: min(520px, 100%); max-height: calc(100vh - 40px); max-height: calc(100dvh - 40px); display: flex; flex-direction: column; text-align: left; padding: 20px 18px 18px; }
.dialog.terms h2 { font-size: 19px; line-height: 1.25; text-align: center; margin-bottom: 10px; }
.dialog.terms .terms-text { overflow-y: auto; min-height: 0; padding-right: 4px; margin-bottom: 14px; -webkit-overflow-scrolling: touch; }
.dialog.terms .terms-text p { margin: 0 0 10px; font-size: 14px; line-height: 1.45; font-weight: 600; }
.dialog.terms .btn-gold { align-self: center; flex: none; }
.exit-ask { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.exit-ask img { width: 140px; }
/* «Закончим урок?» — «Да» и «Нет»: круглые объёмные кнопки, как кружки на карте; галочка и крестик понятны без чтения */
.exit-btns { display: flex; gap: 30px; margin-top: 8px; }
.exit-btns button { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 0; background: none; border: 0; color: var(--moon);
  -webkit-tap-highlight-color: transparent; }
.exit-btns .c { width: 86px; height: 86px; border-radius: 50%; display: grid; place-items: center; color: #fff;
  border: 3px solid rgba(255, 255, 255, 0.35); transition: transform 0.12s, box-shadow 0.12s; }
.exit-btns svg { width: 42px; height: 42px; stroke-width: 3.4; filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.18)); }
.exit-btns .t { font-weight: 900; font-size: 20px; line-height: 1; }
.exit-btns .yes .c { background: radial-gradient(circle at 50% 35%, #7cf0bb 0%, #2fc985 60%, #1fa86c 100%); box-shadow: 0 6px 0 #168a55, 0 0 22px rgba(61, 220, 151, 0.35); }
.exit-btns .no .c { background: radial-gradient(circle at 50% 35%, #ff9a9d 0%, #f25a5f 60%, #d93f45 100%); box-shadow: 0 6px 0 #b42e37, 0 0 22px rgba(255, 90, 95, 0.3); }
.exit-btns button:active .c { transform: translateY(5px); }
.exit-btns .yes:active .c { box-shadow: 0 1px 0 #168a55; } .exit-btns .no:active .c { box-shadow: 0 1px 0 #b42e37; }

/* отдых */
.rest { align-items: center; justify-content: center; text-align: center; padding: 30px 24px; gap: 14px; }
/* только свои элементы экрана (>): иначе бледный цвет абзаца перекрашивал пример в окне «Только для взрослых» */
.rest > img { width: 220px; animation: bob 3s ease-in-out infinite; }
.rest > h1 { margin: 0; font-family: var(--tale); font-weight: 400; color: var(--gold); font-size: 32px; }
.rest > p { margin: 0; color: var(--muted); font-weight: 800; font-size: 17px; }

/* искорки */
.spark { position: fixed; z-index: 60; width: 18px; height: 18px; pointer-events: none; color: var(--gold); }
.spark svg { width: 100%; height: 100%; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
@media (min-width: 700px) {
  #app { left: 50%; width: 480px; margin-left: -240px; box-shadow: 0 0 80px rgba(0, 0, 0, 0.5); }
}

/* ---------- волшебный словарик ---------- */
.dict .page-head h1 { font-size: 24px; }
.abc-ribbon { flex: none; display: flex; gap: 8px; overflow-x: auto; padding: 10px 14px 8px; scrollbar-width: none; scroll-snap-type: x proximity; }
.abc-ribbon::-webkit-scrollbar { display: none; }
.abc-chip {
  flex: none; min-width: 50px; height: 54px; border-radius: 18px; padding: 0 8px;
  display: grid; place-items: center; scroll-snap-align: center;
  background: rgba(255, 255, 255, 0.1); border: 2px solid rgba(255, 255, 255, 0.12);
  font-family: var(--read); font-weight: 700; font-size: 30px;
  transition: transform 0.15s, background 0.2s;
}
.abc-chip .lt.v { color: #ff7a7e; } .abc-chip .lt.c { color: #7aaaff; } .abc-chip .lt.s { color: var(--sign); }
.abc-chip.on { background: var(--moon); border-color: var(--gold); transform: scale(1.08); box-shadow: 0 0 18px rgba(255, 201, 74, 0.55); }
.abc-chip.on .lt.v { color: #e23d44; } .abc-chip.on .lt.c { color: #2f6fe4; }
.dict-body { padding-bottom: calc(110px + var(--bottom)); scroll-behavior: smooth; }
.dict-section { padding: 6px 0 18px; }
.dict-head { display: flex; align-items: center; gap: 14px; padding: 12px 6px 10px; cursor: pointer; }
.dict-head .ll { margin-top: 10px; }
.dict-letter-name { font-family: var(--read); font-weight: 700; font-size: 26px; }
.dict-note { font-size: 14px; font-weight: 800; color: var(--muted); }
.dict-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.word-card {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 6px 10px; border-radius: 22px;
  background: linear-gradient(180deg, #fffdf7 0%, #f3eeff 100%);
  box-shadow: 0 6px 0 #cfc8ea, 0 10px 20px rgba(0, 0, 0, 0.25);
  transition: transform 0.12s;
}
.word-card:active { transform: translateY(3px); box-shadow: 0 3px 0 #cfc8ea; }
.word-card .pic { width: 84%; aspect-ratio: 1; height: auto; }
.word-card { container-type: inline-size; }
/* длинные слова («дирижабль») уменьшаются под ширину карточки: --n — число букв */
.word-card .w { font-family: var(--read); font-weight: 700; font-size: min(18px, calc(100cqi / (var(--n, 6) * 0.74))); white-space: nowrap; color: var(--ink); line-height: 1.1; }
.word-card .w .lt.v { color: #e23d44; } .word-card .w .lt.c { color: #2f6fe4; } .word-card .w .lt.s { color: #6b63a8; }
.word-card .can-star { position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; color: var(--gold); filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3)); }
.word-card.found { box-shadow: 0 0 0 4px var(--mint), 0 0 26px rgba(61, 220, 151, 0.7); }
.dict-guess { position: absolute; right: 16px; bottom: calc(18px + var(--bottom)); z-index: 6; min-height: 58px; font-size: 19px; padding: 0 22px; }
.dict-guess svg { width: 22px; height: 22px; }
.dict-guess.waiting { animation: hint 1s ease-in-out infinite; }
.dict-overlay { align-items: end; padding: 0; }
.dict-sheet {
  position: relative; width: 100%; max-width: 480px; margin: 0 auto;
  background: var(--moon); color: var(--ink); border-radius: 34px 34px 0 0;
  padding: 18px 18px calc(22px + var(--bottom));
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  animation: sheet-up 0.35s cubic-bezier(.3, 1.3, .5, 1) both;
}
@keyframes sheet-up { from { transform: translateY(100%); } }
.dict-close { position: absolute; right: 14px; top: 14px; background: #efeafd; border-color: #e1dbf7; }
.dict-close svg { color: var(--ink); }
.dict-pic { width: min(200px, 52vw); height: min(200px, 52vw); animation: pop-in 0.5s 0.1s cubic-bezier(.3, 1.6, .5, 1) both; cursor: pointer; }
.dict-pic.jump, .dict-l.jump { animation: jump 0.5s ease; }
.dict-sheet .reading { margin-top: 0; font-size: clamp(46px, 14vw, 64px); }
.dict-sheet .syl-block { cursor: pointer; padding: 0 2px; border-radius: 12px; }
.dict-letters { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.dict-l { width: 46px; height: 50px; border-radius: 14px; background: #efeafd; font-family: var(--read); font-weight: 700; font-size: 28px; display: grid; place-items: center; }
.dict-l.lt.v { color: #e23d44; } .dict-l.lt.c { color: #2f6fe4; } .dict-l.lt.s { color: #6b63a8; }
.dict-actions { display: flex; gap: 14px; margin-top: 4px; }
.dict-btn { width: 60px; height: 60px; background: #5b4bd6; border: none; box-shadow: 0 5px 0 #3e30a8; }
.dict-btn svg { width: 28px; height: 28px; color: #fff; }
.dict-status { font-weight: 800; font-size: 15px; color: #6b62b0; display: flex; align-items: center; gap: 6px; }
.dict-status.ok { color: #1e9e66; }
.dict-status svg { width: 20px; height: 20px; color: var(--gold); }

/* ---------- Волшебная книга ---------- */
/* поляна ночью, книга лежит на пне; буквы-плитки парят в небе */
/* --mb-bg: тот же фон из памяти телефона (js/assets.js подставляет, когда скачал) */
.mb-game { position: absolute; inset: 0; padding: 8px 12px 0; background: #1b1a4a var(--mb-bg, url(../img/magicbook/bg.webp)) center bottom / cover no-repeat; overflow: hidden; }
.mb-flies { position: absolute; inset: 0; pointer-events: none; }
.mb-flies i { position: absolute; width: 6px; height: 6px; border-radius: 50%; background: #ffe9a0; box-shadow: 0 0 10px 3px rgba(255, 214, 110, 0.85); opacity: 0; animation: mb-fly 6s ease-in-out infinite; }
@keyframes mb-fly { 0% { opacity: 0; transform: translate(0, 0); } 20% { opacity: 1; } 50% { transform: translate(18px, -26px); } 80% { opacity: 0.9; } 100% { opacity: 0; transform: translate(-10px, -48px); } }
.mb-tiles { position: relative; z-index: 2; margin-top: 2vh; }
.mb-tile { animation: float-tile 2.6s ease-in-out infinite; box-shadow: 0 6px 0 var(--tile-deep), 0 0 18px rgba(255, 214, 110, 0.55); }
@keyframes float-tile { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-8px) rotate(2deg); } }
.mb-tile.used { visibility: hidden; }
.mb-zone { position: absolute; left: 50%; bottom: 31%; width: min(96%, 440px); transform: translateX(-50%); z-index: 1; }
.mb-book { position: relative; aspect-ratio: 1200 / 797; animation: mb-breathe 4s ease-in-out infinite; transform-origin: 50% 80%; }
@keyframes mb-breathe { 50% { transform: translateY(-3px) scale(1.012); } }
.mb-book-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 14px 18px rgba(0, 0, 0, 0.45)); pointer-events: none; }
.mb-aura { position: absolute; left: 8%; right: 8%; top: -18%; height: 70%; border-radius: 50%; background: radial-gradient(ellipse, rgba(255, 214, 120, 0.55) 0%, rgba(255, 214, 120, 0) 70%); filter: blur(10px); animation: mb-aura 3.2s ease-in-out infinite; pointer-events: none; }
@keyframes mb-aura { 50% { opacity: 0.6; transform: scale(1.08); } }
/* мягкое сияние самих страниц */
.mb-pageglow { position: absolute; left: 13%; right: 13%; top: 21%; height: 50%; border-radius: 40%; background: radial-gradient(ellipse, rgba(255, 246, 210, 0.55) 0%, rgba(255, 246, 210, 0) 70%); mix-blend-mode: screen; animation: mb-aura 2.6s ease-in-out infinite reverse; pointer-events: none; }
/* клеточки — на середине страниц (страницы: 21–71 % высоты, 13–86 % ширины книги) */
.mb-slots { position: absolute; left: 14%; right: 14%; top: 46%; transform: translateY(-50%); display: flex; justify-content: center; gap: 1.6%; z-index: 2; }
.mb-slot {
  width: 15.5%; max-width: 62px; aspect-ratio: 5 / 6; border-radius: 12px; border: 2px dashed rgba(170, 120, 50, 0.55); background: rgba(255, 250, 235, 0.55);
  display: grid; place-items: center; font-family: var(--read); font-weight: 700; font-size: clamp(22px, 7vw, 34px); color: #2a2350;
  box-shadow: inset 0 0 8px rgba(214, 170, 90, 0.35);
}
.mb-slot.filled { border: 2px solid #e0a83a; background: #fffdf6; box-shadow: 0 0 14px rgba(255, 196, 70, 0.8), inset 0 0 6px rgba(255, 220, 140, 0.6); animation: right 0.4s; }
.mb-dust { position: absolute; left: 20%; right: 20%; top: 4%; height: 40%; pointer-events: none; z-index: 1; }
.mb-dust i { position: absolute; bottom: 0; width: 6px; height: 6px; border-radius: 50%; background: #ffe29a; box-shadow: 0 0 8px 2px rgba(255, 210, 110, 0.8); animation: dust-up 2s ease-out forwards; }
@keyframes dust-up { from { transform: translateY(0) scale(0.5); opacity: 1; } to { transform: translateY(-90px) scale(1.1); opacity: 0; } }
.mb-book.nope { animation: book-nope 0.55s ease; }
@keyframes book-nope { 25% { transform: rotate(-3deg); } 50% { transform: rotate(3deg); } 75% { transform: rotate(-1.5deg); } }
/* слово собрано: страницы вспыхивают, из книги бьют лучи */
.mb-book.glow .mb-slot { border-color: var(--mint); box-shadow: 0 0 18px rgba(61, 220, 151, 0.8); }
.mb-book.glow .mb-aura { animation: book-glow 1.4s ease-out forwards; }
.mb-book.glow .mb-pageglow { animation: book-glow 1.4s ease-out forwards; }
.mb-book.glow::after { content: ""; position: absolute; left: 50%; top: 30%; width: 160%; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%; background: repeating-conic-gradient(rgba(255, 220, 130, 0.35) 0 8deg, transparent 8deg 22deg); -webkit-mask: radial-gradient(circle, #000 15%, transparent 62%); mask: radial-gradient(circle, #000 15%, transparent 62%); animation: mb-rays 2.4s ease-out forwards; pointer-events: none; z-index: 0; }
@keyframes mb-rays { from { opacity: 0; transform: translate(-50%, -50%) rotate(0deg) scale(0.4); } 30% { opacity: 1; } to { opacity: 0; transform: translate(-50%, -50%) rotate(40deg) scale(1.1); } }
@keyframes book-glow { 0% { transform: scale(1); opacity: 1; } 40% { transform: scale(1.7); opacity: 1; } 100% { transform: scale(1.3); opacity: 0.8; } }
.mb-prize { position: absolute; left: 50%; top: 0; width: 44%; aspect-ratio: 1; margin-left: -22%; z-index: 3; opacity: 0; transform: translateY(40%) scale(0.1); pointer-events: none; filter: drop-shadow(0 0 18px rgba(255, 220, 130, 0.8)); }
.mb-prize .pic { width: 100%; height: 100%; }
.mb-prize.show { animation: popup-up 1.1s cubic-bezier(.3, 1.4, .5, 1) forwards; }
@keyframes popup-up { 0% { opacity: 0; transform: translateY(40%) scale(0.1) rotateX(70deg); } 100% { opacity: 1; transform: translateY(-62%) scale(1) rotateX(0); } }

/* ---------- копилка слов на экране награды ---------- */
.jar-row { margin-top: 2vh; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.jar-pics { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.jar-pics .pic { width: 54px; height: 54px; animation: jar-in 0.6s cubic-bezier(.3, 1.6, .5, 1) both; }
@keyframes jar-in { from { transform: translateY(-40px) scale(0); opacity: 0; } }
.jar-label { font-size: 16px; font-weight: 900; color: var(--gold); }
.word-card.mine { box-shadow: 0 6px 0 #e3b347, 0 0 0 3px var(--gold), 0 10px 22px rgba(255, 201, 74, 0.35); }
.word-card .jar-badge { position: absolute; top: 6px; left: 6px; font-size: 11px; font-weight: 900; color: #7a4a00; background: var(--gold); border-radius: 10px; padding: 2px 6px; }

/* ---------- Лопни шарики (новая версия) ---------- */
.pop-game { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; padding: 4px 14px 0; }
.pop-head {
  display: flex; align-items: center; gap: 16px; padding: 8px 8px 8px 20px; border-radius: 28px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.06));
  border: 1px solid rgba(255, 255, 255, 0.2); box-shadow: 0 10px 26px rgba(8, 6, 30, 0.3);
}
.pop-task { display: flex; flex-direction: column; line-height: 1.15; }
.pop-task b { font-size: 19px; font-weight: 900; }
.pop-task span { font-size: 13px; font-weight: 800; color: var(--muted); }
.pop-target {
  width: 70px; height: 70px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: radial-gradient(circle at 50% 38%, #ffffff 0%, #efe9ff 72%);
  box-shadow: 0 0 0 4px rgba(255, 201, 74, 0.75), 0 0 26px rgba(255, 201, 74, 0.55);
}
.pop-target .ll-g { text-shadow: 0 0.035em 0 var(--cd); }
.pop-slots { display: flex; gap: 8px; margin: 12px 0 2px; }
.pop-slot {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255, 255, 255, 0.07); border: 2px dashed rgba(255, 255, 255, 0.25); transition: all 0.3s;
}
.pop-slot svg { width: 18px; height: 18px; color: rgba(255, 255, 255, 0.16); transition: color 0.3s; }
.pop-slot.on { background: rgba(255, 201, 74, 0.2); border: 2px solid var(--gold); animation: right 0.5s; }
.pop-slot.on svg { color: var(--gold); filter: drop-shadow(0 0 6px rgba(255, 201, 74, 0.9)); }
.pop-area { position: relative; flex: 1; align-self: stretch; margin: 0 -14px; overflow: hidden; touch-action: manipulation; }
.pop-water {
  position: absolute; left: 0; right: 0; bottom: 0; height: 110px; pointer-events: none;
  background: linear-gradient(180deg, rgba(70, 150, 230, 0) 0%, rgba(70, 150, 230, 0.16) 55%, rgba(50, 120, 210, 0.34) 100%);
}
.pop-water i {
  position: absolute; left: 10%; right: 10%; bottom: 34px; height: 18px; border-radius: 50%;
  border: 2px solid rgba(190, 225, 255, 0.25); animation: ripple 3.4s ease-in-out infinite;
}
.pop-water i + i { left: 25%; right: 25%; bottom: 16px; animation-delay: 1.7s; }
@keyframes ripple { 0%, 100% { transform: scaleX(0.9); opacity: 0.5; } 50% { transform: scaleX(1.08); opacity: 1; } }
.pop-bub {
  position: absolute; left: 0; top: 0; border-radius: 50%; display: grid; place-items: center; padding: 0;
  will-change: transform; border: 1.5px solid rgba(255, 255, 255, 0.5);
  background:
    radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.95) 0 5%, rgba(255, 255, 255, 0) 11%),
    radial-gradient(circle at 72% 78%, rgba(255, 255, 255, 0.4) 0 4%, rgba(255, 255, 255, 0) 9%),
    radial-gradient(circle at 50% 50%, rgba(150, 180, 255, 0.06) 0 58%, rgba(170, 205, 255, 0.24) 70%, rgba(255, 255, 255, 0.5) 74%, rgba(170, 205, 255, 0) 76%);
  box-shadow: inset 7px -9px 16px rgba(255, 140, 220, 0.3), inset -9px 7px 16px rgba(110, 220, 255, 0.3), 0 10px 24px rgba(8, 6, 30, 0.35);
}
.pop-bub.k-v, .pop-fly.k-v { --c: var(--vowel); --cd: var(--vowel-deep); }
.pop-bub.k-c, .pop-fly.k-c { --c: var(--cons); --cd: var(--cons-deep); }
.pop-bub.k-s, .pop-fly.k-s { --c: var(--sign); --cd: var(--sign-deep); }
.pop-letter, .pop-fly {
  font-family: var(--read); font-weight: 700; line-height: 1; color: var(--c);
  text-shadow:
    0 0.03em 0 var(--cd),
    0.05em 0 0 #fff, -0.05em 0 0 #fff, 0 0.05em 0 #fff, 0 -0.05em 0 #fff,
    0.035em 0.035em 0 #fff, -0.035em 0.035em 0 #fff, 0.035em -0.035em 0 #fff, -0.035em -0.035em 0 #fff,
    0 0.08em 0.1em rgba(8, 6, 30, 0.45);
}
.pop-letter { display: inline-block; animation: letter-bob 3s ease-in-out infinite; }
@keyframes letter-bob { 50% { transform: translateY(-3px) rotate(-3deg); } }
.pop-fly { position: fixed; z-index: 70; pointer-events: none; }
.pop-bub.popped { animation: bub-gone 0.24s ease-out forwards; }
@keyframes bub-gone { to { opacity: 0; filter: blur(2px); } }
.pop-bub.nope { animation: nope 0.5s ease; }
.pop-bub.nope .pop-letter { animation: shake 0.45s; }
@keyframes nope {
  30% { box-shadow: 0 0 0 4px rgba(255, 90, 95, 0.75), 0 0 24px rgba(255, 90, 95, 0.6); border-color: rgba(255, 120, 120, 0.9); }
}
.pop-ring { position: absolute; border-radius: 50%; border: 3px solid rgba(255, 255, 255, 0.9); pointer-events: none; animation: pop-ring 0.45s ease-out forwards; }
@keyframes pop-ring { from { transform: scale(0.7); opacity: 1; } to { transform: scale(1.5); opacity: 0; } }
.pop-drop { position: absolute; width: 8px; height: 8px; border-radius: 50%; background: rgba(205, 232, 255, 0.95); pointer-events: none; box-shadow: 0 0 6px rgba(205, 232, 255, 0.8); }
/* подсказка: нужные шарики светятся золотом */
.pop-bub.hint { animation: pop-hint 1.1s ease-in-out infinite; }
@keyframes pop-hint {
  50% {
    border-color: rgba(255, 226, 140, 0.95);
    box-shadow: inset 7px -9px 16px rgba(255, 140, 220, 0.3), inset -9px 7px 16px rgba(110, 220, 255, 0.3), 0 10px 24px rgba(8, 6, 30, 0.35),
      0 0 0 4px rgba(255, 201, 74, 0.85), 0 0 30px rgba(255, 201, 74, 0.75);
  }
}
.pop-bub.away { pointer-events: none; }
/* финал: большой золотой шар */
.pop-bub.gold {
  border: 2px solid rgba(255, 226, 140, 0.95);
  background:
    radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.95) 0 5%, rgba(255, 255, 255, 0) 11%),
    radial-gradient(circle at 72% 78%, rgba(255, 255, 255, 0.45) 0 4%, rgba(255, 255, 255, 0) 9%),
    radial-gradient(circle at 50% 50%, rgba(255, 214, 110, 0.22) 0 56%, rgba(255, 201, 74, 0.45) 70%, rgba(255, 244, 200, 0.8) 74%, rgba(255, 201, 74, 0) 76%);
  box-shadow: inset 10px -12px 22px rgba(255, 170, 60, 0.45), inset -12px 10px 22px rgba(255, 236, 160, 0.4), 0 12px 28px rgba(8, 6, 30, 0.35), 0 0 36px rgba(255, 201, 74, 0.5);
  animation: gold-glow 1.6s ease-in-out infinite;
}
.pop-bub.gold::after {
  content: ''; position: absolute; inset: -12px; border-radius: 50%; pointer-events: none;
  border: 2px dashed rgba(255, 226, 140, 0.55); animation: pop-spin 9s linear infinite;
}
@keyframes gold-glow {
  50% { box-shadow: inset 10px -12px 22px rgba(255, 170, 60, 0.45), inset -12px 10px 22px rgba(255, 236, 160, 0.4), 0 12px 28px rgba(8, 6, 30, 0.35), 0 0 64px rgba(255, 201, 74, 0.85); }
}
@keyframes pop-spin { to { transform: rotate(360deg); } }
.pop-bub.gold.popped { animation: bub-gone 0.24s ease-out forwards; }
.pop-ring.gold { border-color: var(--gold); box-shadow: 0 0 18px rgba(255, 201, 74, 0.7); }
.pop-drop.gold { background: #ffe08a; box-shadow: 0 0 8px rgba(255, 201, 74, 0.9); }
.pop-slot.gold { border-color: rgba(255, 201, 74, 0.45); }
.pop-slot.gold svg { color: rgba(255, 201, 74, 0.3); }
.pop-slot.gold.on svg { color: var(--gold); }
/* ветерок между волнами */
.pop-wind {
  position: absolute; left: 0; height: 3px; border-radius: 3px; pointer-events: none;
  background: linear-gradient(90deg, rgba(220, 235, 255, 0), rgba(220, 235, 255, 0.6), rgba(220, 235, 255, 0));
}

/* ---------- оживающий мир на карте ---------- */
.deco { position: absolute; z-index: 1; object-fit: contain; pointer-events: none; transform-origin: 50% 90%; transition: filter 1.2s ease, opacity 1.2s ease; }
.deco.gray { filter: grayscale(1) brightness(0.55); opacity: 0.4; }
.deco.alive { filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.35)); opacity: 1; animation: deco-sway 4.5s ease-in-out infinite; }
@keyframes deco-sway { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg) translateY(-2px); } }
.deco.bloom { animation: deco-bloom 1s cubic-bezier(.3, 1.6, .5, 1), deco-sway 4.5s 1s ease-in-out infinite; }
@keyframes deco-bloom { 0% { transform: scale(0.6); } 55% { transform: scale(1.25) rotate(-6deg); } 100% { transform: scale(1); } }
.deco-fly { position: absolute; z-index: 1; width: 7px; height: 7px; border-radius: 50%; background: #ffe9a6; box-shadow: 0 0 10px 4px rgba(255, 220, 120, 0.75); pointer-events: none; animation: firefly 6s ease-in-out infinite, glow 1.6s ease-in-out infinite alternate; }
@keyframes firefly { 0%, 100% { transform: translate(0, 0); } 25% { transform: translate(16px, -12px); } 50% { transform: translate(-6px, -24px); } 75% { transform: translate(-14px, 6px); } }
@keyframes glow { from { opacity: 0.25; } to { opacity: 1; } }
.trail .node { z-index: 2; }
.chapter-banner img { transition: filter 2.2s ease; }
.chapter-banner.gray img { filter: grayscale(1) brightness(0.6) contrast(0.95); }
.chapter.locked .chapter-banner img { filter: grayscale(1) brightness(0.55); }
.chapter-banner.colorize::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(110deg, rgba(255, 255, 255, 0) 30%, rgba(255, 240, 190, 0.65) 50%, rgba(255, 255, 255, 0) 70%);
  transform: translateX(-100%); animation: light-sweep 1.8s ease-out forwards;
}
@keyframes light-sweep { to { transform: translateX(100%); } }

/* обложка сказки */
.story-meta { margin-top: 2px; font-size: 14px; font-weight: 800; color: var(--muted); }
.story-cover { height: 34vh; margin-top: 2vh; }
.story-start { margin-top: 3vh; min-height: 68px; font-size: 22px; animation: breathe-btn 2s ease-in-out infinite; }
.story-start svg { width: 30px; height: 30px; }

/* ---------- чтение по слогам ---------- */
.sentence.by-syl { line-height: 1.75; }
.sentence .w { display: inline-block; white-space: nowrap; }
.sentence .sy { position: relative; display: inline-block; padding: 0 1px 6px; border-radius: 8px; transition: background 0.12s; }
.sentence.by-syl .sy.a { color: var(--ink); }
.sentence.by-syl .sy.b { color: #6b4fd6; }
.sentence.by-syl .sy::after {
  content: ''; position: absolute; left: 12%; right: 12%; bottom: 1px; height: 8px;
  border-bottom: 3px solid currentColor; border-radius: 0 0 50% 50% / 0 0 100% 100%; opacity: 0.5;
}
.sentence .sy.on { background: rgba(255, 201, 74, 0.5); }
.sentence .hy { color: #a39dc4; }
.story-ctrl { gap: 18px; }
.ctrl-btn { display: flex; flex-direction: column; align-items: center; gap: 4px; background: none; border: none; color: var(--moon); }
.ctrl-ico { width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, 0.12); border: 2px solid rgba(255, 255, 255, 0.2); }
.ctrl-ico svg { width: 28px; height: 28px; }
.ctrl-label { font-size: 13px; font-weight: 900; }
.ctrl-btn:active .ctrl-ico { transform: scale(0.92); }
.sentence .wrap-w { white-space: nowrap; }

/* ---------- мультик «буква проснулась» (js/cartoon.js): сцена рисуется на холсте ---------- */
.cartoon { position: absolute; inset: 0; z-index: 40; overflow: hidden; background: #0b0d2e; }
.cartoon.out { animation: ct-out 0.4s ease-in forwards; }
@keyframes ct-out { to { opacity: 0; } }
.ct-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.ct-ugu {
  position: absolute; right: 3%; top: calc(var(--top) + 54px); width: 30%; max-width: 150px; pointer-events: none;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.45));
  transform: translate(140%, -140%) rotate(18deg); opacity: 0;
  transition: transform 0.9s cubic-bezier(.25, .9, .35, 1.15), opacity 0.4s;
}
.ct-ugu.in { transform: none; opacity: 1; }
.ct-ugu.in.talk { animation: ct-talk 0.45s ease-in-out infinite alternate; }
.ct-ugu.away { transform: translate(140%, -160%) rotate(-12deg); opacity: 0; transition: transform 0.9s ease-in, opacity 0.6s 0.3s; animation: none; }
@keyframes ct-talk { from { transform: translateY(0) rotate(0); } to { transform: translateY(-5px) rotate(-2deg); } }
.ct-caption {
  position: absolute; left: 16px; right: 16px; bottom: calc(var(--bottom) + 26px); text-align: center;
  font-size: 15px; font-weight: 800; line-height: 1.3; color: rgba(255, 255, 255, 0.92); text-shadow: 0 1px 5px rgba(0, 0, 0, 0.8);
  opacity: 0; transition: opacity 0.4s; pointer-events: none;
}
.ct-caption.on { opacity: 1; }
.ct-skip {
  position: absolute; left: 12px; top: calc(var(--top) + 12px); padding: 8px 14px; border-radius: 16px;
  background: rgba(20, 16, 60, 0.55); color: #fff; font-weight: 800; font-size: 14px; border: 1.5px solid rgba(255, 255, 255, 0.25);
}
.ct-next {
  position: absolute; left: 50%; bottom: calc(var(--bottom) + 26px); transform: translateX(-50%);
  min-width: 200px; height: 56px; padding: 0 28px; border-radius: 20px;
  background: var(--gold); color: var(--gold-ink); font-weight: 900; font-size: 19px; border: 0;
  box-shadow: 0 6px 0 var(--gold-deep), 0 10px 26px rgba(255, 201, 74, 0.35); animation: pop-in 0.4s cubic-bezier(.3, 1.5, .5, 1) both;
}
.ct-skip[hidden], .ct-next[hidden] { display: none; }
.cartoon.out { pointer-events: none; }
.ct-fly { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 45; pointer-events: none; }
/* награда после мультика: большая живая буква под звёздами */
.shimmer-letter { display: block; flex: none; max-width: 100%; }
.reward-hero { display: flex; flex-direction: column; align-items: center; margin-top: -4px; }
.reward-hero .shimmer-letter { margin: -8px -20px -22px; max-width: none; } /* на всю ширину: по бокам только сияние */
.reward-hero.pop .shimmer-letter { animation: pop-in 0.6s 0.15s cubic-bezier(.3, 1.5, .5, 1) both; } /* без мультика — буква выпрыгивает */
.reward-hero-text { font-family: var(--tale); font-size: 26px; color: var(--gold); text-align: center; text-shadow: 0 3px 0 #7a4a00, 0 0 22px rgba(255, 201, 74, 0.45); animation: pop-in 0.5s 0.6s cubic-bezier(.3, 1.6, .5, 1) both; }

/* ---------- «Лесной сыщик» (js/games/detective.js) ---------- */
.det-game { position: absolute; inset: 0; display: flex; flex-direction: column; padding-bottom: calc(100px + var(--bottom)); }
.det-top { flex: none; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 0 16px 6px; }
/* записка-свиток от светлячка */
.det-note { position: relative; max-width: 100%; padding-top: 30px; } /* компактная записка: картинке леса больше места */
.det-scroll {
  position: relative; min-width: 190px; padding: 12px 26px 2px; text-align: center; color: var(--ink);
  background: radial-gradient(ellipse at 50% 40%, #fffaf0 0%, #fbeccb 70%, #f1d9a6 100%);
  border-top: 2px solid #e8c98a; border-bottom: 2px solid #e8c98a;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35), inset 0 0 0 4px rgba(255, 255, 255, 0.35), inset 0 0 22px rgba(196, 150, 70, 0.25);
  transform-origin: 50% 50%; animation: det-unroll 0.55s 0.25s cubic-bezier(.3, 1.2, .5, 1) both;
}
.det-scroll::after { content: ''; position: absolute; inset: 5px 22px; border: 1.5px dashed rgba(190, 140, 60, 0.45); border-radius: 6px; pointer-events: none; }
@keyframes det-unroll { from { transform: scaleX(0.08); opacity: 0.6; } }
.det-roll { position: absolute; top: -7px; bottom: -7px; width: 18px; border-radius: 9px; background: linear-gradient(90deg, #c98d3e, #f6d79a 45%, #fff3d0 55%, #c98d3e); box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3); }
.det-roll.l { left: -9px; } .det-roll.r { right: -9px; }
.det-note-from { display: flex; align-items: center; justify-content: center; gap: 6px; font-family: var(--tale); font-size: 11px; letter-spacing: 0.02em; color: #9a6a24; margin: 0; }
.det-note-from i { font-style: normal; color: #e0a83a; font-size: 11px; }
.det-note .reading { margin: 0; position: relative; z-index: 1; }
.det-note .lt { display: inline-block; }
.det-firefly { position: absolute; left: 50%; top: 0; width: 50px; height: 40px; margin-left: -25px; z-index: 3; filter: drop-shadow(0 0 10px rgba(255, 220, 110, 0.9)); }
.det-firefly svg { width: 100%; height: 100%; overflow: visible; }
.det-firefly.land { animation: det-ff-land 1.1s cubic-bezier(.3, .9, .4, 1) both; }
@keyframes det-ff-land { 0% { transform: translate(150px, 6px) rotate(20deg) scale(0.6); opacity: 0; } 30% { opacity: 1; } 60% { transform: translate(-26px, -8px) rotate(-10deg) scale(1.05); } 100% { transform: none; } }
.det-firefly .ff-wing { transform-box: fill-box; transform-origin: 50% 100%; animation: det-ff-wing 0.18s ease-in-out infinite alternate; }
@keyframes det-ff-wing { to { transform: scaleY(0.35); } }
.det-firefly .ff-glow { transform-box: fill-box; transform-origin: center; animation: det-ff-glow 1.6s ease-in-out infinite; }
@keyframes det-ff-glow { 50% { transform: scale(1.35); opacity: 0.85; } }
.det-firefly.flash { animation: det-ff-flash 0.9s ease; }
@keyframes det-ff-flash { 30% { transform: translateY(-6px) scale(1.18); filter: drop-shadow(0 0 14px rgba(255, 230, 120, 1)); } }
.det-note.dim .det-scroll { background: radial-gradient(ellipse at 50% 40%, #f4f1f8 0%, #e2ddeb 100%); border-color: #c9c1db; }
.det-note.dim .det-roll { background: linear-gradient(90deg, #8e86a8, #d6d0e4 50%, #8e86a8); }
.det-note.dim .det-firefly { filter: grayscale(0.8) brightness(0.8); }
.det-note.dim .det-firefly .ff-glow { animation: none; opacity: 0.15; }
/* ребёнок долго не выбирает — буквы по очереди вспыхивают */
.det-lt-glow { animation: det-lt-glow 0.9s ease; }
@keyframes det-lt-glow { 35% { transform: translateY(-8px) scale(1.4); text-shadow: 0 0 14px rgba(255, 201, 74, 1), 0 0 4px #fff; } }
.det-restore-slots { display: flex; gap: 6px; justify-content: center; margin: 6px 0; }
.det-slot { min-width: 40px; height: 44px; padding: 0 6px; border-radius: 12px; border: 2px dashed #b3aacb; display: grid; place-items: center; font-family: var(--read); font-weight: 700; font-size: 28px; color: var(--ink); }
.det-slot.on { border: 2px solid var(--mint); background: #fff; }
.det-restore-chips { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-bottom: 6px; }
.det-chip { min-width: 52px; height: 50px; padding: 0 10px; border-radius: 14px; background: var(--tile); border: 3px solid var(--tile-edge); box-shadow: 0 5px 0 var(--tile-deep); font-family: var(--read); font-weight: 700; font-size: 28px; color: var(--ink); }
.det-chip.used { visibility: hidden; }
.det-chip.shake { animation: shake 0.4s; }
.det-queue { display: flex; gap: 6px; min-height: 10px; }
.det-queue i { width: 10px; height: 10px; border-radius: 50%; background: rgba(255, 255, 255, 0.25); }
.det-queue i.now { background: #ffe29a; box-shadow: 0 0 10px rgba(255, 201, 74, 0.9); }
.det-queue i.done { background: var(--mint); }
.det-queue:has(i:only-child) { visibility: hidden; }
.det-pano { flex: 1; min-height: 0; overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; scrollbar-width: none; border-radius: 18px; margin: 0 8px; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.12); touch-action: pan-x; cursor: grab; }
.det-pano.dragging { cursor: grabbing; }
.det-pano.dragging .det-ch { pointer-events: none; }
.det-pano::-webkit-scrollbar { display: none; }
.det-world { position: relative; height: 100%; background: center / 100% 100% no-repeat; }
.det-ch { position: absolute; height: calc(var(--s, 1) * 21%); aspect-ratio: 1; transform: translate(-50%, -100%); padding: 0; background: none; border: 0; transform-origin: 50% 100%; }
.det-ch .pic { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 6px 6px rgba(0, 0, 0, 0.35)); pointer-events: none; }
.det-ch.sleep { filter: grayscale(1) brightness(0.55); opacity: 0.6; }
.det-ch.nope { animation: det-nope 0.6s ease; }
@keyframes det-nope { 20% { transform: translate(-50%, -100%) rotate(-10deg); } 45% { transform: translate(-50%, -100%) rotate(9deg); } 70% { transform: translate(-50%, -100%) rotate(-5deg); } }
.det-ch.found { animation: det-found 0.7s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes det-found { 40% { transform: translate(-50%, -100%) scale(1.3); } }
.det-swipe { position: absolute; right: 18px; bottom: 12px; display: flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 14px; background: rgba(20, 16, 60, 0.7); color: #fff; font-weight: 800; font-size: 14px; pointer-events: none; animation: det-swipe 1.6s ease-in-out infinite; transition: opacity 0.4s; }
.det-swipe svg { width: 20px; height: 20px; }
.det-swipe.gone { opacity: 0; }
@keyframes det-swipe { 50% { transform: translateX(-16px); } }
.det-loupe { position: absolute; inset: 0; z-index: 30; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; background: radial-gradient(circle at 50% 42%, rgba(255, 214, 120, 0.22) 0%, rgba(10, 8, 40, 0.72) 62%); animation: screen-in 0.3s ease-out both; }
.det-loupe.out { animation: ct-out 0.3s ease-in forwards; }
/* лупа: стекло 222/320 по центру (130,130) из рисунка оправы 320×320; ручка уходит вниз-вправо */
.det-loupe-lens { position: relative; width: min(84vw, 330px); aspect-ratio: 1; margin-right: -12%; margin-bottom: -10%; animation: det-lens-in 0.6s cubic-bezier(.25, 1.4, .45, 1) both, det-lens-bob 3.2s 0.6s ease-in-out infinite; transform-origin: 40% 40%; filter: drop-shadow(0 16px 28px rgba(0, 0, 0, 0.5)); }
@keyframes det-lens-in { from { transform: translate(30%, 40%) rotate(25deg) scale(0.4); opacity: 0; } }
@keyframes det-lens-bob { 50% { transform: rotate(-2.5deg) translateY(-4px); } }
.det-loupe-glass { position: absolute; left: calc(19 / 320 * 100%); top: calc(19 / 320 * 100%); width: calc(222 / 320 * 100%); aspect-ratio: 1; border-radius: 50%; overflow: hidden; background: radial-gradient(circle at 40% 35%, #3f7a5a, #1f4a3a); display: grid; place-items: center; }
.det-loupe-frame { position: absolute; inset: 0; pointer-events: none; }
.det-loupe-frame svg { width: 100%; height: 100%; display: block; overflow: visible; }
.det-loupe-video { width: 100%; height: 100%; object-fit: cover; transform: scale(1.06); }
.det-loupe-pic { width: 72%; height: 72%; object-fit: contain; }
.det-loupe-pic.det-hop { animation: jump 0.5s ease 3; }
.det-loupe-word { padding: 6px 18px 4px; border-radius: 16px; background: #fff6e3; animation: pop-in 0.35s cubic-bezier(.3, 1.5, .5, 1) both; }
.det-loupe-word .reading { margin: 0; }
.det-folder { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.det-case { height: 118px; border-radius: 18px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-weight: 900; font-size: 16px; }
.det-case.owned { background: #fff6e3; color: var(--ink); box-shadow: 0 5px 0 #e3c48d; }
.det-case.owned .pic { width: 70px; height: 70px; object-fit: contain; }
.det-case.missing { background: rgba(255, 255, 255, 0.06); border: 2px dashed rgba(255, 255, 255, 0.18); color: rgba(255, 255, 255, 0.4); }
.det-case.missing svg { width: 28px; height: 28px; }

/* лес шире экрана: стрелки по краям и рука-подсказка */
.det-pano-wrap { position: relative; flex: 1; min-height: 0; display: flex; }
.det-arrow {
  position: absolute; top: 50%; width: 52px; height: 52px; margin-top: -26px; border-radius: 50%; z-index: 4;
  display: grid; place-items: center; background: var(--gold); border: 3px solid #fff3c9;
  box-shadow: 0 5px 0 var(--gold-deep), 0 0 0 6px rgba(255, 201, 74, 0.25), 0 8px 20px rgba(0, 0, 0, 0.4);
  animation: det-arrow 1.4s ease-in-out infinite; transition: opacity 0.3s;
}
.det-arrow svg { width: 26px; height: 26px; color: var(--gold-ink); }
.det-arrow.right { right: 14px; }
.det-arrow.left { left: 14px; animation-name: det-arrow-l; }
.det-arrow.left svg { transform: scaleX(-1); }
.det-arrow.hide { opacity: 0; pointer-events: none; }
@keyframes det-arrow { 50% { transform: translateX(5px); } }
@keyframes det-arrow-l { 50% { transform: translateX(-5px); } }
.det-hand { position: absolute; left: 50%; top: 50%; z-index: 5; width: 84px; height: 84px; margin: -42px 0 0 -42px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, 0.92); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4); pointer-events: none; animation: det-hand 1.1s ease-in-out infinite; }
.det-hand svg { width: 46px; height: 46px; color: var(--ink); }
@keyframes det-hand { 0% { transform: translateX(70px); opacity: 0; } 15% { opacity: 1; } 85% { opacity: 1; } 100% { transform: translateX(-70px); opacity: 0; } }

/* ---------- Мини-игры ---------- */
.games-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.game-card {
  position: relative; border-radius: 24px; padding: 12px 8px 12px; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.05)); border: 2px solid rgba(255, 201, 74, 0.4);
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.25); color: #fff; transition: transform 0.12s;
}
.game-card:active { transform: translateY(4px); box-shadow: 0 2px 0 rgba(0, 0, 0, 0.25); }
.game-card b { font-size: 17px; font-weight: 900; line-height: 1.15; }
.game-card small { font-size: 12.5px; font-weight: 700; color: var(--muted); line-height: 1.2; min-height: 2.4em; }
.gc-art { width: 100%; height: 84px; display: grid; place-items: center; }
.gc-pic { height: 84px; width: auto; max-width: 100%; object-fit: contain; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.35)); }
.gc-icon { width: 64px; height: 64px; color: var(--gold); }
.gc-glyph { font-family: var(--read); font-weight: 700; font-size: 38px; color: var(--gold); letter-spacing: 0.03em; }
.game-card.locked { opacity: 0.5; border-color: rgba(255, 255, 255, 0.12); box-shadow: none; }
.gc-lock { position: absolute; top: 10px; right: 10px; width: 20px; height: 20px; color: var(--muted); }
/* закрытая мини-игра: окно «Эта игра пока спит» со спящим Угу (решение пользователя 24.11) */
.game-sleeps { display: flex; flex-direction: column; align-items: center; }
.game-sleeps > img { width: 120px; margin: -6px 0 4px; }
.game-sleeps .btn-gold { min-height: 54px; font-size: 19px; padding: 0 30px; margin-top: 2px; animation: none; }
.practice-end { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 20px; }
.practice-end img { width: min(48%, 190px); filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.4)); animation: pop-in 0.5s cubic-bezier(.3, 1.6, .5, 1) both; }
.pe-title { font-family: var(--tale); font-size: 40px; color: var(--gold); text-shadow: 0 4px 0 #7a4a00; }
.pe-row { display: flex; gap: 10px; width: 100%; max-width: 360px; }
.pe-btn { flex: 1; height: 56px; border-radius: 20px; display: flex; align-items: center; justify-content: center; gap: 8px; font-weight: 900; font-size: 17px; color: #fff; background: rgba(255, 255, 255, 0.12); border: 2px solid rgba(255, 255, 255, 0.3); }
.pe-btn svg { width: 22px; height: 22px; }
.pe-btn.gold { background: var(--gold); color: var(--gold-ink); border-color: var(--gold-deep); box-shadow: 0 5px 0 var(--gold-deep); }

/* ---------- волшебный альбом: живые наклейки ---------- */
.st-magic { position: absolute; inset: 0; z-index: 40; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; background: radial-gradient(circle at 50% 45%, rgba(74, 63, 154, 0.85) 0%, rgba(10, 8, 40, 0.92) 70%); animation: screen-in 0.3s ease-out both; overflow: hidden; }
.st-magic.out { animation: ct-out 0.28s ease-in forwards; }
.st-magic-rays { position: absolute; left: 50%; top: 45%; width: 620px; height: 620px; margin: -310px 0 0 -310px; border-radius: 50%; background: repeating-conic-gradient(rgba(255, 214, 120, 0.22) 0 10deg, transparent 10deg 24deg); -webkit-mask: radial-gradient(circle, #000 20%, transparent 68%); mask: radial-gradient(circle, #000 20%, transparent 68%); animation: st-rays 14s linear infinite; pointer-events: none; }
@keyframes st-rays { to { transform: rotate(360deg); } }
.st-magic-card { position: relative; display: flex; flex-direction: column; align-items: center; gap: 10px; animation: st-pop 0.6s cubic-bezier(.25, 1.6, .45, 1) both; }
@keyframes st-pop { from { transform: scale(0.2) rotate(-12deg); opacity: 0; } }
.st-magic-img { width: min(72vw, 280px); aspect-ratio: 1; object-fit: contain; filter: drop-shadow(0 0 24px rgba(255, 210, 110, 0.6)) drop-shadow(0 12px 18px rgba(0, 0, 0, 0.4)); animation: st-float 3s ease-in-out infinite; }
@keyframes st-float { 50% { transform: translateY(-8px); } }
.st-magic-name { font-family: var(--tale); font-size: 30px; color: var(--gold); text-shadow: 0 3px 0 #7a4a00, 0 0 20px rgba(255, 201, 74, 0.5); text-align: center; }
.st-magic-hint { position: absolute; bottom: calc(24px + var(--bottom)); font-size: 14px; font-weight: 800; color: var(--muted); }

/* ---------- Волшебные ниточки (js/games/letters.js → match) ---------- */
/* слева буквы, справа картинки; ребёнок ведёт пальцем цветную ниточку от буквы к картинке */
.mt-game { padding-top: 12px; }
.mt-board {
  --tok: 76px; --tok: min(88px, calc(100cqh / var(--n) - 24px));
  position: relative; flex: 1; width: min(420px, 100%); min-height: 0; padding: 0 10px;
  display: flex; justify-content: space-between; container-type: size;
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.mt-col { position: relative; z-index: 1; display: flex; flex-direction: column; justify-content: space-around; align-items: center; }
.mt-tok { position: relative; width: var(--tok); height: var(--tok); cursor: grab; animation: mt-in 0.5s calc(var(--i) * 0.09s) cubic-bezier(.3, 1.5, .5, 1) both; }
@keyframes mt-in { from { opacity: 0; transform: scale(0.3); } }
.mt-face { width: 100%; height: 100%; display: grid; place-items: center; transition: transform 0.2s, box-shadow 0.3s, border-color 0.3s; }
/* буква — медальон с кольцом цвета своей ниточки */
.mt-letter .mt-face {
  border-radius: 50%; background: radial-gradient(circle at 50% 32%, #43379a 0%, #241d61 100%);
  border: 3px solid var(--tc); box-shadow: 0 0 16px -2px var(--tc), inset 0 0 0 5px rgba(255, 255, 255, 0.05);
}
.mt-letter .ll { --s: calc(var(--tok) * 0.62) !important; pointer-events: none; }
/* картинка — светлая карточка; кольцо окрашивается, когда к ней пришла ниточка */
.mt-pic .mt-face {
  border-radius: 24px; background: radial-gradient(circle at 50% 35%, #fffdf6 0%, #fbeccb 100%);
  border: 3px solid #e8c98a; box-shadow: 0 8px 16px rgba(0, 0, 0, 0.32);
}
.mt-pic .pic { width: 82%; height: 82%; object-fit: contain; pointer-events: none; }
/* «узелок», за который тянут ниточку */
.mt-knob {
  position: absolute; top: 50%; width: 18px; height: 18px; margin-top: -9px; border-radius: 50%;
  background: var(--tc, #fbf8ff); box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.9), 0 0 12px var(--tc, rgba(255, 255, 255, 0.8));
  animation: mt-knob 1.6s calc(var(--i) * 0.2s) ease-in-out infinite;
}
.mt-knob::before { content: ""; position: absolute; inset: -16px; border-radius: 50%; } /* узелок легко ухватить пальцем */
.mt-letter .mt-knob { right: -9px; }
.mt-pic .mt-knob { left: -9px; }
@keyframes mt-knob { 50% { transform: scale(1.3); } }
.mt-tok.grab .mt-face { transform: scale(1.08); }
.mt-tok.over .mt-face { transform: scale(1.14); box-shadow: 0 0 0 4px #fff, 0 0 24px rgba(255, 255, 255, 0.85); }
.mt-tok.done { cursor: default; }
.mt-tok.done .mt-knob { animation: none; transform: scale(1.15); }
.mt-letter.done .mt-face { box-shadow: 0 0 22px 2px var(--tc), inset 0 0 0 5px rgba(255, 255, 255, 0.08); }
.mt-letter.some .mt-face { box-shadow: 0 0 12px 0 var(--tc), inset 0 0 0 3px var(--tc); } /* у буквы два друга, один уже найден */
.mt-pic.done .mt-face { border-color: var(--tc); box-shadow: 0 0 0 3px var(--tc), 0 0 22px var(--tc); }
.mt-tok.boing .mt-face { animation: mt-boing 0.45s ease; }
@keyframes mt-boing { 40% { transform: scale(1.18); } 70% { transform: scale(0.95); } }
.mt-pic.nope .mt-face { animation: mt-nope 0.5s ease; }
@keyframes mt-nope { 20% { transform: translateX(-7px) rotate(-5deg); } 45% { transform: translateX(7px) rotate(5deg); } 70% { transform: translateX(-4px); } }
.mt-pic.hint .mt-face { animation: mt-hint 1s ease-in-out infinite; }
@keyframes mt-hint { 50% { transform: scale(1.06); box-shadow: 0 0 0 4px var(--gold), 0 0 28px rgba(255, 201, 74, 0.9); } }
/* ниточки */
.mt-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; z-index: 0; }
.mt-thread { fill: none; stroke-width: 8; stroke-linecap: round; stroke-linejoin: round; }
.mt-thread.live { stroke-width: 7; }
.mt-thread.wrong { stroke: #ff5a5f; }
.mt-glow { fill: none; stroke-width: 22; stroke-linecap: round; stroke-linejoin: round; opacity: 0.25; }
.mt-shine { fill: none; stroke: #fff; stroke-width: 3.5; stroke-linecap: round; stroke-dasharray: 0.1 18; opacity: 0.9; animation: mt-flow 1.3s linear infinite; }
@keyframes mt-flow { to { stroke-dashoffset: -36.2; } }
.mt-board.all .mt-glow { animation: mt-all 1.3s ease-out; }
@keyframes mt-all { 40% { opacity: 0.75; stroke-width: 30; } }
/* искорка на кончике пальца */
.mt-tip { position: absolute; left: -15px; top: -15px; width: 30px; height: 30px; z-index: 3; pointer-events: none; opacity: 0; transition: opacity 0.15s; }
.mt-tip svg { width: 100%; height: 100%; filter: drop-shadow(0 0 7px currentColor); animation: mt-spin 1.4s linear infinite; }
@keyframes mt-spin { to { transform: rotate(360deg); } }
.mt-board.drawing .mt-tip { opacity: 1; }
/* призрачный пальчик показывает жест */
.mt-ghost { position: absolute; left: -19px; top: -5px; width: 46px; height: 46px; z-index: 4; pointer-events: none; }
.mt-ghost svg { width: 100%; height: 100%; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.45)); }
.mt-tok.sel .mt-face { transform: scale(1.12); box-shadow: 0 0 0 4px #fff, 0 0 26px var(--tc, rgba(255, 255, 255, 0.9)); }
.mt-board.picking .mt-tok:not(.sel):not(.done) .mt-knob { animation-duration: 0.8s; }

/* ---------- Корзинка: нарисованная корзинка на пеньке ночной поляны ---------- */
.bk-game { padding: 10px 14px 0; background: #1b1a4a var(--mb-bg, url(../img/magicbook/bg.webp)) center bottom / cover no-repeat; overflow: hidden; }
.bk-game .basket-items { position: relative; z-index: 2; margin-top: 1vh; }
.bk-game .basket-item {
  background: radial-gradient(circle at 50% 35%, #fffdf6 0%, #fbeccb 100%); border: 3px solid #e8c98a; border-radius: 22px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.35), 0 0 14px rgba(255, 214, 110, 0.25);
  animation: bk-float 3s calc(var(--i, 0) * -0.5s) ease-in-out infinite;
}
.bk-game .basket-item.dragging { animation: none; box-shadow: 0 14px 26px rgba(0, 0, 0, 0.45), 0 0 22px rgba(255, 214, 110, 0.7); }
.bk-game .basket-item.selected { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold), 0 0 24px rgba(255, 201, 74, 0.9); }
@keyframes bk-float { 50% { transform: translateY(-5px); } }
.bk-zone { position: absolute; left: 50%; bottom: 28%; width: 180px; transform: translateX(-50%); z-index: 1; }
.bk-game .basket { position: relative; width: 100%; height: auto; aspect-ratio: 640 / 754; margin: 0; padding: 0; background: none; border: 0; display: block; }
.bk-img { position: absolute; inset: 0; width: 100%; height: 100%; filter: drop-shadow(0 6px 5px rgba(0, 0, 0, 0.55)); pointer-events: none; }
.bk-aura { position: absolute; left: 10%; right: 10%; top: 18%; height: 40%; border-radius: 50%; background: radial-gradient(ellipse, rgba(255, 214, 120, 0.6) 0%, rgba(255, 214, 120, 0) 70%); filter: blur(8px); animation: mb-aura 3s ease-in-out infinite; pointer-events: none; }
.bk-medal { position: absolute; left: 50.6%; top: 72.5%; width: 42%; aspect-ratio: 1; transform: translate(-50%, -50%); display: grid; place-items: center; }
.bk-game .basket .ll { --s: calc(var(--bw, 180px) * 0.27) !important; top: 0; }
.bk-game .basket.hit { animation: bk-hit 0.55s ease; }
@keyframes bk-hit { 30% { transform: scale(1.06) rotate(-2deg); } 60% { transform: scale(0.98) rotate(1.5deg); } }
.bk-game .basket-item.gone { animation: none; }
.bk-zone::before { content: ""; position: absolute; left: 6%; right: 6%; bottom: -5%; height: 12%; border-radius: 50%; background: radial-gradient(ellipse, rgba(25, 18, 5, 0.6) 0%, rgba(25, 18, 5, 0) 70%); pointer-events: none; } /* тень корзинки на пне */

/* ---------- полный доступ: замочек на карте, окно Угу, тарифы в звёздах ---------- */
.node.pay { border: 3px dashed rgba(255, 201, 74, 0.7); animation: none; }
.node.pay.done { border: none; filter: saturate(0.55) brightness(0.85); }
.pay-lock {
  position: absolute; right: -6px; top: -6px; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: var(--gold); color: #5a3a00; box-shadow: 0 3px 0 var(--gold-deep), 0 0 14px rgba(255, 201, 74, 0.6);
}
.pay-lock svg { width: 18px; height: 18px; }
.pay-ask { display: flex; flex-direction: column; align-items: center; }
.pay-ask img { width: 120px; margin: -6px 0 4px; }
.pay-ask .btn-gold { min-height: 56px; font-size: 19px; padding: 0 26px; }
.pay-ask .btn-gold svg { width: 22px; height: 22px; }
.pay-hint { margin: 6px 0 2px; font-size: 13px; font-weight: 700; color: #5b5480; line-height: 1.4; }
.parents-card .pay-open { width: 100%; min-height: 52px; font-size: 18px; margin-top: 10px; padding: 0 14px; white-space: nowrap; } /* «Открыть полный доступ» в одну строку */
.parents-card .pay-open svg { width: 22px; height: 22px; }

.paywall .page-head h1 { font-family: var(--ui); font-weight: 900; color: var(--moon); }
.pay-card { max-width: 520px; margin: 0 auto; color: var(--moon); }
.pay-lead, .pay-status { margin: 4px 0 12px; font-size: 18px; font-weight: 800; }
.pay-status { color: var(--gold); }
.pay-list { list-style: none; margin: 0 0 18px; padding: 0; display: grid; gap: 8px; }
.pay-list li { display: flex; gap: 10px; align-items: flex-start; font-size: 15.5px; font-weight: 700; line-height: 1.35; color: var(--muted); }
.pay-list svg { flex: none; width: 20px; height: 20px; color: #3ddc97; }
.pay-plans { display: grid; gap: 14px; }
.pay-plan {
  position: relative; display: grid; grid-template-columns: 1fr auto; grid-template-areas: 'name price' 'note price';
  align-items: center; gap: 2px 12px; width: 100%; padding: 18px 18px 16px; border-radius: 22px; text-align: left; color: var(--moon);
  background: #2a2463; border: 2px solid rgba(255, 255, 255, 0.12); box-shadow: 0 5px 0 #1a1548; transition: transform 0.12s;
}
.pay-plan:active { transform: translateY(3px); box-shadow: 0 2px 0 #1a1548; }
.pay-plan:disabled { opacity: 0.6; }
.pay-plan.deal { border-color: rgba(255, 201, 74, 0.55); }
.pay-plan.best { border: 3px solid var(--gold); background: linear-gradient(170deg, #3b2f7e, #2a2463); box-shadow: 0 5px 0 #1a1548, 0 0 26px rgba(255, 201, 74, 0.35); }
.pay-name { grid-area: name; font-size: 20px; font-weight: 900; }
.pay-note { grid-area: note; font-size: 13.5px; font-weight: 700; color: var(--muted); }
.pay-price { grid-area: price; display: inline-flex; align-items: center; gap: 6px; font-size: 26px; font-weight: 900; color: var(--gold); }
.pay-price svg { width: 24px; height: 24px; color: var(--gold); }
.pay-badge {
  position: absolute; top: -11px; left: 16px; padding: 4px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 900;
  letter-spacing: 0.04em; text-transform: uppercase; color: #2a1a00; background: var(--gold);
}
.pay-plan.best .pay-badge { color: #fff; background: linear-gradient(180deg, #ff9a62, #f2545b); }
.pay-msg { min-height: 22px; margin: 12px 0 0; font-size: 15px; font-weight: 800; color: var(--gold); text-align: center; }
.pay-fine { margin: 10px 0 6px; font-size: 12px; font-weight: 700; line-height: 1.45; color: rgba(251, 248, 255, 0.55); text-align: center; }
.pay-link { display: block; margin: 0 auto; padding: 6px; font-size: 13px; font-weight: 800; color: var(--gold); text-decoration: underline; text-underline-offset: 3px; }

/* словарик без доступа: закрытые буквы в ленте и замочек в конце */
.abc-chip.locked { opacity: 0.45; }
.dict-locked { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 26px 18px 30px; margin: 10px 0 96px; /* снизу место под «Угадай-ка» */
  border-radius: 24px; background: rgba(255, 255, 255, 0.06); border: 2px dashed rgba(255, 201, 74, 0.5); }
.dict-locked-ic { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: var(--gold); color: #5a3a00; }
.dict-locked-ic svg { width: 28px; height: 28px; }
.dict-locked h3 { margin: 6px 0 0; font-size: 20px; font-weight: 900; color: var(--moon); }
.dict-locked p { margin: 0 0 10px; color: var(--muted); font-weight: 700; }
.dict-locked .btn-gold { min-height: 54px; font-size: 18px; padding: 0 24px; }

/* «Для взрослых»: ссылка на сайт букваря */
/* по центру, в две строки: подпись, а под ней адрес целиком (адрес не переносится) */
.parents-card .site-link { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 100%; margin: 10px 0 2px;
  padding: 12px 14px 13px; border-radius: 16px; text-align: center;
  background: #efeafd; color: #5b5480; font-size: 14px; font-weight: 700; line-height: 1.35; }
.parents-card .site-link b { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap;
  font-size: 17px; font-weight: 900; color: #4b3fb0; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.parents-card .site-link b svg { width: 18px; height: 18px; }
.parents-card .site-link:active { transform: scale(0.98); }
.pay-gift { margin-top: -6px !important; padding: 10px 12px; border-radius: 14px; background: #fff4d6; color: #7a4a00 !important; font-size: 14.5px; }
