/* Tiny Hands Learn: the website's look (colours, Fredoka and Nunito, the drifting pastel gradient)
   for a full-screen app made for small fingers. Games add their own rules at the end, each
   prefixed by its name. */

:root {
  --primary: #7C6BBF; --primary-light: #F0EBFF; --primary-dark: #6354A4;
  --text: #2D2D2D; --muted: #8B8580; --salmon: #F4845F; --green: #5CC24A; --gold: #FFC93C;
  --blue: #4FA8F0; --paper: #FFFAF7;
  --title: 'Fredoka', 'Fredoka One', system-ui, sans-serif;
  --body: 'Nunito', system-ui, sans-serif;
  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; background: var(--paper); color: var(--text); font-family: var(--body); font-weight: 700;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
button:disabled { cursor: default; }
img.emo { display: block; object-fit: contain; pointer-events: none; -webkit-user-drag: none; }
/* the 3D cast (Bubba's poses) is drawn with room around it: a little larger, to fill the place an emoji did */
img.emo.char, img.story-emo.char { scale: 1.3; }
#learn { position: fixed; inset: 0; overflow: hidden; }

/* screens stack over each other; each fills the window */
.screen { position: absolute; inset: 0; display: flex; flex-direction: column; overflow: hidden; background: var(--paper);
  padding-top: var(--safe-t); animation: screen-in .3s ease-out both; }
.screen.leaving { animation: screen-out .25s ease-in both; }
@keyframes screen-in { from { opacity: 0; transform: translateY(14px); } }
@keyframes screen-out { to { opacity: 0; transform: translateY(14px); } }
.drift { background: linear-gradient(135deg, #DDD0FF, #C8E8F0, #FFD9C4, #D8CCFF, #C4F0D8, #E0D4FF); background-size: 400% 400%; animation: screen-in .3s ease-out both, drift 40s ease-in-out infinite; }
@keyframes drift { 0%, 100% { background-position: 0% 0%; } 50% { background-position: 100% 100%; } }
.center { align-items: center; justify-content: center; text-align: center; padding: 24px; }
.spacer { flex: 1 1 0; min-height: 8px; }
.muted { color: var(--muted); font-weight: 600; }
.small { font-size: 14px; }
.lead { font-size: 19px; text-align: center; }
.title { font-family: var(--title); font-weight: 700; color: var(--primary); font-size: 40px; text-align: center; line-height: 1.1; }
.letter { font-family: var(--title); font-weight: 700; line-height: 1; }

/* Bubba bobbing */
.bubba-bob { animation: bob 1.6s ease-in-out infinite alternate; filter: drop-shadow(0 6px 10px rgba(79,168,240,.3)); }
@keyframes bob { from { transform: translateY(4%) rotate(-4deg); } to { transform: translateY(-4%) rotate(4deg); } }
@media (prefers-reduced-motion: reduce) { .bubba-bob, .drift { animation: none; } }

/* buttons */
.big-btn { display: block; width: 100%; max-width: 520px; margin: 0 auto; min-height: 60px; border-radius: 999px; background: var(--salmon); color: #fff;
  font-size: 20px; font-weight: 800; box-shadow: 0 4px 8px rgba(0,0,0,.12); transition: transform .12s; }
.big-btn:active { transform: scale(.96); }
.big-btn:disabled { background: rgba(139,133,128,.35); box-shadow: none; }
.round-btn { width: 48px; height: 48px; flex: none; display: grid; place-items: center; border-radius: 50%; background: rgba(255,255,255,.9);
  color: var(--primary); box-shadow: 0 2px 6px rgba(0,0,0,.08); transition: transform .12s; }
.round-btn.plain { background: none; box-shadow: none; color: var(--muted); }
.round-btn:active, .answer:active, .place:active, .stop:active, .harbour:active, .child-chip:active { transform: scale(.94); }

.top-bar { display: flex; align-items: center; gap: 14px; padding: 10px 18px 6px; position: relative; z-index: 5; }
.top-bar.float { position: absolute; left: 0; right: 0; top: var(--safe-t); }
.top-bar .grow { flex: 1; }
.progress { flex: 1; height: 16px; border-radius: 99px; background: rgba(0,0,0,.07); overflow: hidden; }
.progress i { display: block; height: 100%; width: 18px; border-radius: 99px; background: linear-gradient(#8BD96E, #5CC24A); transition: width .5s cubic-bezier(.3,1.3,.5,1); }
.progress.salmon { height: 14px; background: rgba(255,255,255,.7); }
.progress.salmon i { background: var(--salmon); }

/* the start screen */
.start { align-items: center; justify-content: center; gap: 24px; cursor: pointer; }
.tap-pill { background: var(--salmon); color: #fff; padding: 16px 34px; border-radius: 99px; font-size: 22px; font-weight: 800;
  box-shadow: 0 6px 16px rgba(244,132,95,.35); animation: pulse 1.4s ease-in-out infinite alternate; }
@keyframes pulse { to { transform: scale(1.07); } }
.loading { align-items: center; justify-content: center; }

/* first run */
.firstrun-body { flex: 1; display: flex; justify-content: center; padding: 0 24px calc(24px + var(--safe-b)); overflow-y: auto; }
.fr-step { width: 100%; max-width: 560px; display: flex; flex-direction: column; align-items: center; gap: 18px; animation: slide-in .4s cubic-bezier(.3,1.2,.5,1) both; }
@keyframes slide-in { from { opacity: 0; transform: translateX(40px); } }
.q { font-family: var(--title); font-weight: 700; font-size: 32px; text-align: center; color: var(--text); }
.name-input { width: 100%; font: 800 30px var(--body); padding: 14px 20px; border-radius: 20px; border: 2px solid rgba(124,107,191,.5); background: #fff; color: var(--text); outline: none; -webkit-user-select: text; user-select: text; }
.age-grid, .buddy-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; width: 100%; }
.age-grid button { min-height: 90px; border-radius: 24px; background: #fff; color: var(--primary); font: 700 44px var(--title); box-shadow: 0 3px 8px rgba(0,0,0,.06); }
.age-grid button.on { background: var(--primary); color: #fff; }
.buddy-grid button { aspect-ratio: 1; display: grid; place-items: center; border-radius: 50%; background: #fff; border: 4px solid transparent; box-shadow: 0 3px 8px rgba(0,0,0,.06); transition: transform .2s; }
.buddy-grid button.on { background: var(--primary-light); border-color: var(--primary); transform: scale(1.08); }
.pair { display: flex; align-items: flex-end; }
.pair > img { margin-left: -10px; transform: translateY(20px); }

/* ---------- the village ---------- */
.village { background: #4FA8E8; }
.village-world { position: absolute; inset: 0; }
/* the island (island.js): the sea stays put, the island scrolls over it, cloud shadows drift over both */
.isl-sea { position: absolute; inset: 0; overflow: hidden; background: radial-gradient(ellipse 80% 60% at 50% 45%, #6CCBF2, #3E9BE0 70%, #2F86D0); }
.isl-wave { position: absolute; width: 46px; height: 12px; border-top: 4px solid rgba(255,255,255,.35); border-radius: 50% 50% 0 0; animation: isl-wave 3.2s ease-in-out infinite alternate; }
@keyframes isl-wave { from { transform: translateX(-10px); opacity: .5; } to { transform: translateX(10px); opacity: 1; } }
.isl-boat { position: absolute; filter: drop-shadow(0 6px 4px rgba(0,40,90,.18)); }
.isl-boat.a { top: 14%; animation: isl-sail 70s linear infinite; }
.isl-boat.b { top: 78%; animation: isl-sail 95s linear infinite reverse; animation-delay: -40s; }
.isl-boat.b img { transform: scaleX(-1); }
@keyframes isl-sail { from { left: -90px; } to { left: calc(100% + 90px); } }
.isl-dolphin { position: absolute; left: 82%; top: 62%; opacity: 0; animation: isl-jump 11s ease-in-out infinite; }
@keyframes isl-jump { 0%, 70% { opacity: 0; transform: translate(0, 30px) rotate(-30deg); } 74% { opacity: 1; } 80% { transform: translate(40px, -50px) rotate(10deg); } 87% { opacity: 1; transform: translate(80px, 20px) rotate(50deg); } 90%, 100% { opacity: 0; transform: translate(80px, 40px) rotate(50deg); } }
.isl-scroll { position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; }
.isl-stage { position: relative; margin: 0 auto; }
.isl-map { position: absolute; left: 0; top: var(--pad-top); width: 1000px; transform-origin: 0 0; }
.isl-land { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; }
.isl-foam { animation: isl-foam 6s linear infinite; }
@keyframes isl-foam { to { stroke-dashoffset: -88; } }
.isl-lead { animation: isl-march 1.2s linear infinite; }
@keyframes isl-march { to { stroke-dashoffset: -52; } }
.isl-decor { position: absolute; transform: translate(-50%, -50%); pointer-events: none; filter: drop-shadow(0 6px 3px rgba(40,90,30,.18)); }
.isl-map .place .building > .emo { filter: drop-shadow(0 10px 6px rgba(40,70,30,.25)); }
.isl-map .place .label { font-size: calc(var(--s) * .2); padding: 6px 16px; box-shadow: 0 3px 6px rgba(0,0,0,.08); }
.isl-map .place .lock { font-size: calc(var(--s) * .16); padding: 4px 8px; }
.isl-map .place.closed { opacity: 1; }
.isl-map .place.closed .building > .emo { filter: grayscale(.55) brightness(1.05) opacity(.75); }
.isl-clouds { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.isl-clouds i { position: absolute; width: 420px; height: 220px; border-radius: 50%; background: rgba(20,60,110,.07); filter: blur(30px); animation: isl-cloud 80s linear infinite; }
.isl-clouds i:nth-child(1) { top: 10%; } .isl-clouds i:nth-child(2) { top: 45%; animation-delay: -30s; animation-duration: 110s; } .isl-clouds i:nth-child(3) { top: 75%; animation-delay: -60s; }
@keyframes isl-cloud { from { left: -460px; } to { left: 100%; } }
.village .harbour { align-items: flex-end; position: absolute; left: 12px; bottom: calc(12px + var(--safe-b)); z-index: 3; }
@media (prefers-reduced-motion: reduce) { .isl-wave, .isl-boat, .isl-dolphin, .isl-foam, .isl-lead, .isl-clouds i { animation: none; } .isl-dolphin { display: none; } }
.place { position: absolute; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 4px; transition: transform .12s; }
.place:active { transform: translate(-50%, -50%) scale(.94); }
.place.closed { opacity: .6; }
.place .building { position: relative; display: block; }
.place .sign { position: absolute; right: calc(var(--s) * -0.12); top: calc(var(--s) * -0.06); background: #fff; border-radius: 50%; padding: calc(var(--s) * .05); }
/* a building's sign: its unit's letters */
.place .sign.letters { right: auto; left: 50%; top: calc(var(--s) * -0.2); transform: translateX(-50%); border-radius: 999px; padding: calc(var(--s) * .04) calc(var(--s) * .1); font-weight: 800; font-size: calc(var(--s) * .2); line-height: 1; color: #5B4BA8; white-space: nowrap; box-shadow: 0 3px 0 rgba(0,0,0,.12); }
.place.closed .sign.letters { opacity: .75; }
.place .lock { position: absolute; left: calc(var(--s) * -0.05); top: 30%; background: #fff; border-radius: 50%; padding: 2px 5px; font-size: calc(var(--s) * .14); }
.place .label { font-weight: 800; font-size: max(12px, calc(var(--s) * .15)); background: rgba(255,255,255,.9); padding: 4px 10px; border-radius: 99px; white-space: nowrap; }
.place .glow { position: absolute; width: calc(var(--s) * 1.35); height: calc(var(--s) * 1.35); top: calc(var(--s) * -0.175); border-radius: 50%; background: rgba(244,132,95,.28); animation: glow 1.4s ease-in-out infinite alternate; }
@keyframes glow { from { transform: scale(.92); } to { transform: scale(1.12); } }
.place .star { position: absolute; left: calc(var(--s) * -0.12); top: calc(var(--s) * -0.05); }
.place .hand { position: absolute; bottom: calc(var(--s) * -0.62); animation: hand 1.4s ease-in-out infinite alternate; }
@keyframes hand { from { transform: translateY(4px); } to { transform: translateY(-8px); } }
.harbour { position: absolute; left: 14px; display: flex; align-items: flex-start; gap: 6px; text-align: left; transition: transform .12s; }
.speech { background: #fff; color: var(--text); padding: 10px 14px; border-radius: 18px; box-shadow: 0 3px 6px rgba(0,0,0,.08); font-weight: 700; line-height: 1.25; animation: speech-in .35s cubic-bezier(.3,1.5,.5,1) both; }
@keyframes speech-in { from { transform: scale(.6); opacity: 0; transform-origin: left center; } }
.book-btn img { width: 34px; height: 34px; }
.child-wrap { position: relative; }
.child-chip { display: flex; align-items: center; gap: 8px; padding: 6px 14px 6px 6px; border-radius: 99px; background: rgba(255,255,255,.9); box-shadow: 0 2px 6px rgba(0,0,0,.08); font-weight: 800; font-size: 17px; }
.child-chip .stars { display: flex; align-items: center; gap: 2px; font-size: 15px; }
.child-menu { position: absolute; right: 0; top: 56px; background: #fff; border-radius: 18px; box-shadow: 0 8px 24px rgba(0,0,0,.15); padding: 6px; min-width: 190px; z-index: 10; }
.child-menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border-radius: 12px; font-weight: 800; text-align: left; }
.child-menu button.on { background: var(--primary-light); }
.child-menu .add { color: var(--primary); }
.fly-sticker { position: absolute; left: 0; top: 0; z-index: 20; pointer-events: none; }

/* ---------- a place's map ---------- */
.place-map .top-bar img { flex: none; }
.place-name { font-family: var(--title); font-size: 26px; color: var(--primary); line-height: 1.1; }
.place-scroll { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch;
  -webkit-mask-image: linear-gradient(transparent, #000 18px, #000 calc(100% - 150px), rgba(0,0,0,.15) calc(100% - 40px));
  mask-image: linear-gradient(transparent, #000 18px, #000 calc(100% - 150px), rgba(0,0,0,.15) calc(100% - 40px)); }
.stops { position: relative; }
.stops > svg { position: absolute; left: 0; top: 0; pointer-events: none; }
.unit-sign { position: absolute; transform: translate(-50%, -50%); font-family: var(--title); font-size: 18px; color: var(--primary); background: rgba(255,255,255,.92); padding: 6px 14px; border-radius: 99px; white-space: nowrap; box-shadow: 0 2px 4px rgba(0,0,0,.06); }
.stop { position: absolute; width: 84px; height: 84px; margin: -42px 0 0 -42px; border-radius: 50%; border: 5px solid #fff; display: grid; place-items: center; box-shadow: 0 3px 6px rgba(0,0,0,.12); transition: transform .12s; }
.stop.next { animation: stop-glow 1.1s ease-in-out infinite alternate; }
@keyframes stop-glow { from { box-shadow: 0 3px 6px rgba(244,132,95,.6); transform: scale(1); } to { box-shadow: 0 3px 18px rgba(244,132,95,.7); transform: scale(1.08); } }
.stop-label { font-family: var(--title); font-size: 40px; color: #fff; line-height: 1; }
.stop-lock { color: rgba(139,133,128,.6); display: grid; }
.stop-star { position: absolute; right: -8px; bottom: -8px; }
.stop-hand { position: absolute; top: 70px; animation: hand 1.1s ease-in-out infinite alternate; }
.stop-buddy { position: absolute; transform: translate(-50%, -50%); filter: drop-shadow(0 3px 4px rgba(0,0,0,.2)); pointer-events: none; transition: left .6s cubic-bezier(.3,1.2,.5,1), top .6s cubic-bezier(.3,1.2,.5,1); }
.bubba-says { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: flex-end; gap: 10px; padding: 0 18px calc(14px + var(--safe-b)); pointer-events: none; }
.bubba-says .speech { font-size: 18px; }

/* ---------- a lesson ---------- */
.lesson { background: var(--paper); }
.lesson-stage { position: relative; flex: 1; width: 100%; max-width: 720px; margin: 0 auto; }
.step { position: absolute; inset: 0; display: flex; flex-direction: column; padding-bottom: calc(18px + var(--safe-b)); animation: step-in .45s cubic-bezier(.3,1.1,.5,1) both; }
/* a game of several questions: one screen, a question at a time, dots for how many */
.step .round { position: absolute; inset: 0; display: flex; flex-direction: column; padding-bottom: calc(18px + var(--safe-b)); }
.step .round.in { animation: step-in .4s cubic-bezier(.3,1.1,.5,1) both; }
.step .round.out { opacity: 0; transition: opacity .25s; pointer-events: none; }
.round-dots { position: absolute; right: 18px; top: 16px; z-index: 3; display: flex; gap: 5px; pointer-events: none; }
.round-dots i { width: 13px; height: 13px; border-radius: 50%; background: rgba(0,0,0,.1); transition: background .3s, transform .3s; }
.round-dots i.on { background: var(--green); transform: scale(1.15); }
/* Bubba is talking (lesson.js holdWhileTalking): taps wait until she's finished, and it shows - the
   answers dim and shrink a little, Bubba moves as she talks, waves pulse from her speaker, an ear
   pops up; a tap makes her hop; when she's done the answers brighten and bounce: your turn */
.lesson .hold :is(button:not(.prompt-bubba), .touchable) { opacity: .42; filter: saturate(.35); scale: .95; transition: opacity .25s, filter .25s, scale .25s; }
.lesson .hold .big-btn { opacity: .4; }
.lesson .ready :is(button:not(.prompt-bubba), .touchable) { animation: your-turn .5s cubic-bezier(.3,1.7,.5,1); }
@keyframes your-turn { 0% { scale: .95; opacity: .6; } 55% { scale: 1.06; opacity: 1; } 100% { scale: 1; } }
.lesson :is(.hold, .listening) .prompt-bubba .bubba { animation: bubba-talk .45s ease-in-out infinite alternate; transform-origin: 50% 80%; }
@keyframes bubba-talk { from { scale: 1; rotate: -3deg; } to { scale: 1.07; rotate: 3deg; } }
.lesson :is(.hold, .listening) .prompt-bubba .speaker { animation: speak-waves 1s ease-out infinite; }
@keyframes speak-waves { 0% { box-shadow: 0 0 0 0 rgba(62,142,222,.55); } 100% { box-shadow: 0 0 0 14px rgba(62,142,222,0); } }
/* sound waves rippling out from Bubba while she talks */
.prompt-bubba .bubba { position: relative; }
.lesson :is(.hold, .listening) .prompt-bubba .bubba::before, .lesson :is(.hold, .listening) .prompt-bubba .bubba::after { content: ''; position: absolute; inset: -4px; border-radius: 50%;
  border: 3px solid rgba(62,142,222,.55); pointer-events: none; animation: bubba-waves 1.4s ease-out infinite; }
.lesson :is(.hold, .listening) .prompt-bubba .bubba::after { animation-delay: .7s; }
@keyframes bubba-waves { from { scale: .85; opacity: .9; } to { scale: 1.7; opacity: 0; } }
/* an ear over the answers: listen first (lesson.js places it over what can be tapped) */
.listen-ear { position: absolute; z-index: 5; width: 74px; height: 74px; translate: -50% -50%; pointer-events: none; border-radius: 50%;
  background: rgba(255,255,255,.92) url(/assets/emoji/fluent/1f442_3d.webp) center / 58% no-repeat; box-shadow: 0 6px 18px rgba(62,142,222,.28), 0 0 0 4px rgba(62,142,222,.25);
  animation: ear-in .35s cubic-bezier(.3,1.7,.5,1) both, ear-bob 1s .35s ease-in-out infinite alternate; }
.listen-ear.out { animation: ear-out .25s ease-in both; }
/* a story's Next while Bubba reads the page: dimmed, an ear on it */
.st-btn.next.wait { position: relative; opacity: .5; filter: saturate(.4); }
.st-btn.next.wait::after { content: ''; position: absolute; right: 14px; top: 50%; width: 40px; height: 40px; translate: 0 -50%; border-radius: 50%;
  background: #fff url(/assets/emoji/fluent/1f442_3d.webp) center / 62% no-repeat; box-shadow: 0 0 0 3px rgba(62,142,222,.3); animation: ear-in .35s cubic-bezier(.3,1.7,.5,1) both; }
@keyframes ear-in { from { scale: 0; } to { scale: 1; } }
@keyframes ear-out { to { scale: 0; opacity: 0; } }
@keyframes ear-bob { from { translate: -50% -50%; } to { translate: -50% calc(-50% - 6px); } }
.prompt-bubba.nudge .bubba { animation: bubba-hop .45s cubic-bezier(.3,1.7,.5,1) !important; }
@keyframes bubba-hop { 0% { translate: 0 0; } 40% { translate: 0 -12px; scale: 1.1; } 100% { translate: 0 0; } }
@media (prefers-reduced-motion: reduce) { .lesson .hold .prompt-bubba .bubba, .lesson .hold .prompt-bubba .speaker, .lesson .ready :is(button, .touchable), .listen-ear { animation: none; } .lesson .hold .prompt-bubba .bubba::before, .lesson .hold .prompt-bubba .bubba::after { animation: none; opacity: 0; } }
.step.out { animation: step-out .35s ease-in both; pointer-events: none; }
@keyframes step-in { from { opacity: 0; transform: translateX(60px); } }
@keyframes step-out { to { opacity: 0; transform: translateX(-60px); } }
.cheer-layer { position: absolute; inset: 0; pointer-events: none; z-index: 30; overflow: hidden; }

/* Bubba's prompt */
.prompt { display: flex; align-items: center; gap: 12px; padding: 14px 22px 0; }
.prompt-bubba { position: relative; flex: none; }
.prompt-bubba .speaker { position: absolute; right: 0; bottom: 0; background: var(--blue); border-radius: 50%; width: 28px; height: 28px; display: grid; place-items: center; }
.prompt-body { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.prompt-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.prompt-text { font-size: 22px; font-weight: 800; line-height: 1.2; }
.prompt-tile { width: 58px; height: 58px; display: grid; place-items: center; background: #fff; border-radius: 16px; box-shadow: 0 2px 5px rgba(0,0,0,.1); font: 700 42px var(--title); }
.prompt-dots { display: flex; gap: 5px; }
.prompt-dots i { width: 13px; height: 13px; border-radius: 50%; background: rgba(0,0,0,.1); transition: background .3s, transform .3s; }
.prompt-dots i.on { background: var(--green); transform: scale(1.15); }

/* answer cards */
.answers { display: flex; justify-content: center; gap: 18px; padding: 0 20px; }
.answer { flex: 1 1 0; max-width: 190px; min-height: 150px; display: grid; place-items: center; background: #fff; border-radius: 28px; border: 4px solid rgba(0,0,0,.06);
  box-shadow: 0 4px 10px rgba(0,0,0,.07); transition: transform .3s cubic-bezier(.3,1.6,.5,1), border-color .3s; }
.answer.tiny { min-height: 170px; }
.answer.big { gap: 14px; }
.answer.right { border-color: var(--green); transform: scale(1.12); }
.answer.hint { border-color: var(--gold); }

/* meet a letter */
.meet { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 26px; padding: 0 24px; }
.meet-letter { font-family: var(--title); font-weight: 700; line-height: 1; text-shadow: 0 5px 8px rgba(0,0,0,.08); }
.meet-pic { display: flex; align-items: center; gap: 14px; font-size: 34px; font-weight: 800; }

/* the end: a sticker */
.sticker-won { align-items: center; justify-content: center; gap: 22px; padding: 0 24px calc(24px + var(--safe-b)); text-align: center; }
.won-art { padding: 30px; border-radius: 50%; background: var(--primary-light); perspective: 600px; }
.sticker-won .title { font-size: 38px; }

/* Bubba's cheer */
.cheer { position: absolute; inset: 0; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 18px; }
.cheer-body { position: relative; transform: translateY(400px); }
.cheer-whale { position: relative; transform-origin: 50% 100%; }
.cheer-fx { position: absolute; inset: 0; }
.cheer-fx .drop { position: absolute; width: 11px; height: 13px; border-radius: 50%; }
.cheer-fx .spark { position: absolute; }
.cheer-bubble { position: absolute; left: 55%; top: -25%; white-space: nowrap; background: #fff; color: var(--primary); padding: 10px 16px; border-radius: 99px;
  font-size: 22px; font-weight: 800; box-shadow: 0 3px 8px rgba(0,0,0,.1); transform-origin: 0 100%; opacity: 0; }

/* drag hint */
.drag-hint { position: absolute; left: 0; top: 0; pointer-events: none; z-index: 25; filter: drop-shadow(0 2px 4px rgba(0,0,0,.2)); }
.dragging { z-index: 20; }

/* picture cards */
.pic-card { display: grid; place-items: center; background: #fff; box-shadow: 0 3px 6px rgba(0,0,0,.08); }

/* ---------- stickers ---------- */
.sticker { position: relative; display: grid; place-items: center; }
.sticker-pic { position: absolute; pointer-events: none; }
.sticker-foil, .sticker-shine { position: absolute; inset: 0; pointer-events: none; }
.sticker-foil { background: conic-gradient(#ff7eb3, #ffb36b, #ffe66b, #7be07b, #6bd6ff, #b07bff, #ff7eb3); mix-blend-mode: overlay; opacity: .6; }
.sticker-shine { overflow: hidden; }
.sticker-shine i { position: absolute; top: -30%; left: 0; width: 35%; height: 160%; background: linear-gradient(90deg, transparent, rgba(255,255,255,.65), transparent);
  transform: translateX(-170%) rotate(20deg); animation: shine 2.6s linear .3s infinite; will-change: transform; }
@keyframes shine { to { transform: translateX(370%) rotate(20deg); } }
.sticker-slot { position: relative; display: grid; place-items: center; }
.sticker-ghost { position: absolute; inset: 0; background: rgba(0,0,0,.07); }
.sticker-slot span { position: relative; font-family: var(--title); color: rgba(0,0,0,.18); }
.book .top-bar { justify-content: space-between; }
.book-title { font-family: var(--title); font-size: 28px; color: var(--primary); text-align: center; }
.book-track { flex: 1; display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.book-track::-webkit-scrollbar { display: none; }
.book-page { flex: 0 0 100%; scroll-snap-align: center; display: flex; flex-direction: column; align-items: center; gap: 18px; margin: 10px 0; padding: 26px 16px; }
.book-page > * { max-width: 520px; }
.book-page h2 { font-family: var(--title); font-size: 30px; }
.book-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px 10px; justify-items: center; width: 100%; background: #FFFDF8; border-radius: 28px; padding: 26px 12px; box-shadow: 0 6px 14px rgba(0,0,0,.08); }
.book-view { flex: 1; min-height: 0; position: relative; display: flex; }
.book-arrow { position: absolute; top: 50%; translate: 0 -50%; display: none; z-index: 2; }
.book-arrow.next svg { transform: scaleX(-1); }
.book-arrow.prev { left: 16px; } .book-arrow.next { right: 16px; }
@media (hover: hover) and (pointer: fine) { .book-arrow:not([hidden]) { display: grid; } }
.book-dots { display: flex; justify-content: center; gap: 8px; padding: 10px 0 calc(16px + var(--safe-b)); }
.book-dots button { width: 10px; height: 10px; border-radius: 50%; background: rgba(0,0,0,.18); }
.book-dots button.on { background: var(--primary); }

@media (max-width: 420px) {
  .title { font-size: 34px; }
  .prompt-text { font-size: 19px; }
  .answers { gap: 12px; padding: 0 14px; }
  .answer { min-height: 130px; border-radius: 24px; }
}

/* ---------- sign in (grown-ups) ---------- */
.signin-body { flex: 1; display: flex; justify-content: center; align-items: center; padding: 16px 24px calc(24px + var(--safe-b)); overflow-y: auto; }
.signin .fr-step { gap: 14px; }
.agree { display: flex; gap: 10px; align-items: flex-start; text-align: left; font-weight: 600; font-size: 15px; background: rgba(255,255,255,.7); padding: 12px 14px; border-radius: 16px; width: 100%; max-width: 520px; }
.agree input { width: 22px; height: 22px; flex: none; accent-color: var(--primary); margin-top: 1px; }
.agree a { color: var(--primary); }
.google-btn { display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; max-width: 520px; min-height: 58px; border-radius: 999px; background: #fff; border: 2px solid rgba(0,0,0,.08); font-size: 18px; font-weight: 800; box-shadow: 0 3px 8px rgba(0,0,0,.06); }
.or { color: var(--muted); font-weight: 700; }
.name-input.email { font-size: 20px; max-width: 520px; -webkit-user-select: text; user-select: text; }
.name-input.code { font-size: 34px; text-align: center; letter-spacing: 8px; max-width: 280px; }
.signin-note { min-height: 22px; color: var(--salmon); font-weight: 700; text-align: center; }
.link-btn { color: var(--primary); text-decoration: underline; font-weight: 700; padding: 8px; }
.center-text { text-align: center; }

/* ---------- grown-ups ---------- */
.gate-body { flex: 1; display: flex; justify-content: center; align-items: center; padding: 0 24px calc(24px + var(--safe-b)); }
.gu-body { flex: 1; overflow-y: auto; padding: 8px 18px calc(24px + var(--safe-b)); display: flex; flex-direction: column; gap: 14px; align-items: center; }
.gu-card { width: 100%; max-width: 560px; background: rgba(255,255,255,.92); border-radius: 22px; padding: 18px; box-shadow: 0 3px 10px rgba(0,0,0,.06); display: flex; flex-direction: column; gap: 10px; }
.gu-card h2 { font-family: var(--title); color: var(--primary); font-size: 22px; }
.gu-card a { color: var(--primary); }
.gu-row { display: flex; gap: 10px; flex-wrap: wrap; }
.gu-btn { padding: 10px 18px; border-radius: 99px; background: var(--primary-light); color: var(--primary); font-weight: 800; }
.gu-btn.small { padding: 8px 14px; font-size: 14px; }
.gu-btn.danger { background: #FFE7DE; color: #C4532F; }
.gu-ask { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; background: rgba(40,30,70,.35); }
.gu-ask-card { max-width: 420px; background: #fff; border-radius: 24px; padding: 22px 22px 18px; box-shadow: 0 12px 40px rgba(0,0,0,.2); }
.gu-ask-card p { margin: 0 0 16px; font-size: 18px; font-weight: 700; line-height: 1.35; }
.gu-ask-card .gu-row { justify-content: flex-end; }
.gu-child { display: flex; align-items: center; gap: 12px; }
.grow { flex: 1; min-width: 0; }
.gear-btn { color: var(--primary); }
.name-check { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 100%; max-width: 520px; }
/* Bubba glows when the next thing is with her (the name game, a practice after a unit check) */
.village .harbour.next .bubba-bob { filter: drop-shadow(0 0 14px rgba(244,132,95,.85)); animation: bob 1.6s ease-in-out infinite alternate, harbour-glow 1.4s ease-in-out infinite alternate; }
@keyframes harbour-glow { from { filter: drop-shadow(0 0 6px rgba(244,132,95,.5)); } to { filter: drop-shadow(0 0 18px rgba(244,132,95,.95)); } }
.gu-progress { padding: 6px 0 10px; border-bottom: 1px solid rgba(0,0,0,.06); }
.gu-progress:last-child { border-bottom: 0; }
.gu-checks { margin: 6px 0 0 50px; padding: 0; list-style: none; display: grid; gap: 4px; font-size: 15px; }
.stop-stars { position: absolute; top: 88px; font-size: 18px; letter-spacing: 1px; color: #F5B700; white-space: nowrap; text-shadow: 0 1px 0 #fff; }
/* the right answer glowing after two misses, in any game (answer cards have their own) */
.hint:not(.answer) { box-shadow: 0 0 0 5px var(--gold), 0 0 24px rgba(255,200,60,.8) !important; animation: hint-pulse 1s ease-in-out infinite alternate; }
@keyframes hint-pulse { from { filter: brightness(1); } to { filter: brightness(1.12); } }
