:root { font-family: ui-rounded, "SF Pro Rounded", system-ui, sans-serif; color: #26365b; background: #c7efff; font-weight: 800; }
* { box-sizing: border-box; }
body { margin: 0; background: radial-gradient(ellipse at 10% 15%, #ffffffb0 0 9%, transparent 10%), radial-gradient(ellipse at 90% 80%, #ffffff90 0 12%, transparent 13%), #c7efff; }
button { font: inherit; color: inherit; cursor: pointer; min-height: 64px; border: 0; border-radius: 22px; padding: 12px 20px; background: white; box-shadow: 0 6px 0 #26365b20; touch-action: manipulation; -webkit-user-select: none; user-select: none; }
button:active { transform: scale(.96); }
button:focus-visible { outline: 4px solid #6345bf; outline-offset: 3px; }
button:disabled { cursor: default; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(30px, 5vw, 56px); letter-spacing: -2px; }
h2 { font-size: clamp(22px, 3vw, 34px); }
.screen { min-height: 100dvh; padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); max-width: 1200px; margin: auto; display: flex; flex-direction: column; gap: 20px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.topbar h2 { flex: 1; text-align: center; }
.home-button { font-size: 28px; padding: 8px 16px; }
.stars { background: #fff2a4; border: 3px solid #fff; padding: 12px 18px; border-radius: 30px; white-space: nowrap; font-size: 23px; }
.hero { text-align: center; }
.hero p { margin-top: 8px; font-size: 19px; }
.mascots { font-size: 52px; }
.game-grid, .set-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.tile { min-height: 175px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; font-size: 22px; border: 4px solid #ffffffb0; animation: enter .45s backwards; animation-delay: calc(var(--i) * 45ms); }
.tile:nth-child(4n+1) { background: #fff09b; }
.tile:nth-child(4n+2) { background: #ffb8aa; }
.tile:nth-child(4n+3) { background: #9ee7c8; }
.tile:nth-child(4n) { background: #d7c3ff; }
.tile-icon { font-size: 56px; }
.grown-link { align-self: center; background: transparent; box-shadow: none; font-size: 16px; }
.center { text-align: center; align-items: center; }
.panel { background: #ffffffdf; border: 4px solid white; border-radius: 30px; padding: 24px; box-shadow: 0 9px 0 #5280a51a; }
.practice { width: min(100%, 690px); margin: auto; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.word-card { width: 100%; text-align: center; }
.picture { display: block; font-size: clamp(90px, 17dvh, 170px); line-height: 1.25; }
.picture svg { width: 1em; height: 1em; }
.word { font-size: clamp(32px, 5vw, 56px); overflow-wrap: anywhere; }
.phrase-word { font-size: clamp(25px, 3.5vw, 39px); }
mark { background: transparent; color: #b53378; }
.row { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 12px; }
.primary { background: #ffd857; font-size: 25px; min-width: min(280px, 100%); }
.mint { background: #9ee7c8; }
.dots { display: flex; gap: 12px; justify-content: center; }
.dot { width: 28px; height: 28px; border: 3px solid #9da8bd; border-radius: 50%; background: white; }
.dot.filled { background: #bd8af4; border-color: #7952b3; animation: bounce .3s; }
.note { min-height: 26px; font-size: 19px; text-align: center; }
.tabs button[aria-pressed="true"] { background: #d7c3ff; }
.memory-screen { height: 100dvh; min-height: 0; gap: 12px; }
.runner-screen { height: 100dvh; min-height: 0; gap: 10px; padding-bottom: max(20px, env(safe-area-inset-bottom)); }
.runner-screen .topbar, .runner-hud, .runner-controls { flex: none; }
.runner-hud { display: flex; justify-content: space-between; align-items: flex-start; font-size: 18px; position: absolute; inset: 12px 12px auto; z-index: 3; pointer-events: none; }
.runner-hud-left { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.runner-hud .runner-coins { display: flex; align-items: center; gap: 10px; padding: 5px 14px 5px 6px; border: 2px solid #ffffff80; border-radius: 32px; background: #28251cc4; color: white; font-size: clamp(26px,4vw,44px); text-shadow: 2px 3px 0 #201a17, -1px -1px 0 #201a17; }
.runner-coins img { width: clamp(34px,5vw,60px); height: clamp(34px,5vw,60px); object-fit: contain; }
.runner-hud [data-testid="runner-progress"] { font-size: 16px; padding: 3px 9px; border-radius: 18px; background: #30261999; color: white; }
.runner-hud-right { display: flex; flex-direction: column; gap: 10px; align-items: flex-end; }
.runner-pause { pointer-events: auto; width: 60px; height: 60px; min-height: 56px; padding: 0; border: 3px solid #ffdd84; border-radius: 18px; color: white; background: linear-gradient(#ffce4d,#e87920); font-size: 30px; text-shadow: 1px 2px 0 #994707; box-shadow: 0 5px 0 #8d421c; }
.runner-word-bubble { position: absolute; top: 0; left: 50%; translate: -50% 0; width: clamp(82px,16vw,180px); padding: 8px; border: 3px solid white; border-radius: 28px; background: #fff5d6cc; box-shadow: 0 3px 0 #62431e44; }
.runner-word-bubble::after { content: ''; position: absolute; bottom: -14px; left: 60%; width: 22px; height: 22px; rotate: 45deg; background: #fff5d6; border-right: 3px solid white; border-bottom: 3px solid white; }
.runner-word-bubble .picture { position: relative; z-index: 1; text-align: center; font-size: clamp(44px,7vw,90px); line-height: 1.1; }
.runner-pause-menu { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; background: #37220b88; }
.runner-pause-menu .panel { display: flex; flex-direction: column; gap: 20px; text-align: center; min-width: min(280px,90%); }
.runner-pause-menu button { min-height: 72px; background: #ffd857; }
.runner-pause-menu[hidden], .runner-word-bubble[hidden] { display: none; }
.runner-vignette, .runner-speedlines { position: absolute; inset: 0; pointer-events: none; }
.runner-vignette { background: radial-gradient(ellipse, transparent 45%, #81421245 100%); }
.runner-speedlines { opacity: 0; overflow: hidden; }
.runner-speedlines.running { opacity: .6; }
.runner-speedlines::before { content: ''; position: absolute; inset: -10%; background: repeating-conic-gradient(from 5deg at 50% 45%, transparent 0deg 12deg, #fff9dd 12.1deg 12.8deg, transparent 13.1deg 25deg); mask-image: linear-gradient(90deg, #000, transparent 32% 68%, #000); -webkit-mask-image: linear-gradient(90deg, #000, transparent 32% 68%, #000); animation: runner-streaks .45s linear infinite; animation-play-state: paused; }
.runner-speedlines.running::before { animation-play-state: running; }
@keyframes runner-streaks { from { transform: scale(.9); } to { transform: scale(1.12); } }
@media (prefers-reduced-motion: reduce) { .runner-speedlines.running { opacity: .12; } .runner-speedlines::before { animation: none; } }
.runner-full-btn { pointer-events: auto; width: 52px; height: 52px; min-height: 48px; padding: 0; border: 3px solid white; border-radius: 50%; background: #ffffffd9; font-size: 24px; line-height: 1; box-shadow: 0 5px 0 #46342245; }
/* Full screen: the game fills the screen; HUD and steer buttons float over it. */
.runner-screen.full { position: fixed; inset: 0; z-index: 50; height: 100dvh; padding: 0; gap: 0; background: #000; }
.runner-screen.full .topbar, .runner-screen.full ~ .scoring-badge, .runner-screen.full .scoring-badge { display: none; }
.runner-screen.full .runner-view { border-radius: 0; min-height: 0; }
.runner-screen.full .runner-hud { inset: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) auto max(12px, env(safe-area-inset-left)); }
.runner-screen.full .runner-controls { position: absolute; left: 0; right: 0; bottom: max(14px, env(safe-area-inset-bottom)); z-index: 2; justify-content: space-between; padding: 0 max(12px, env(safe-area-inset-left)); pointer-events: none; }
.runner-screen.full .runner-controls button { pointer-events: auto; opacity: .9; }
.runner-screen.full.at-gate .runner-controls { display: none; }
.runner-screen.full .runner-caught { bottom: 120px; }
.runner-loading { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 24px; color: white; text-shadow: 0 4px 0 #315638; background: #22674c35; font-size: clamp(28px,6vw,60px); z-index: 3; pointer-events: none; animation: runner-ready .4s ease-out; }
@keyframes runner-ready { from { opacity: .2; transform: scale(.65); } 70% { transform: scale(1.08); } }
.runner-view { flex: 1; min-height: 300px; position: relative; border-radius: 26px; overflow: hidden; }
.runner-view canvas { display: block; width: 100%; height: 100%; position: absolute; inset: 0; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
/* The card slot sits over the canvas: without its own layer the absolutely-positioned canvas paints over the
   static slot and swallows taps on "Run again". Slot ignores pointers so swipes still reach the canvas. */
.runner-card-slot { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.runner-card-slot > * { pointer-events: auto; }
.runner-controls { gap: 12px; flex-wrap: nowrap; }
.runner-controls button { width: 76px; height: 76px; min-height: 72px; padding: 8px; border-radius: 50%; font-size: 32px; background: #fff09b; }
.runner-controls button:nth-child(2) { background: #d7c3ff; }
.runner-controls button { flex-shrink: 0; min-width: 64px; }
.runner-controls button:nth-child(3) { background: #b6df9b; }
.runner-caught { position: absolute; bottom: 12px; left: 50%; translate: -50% 0; width: min(94%, 480px); text-align: center; background: #fff2ccf2; }
.runner-caught h2 { font-size: clamp(24px, 4vw, 36px); }
.runner-caught button { min-width: 96px; min-height: 96px; background: #ffd857; }
@media (max-width: 420px) { .runner-controls { gap: 8px; } .runner-controls button { width: 68px; height: 72px; } }
.runner-word { position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%); width: min(96%, 500px); display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px; animation: runner-card .25s ease-out; }
.runner-word .picture { font-size: clamp(54px, 8dvh, 85px); line-height: 1; }
.runner-word .word { font-size: 32px; }
.runner-word button { min-height: 48px; padding: 8px 12px; }
.runner-word .primary { min-width: min(280px,100%); min-height: 64px; font-size: 24px; }
.runner-word .score-controls { flex-wrap: nowrap; gap: 6px; }
.runner-word .score-controls button { font-size: 16px; min-height: 64px; }
.runner-word .dot { width: 28px; height: 28px; }
.runner-word .runner-skip { box-shadow: none; font-size: 14px; background: transparent; }
/* Centred with `translate`, not `transform`: the global button:active { transform: scale(.96) } would replace a
   transform centring and throw the button half its size away from the finger mid-press, so the tap hit the canvas. */
.runner-again { position: absolute; left: 50%; top: 50%; translate: -50% -50%; min-width: min(300px,95%); }
/* iPad: thumbs rest at the edges when holding it, so the steer buttons go to the sides and grow; the card scales up. */
/* Steering is ignored while the word card is up; fade the buttons so they don't look broken. */
.runner-screen.at-gate .runner-controls { opacity: .35; }
@media (min-width: 700px) {
  .runner-word .picture { font-size: clamp(80px, 10dvh, 130px); }
  .runner-controls { justify-content: space-between; padding: 0 8px; }
  .runner-controls button { width: 104px; height: 104px; font-size: 44px; }
  .runner-hud { font-size: 24px; }
  .runner-word { width: min(90%, 600px); gap: 12px; padding: 20px; }
  .runner-word .word { font-size: 44px; }
  .runner-word .dot { width: 36px; height: 36px; }
  .runner-word .primary { min-height: 80px; font-size: 30px; }
  .runner-word .score-controls button { font-size: 22px; min-height: 80px; padding: 8px 18px; }
}
/* The portal carries the large picture; a compact two-column card leaves its arch visible. */
.runner-screen.at-gate .runner-word { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; padding: 10px 14px; }
.runner-screen.at-gate .runner-word .picture { font-size: clamp(36px, 5dvh, 58px); justify-self: end; }
.runner-screen.at-gate .runner-word .word { justify-self: start; font-size: clamp(28px, 4dvh, 42px); }
.runner-screen.at-gate .runner-word .hear { justify-self: end; }
.runner-screen.at-gate .runner-word .dots { justify-self: start; }
/* The big say/score button spans the card: alone in the 2-column grid it sat half-width on the left on iPad. */
.runner-screen.at-gate .runner-word .score-controls, .runner-screen.at-gate .runner-word .runner-skip, .runner-screen.at-gate .runner-word > .primary { grid-column: 1 / -1; justify-self: center; }
.runner-screen.at-gate .runner-word .runner-skip { min-height: 32px; padding: 4px; }
.runner-word .voice-bar, .runner-word .mic-status, .runner-word .mic-help { grid-column: 1 / -1; justify-self: center; }
/* Natural DOM order: bar, status, help, scores, skip. The bar is a <canvas>, so it must undo `.runner-view canvas`
   (absolute, inset 0, 100% x 100%), which pinned it over the word (11-23 screenshots). */
.runner-word .voice-bar { position: relative; inset: auto; display: block; width: 100%; min-width: 260px; max-width: 420px; height: 72px; border-radius: 36px; background: #123a2fe6; box-shadow: inset 0 0 0 3px #ffffff40; }
.runner-word .mic-status { text-align: center; font-size: 19px; font-weight: 700; min-height: 26px; }
.runner-word .mic-help { text-align: center; font-size: 17px; }
.runner-word .mic-help small { display: block; margin-top: 4px; font-size: 12px; }
.runner-word [hidden] { display: none; }
@keyframes mic-pulse { 50% { box-shadow: 0 0 0 12px #bd8af470; } }
@keyframes runner-card { from { opacity: 0; translate: 0 40px; } }
.memory-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-template-rows: repeat(3, minmax(0, 1fr)); gap: 14px; }
.mem-card { perspective: 800px; padding: 0; background: transparent; box-shadow: none; min-height: 64px; }
.card-inner { display: block; position: relative; width: 100%; height: 100%; transition: transform .35s; transform-style: preserve-3d; }
.mem-card.flipped .card-inner { transform: rotateY(180deg); }
.card-face { position: absolute; inset: 0; border-radius: 22px; border: 4px solid white; display: flex; align-items: center; justify-content: center; flex-direction: column; backface-visibility: hidden; -webkit-backface-visibility: hidden; box-shadow: 0 5px 0 #26365b20; overflow: hidden; }
.card-back { background: radial-gradient(circle at 20% 20%, #ffffff90 0 6%, transparent 7%), linear-gradient(135deg, #d7c3ff, #a998ef); font-size: 45px; }
.card-front { transform: rotateY(180deg); background: #fffdf4; font-size: clamp(16px, 2.5vw, 28px); }
.card-front .picture { font-size: clamp(35px, 8dvh, 80px); }
.matched .card-front { background: #bdedd5; border-color: #68c79e; }
.memory-footer { min-height: 64px; }
.blend-equation { display: flex; align-items: center; justify-content: center; gap: 16px; font-size: 34px; width: 100%; }
.blend-bit { min-width: 0; flex: 1; }
.blend-bit .picture { font-size: clamp(60px, 11vw, 130px); }
.mixing .snake { animation: snake .8s forwards; }
.mixing .part { animation: bounce .6s .4s; }
.result { min-height: 190px; }
.wheel-wrap { position: relative; width: min(54dvh, 330px, 85vw); aspect-ratio: 1; margin: auto; }
.wheel-wrap::after { content: '▼'; position: absolute; left: calc(50% - 18px); top: -20px; font-size: 38px; color: #b53378; }
.wheel { border: 8px solid white; border-radius: 50%; width: 100%; height: 100%; position: relative; background: conic-gradient(#ffd857 0 45deg, #ffb8aa 45deg 90deg, #9ee7c8 90deg 135deg, #d7c3ff 135deg 180deg, #ffd857 180deg 225deg, #ffb8aa 225deg 270deg, #9ee7c8 270deg 315deg, #d7c3ff 315deg); transition: transform 3s cubic-bezier(.15,.7,.15,1); box-shadow: 0 8px 0 #26365b20; }
.slice { position: absolute; left: 50%; top: 50%; width: 64px; height: 64px; margin: -32px; font-size: 64px; display: grid; place-items: center; }
.slice svg { width: 40px; }
.shells { gap: 7px; }
.shells button { font-size: 28px; padding: 6px; min-width: 64px; }
.shells button.done { background: #9ee7c8; }
.choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; width: 100%; }
.choices.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.choice { padding: 16px 6px; font-size: clamp(19px, 3vw, 30px); overflow-wrap: anywhere; }
.choice .picture { font-size: clamp(60px, 10vw, 120px); }
.clue { font-size: clamp(23px, 3vw, 31px); text-align: center; line-height: 1.4; }
.correct { background: #9ee7c8; }
.wiggle { animation: wiggle .35s; }
.howto { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.tip { display: flex; flex-direction: column; align-items: center; gap: 12px; font-size: 21px; text-align: center; }
.tip-icon { font-size: 55px; }
/* Above .runner-screen.full (z 50): in full screen the celebration sat behind the game and taps hit Run again. */
.celebrate { position: fixed; inset: 0; z-index: 70; background: #514195db; display: grid; place-items: center; overflow: hidden; color: white; text-align: center; touch-action: manipulation; }
.celebrate h2 { font-size: clamp(42px, 8vw, 80px); }
.celebrate .trophy { font-size: 120px; }
.confetti { position: absolute; top: -40px; width: 15px; height: 24px; background: var(--color); left: var(--left); animation: fall 2.4s var(--delay) linear infinite; pointer-events: none; }
.flying-star { position: fixed; z-index: 71; font-size: 45px; pointer-events: none; left: 50%; top: 50%; animation: fly .75s forwards; }
.count-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.count-list p { padding: 12px; background: white; border-radius: 12px; overflow-wrap: anywhere; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
[data-screen="spin"] { overflow-x: clip; }
[data-screen="home"] .home-button { display: none; }
.scoring-badge { align-self: center; font-size: 14px; }
.score-good, .dot.good { background: #9ee7c8; }
.score-almost, .dot.almost { background: #ffd857; }
.score-miss, .dot.miss { background: #d8dce4; }
.score-controls { width: 100%; }
.score-controls button { flex: 1; padding: 12px 8px; }
@keyframes enter { from { opacity: 0; transform: translateY(15px) scale(.9); } }
@keyframes bounce { 50% { transform: scale(1.09); } }
@keyframes wiggle { 25%,75% { transform: rotate(-3deg); } 50% { transform: rotate(3deg); } }
@keyframes snake { to { transform: translateX(90%) scale(.4); opacity: 0; } }
@keyframes fly { to { left: 90%; top: 3%; opacity: 0; transform: scale(.4); } }
@keyframes fall { to { transform: translateY(110dvh) rotate(600deg); } }
@media (orientation: portrait) { .game-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .memory-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 800px) { [data-screen="home"] { height: 100dvh; gap: 12px; } .game-grid { flex: 1; min-height: 0; } .tile { min-height: 0; } }
@media (max-width: 600px) { .screen { gap: 14px; padding: 12px; } .topbar h2 { font-size: 20px; } .stars { font-size: 18px; padding: 12px; } .game-grid, .set-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; } .tile { min-height: 140px; padding: 10px; font-size: 18px; } .tile-icon { font-size: 42px; } .panel { padding: 16px; } .memory-grid { gap: 10px; } .howto { grid-template-columns: 1fr; } .blend-equation { gap: 5px; font-size: 24px; } .choices { gap: 8px; } .choice { font-size: 18px; } .shells { gap: 5px; } .hero p { font-size: 16px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }

/* review fixes 11-09 */
.shells { flex-direction: column; gap: 14px; }
.eq-result .picture { font-size: clamp(60px, 11vw, 130px); animation: bounce .5s; }
[data-testid="scoring-toggle"] { display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%; min-height: 84px; font-size: 21px; text-align: left; }
[data-testid="scoring-toggle"]::after { content: ''; flex: none; width: 70px; height: 40px; border-radius: 20px; background: #d8dce4; box-shadow: inset -30px 0 0 4px #fff; transition: all .2s; }
[data-testid="scoring-toggle"][aria-pressed="true"] { background: #e3f8ee; }
[data-testid="scoring-toggle"][aria-pressed="true"]::after { background: #3fb37f; box-shadow: inset 30px 0 0 4px #fff; }
@media (min-width: 800px) {
  .practice { width: min(100%, 780px); }
  .primary { font-size: 30px; min-height: 86px; min-width: 360px; }
  .dot { width: 40px; height: 40px; }
  .practice .row > button:not(.primary) { font-size: 21px; min-height: 70px; padding: 12px 26px; }
  .score-controls button { font-size: 26px; min-height: 86px; }
}
@media (min-width: 900px) and (orientation: landscape) {
  [data-screen="spin"] .practice { width: min(100%, 1100px); display: grid; grid-template-columns: auto 1fr; column-gap: 40px; row-gap: 14px; align-items: center; justify-items: center; }
  [data-screen="spin"] .wheel-wrap { grid-row: 1 / span 5; width: min(70dvh, 520px); }
  [data-screen="spin"] .slice { font-size: 80px; }
  /* Egg spinner gets the same side-by-side layout: stacked, its Next button fell below an 820 px-tall iPad. */
  [data-screen="egg-spin"] .practice { width: min(100%, 1100px); display: grid; grid-template-columns: auto 1fr; column-gap: 40px; row-gap: 14px; align-items: center; justify-items: center; }
  [data-screen="egg-spin"] .wheel-wrap { grid-row: 1 / span 5; width: min(62dvh, 500px); }
}
.wheel { container-type: size; }
.shells .primary { min-width: min(300px, 100%); padding: 12px 28px; font-size: 25px; }
@media (min-width: 800px) { .shells .primary { min-width: 360px; font-size: 30px; } }

/* ---- living pictures (Eddie 11-10: "more animation with the objects instead of just static") ----
   Idle loops animate the individual translate/rotate/scale properties; pop-in and jump animate `transform`.
   They compose instead of overriding each other, so a jumping sheep keeps waddling. */
.picture { display: inline-block; --idle: m-float; --dur: 3.2s; --ease: ease-in-out;
  animation: var(--idle) var(--dur) var(--ease) var(--phase, 0s) infinite, pop-in .55s cubic-bezier(.34,1.56,.64,1) both; }
.picture.jump { animation: var(--idle) var(--dur) var(--ease) var(--phase, 0s) infinite, jump .55s cubic-bezier(.3,1.5,.6,1); }
.picture[data-motion="swim"] { --idle: m-swim; --dur: 2.6s; }
.picture[data-motion="waddle"] { --idle: m-waddle; --dur: 1.6s; }
.picture[data-motion="drive"] { --idle: m-drive; --dur: 2.4s; }
.picture[data-motion="glow"] { --idle: m-glow; --dur: 1.8s; }
.picture[data-motion="splash"] { --idle: m-splash; --dur: 1.5s; }
.picture[data-motion="spin"] { --idle: m-spin; --dur: 7s; --ease: linear; }
.tile-icon { display: inline-block; animation: m-float 3s ease-in-out infinite; animation-delay: calc(var(--i, 0) * -.45s); }
.mascots { display: inline-block; animation: m-waddle 1.8s ease-in-out infinite; }
@keyframes m-float { 0%,100% { translate: 0 0; rotate: -2deg; } 50% { translate: 0 -7%; rotate: 2deg; } }
@keyframes m-swim { 0%,100% { translate: -8% 0; rotate: -6deg; } 50% { translate: 8% -4%; rotate: 6deg; } }
@keyframes m-waddle { 0%,100% { rotate: -7deg; translate: 0 0; } 25% { translate: 0 -6%; } 50% { rotate: 7deg; translate: 0 0; } 75% { translate: 0 -6%; } }
@keyframes m-drive { 0%,100% { translate: -7% 0; rotate: -3deg; } 50% { translate: 7% -2%; rotate: 3deg; } }
@keyframes m-glow { 0%,100% { scale: 1; filter: drop-shadow(0 0 0 rgba(255,216,87,0)); } 50% { scale: 1.09; filter: drop-shadow(0 0 .14em rgba(255,200,40,.9)); } }
@keyframes m-splash { 0%,100% { scale: 1 1; translate: 0 0; } 30% { scale: 1.08 .92; translate: 0 3%; } 60% { scale: .95 1.07; translate: 0 -6%; } }
@keyframes m-spin { to { rotate: 360deg; } }
@keyframes pop-in { 0% { transform: scale(.2); opacity: 0; } 70% { transform: scale(1.12); opacity: 1; } 100% { transform: scale(1); } }
@keyframes jump { 0%,100% { transform: none; } 30% { transform: translateY(-24%) scale(1.12, .92); } 55% { transform: translateY(0) scale(.9, 1.1); } 75% { transform: translateY(-7%) scale(1.03); } }
.runner-screen.full .runner-word { bottom: max(8px, env(safe-area-inset-bottom)); }

/* The painted 3:2 stage keeps the stones and hero in the map's coordinate system.
   Its sides crop on phones; the painted backdrop fills the wider iPad edges. */
.screen.world-home { position: relative; width: 100%; max-width: none; height: 100dvh; min-height: 0; padding: 0; overflow: hidden; background: linear-gradient(#2f5f34, #1d3f24); }
.world-home > .topbar, .hatch-screen > .topbar { display: none; }
/* The 3:2 map COVERS the screen (it sat inside a blurred box with a seam on iPad): it is at least full width and
   tall enough to reach the egg zone; sides crop on phones, the path stays in the centre column. */
.world-stage { position: absolute; height: max(calc(100dvh - 120px - env(safe-area-inset-bottom)), 66.667vw); aspect-ratio: 3 / 2; left: 50%; top: 0; translate: -50% 0; }
.world-map { width: 100%; height: 100%; object-fit: cover; display: block; }
/* Stops are rings over the painted stones (the stones stay visible): done = a gold footprint badge, current = a big
   glowing ring under the hero, future = a faint ring. Solid 64 px discs covered and stacked over the path. */
.map-stop { position: absolute; translate: -50% -50%; width: clamp(34px, 4.2%, 52px); aspect-ratio: 1; height: auto; min-height: 0; padding: 0; border-radius: 50%; border: 3px solid #fff7d199; background: transparent; box-shadow: none; font-size: clamp(14px, 2vw, 22px); line-height: 1; }
.map-stop.future { border-color: #ffffff55; border-style: dashed; }
.map-stop.done { background: #ffd86ae6; border-color: #fff4c4; box-shadow: 0 3px 0 #6b4d1a80; }
.map-stop[aria-current="step"] { z-index: 2; width: clamp(52px, 6.5%, 78px); border: 5px solid #fff38a; background: #fff7a033; box-shadow: 0 0 0 6px #fce67755, 0 0 26px #fff3a0; animation: stone-pulse 2s ease-in-out infinite; }
.map-stop.jump, .dino-card img.jump { animation: jump .55s; }
.map-hero { z-index: 3; position: absolute; width: 78px; height: 100px; object-fit: contain; translate: -50% -90%; pointer-events: none; animation: hero-bob 2s ease-in-out infinite; transition: left 1.1s ease-in-out, top 1.1s ease-in-out; filter: drop-shadow(0 5px 3px #233a2860); }
.world-gems { position: absolute; top: max(12px,env(safe-area-inset-top)); left: max(12px,env(safe-area-inset-left)); display: flex; align-items: center; gap: 8px; padding: 5px 14px 5px 6px; border: 2px solid #ffffff80; border-radius: 32px; background: #28251cc4; color: white; font-size: 30px; text-shadow: 2px 3px 0 #201a17; }
.world-nest { position: absolute; top: max(8px,env(safe-area-inset-top)); right: max(12px,env(safe-area-inset-right)); width: 88px; height: 78px; padding: 0; background: transparent; box-shadow: none; }
.world-nest img { width: 100%; height: 100%; object-fit: contain; }
.world-nest b { position: absolute; right: 0; top: 0; border-radius: 50%; background: #ffdf7b; border: 2px solid white; min-width: 30px; padding: 3px; }
.play-egg { position: absolute; bottom: max(10px,env(safe-area-inset-bottom)); left: 50%; translate: -50% 0; width: 150px; height: 160px; padding: 0; background: transparent; box-shadow: none; animation: egg-wobble 3s ease-in-out infinite; filter: drop-shadow(0 8px 7px #263e3380); }
.play-egg img { width: 100%; height: 100%; object-fit: contain; }
.play-egg span { position: absolute; top: 45%; left: 50%; translate: -50% 0; font-size: 40px; color: #31583c; text-shadow: 0 2px 0 #fff2b8; }
.grownup-lock { position: absolute; bottom: max(16px,env(safe-area-inset-bottom)); left: max(16px,env(safe-area-inset-left)); width: 48px; height: 48px; min-height: 48px; padding: 0; border-radius: 50%; background: #fff6c9c9; font-size: 23px; touch-action: none; -webkit-touch-callout: none; }
.grownup-lock svg { position: absolute; inset: 0; width: 48px; height: 48px; rotate: -90deg; pointer-events: none; }
.grownup-lock circle { fill: none; stroke: #4a8555; stroke-width: 4; stroke-dasharray: 132; stroke-dashoffset: 132; }
.grownup-lock.holding circle { stroke-dashoffset: 0; transition: stroke-dashoffset 2s linear; }
.practice-sounds { display: flex; align-items: center; gap: 16px; }
.practice-sounds select { min-height: 64px; font: inherit; padding: 12px; border-radius: 16px; }
.dino-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.dino-card { display: flex; flex-direction: column; align-items: center; gap: 10px; background: #fff7d9; }
.dino-card img { width: 100%; height: clamp(140px,22dvh,240px); object-fit: contain; }
.dino-card[data-locked="true"] img { filter: brightness(0); opacity: .35; }
.dino-card[data-locked="true"] { background: #d0dfca; }
.dino-card span { font-size: clamp(18px,2.2vw,26px); }
[data-screen="egg-spin"] { background: radial-gradient(ellipse at 50% 30%,#fff6cb,#b3deb9); overflow-x: clip; }
[data-screen="egg-spin"] .wheel-wrap { width: min(38dvh,330px,80vw); }
[data-screen="egg-spin"] .wheel { background: conic-gradient(#ffd85799 0 45deg,#c6e2a499 45deg 90deg,#ffd85799 90deg 135deg,#c6e2a499 135deg 180deg,#ffd85799 180deg 225deg,#c6e2a499 225deg 270deg,#ffd85799 270deg 315deg,#c6e2a499 315deg); border-color: #fff2d5; }
.wheel-egg { position: absolute; inset: -5%; width: 110%; height: 110%; object-fit: contain; }
[data-screen="egg-spin"] .slice { font-size: clamp(32px,6vw,48px); }
.screen.hatch-screen { position: fixed; inset: 0; max-width: none; padding: 0; background: radial-gradient(ellipse,#fff5b0,#91c59b); }
.hatch-scene { flex: 1; width: 100%; border-radius: 0; background: transparent; box-shadow: none; display: grid; place-items: center; overflow: hidden; }
.hatch-egg { width: min(65vw,340px); height: min(60dvh,450px); object-fit: contain; animation: egg-wobble .45s ease-in-out infinite; }
.hatch-reveal img { width: min(75vw,440px); height: min(62dvh,550px); object-fit: contain; animation: pop-in .65s both; }
.hatch-reveal h2 { max-width: 800px; font-size: clamp(28px,5vw,54px); margin-top: 18px; }
.hatch-scene [hidden] { display: none; }
@keyframes stone-pulse { 50% { scale: 1.06; } }
@keyframes hero-bob { 50% { transform: translateY(-6px); } }
@keyframes egg-wobble { 0%,60%,100% { rotate: 0deg; } 68%,84% { rotate: -5deg; } 76%,92% { rotate: 5deg; } }
@media (min-width: 700px) {
  .world-stage { height: max(calc(100dvh - 200px - env(safe-area-inset-bottom)), 66.667vw); }
  .play-egg { width: 180px; height: 195px; }
  .map-hero { width: 90px; height: 116px; }
  .dino-grid { grid-template-columns: repeat(5,minmax(0,1fr)); }
}
@media (prefers-reduced-motion: reduce) { .map-hero, .map-stop, .play-egg, .hatch-egg, .hatch-reveal img, .dino-card img { animation: none; transition: none; } }
