/* css/kid.css - детские экраны: цветной мир, выбор героя, облачко, салют, экран занятия, тропинка.
   Порядок файлов в index.html важен: правила ниже перекрывают правила выше; карта файлов - obsidian/Pally/architecture/code-map.md */
/* ---------- Детские экраны: цветной мир вместо бежевой страницы ---------- */
body { min-height: 100dvh; }
.app { position: relative; z-index: 1; --ink-bg: var(--ink); --muted-bg: var(--muted); }
body[data-world="pick"] { background: linear-gradient(180deg, #5fbfff 0%, #b3e4ff 48%, #ffe7a0 100%) fixed; }
body[data-world="bear"] { background: linear-gradient(180deg, #7cc7e8 0%, #b9e39a 52%, #fff0c2 100%) fixed; }
body[data-world="alien"] { background: linear-gradient(180deg, #281c5e 0%, #5a3fa8 55%, #a377d6 100%) fixed; }
body[data-world="dragon"] { background: linear-gradient(180deg, #ff9550 0%, #ffc573 50%, #fff0c4 100%) fixed; }
body[data-world="alien"] .app { --ink-bg: #fff; --muted-bg: #e2d8ff; }

/* Плывущие пузырьки, а в космосе — мерцающие звёзды */
body[data-world]::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, .8) 0 3px, transparent 4px),
    radial-gradient(circle, rgba(255, 255, 255, .5) 0 7px, transparent 8px),
    radial-gradient(circle, rgba(255, 255, 255, .32) 0 12px, transparent 13px);
  background-size: 150px 150px, 240px 240px, 380px 380px;
  background-position: 20px 30px, 90px 120px, 200px 60px;
  animation: bubbles 22s linear infinite;
}
body[data-world="alien"]::before {
  background-image:
    radial-gradient(circle, #fff 0 1.5px, transparent 2.5px),
    radial-gradient(circle, rgba(255, 255, 255, .8) 0 1px, transparent 2px),
    radial-gradient(circle, #ffe9a8 0 2.5px, transparent 3.5px);
  background-size: 90px 90px, 140px 140px, 310px 310px;
  animation: bubbles 60s linear infinite, twinkle-bg 2.4s ease-in-out infinite alternate;
}
@keyframes bubbles { to { background-position: 20px -120px, 90px -120px, 200px -320px; } }
@keyframes twinkle-bg { from { opacity: .55; } to { opacity: 1; } }
/* Облака на экране выбора */
body[data-world="pick"]::after {
  content: ""; position: fixed; left: -20%; top: 6%; width: 140%; height: 260px; pointer-events: none; z-index: 0;
  background:
    radial-gradient(ellipse 130px 46px at 14% 30%, #fff 62%, transparent 64%),
    radial-gradient(ellipse 90px 34px at 20% 44%, #fff 62%, transparent 64%),
    radial-gradient(ellipse 150px 50px at 78% 62%, rgba(255, 255, 255, .92) 62%, transparent 64%),
    radial-gradient(ellipse 100px 36px at 70% 74%, rgba(255, 255, 255, .92) 62%, transparent 64%),
    radial-gradient(ellipse 110px 38px at 48% 12%, rgba(255, 255, 255, .8) 62%, transparent 64%);
  animation: clouds 38s ease-in-out infinite alternate;
}
@keyframes clouds { from { transform: translateX(-6%); } to { transform: translateX(6%); } }

/* Текст, лежащий прямо на цветном фоне */
body[data-world] .brand.sm, body[data-world] .topbar h1, body[data-world] .talk-status,
body[data-world] .app > .link, body[data-world] .talk-controls .link { color: var(--ink-bg); }
/* «Для родителей» внизу детских экранов - цель касания не меньше 44 px */
body[data-world] .app > .link { min-height: 44px; }
body[data-world] .talk-heard { color: var(--muted-bg); }
body[data-world] .card { color: var(--ink); }

/* Экран выбора персонажа */
.app.wide { max-width: 880px; }
.pick-head { display: flex; align-items: flex-start; justify-content: center; gap: 12px; padding-top: 4px; }
.pick-title {
  font-family: var(--sans); font-weight: 800; text-align: center;
  font-size: clamp(28px, 5.2vw, 50px); line-height: 1.08;
  color: #fff; text-shadow: 0 3px 0 rgba(22, 70, 130, .38), 0 8px 18px rgba(22, 70, 130, .25);
  animation: wobble 3.2s ease-in-out infinite;
}
body[data-world="dragon"] .pick-title { text-shadow: 0 3px 0 rgba(150, 70, 10, .4), 0 8px 18px rgba(150, 70, 10, .25); }
.pet-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(8px, 2.2vw, 22px); align-items: end; margin-top: 10px; }
.pet-card {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: clamp(10px, 2vw, 20px) 6px clamp(12px, 2vw, 18px);
  border: 4px solid #fff; border-radius: 32px;
  color: #fff; cursor: pointer;
  box-shadow: 0 8px 0 rgba(0, 0, 0, .13), 0 16px 28px rgba(0, 0, 0, .16);
  transition: transform .28s cubic-bezier(.3, 1.5, .5, 1), opacity .25s, filter .25s, box-shadow .25s;
}
.pet-card.w-bear { background: linear-gradient(180deg, #b5e38a, #4f9b3a); }
.pet-card.w-alien { background: linear-gradient(180deg, #a98bff, #5636bd); }
.pet-card.w-dragon { background: linear-gradient(180deg, #ffd27a, #ef8236); }
.pet-card b { font-size: clamp(14px, 2.6vw, 26px); font-weight: 800; text-shadow: 0 2px 0 rgba(0, 0, 0, .2); }
.pet-fig { display: block; width: 100%; max-width: 220px; padding: 0; border: 0; background: none; cursor: pointer; }
.pet-fig .mascot-svg {
  display: block; width: 100%; height: auto;
  filter: drop-shadow(0 6px 0 rgba(0, 0, 0, .13));
  transform-origin: 50% 92%;
  animation: idle 2.6s ease-in-out infinite;
}
.pet-shadow { display: block; width: 54%; height: 12px; margin-top: -4px; border-radius: 50%; background: rgba(0, 0, 0, .22); animation: shadow 2.6s ease-in-out infinite; }
.pet-card:nth-child(2) .mascot-svg, .pet-card:nth-child(2) .pet-shadow { animation-delay: -.9s; }
.pet-card:nth-child(3) .mascot-svg, .pet-card:nth-child(3) .pet-shadow { animation-delay: -1.7s; }
.pet-card:nth-child(2) .p-eyes { animation-delay: -1.4s; }
.pet-card:nth-child(3) .p-eyes { animation-delay: -2.7s; }
.pet-grid.enter .pet-card { animation: drop-in .75s cubic-bezier(.3, 1.6, .5, 1) both; }
.pet-grid.enter .pet-card:nth-child(1) { animation-delay: .1s; }
.pet-grid.enter .pet-card:nth-child(2) { animation-delay: .28s; }
.pet-grid.enter .pet-card:nth-child(3) { animation-delay: .46s; }
.pet-card:hover { transform: translateY(-10px) scale(1.03); }
.pet-card:hover .mascot-svg { animation: wiggle .45s ease-in-out infinite; }
.pet-card:active { transform: scale(.93); }
.pet-card.dim { opacity: .62; filter: saturate(.55); transform: scale(.88); }
.pet-card.dim:hover { opacity: .95; filter: none; }
.pet-card[aria-pressed=true] { transform: scale(1.07); z-index: 2; box-shadow: 0 0 0 7px rgba(255, 255, 255, .6), 0 16px 34px rgba(0, 0, 0, .28); }
.pet-card[aria-pressed=true] .mascot-svg { animation: dance 1s ease-in-out infinite; }
.pet-grid.picked .pet-card[aria-pressed=true] .mascot-svg { animation: big-hop .85s cubic-bezier(.3, 1.4, .5, 1), dance 1s ease-in-out .85s infinite; }
.pet-card.talking .mascot-svg, .home-hero.talking .mascot-svg { animation: chat .3s ease-in-out infinite alternate; }
.pet-card:focus-visible, .pet-fig:focus-visible { outline: 4px solid #fff; outline-offset: 4px; }
.pet-card[aria-pressed=true]::before, .pet-card[aria-pressed=true]::after {
  content: "✦"; position: absolute; color: #fff7c2; font-size: clamp(20px, 3vw, 34px);
  text-shadow: 0 0 10px rgba(255, 240, 150, .9); animation: twinkle 1s ease-in-out infinite alternate;
}
.pet-card[aria-pressed=true]::before { top: 8px; left: 12px; }
.pet-card[aria-pressed=true]::after { top: 30%; right: 10px; font-size: clamp(14px, 2vw, 22px); animation-delay: .4s; }

/* Облачко со словами персонажа */
.say-bubble {
  position: relative; margin: 18px auto 0; max-width: 580px; width: 100%;
  padding: 16px 22px; border-radius: 28px;
  background: #fff; color: var(--ink);
  font-size: clamp(18px, 2.5vw, 25px); font-weight: 800; line-height: 1.3; text-align: center;
  box-shadow: 0 6px 0 rgba(0, 0, 0, .1), 0 12px 22px rgba(0, 0, 0, .1);
}
.say-bubble::before {
  content: ""; position: absolute; top: -10px; left: 50%; width: 22px; height: 22px;
  background: #fff; border-radius: 5px; transform: translateX(-50%) rotate(45deg);
}
.say-bubble.pop, .card.pop { animation: pop-in .4s cubic-bezier(.3, 1.5, .5, 1) both; }
/* Пустое облачко (ночью до первой фразы героя) не видно, но место под строку держит: экран не прыгает */
.say-bubble:empty { visibility: hidden; }
.say-bubble:empty::after { content: "\00a0"; }
.name-card { margin-top: 4px; border-width: 4px; border-color: #fff; border-radius: 30px; box-shadow: 0 8px 0 rgba(0, 0, 0, .1), 0 14px 24px rgba(0, 0, 0, .12); }
.name-card label { font-size: 22px; }
.chip.big-chip { min-height: 58px; padding: 10px 24px; font-size: 21px; font-weight: 800; border-width: 3px; }
.chip.big-chip:hover { transform: translateY(-3px); }
.chip.big-chip[aria-pressed=true] { background: var(--sun); border-color: #d99a12; color: var(--ink); }
.btn.go-btn { min-height: 66px; font-size: 24px; background: #35b36b; box-shadow: 0 6px 0 #1f7d47; }
.btn.go-btn:hover { background: #2fa461; }
.btn.go-btn:not(:disabled) { animation: throb 1.1s ease-in-out infinite; }

/* Персонаж на главном экране */
.home-hero { display: flex; flex-direction: column; align-items: center; }
.home-hero .pet-fig { width: clamp(150px, 42vw, 210px); }
.home-hero .pet-fig.poked .mascot-svg { animation: big-hop .8s cubic-bezier(.3, 1.4, .5, 1), idle 2.6s ease-in-out .8s infinite; }
.home-hero .say-bubble { margin-top: 14px; }
.home-hero + .hero-row { justify-content: center; }
.home-hero + .hero-row .badges { justify-content: center; margin-top: 0; }
.pet-trio { display: flex; gap: 10px; justify-content: center; }
.cta-final .pet-trio .mascot { width: 92px; height: 92px; }

/* Салют и подсказка про звук */
#fx { position: fixed; inset: 0; pointer-events: none; z-index: 60; overflow: hidden; }
#fx i { position: absolute; width: 11px; height: 15px; border-radius: 3px; }
/* Значок «Послушать» (решение 108): пока браузер не дал звучать, в облачке героя пульсирует динамик и показывает рука.
   Ставит и убирает soundNudge в app/speech.js; вид - из мокапа mockups/sound-nudge */
.nudge-host { position: relative; }
/* #app - сильнее отступов облачка на отдельных экранах (.app.map .say-bubble, .isl-hero .say-bubble) */
#app .say-bubble.nudge-bubble, #app .bubble.nudge-bubble { padding-right: 96px; }
.snd-nudge {
  position: absolute; right: -26px; top: 50%; z-index: 5; display: grid; place-items: center;
  width: 92px; height: 92px; margin-top: -46px; padding: 0; border: 0; border-radius: 50%;
  background: #ffc83a; box-shadow: 0 6px 0 #d99a12; cursor: pointer;
  animation: snd-pulse 1.4s ease-in-out infinite;
}
.snd-nudge svg { width: 48px; height: 48px; fill: #3a2600; }
.snd-nudge::before, .snd-nudge::after {
  content: ""; position: absolute; inset: -10px; border-radius: 50%; border: 4px solid rgba(255, 200, 58, .75);
  animation: snd-ring 1.4s ease-out infinite; pointer-events: none;
}
.snd-nudge::after { animation-delay: .7s; }
/* Касание было: значок прозрачный, пока не уберётся (app/speech.js, pendingPlay) */
.snd-nudge.gone { opacity: 0; animation: none; }
.snd-nudge.gone::before, .snd-nudge.gone::after, .snd-nudge.gone .snd-hand { display: none; }
.snd-hand {
  position: absolute; right: -30px; top: calc(50% + 26px); font-size: 54px; line-height: 1; pointer-events: none;
  filter: drop-shadow(0 3px 2px rgba(0, 0, 0, .3)); animation: snd-tap 1.4s ease-in-out infinite;
}
/* Облачка нет - значок у самого героя, сверху справа; нет и героя - в углу экрана */
.nudge-hero > .snd-nudge { top: 0; right: -10px; margin-top: 0; }
.snd-nudge.corner { position: fixed; top: 14px; right: 40px; margin-top: 0; z-index: 70; }
@keyframes snd-pulse { 50% { transform: scale(1.08); } }
@keyframes snd-ring { from { transform: scale(.85); opacity: 1; } to { transform: scale(1.35); opacity: 0; } }
@keyframes snd-tap { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(-14px, -14px); } }
@media (max-width: 820px) {
  .snd-nudge { right: 12px; width: 68px; height: 68px; margin-top: -34px; }
  .snd-nudge svg { width: 36px; height: 36px; }
  .snd-hand { right: -10px; top: calc(50% + 14px); font-size: 40px; }
  .nudge-hero > .snd-nudge { right: -6px; }
}

@keyframes idle { 0%, 100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-11px) rotate(3deg); } }
@keyframes shadow { 0%, 100% { transform: scaleX(1); opacity: .9; } 50% { transform: scaleX(.76); opacity: .5; } }
@keyframes drop-in { from { opacity: 0; transform: translateY(-90px) scale(.55) rotate(-10deg); } to { opacity: 1; transform: none; } }
@keyframes wiggle { 0%, 100% { transform: rotate(-8deg); } 50% { transform: rotate(8deg); } }
@keyframes dance { 0%, 100% { transform: rotate(-7deg) translateY(0); } 50% { transform: rotate(7deg) translateY(-9px); } }
@keyframes big-hop {
  0% { transform: translateY(0) scale(1, 1); }
  18% { transform: translateY(6px) scale(1.14, .84); }
  50% { transform: translateY(-38px) scale(.93, 1.12) rotate(9deg); }
  80% { transform: translateY(0) scale(1.1, .9); }
  100% { transform: none; }
}
@keyframes chat { from { transform: translateY(0) rotate(-4deg); } to { transform: translateY(-6px) rotate(4deg); } }
@keyframes pop-in { from { opacity: 0; transform: translateY(18px) scale(.8); } to { opacity: 1; transform: none; } }
@keyframes twinkle { from { opacity: .3; transform: scale(.7) rotate(-12deg); } to { opacity: 1; transform: scale(1.2) rotate(12deg); } }
@keyframes wobble { 0%, 100% { transform: rotate(-1.2deg); } 50% { transform: rotate(1.2deg); } }
@keyframes throb { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.04); } }

@media (prefers-reduced-motion: reduce) {
  .p-eyes, .p-sway, .p-tail, .p-wing-l, .p-wing-r, .p-glow, .p-arm-l, .p-arm-r, .p-mouth-open,
  .pet-fig .mascot-svg, .pet-shadow, .pet-grid.enter .pet-card, .card.pop, .say-bubble.pop, .pick-title,
  .btn.go-btn, .snd-nudge, .snd-nudge::before, .snd-nudge::after, .snd-hand, body[data-world]::before, body[data-world]::after,
  .pet-card[aria-pressed=true]::before, .pet-card[aria-pressed=true]::after { animation: none !important; }
}
.form-card audio { width: 100%; }

/* ---------- Экран занятия: живой, но задание остаётся на спокойной белой карточке ---------- */
.steps { flex: 1; display: flex; align-items: center; justify-content: center; gap: 5px; min-width: 0; }
.steps i {
  flex: 1; max-width: 28px; aspect-ratio: 1;
  display: grid; place-items: center;
  border-radius: 50%; border: 2px solid rgba(255, 255, 255, .95);
  background: rgba(255, 255, 255, .5);
  font-style: normal; font-size: 13px; font-weight: 800; color: #fff; line-height: 1;
}
.steps i.now { background: #fff; box-shadow: 0 0 0 3px rgba(255, 255, 255, .55); animation: throb 1s ease-in-out infinite; }
.steps i.done.star { background: var(--sun); color: #7a4b00; }
.steps i.done.ok { background: #35b36b; }
.steps i.done.try { background: #9db6c8; }
/* Пример не совпал с тетрадью и делается в тетради сам: отмечен спокойно, без красного, но не как ещё не решённый */
.steps i.done.skip { background: transparent; border-style: dashed; color: #fff; }
.steps i.new { animation: star-in .55s cubic-bezier(.3, 1.7, .5, 1); }
.topbar .combo { flex: none; margin: 0; font-weight: 800; font-size: 15px; }

.run-card {
  display: flex; flex-direction: column; gap: 10px;
  padding: 16px 18px; border-radius: 26px;
  background: #fff; color: var(--ink);
  box-shadow: 0 6px 0 rgba(0, 0, 0, .1), 0 12px 22px rgba(0, 0, 0, .1);
}
.run-card .big { border: 0; background: var(--bg); }
.run-card .question { font-size: 21px; }
.slide { animation: slide-in .38s cubic-bezier(.3, 1.3, .5, 1) both; }
.answers.slide { animation-delay: .07s; }

.run-pet { display: flex; align-items: center; gap: 12px; }
.run-pet .pet-fig { flex: none; width: 86px; cursor: default; }
.run-pet.happy .mascot-svg { animation: big-hop .8s cubic-bezier(.3, 1.4, .5, 1), idle 2.6s ease-in-out .8s infinite; }
.run-pet.happy .p-arm-r { animation: wave .4s ease-in-out infinite alternate; }
.run-pet.think .mascot-svg { animation: think 1.8s ease-in-out infinite; }
.run-pet.talking .mascot-svg { animation: chat .3s ease-in-out infinite alternate; }
.say-bubble::before { background: inherit; }
.say-bubble.side {
  flex: 1; margin: 0; padding: 12px 16px; border-radius: 22px;
  display: flex; flex-direction: column; gap: 4px;
  font-size: 17px; font-weight: 700; text-align: left;
}
.say-bubble.side::before { top: 50%; left: -8px; width: 18px; height: 18px; transform: translateY(-50%) rotate(45deg); }
.say-bubble.side b { font-weight: 800; }
.say-bubble.side span { font-weight: 600; }
.say-bubble.side.hint { background: #fff3cf; }
.say-bubble.side.good { background: #d9f6e3; font-size: 22px; }
.say-bubble.side.steps { background: #dff1f6; }
.say-bubble .thinking { animation: pulse 1.2s ease-in-out infinite; }

.answers { display: flex; flex-direction: column; gap: 10px; }
.option {
  border: 0; border-radius: 20px;
  box-shadow: 0 5px 0 rgba(0, 0, 0, .15);
  transition: transform .08s, box-shadow .08s;
}
.option.c0 { background: #ffe9a8; }
.option.c1 { background: #c2e7ff; }
.option.c2 { background: #caf3d5; }
.option.c3 { background: #ffd5df; }
.option:hover:not(:disabled) { transform: translateY(-2px); border-color: transparent; }
.option:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 1px 0 rgba(0, 0, 0, .15); }
.option.right { background: #35b36b; color: #fff; animation: pop-good .45s cubic-bezier(.3, 1.6, .5, 1); }
.option.wrong { background: #f1c4bd; color: #8f5a52; box-shadow: none; }
.option.shake, .entry.shake { animation: shake .4s ease-in-out; }
.entry { border: 3px dashed var(--sun); background: #fff; border-radius: 20px; }
.entry.right { border-style: solid; border-color: #35b36b; background: #d9f6e3; color: #1f7d47; animation: pop-good .45s cubic-bezier(.3, 1.6, .5, 1); }
.key {
  border: 0; border-radius: 18px; background: #fff;
  box-shadow: 0 4px 0 rgba(0, 0, 0, .14);
  transition: transform .06s, box-shadow .06s;
}
.key:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0, 0, 0, .14); background: var(--sun-soft); }
.key.ok-key { background: #35b36b; box-shadow: 0 4px 0 #1f7d47; }
.key.ok-key:active:not(:disabled) { background: #2fa461; }

@keyframes slide-in { from { opacity: 0; transform: translateX(46px); } to { opacity: 1; transform: none; } }
@keyframes star-in { from { transform: scale(0) rotate(-140deg); } to { transform: scale(1) rotate(0); } }
@keyframes pop-good { 0% { transform: scale(1); } 45% { transform: scale(1.09); } 100% { transform: scale(1); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-9px); } 40% { transform: translateX(8px); } 60% { transform: translateX(-6px); } 80% { transform: translateX(4px); } }
@keyframes think { 0%, 100% { transform: rotate(-9deg); } 50% { transform: rotate(-3deg) translateY(-4px); } }

@media (prefers-reduced-motion: reduce) {
  .slide, .steps i, .option, .entry, .run-pet .mascot-svg, .say-bubble .thinking { animation: none !important; }
}

/* ---------- Детские экраны на весь экран: карта-дорожка и сцена занятия ---------- */
body[data-world] .app h1, body[data-world] .app h2 { font-family: var(--sans); font-weight: 800; }

.app.map { max-width: 1120px; gap: 18px; padding-bottom: 60px; }
.hud { display: flex; align-items: center; gap: 10px; }
.hud .spacer { flex: 1; }
.hud-pill {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 46px; padding: 6px 18px;
  border: 0; border-radius: 999px;
  background: #fff; color: var(--ink);
  font: 800 19px var(--sans);
  box-shadow: 0 4px 0 rgba(0, 0, 0, .13);
}
button.hud-pill { cursor: pointer; }
button.hud-pill:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0, 0, 0, .13); }
.hud-pill.ok { background: #d9f6e3; color: #1f7d47; }
.hud-btn {
  width: 48px; height: 48px; display: grid; place-items: center;
  border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .75); color: var(--ink); cursor: pointer;
}
.hud-btn:hover { background: #fff; }

.home-stage { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.home-hero .pet-fig { width: clamp(170px, 44vw, 250px); }
.home-side { display: flex; flex-direction: column; align-items: center; gap: 18px; width: 100%; }
.home-side .say-bubble { margin-top: 6px; }
.round-row { display: flex; justify-content: center; gap: 26px; }
.round-btn {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 0; border: 0; background: none; cursor: pointer;
  font: 800 16px var(--sans);
}
.round-face {
  width: 100px; height: 100px; display: grid; place-items: center;
  border: 5px solid #fff; border-radius: 50%; color: #fff;
  box-shadow: 0 8px 0 rgba(0, 0, 0, .17), 0 16px 24px rgba(0, 0, 0, .14);
  transition: transform .12s, box-shadow .12s;
}
.round-btn.talk .round-face { background: linear-gradient(180deg, #ff9d60, #ec6630); }
.round-btn.shop .round-face { background: linear-gradient(180deg, #b890ff, #7a4fdc); }
.round-btn b { padding: 4px 14px; border-radius: 999px; background: #fff; color: var(--ink); box-shadow: 0 3px 0 rgba(0, 0, 0, .1); }
.round-btn:hover:not(:disabled) .round-face { transform: translateY(-5px); }
.round-btn:active:not(:disabled) .round-face { transform: translateY(5px); box-shadow: 0 2px 0 rgba(0, 0, 0, .17); }
.round-btn:disabled { cursor: default; }
.round-btn:disabled .round-face { background: #c9d3da; box-shadow: 0 6px 0 rgba(0, 0, 0, .1); }
.round-btn:focus-visible .round-face, .node:focus-visible, .hud-btn:focus-visible, .hud-pill:focus-visible { outline: 4px solid #fff; outline-offset: 4px; }
.ribbon { padding: 9px 18px; border-radius: 999px; background: #fff7c9; color: var(--ink); font-weight: 800; text-align: center; }
/* Короткая лента «Уже твоё: N наград» - только на низком окне (решение 41), см. ниже */
.ribbon .rb-short { display: none; }

.subj-switch { display: flex; justify-content: center; gap: 10px; }
.subj-switch .chip { background: rgba(255, 255, 255, .7); border-color: transparent; }
.subj-switch .chip[aria-pressed=true] { background: #fff; border-color: #fff; color: var(--ink); box-shadow: 0 4px 0 rgba(0, 0, 0, .13); }
.trails { display: flex; justify-content: center; gap: 48px; }
.trail { display: none; flex-direction: column; align-items: center; gap: 22px; }
.trail.active { display: flex; }
.trail-title { padding: 9px 30px; border-radius: 999px; color: #fff; font-size: 22px; box-shadow: 0 5px 0 rgba(0, 0, 0, .16); }
.trail-title.t-math { background: #2c8ad6; }
.trail-title.t-rus { background: #df5a41; }
.trail-track { position: relative; width: 340px; }
.trail-line { position: absolute; left: 0; top: 0; }
.trail-line path { fill: none; stroke-linecap: round; }
/* Тропинка: полупрозрачная «дорога» и белый пунктир посередине — видна на любом фоне */
.trail-line .road { stroke: rgba(24, 60, 90, .17); stroke-width: 38; }
.trail-line .dash { stroke: #fff; stroke-width: 6; stroke-dasharray: 14 18; }

.stop { position: absolute; width: 176px; margin: -46px 0 0 -88px; display: flex; flex-direction: column; align-items: center; }
.stop.now { margin-top: -94px; z-index: 2; }
.node {
  width: 92px; height: 92px; display: grid; place-items: center;
  padding: 0; border: 5px solid #fff; border-radius: 50%; color: #fff;
  box-shadow: 0 8px 0 rgba(0, 0, 0, .18), 0 16px 22px rgba(0, 0, 0, .14);
}
.node-face { display: grid; place-items: center; }
.node.done { background: linear-gradient(180deg, #ffd964, #f1a51c); color: #7a4b00; }
.node.part { background: linear-gradient(180deg, #fff0bd, #f5d27a); color: #a87a16; }
.node.lock { background: #cfd8de; color: #8d9ba6; box-shadow: 0 6px 0 rgba(0, 0, 0, .1); }
button.node.now {
  width: 116px; height: 116px; cursor: pointer;
  background: linear-gradient(180deg, #64dd8f, #25a058);
  animation: node-pulse 1.5s ease-in-out infinite;
  transition: transform .12s;
}
button.node.now:hover { transform: scale(1.07); }
button.node.now:active { transform: scale(.94); }
.start-tag {
  margin-bottom: 8px; padding: 4px 14px; border-radius: 12px;
  background: #fff; color: #1f8a4a;
  font: 800 15px var(--sans); text-transform: uppercase; letter-spacing: .05em;
  box-shadow: 0 3px 0 rgba(0, 0, 0, .12);
  animation: tag-bounce .7s ease-in-out infinite alternate;
}
.stop-label {
  margin-top: 9px; max-width: 176px; padding: 4px 11px; border-radius: 12px;
  background: rgba(255, 255, 255, .93); color: var(--ink);
  font: 700 13px/1.25 var(--sans); text-align: center;
}
.stop.lock .stop-label { opacity: .7; }
.stop.now .stop-label { font-size: 15px; font-weight: 800; }

@keyframes node-pulse {
  0%, 100% { box-shadow: 0 8px 0 rgba(0, 0, 0, .18), 0 0 0 0 rgba(255, 255, 255, .75); }
  50% { box-shadow: 0 8px 0 rgba(0, 0, 0, .18), 0 0 0 16px rgba(255, 255, 255, 0); }
}
@keyframes tag-bounce { from { transform: translateY(0); } to { transform: translateY(-7px); } }

@media (min-width: 900px) {
  /* Карта: персонаж слева, облачко и кнопки справа, обе дорожки рядом */
  .subj-switch { display: none; }
  .trail { display: flex; }
  .home-stage { flex-direction: row; justify-content: center; align-items: center; gap: 30px; }
  .home-hero .pet-fig { width: 270px; }
  .home-side { align-items: flex-start; width: auto; max-width: 480px; }
  .home-side .say-bubble { margin: 0; text-align: left; font-size: 26px; }
  .home-side .say-bubble::before { top: 50%; left: -9px; transform: translateY(-50%) rotate(45deg); }
  .round-row { justify-content: flex-start; }
  .round-face { width: 112px; height: 112px; }
  .round-btn { font-size: 18px; }
  .trails { gap: 90px; margin-top: 10px; }
  .trail-title { font-size: 26px; }

  /* Занятие: персонаж слева во весь рост, задание и ответы справа, всё крупнее */
  .app.lesson {
    max-width: 1080px; padding-top: 24px;
    display: grid; grid-template-columns: 320px 1fr; column-gap: 40px; row-gap: 18px;
    grid-template-areas: "top top" "pet card" "pet answers" "pet foot";
    align-content: start;
  }
  .app.lesson .topbar { grid-area: top; }
  .app.lesson .steps i { max-width: 40px; font-size: 18px; border-width: 3px; }
  .app.lesson .steps { gap: 9px; }
  .app.lesson .run-card { grid-area: card; padding: 26px 30px; gap: 16px; border-radius: 32px; }
  .app.lesson .run-card .question { font-size: 30px; line-height: 1.3; }
  .app.lesson .stage { font-size: 15px; }
  .app.lesson .big { font-size: 68px; padding: 26px 16px; }
  .app.lesson .big.emoji { font-size: 46px; }
  .app.lesson .big.picture { font-size: 120px; }
  .app.lesson .run-pet { grid-area: pet; flex-direction: column; align-self: start; position: sticky; top: 24px; gap: 18px; }
  .app.lesson .run-pet .pet-fig { width: 250px; }
  .app.lesson .say-bubble.side { font-size: 21px; padding: 16px 20px; width: 100%; }
  .app.lesson .say-bubble.side.good { font-size: 30px; text-align: center; }
  .app.lesson .say-bubble.side::before { top: -9px; left: 50%; transform: translateX(-50%) rotate(45deg); }
  .app.lesson .answers { grid-area: answers; gap: 14px; }
  .app.lesson .options { gap: 16px; }
  .app.lesson .option { min-height: 104px; font-size: 34px; border-radius: 26px; }
  .app.lesson .option.pic { font-size: 64px; }
  .app.lesson .entry { min-height: 88px; font-size: 46px; }
  .app.lesson .keypad { gap: 12px; }
  .app.lesson .key { min-height: 76px; font-size: 30px; border-radius: 22px; }
  .app.lesson > .btn { grid-area: foot; }
  .app.lesson > .spacer { display: none; }
  .app.lesson .icon-btn { width: 52px; height: 52px; font-size: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  button.node.now, .start-tag { animation: none !important; }
}

/* Движения рук и рта у персонажей отключены: на нарисованных кодом фигурках они выглядели нелепо
   (рука отрывалась от тела, открытый рот сливался с носом). Остаются покачивание, моргание и прыжок. */
.p-arm-l, .p-arm-r { animation: none !important; }
.p-mouth-open { display: none; }
.talking .p-mouth, .speaking .p-mouth { opacity: 1; }
.home-hero .pet-fig.poked .mascot-svg { animation: hop-soft .5s ease-out, idle 2.6s ease-in-out .5s infinite; }
.run-pet.happy .mascot-svg { animation: hop-soft .5s ease-out, idle 2.6s ease-in-out .5s infinite; }
.pet-grid.picked .pet-card[aria-pressed=true] .mascot-svg { animation: hop-soft .5s ease-out, idle 2.6s ease-in-out .5s infinite; }
.pet-card[aria-pressed=true] .mascot-svg, .pet-card:hover .mascot-svg { animation: idle 2.6s ease-in-out infinite; }
.pet-card.talking .mascot-svg, .home-hero.talking .mascot-svg, .run-pet.talking .mascot-svg, .talk-stage.speaking .mascot { animation: idle 1.2s ease-in-out infinite; }
@keyframes hop-soft { 0% { transform: translateY(0); } 45% { transform: translateY(-16px); } 100% { transform: translateY(0); } }
img.mascot-svg { display: block; width: 100%; height: 100%; object-fit: contain; user-select: none; -webkit-user-drag: none; }
