/* Fun Zone (v1.66): deep violet space, coin gold, a candy colour for each topic. Loaded on Fun Zone pages only. */
body.theme-fun {
  --void: #160f36; --hull: #211a52; --hull-2: #2b2366; --rivet: #42379a;
  --ink: #fbf8ff; --ink-dim: #c7bff0; --signal: #ffcc33; --signal-soft: rgba(255, 204, 51, .14);
  --plasma: #59c3ff; --ok: #3ddc97; --bad: #ff6b81;
  --display: "Atkinson Hyperlegible", "Segoe UI", system-ui, sans-serif;
  --gold: #ffcc33; --pink: #ff5fa2; --mint: #3ddc97; --sky: #59c3ff; --grape: #b18cff; --tang: #ff8a3d;
  background: radial-gradient(1200px 500px at 85% -10%, #3a2a8a 0%, rgba(58, 42, 138, 0) 60%), var(--void);
}
body.theme-fun h1, body.theme-fun h2 { font-weight: 700; letter-spacing: 0; }
body.theme-fun .btn { border-radius: 999px; font-family: var(--body); letter-spacing: 0; font-weight: 700; }
body.theme-fun .btn.go { background: var(--gold); border-color: var(--gold); color: #1d1240; }
body.theme-fun .btn.big { font-size: 1.15rem; padding: 14px 28px; }
body.theme-fun .panel { border-radius: 20px; }
.nav a.nav-fun { color: #ffcc33; }

.fun { display: grid; gap: 28px; padding-bottom: 40px; }
.fun .small { font-size: .92rem; }

/* Home */
.fun-hero { display: grid; grid-template-columns: auto 1fr; gap: 28px; align-items: center; padding: 26px 28px;
  background: linear-gradient(135deg, #2b2366, #211a52); border: 1px solid var(--rivet); border-radius: 24px; }
.fun-hero-crew { position: relative; width: 170px; display: grid; justify-items: center; }
.pedestal { display: block; width: 150px; height: 26px; margin-top: -8px; border-radius: 50%; background: radial-gradient(closest-side, rgba(89, 195, 255, .55), rgba(89, 195, 255, 0)); }
.crew-pic.float { animation: bob 3.2s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-8px); } }
.fun-hero h1 { font-size: clamp(2.2rem, 6vw, 3.4rem); line-height: 1; margin: 0 0 8px; }
.fun-lede { font-size: 1.15rem; margin: 0 0 16px; }
.fun-wallet { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin: 0 0 10px; }
.coins { display: inline-flex; align-items: center; gap: 8px; padding: 6px 16px 6px 8px; border-radius: 999px; background: rgba(255, 204, 51, .14);
  border: 1px solid rgba(255, 204, 51, .4); font-size: 1.05rem; }
.coins b { font-family: "Chakra Petch", var(--body); font-size: 1.35rem; color: var(--gold); }
.fun-h2 { font-size: 1.6rem; margin: 0; }
.fun-sub { margin: 4px 0 16px; }

.topics { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.topic { --c: var(--sky); position: relative; display: grid; gap: 4px; grid-template-columns: auto 1fr; grid-template-areas: "icon title" "icon blurb" "best best" "go go";
  align-items: center; column-gap: 14px; padding: 18px 18px 16px; border-radius: 20px; text-decoration: none; color: var(--ink);
  background: var(--hull); border: 2px solid var(--rivet); border-top: 6px solid var(--c); transition: transform .15s ease, border-color .15s ease; }
.topic:hover, .topic:focus-visible { transform: translateY(-3px); border-color: var(--c); }
.topic:focus-visible { outline: 3px solid var(--c); outline-offset: 3px; }
.topic .topic-icon { grid-area: icon; color: var(--c); }
.topic-title { grid-area: title; font-weight: 700; font-size: 1.25rem; }
.topic-blurb { grid-area: blurb; color: var(--ink-dim); font-size: .95rem; line-height: 1.35; }
.topic-best { grid-area: best; margin-top: 10px; font-size: .9rem; color: var(--ink-dim); }
.topic-go { grid-area: go; justify-self: start; margin-top: 10px; padding: 8px 20px; border-radius: 999px; background: var(--c); color: #1d1240; font-weight: 700; }
.topic-flags { --c: #ff5fa2; } .topic-geography { --c: #3ddc97; } .topic-landmarks { --c: #ffcc33; }
.topic-grammar { --c: #59c3ff; } .topic-facts { --c: #ff8a3d; } .topic-trivia { --c: #b18cff; } .topic-records { --c: #2ee6c8; }

/* Junior and Senior */
.race-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; margin-bottom: 16px; }
.race-head .fun-sub { margin-bottom: 0; }
.levels { display: inline-flex; padding: 4px; gap: 4px; border-radius: 999px; background: var(--hull); border: 1px solid var(--rivet); }
.level { display: grid; justify-items: center; gap: 0; padding: 8px 20px; border: 0; border-radius: 999px; background: none; color: var(--ink-dim); cursor: pointer; font: inherit; line-height: 1.2; }
.level b { font-size: 1.05rem; color: var(--ink); }
.level span { font-size: .8rem; }
.level:hover { background: var(--hull-2); }
.level:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; }
.level.on { background: var(--gold); color: #3a2a00; }
.level.on b { color: #1d1240; }
.lvl { display: inline-block; vertical-align: middle; margin-left: 6px; padding: 3px 12px; border-radius: 999px; font-size: .9rem; font-weight: 700; }
.lvl-junior { background: rgba(61, 220, 151, .18); color: var(--mint); }
.lvl-senior { background: rgba(89, 195, 255, .18); color: var(--sky); }

/* Race */
.race-top { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 18px; }
.race-top h1 { font-size: clamp(1.5rem, 4vw, 2.1rem); margin: 0; flex: 1 1 auto; }
.race-top .back { color: var(--ink-dim); }
.race-top .back::before { content: "‹ "; }
.race-meta { margin: 0; color: var(--ink-dim); font-family: "Chakra Petch", var(--body); font-size: 1.05rem; }
.track-wrap { border-radius: 20px; overflow: hidden; border: 1px solid var(--rivet); background: linear-gradient(180deg, #120c2e, #1c1448); }
.track { display: block; width: 100%; height: auto; }
.lane-line { stroke: rgba(255, 255, 255, .12); stroke-width: 2; stroke-dasharray: 10 10; }
.lane-line.you { stroke: rgba(255, 95, 162, .45); }
.finish { stroke: #ffcc33; stroke-width: 4; stroke-dasharray: 12 8; }
.rocket { transition: transform .7s cubic-bezier(.2, .8, .2, 1); }
.rocket:not(.you) { transition: none; }
.lane-name { fill: var(--ink-dim); font: 700 15px var(--body); }
.rocket.you .lane-name { fill: #ff5fa2; }
.track.narrow .lane-name { font-size: 24px; }
.flame { transform-origin: 14px 30px; animation: flicker .18s ease-in-out infinite alternate; }
@keyframes flicker { to { transform: scaleX(.7); } }
.rocket.you.boost .flame { animation: boost .7s ease-out 1; }
@keyframes boost { 0% { transform: scaleX(2.2); } 100% { transform: scaleX(1); } }

.race-stage { position: relative; min-height: 320px; }
.race-intro, .race-end { display: flex; gap: 24px; align-items: center; padding: 26px; }
.race-intro h2, .race-end h2 { font-size: 1.7rem; margin: 0 0 8px; }
.race-intro p, .race-end p { margin: 0 0 10px; }
.countdown { display: grid; place-items: center; min-height: 240px; font: 700 clamp(4rem, 14vw, 8rem) "Chakra Petch", var(--body); color: var(--gold); }
.countdown.pop { animation: pop .6s ease-out; }
@keyframes pop { from { transform: scale(1.6); opacity: .2; } to { transform: scale(1); opacity: 1; } }

.question { display: grid; gap: 16px; }
.q-flag { justify-self: center; }
.q-flag .flag { display: block; height: 150px; width: auto; max-width: 100%; border-radius: 6px; box-shadow: 0 6px 24px rgba(0, 0, 0, .35); outline: 1px solid rgba(255, 255, 255, .25); }
.q-text { font-size: clamp(1.35rem, 3.6vw, 1.9rem); line-height: 1.25; margin: 0; text-align: center; }
.answers { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ans { --c: var(--sky); display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 12px 16px; text-align: left; cursor: pointer;
  font: 700 1.1rem var(--body); color: var(--ink); background: var(--hull); border: 2px solid var(--rivet); border-left: 8px solid var(--c); border-radius: 16px;
  transition: transform .1s ease, background .15s ease; }
.ans:hover:not(:disabled) { transform: translateY(-2px); background: var(--hull-2); }
.ans:focus-visible { outline: 3px solid var(--c); outline-offset: 2px; }
.ans kbd { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--c); color: #1d1240; font: 700 .95rem "Chakra Petch", var(--body); }
.ans-1 { --c: #ff5fa2; } .ans-2 { --c: #59c3ff; } .ans-3 { --c: #ffcc33; } .ans-4 { --c: #3ddc97; }
.ans:disabled { cursor: default; opacity: .55; }
.ans.right { opacity: 1; background: rgba(61, 220, 151, .2); border-color: var(--mint); }
.ans.wrong { opacity: 1; background: rgba(255, 107, 129, .18); border-color: var(--bad); }
.ans.right::after { content: "✓"; margin-left: auto; color: var(--mint); font-size: 1.4rem; }
.ans.wrong::after { content: "✗"; margin-left: auto; color: var(--bad); font-size: 1.3rem; }
.feedback { padding: 14px 18px; border-radius: 16px; background: var(--hull); border: 2px solid var(--rivet); display: grid; gap: 6px; justify-items: start; }
.feedback b { font-size: 1.2rem; }
.feedback p { margin: 0; color: var(--ink-dim); }
.feedback.good { border-color: var(--mint); } .feedback.good b { color: var(--mint); }
.feedback.bad b { color: #ffb0bd; }
.feedback .btn { margin-top: 6px; }

.medal { flex: none; display: grid; place-items: center; width: 120px; height: 120px; border-radius: 50%;
  font: 700 2.2rem "Chakra Petch", var(--body); color: #1d1240; background: #c7bff0; box-shadow: inset 0 -8px 0 rgba(0, 0, 0, .15), 0 0 0 6px rgba(255, 255, 255, .08); }
.medal.place-1 { background: #ffcc33; } .medal.place-2 { background: #d9dcef; } .medal.place-3 { background: #f0a35e; }
.won { display: flex; align-items: center; gap: 8px; font-size: 1.3rem; }
.won b { color: var(--gold); }
.best { color: var(--pink); font-weight: 700; }
.race-end .row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }

/* Crew */
.crew-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.crew-card { display: grid; justify-items: center; text-align: center; gap: 6px; padding: 18px 14px; border-radius: 20px; background: var(--hull); border: 2px solid var(--rivet); }
.crew-card h2 { font-size: 1.25rem; margin: 4px 0 0; }
.crew-card p { margin: 0; }
.crew-card .small { color: var(--ink-dim); min-height: 2.6em; }
.crew-card.flying { border-color: var(--gold); background: linear-gradient(180deg, rgba(255, 204, 51, .12), var(--hull)); }
.crew-card.locked .crew-pic { filter: grayscale(.85) brightness(.75); }
.crew-card .tag { padding: 6px 14px; border-radius: 999px; background: rgba(255, 204, 51, .16); color: var(--gold); font-weight: 700; }
.crew-card .price { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }
.crew-card form { margin-top: 4px; }

@media (max-width: 640px) {
  .fun-hero { grid-template-columns: 1fr; justify-items: center; text-align: center; padding: 22px 18px; }
  .fun-wallet { justify-content: center; }
  .answers { grid-template-columns: 1fr; }
  .ans { min-height: 56px; }
  .race-intro, .race-end { flex-direction: column; text-align: center; }
  .race-end .row { justify-content: center; }
  .q-flag .flag { height: 120px; }
}
@media (max-height: 860px) and (min-width: 641px) {
  .q-flag .flag { height: 110px; }
  .fun-hero { padding: 20px 24px; }
}
@media (prefers-reduced-motion: reduce) {
  .crew-pic.float, .flame, .countdown.pop, .rocket.you.boost .flame { animation: none; }
  .rocket, .topic, .ans { transition: none; }
}

/* v1.68: sound, pictures, and new ways to answer */
.sound-controls { display: flex; gap: 6px; flex-wrap: wrap; }
.snd { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--rivet); background: var(--hull);
  color: var(--ink-dim); font: 600 .88rem var(--body); cursor: pointer; }
.snd svg { width: 18px; height: 18px; fill: currentColor; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.snd[aria-pressed="true"] { background: rgba(255, 204, 51, .16); border-color: var(--gold); color: var(--gold); }
.snd[aria-pressed="false"] svg { opacity: .55; }
.snd:focus-visible, .q-say:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; }

.question { position: relative; }
.q-pic { justify-self: center; width: min(100%, 360px); }
.q-pic svg { display: block; width: 100%; height: auto; border-radius: 16px; box-shadow: 0 8px 28px rgba(0, 0, 0, .35); }
.q-say { justify-self: center; display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 999px; border: 2px solid var(--sky);
  background: rgba(89, 195, 255, .12); color: var(--sky); font: 700 .95rem var(--body); cursor: pointer; }
.q-say svg { width: 20px; height: 20px; fill: currentColor; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.turbo { position: absolute; right: 0; top: -6px; margin: 0; padding: 6px 14px; border-radius: 999px; background: linear-gradient(90deg, #ff5fa2, #ffcc33);
  color: #1d1240; font: 700 1rem "Chakra Petch", var(--body); }
.turbo.pop { animation: pop .5s ease-out; }
.rocket.you.turbo .flame { animation-duration: .09s; }
.rocket.you.turbo .flame path:first-child { fill: #ff5fa2; }

/* True or false */
.answers.type-truefalse .ans { justify-content: center; min-height: 76px; font-size: 1.3rem; }
.ans .tf-icon { font-size: 1.4rem; }
.tf-true { --c: #3ddc97 !important; } .tf-false { --c: #ff6b81 !important; }

/* Put in order */
.answers.type-order, .answers.type-spell, .answers.type-map { display: grid; grid-template-columns: 1fr; gap: 14px; justify-items: center; }
.order-hint { margin: 0; color: var(--ink-dim); text-align: center; }
.order-slots { list-style: none; counter-reset: slot; margin: 0; padding: 12px; width: 100%; min-height: 64px; display: flex; flex-wrap: wrap; gap: 10px; justify-content: center;
  border: 2px dashed var(--rivet); border-radius: 16px; }
.order-slots li { counter-increment: slot; display: flex; align-items: center; gap: 6px; }
.order-slots li::before { content: counter(slot); display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--gold); color: #1d1240; font: 700 .85rem var(--body); }
.order-slots.right { border-color: var(--mint); border-style: solid; background: rgba(61, 220, 151, .1); }
.order-slots.wrong { border-color: var(--bad); border-style: solid; background: rgba(255, 107, 129, .1); }
.order-pool { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; min-height: 50px; }
.chip { padding: 10px 16px; border-radius: 12px; border: 2px solid var(--rivet); border-bottom-width: 4px; background: var(--hull); color: var(--ink); font: 700 1.05rem var(--body); cursor: pointer; }
.chip:hover:not(:disabled) { background: var(--hull-2); transform: translateY(-1px); }
.order-slots .chip { border-color: var(--sky); }
.chip:focus-visible, .tile:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

/* Spell it */
.spell-word { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.spell-slot { display: grid; place-items: center; width: 44px; height: 54px; border-radius: 10px; border: 2px solid var(--rivet); border-bottom-width: 4px;
  background: var(--void); font: 700 1.7rem "Chakra Petch", var(--body); text-transform: lowercase; color: var(--ink); }
.spell-slot.full { border-color: var(--sky); background: var(--hull); }
.spell-word.right .spell-slot { border-color: var(--mint); color: var(--mint); }
.spell-word.wrong .spell-slot { border-color: var(--bad); color: #ffb0bd; }
.spell-tiles { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.tile { width: 50px; height: 54px; border-radius: 12px; border: 2px solid var(--gold); border-bottom-width: 5px; background: #fff7d6; color: #1d1240;
  font: 700 1.6rem "Chakra Petch", var(--body); cursor: pointer; }
.tile:disabled { opacity: .25; cursor: default; }
.spell-actions { display: flex; gap: 10px; }

/* Tap the map */
.map-wrap { width: min(100%, 520px); }
.map { display: block; width: 100%; height: auto; }
.region { fill: #9fe3b0; stroke: #12305e; stroke-width: 1.6; cursor: pointer; transition: fill .15s ease; }
.region-wa { fill: #9fe3b0; } .region-nt { fill: #ffb27a; } .region-sa { fill: #ffd27a; } .region-qld { fill: #ff9fb8; }
.region-nsw { fill: #8fd3ff; } .region-vic { fill: #b9a6ff; } .region-tas { fill: #7fe0d6; } .region-act { fill: #ff6b81; }
.map-world { width: min(100%, 680px); }
.map-world .region { stroke-width: 1.1; }
.region-northamerica { fill: #ffb27a; } .region-southamerica { fill: #9fe3b0; } .region-europe { fill: #b9a6ff; }
.region-africa { fill: #ffd27a; } .region-asia { fill: #ff9fb8; } .region-australia { fill: #8fd3ff; } .region-antarctica { fill: #eef4ff; }
.region:hover, .region:focus-visible { fill: #fff3b0; outline: none; }
.region.picked { fill: #fff3b0; }
.region.right { fill: #3ddc97; stroke: #fff; stroke-width: 3; }
.region.wrong { fill: #ff6b81; }

/* Confetti */
.confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 50; }
.confetti i { position: absolute; top: -20px; left: var(--x); width: 10px; height: 16px; border-radius: 3px; background: var(--c);
  animation: fall var(--t) cubic-bezier(.2, .6, .4, 1) forwards; }
@keyframes fall { to { transform: translate(var(--d), 110vh) rotate(var(--r)); opacity: .2; } }

@media (max-width: 640px) {
  .sound-controls { width: 100%; }
  .spell-slot { width: 36px; height: 46px; font-size: 1.4rem; }
  .tile { width: 44px; height: 48px; font-size: 1.4rem; }
  .turbo { position: static; justify-self: center; }
}
@media (prefers-reduced-motion: reduce) {
  .turbo.pop, .confetti i { animation: none; }
}
.chip, .tile { text-transform: none; letter-spacing: 0; }
.map .region:focus, .map .region:focus-visible { outline: none; }
.map .region:focus-visible { stroke: #fff; stroke-width: 3.5; }

/* v1.69: animations. Everything here stops when the device asks for reduced motion. */
/* The crew buddy beside each question: bobs while you think, cheers, wobbles or dances when you answer */
.buddy { position: absolute; left: 0; top: -10px; display: flex; align-items: flex-start; gap: 6px; pointer-events: none; z-index: 2; }
.buddy-pic { display: block; animation: bob 3.2s ease-in-out infinite; }
.buddy.cheer .buddy-pic { animation: cheer .7s cubic-bezier(.3, 1.6, .5, 1); }
.buddy.wobble .buddy-pic { animation: wobble .6s ease-in-out; }
.buddy.dance .buddy-pic { animation: dance .9s ease-in-out 2; }
@keyframes cheer { 0% { transform: translateY(0) scale(1); } 35% { transform: translateY(-22px) scale(1.12) rotate(-8deg); } 70% { transform: translateY(0) scale(.96, 1.05); } 100% { transform: none; } }
@keyframes wobble { 20% { transform: rotate(-12deg); } 40% { transform: rotate(10deg); } 60% { transform: rotate(-6deg); } 80% { transform: rotate(3deg); } }
@keyframes dance { 25% { transform: translateY(-12px) rotate(-14deg); } 50% { transform: translateY(0) rotate(0) scale(1.08); } 75% { transform: translateY(-12px) rotate(14deg); } }
.bubble { margin-top: 4px; padding: 6px 12px; border-radius: 14px 14px 14px 4px; background: #fff; color: #1d1240; font: 700 .95rem var(--body); white-space: nowrap;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .3); }
.bubble.pop { animation: bubble .35s cubic-bezier(.3, 1.6, .5, 1); transform-origin: 0 100%; }
@keyframes bubble { from { transform: scale(.2); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.question.enter { animation: enter .45s cubic-bezier(.2, 1.2, .4, 1); }
@keyframes enter { from { transform: translateY(18px) scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }

/* Right answers bounce; wrong ones shake */
.ans.right, .order-slots.right, .spell-word.right { animation: bounce .55s cubic-bezier(.3, 1.6, .5, 1); }
.ans.wrong, .order-slots.wrong, .spell-word.wrong { animation: shake .45s ease-in-out; }
.region.right { transform-box: fill-box; transform-origin: center; animation: bounce .55s cubic-bezier(.3, 1.6, .5, 1); }
.region.wrong { transform-box: fill-box; transform-origin: center; animation: shake .45s ease-in-out; }
@keyframes bounce { 0% { transform: scale(1); } 40% { transform: scale(1.07); } 70% { transform: scale(.98); } 100% { transform: scale(1); } }
@keyframes shake { 20% { transform: translateX(-8px); } 40% { transform: translateX(7px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(3px); } }

/* Boost sparkles behind your rocket, and the Moon landing */
.spark { transform-box: fill-box; transform-origin: center; animation: spark .9s ease-out forwards; }
@keyframes spark { from { transform: translate(0, 0) scale(1) rotate(0); opacity: 1; } to { transform: translate(var(--dx), var(--dy)) scale(.2) rotate(120deg); opacity: 0; } }
.puff { transform-box: fill-box; transform-origin: center; animation: puff 1s ease-out forwards; }
@keyframes puff { from { transform: translate(0, 0) scale(.3); opacity: .9; } to { transform: translate(var(--dx), var(--dy)) scale(1.4); opacity: 0; } }
.moon-flag { transform-box: fill-box; transform-origin: 50% 100%; animation: plant .6s .35s cubic-bezier(.3, 1.6, .5, 1) both; }
@keyframes plant { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.moon-flag .cloth { transform-box: fill-box; transform-origin: 0 50%; animation: wave 1.2s 1s ease-in-out infinite alternate; }
@keyframes wave { to { transform: skewY(-8deg) scaleX(.9); } }

/* The result: your crew celebrates, and coins fly into your total */
.end-crew { flex: none; }
.race-end.won-race .end-crew .buddy-pic { animation: dance .9s ease-in-out 3; }
.race-end .medal { animation: medal .7s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes medal { from { transform: scale(0) rotate(-180deg); } to { transform: none; } }
.fly-coin { position: fixed; z-index: 60; width: 24px; height: 24px; margin: -12px 0 0 -12px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle at 35% 35%, #fff2b0 0 18%, #ffcc33 20% 62%, #e7a400 64%); box-shadow: inset 0 0 0 2px #c98a00;
  animation: fly-coin .8s cubic-bezier(.5, -.4, .6, 1) forwards; }
@keyframes fly-coin { 0% { transform: translate(0, 0) scale(.6); opacity: 0; } 15% { opacity: 1; transform: translate(0, -20px) scale(1.1); } 100% { transform: translate(var(--dx), var(--dy)) scale(.7); opacity: 1; } }
.won svg.ping { animation: bounce .4s cubic-bezier(.3, 1.6, .5, 1); }

/* The crew page, just after an unlock */
.crew-card.just-unlocked { position: relative; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(255, 204, 51, .35), 0 0 40px rgba(255, 204, 51, .25);
  animation: unlock .8s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes unlock { from { transform: scale(.6) rotate(-6deg); opacity: 0; } to { transform: none; opacity: 1; } }
.crew-card.just-unlocked .crew-pic { animation: cheer .8s .5s cubic-bezier(.3, 1.6, .5, 1) 2, bob 3.2s 2.2s ease-in-out infinite; }
.new-badge { position: absolute; top: 10px; right: 10px; padding: 4px 10px; border-radius: 999px; background: var(--gold); color: #1d1240; font-weight: 700;
  animation: bubble .4s .6s cubic-bezier(.3, 1.6, .5, 1) both; }
.burst { grid-row: 1; grid-column: 1; align-self: center; justify-self: center; width: 180px; height: 180px; margin: -35px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle at 50% 8%, #ffcc33 0 5px, transparent 6px), radial-gradient(circle at 92% 50%, #ff5fa2 0 5px, transparent 6px),
    radial-gradient(circle at 50% 92%, #59c3ff 0 5px, transparent 6px), radial-gradient(circle at 8% 50%, #3ddc97 0 5px, transparent 6px),
    radial-gradient(circle at 20% 20%, #b18cff 0 4px, transparent 5px), radial-gradient(circle at 80% 20%, #ffcc33 0 4px, transparent 5px),
    radial-gradient(circle at 80% 80%, #ff8a3d 0 4px, transparent 5px), radial-gradient(circle at 20% 80%, #ff5fa2 0 4px, transparent 5px),
    repeating-conic-gradient(rgba(255, 236, 160, .2) 0 8deg, transparent 8deg 30deg);
  animation: burst 1.6s .3s ease-out both; }
.crew-card.just-unlocked .crew-pic { grid-row: 1; grid-column: 1; align-self: center; }
@keyframes burst { from { transform: scale(.2) rotate(0); opacity: 1; } 70% { opacity: 1; } to { transform: scale(1.25) rotate(60deg); opacity: 0; } }
.crew-card.just-unlocked > :not(.burst, .new-badge) { position: relative; z-index: 1; }

@media (min-width: 900px) {
  .question .q-text { padding: 0 190px; }
}
@media (max-width: 899px) {
  .buddy { position: static; justify-self: start; margin: -4px 0 -6px; }
  .buddy-pic { width: 48px; height: 48px; }
  .end-crew .buddy-pic { width: 72px; height: 72px; }
}
@media (prefers-reduced-motion: reduce) {
  .buddy-pic, .buddy.cheer .buddy-pic, .buddy.wobble .buddy-pic, .buddy.dance .buddy-pic, .bubble.pop, .question.enter,
  .ans.right, .ans.wrong, .order-slots.right, .order-slots.wrong, .spell-word.right, .spell-word.wrong, .region.right, .region.wrong,
  .spark, .puff, .moon-flag, .moon-flag .cloth, .race-end.won-race .end-crew .buddy-pic, .race-end .medal, .won svg.ping,
  .crew-card.just-unlocked, .crew-card.just-unlocked .crew-pic, .new-badge { animation: none; }
  .spark, .puff, .fly-coin, .burst { display: none; }
}

/* v1.70: visitors playing without signing in */
.guest-note { color: var(--ink-dim); margin: 0 0 14px; max-width: 46ch; }
.race-end .guest-note { margin-bottom: 10px; }
@media (max-width: 640px) { .guest-note { margin-left: auto; margin-right: auto; } }

/* v1.71: daily streaks */
.streak { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: rgba(255, 138, 61, .15); border: 1px solid rgba(255, 138, 61, .5); font-weight: 600; }
.streak b { color: #ffb27a; font-size: 1.15rem; }
.streak.none { filter: grayscale(1); opacity: .7; }
.streak.done .flame-icon { animation: flicker-icon 1.2s ease-in-out infinite alternate; transform-origin: 50% 90%; }
@keyframes flicker-icon { to { transform: scale(1.12) rotate(4deg); } }
.streak-note { margin-top: -2px; }
.won-streak { display: flex; align-items: center; gap: 8px; font-weight: 700; color: #ffb27a; }
.won-streak[hidden] { display: none; }
@media (prefers-reduced-motion: reduce) { .streak.done .flame-icon { animation: none; } }

/* v1.71: rides. Rocket to the Moon (space), go-kart to the podium (a race track on grass), speedboat to the lighthouse (sea) */
.track-wrap.ride-kart { background: linear-gradient(180deg, #67b85c, #4f9a47); }
.track-wrap.ride-boat { background: linear-gradient(180deg, #3d8fd8, #2366b4); }
.track-wrap.ride-kart .sky, .track-wrap.ride-boat .sky { display: none; }
.kerb { stroke: #ff5f7a; stroke-width: 6; stroke-dasharray: 16 16; }
.road-line { stroke: rgba(255, 255, 255, .55); stroke-width: 3; stroke-dasharray: 22 18; }
.road-line.you { stroke: rgba(255, 204, 51, .8); }
.wave { fill: none; stroke: rgba(255, 255, 255, .28); stroke-width: 2.5; }
.wave.you { stroke: rgba(255, 255, 255, .55); }
.buoy { fill: #ff8a3d; stroke: #fff; stroke-width: 2; }
.podium-num { font: 700 22px "Chakra Petch", var(--body); fill: #1d1240; }
.track.narrow .podium-num { font-size: 32px; }
.lamp { animation: lamp 1.6s ease-in-out infinite alternate; }
@keyframes lamp { to { fill: #fff7c2; filter: drop-shadow(0 0 8px #ffe27a); } }
.ride-boat.rocket { animation: bob-boat 1.6s ease-in-out infinite alternate; }
.rocket.ride-boat > * { transform-box: view-box; }
@keyframes bob-boat { to { translate: 0 3px; } }
.ride-kart .flame, .ride-boat .flame { animation-duration: .35s; }

/* The ride picker on the race intro */
.ride-pick { display: flex; flex-wrap: wrap; gap: 10px; margin: 4px 0 14px; }
.ride-btn { display: grid; justify-items: center; gap: 2px; width: 118px; padding: 8px 6px 10px; border-radius: 16px; border: 2px solid var(--rivet);
  background: var(--hull); color: var(--ink); font: 700 .95rem var(--body); cursor: pointer; transition: transform .15s ease, border-color .15s ease; }
.ride-btn svg { width: 96px; height: 48px; }
.ride-btn[aria-pressed="true"] { border-color: var(--gold); background: rgba(255, 204, 51, .12); }
.ride-btn:hover { transform: translateY(-2px); }
.ride-btn:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; }
.ride-label { margin: 0 0 4px; font-weight: 700; }
@media (max-width: 640px) { .ride-pick { justify-content: center; } .ride-btn { width: 100px; } .ride-btn svg { width: 80px; height: 40px; } }
@media (prefers-reduced-motion: reduce) { .lamp, .ride-boat.rocket { animation: none; } .ride-btn { transition: none; } }
.track-wrap.ride-kart .lane-name, .track-wrap.ride-boat .lane-name { fill: #fff; paint-order: stroke; stroke: rgba(10, 8, 30, .55); stroke-width: 4px; }
.track-wrap.ride-kart .rocket.you .lane-name, .track-wrap.ride-boat .rocket.you .lane-name { fill: #ffd1e4; }

/* v1.72: the Games section on the Fun Zone home */
.games { margin-bottom: 26px; }
.game-card { display: grid; grid-template-columns: minmax(160px, 260px) 1fr; gap: 18px; align-items: center; padding: 16px; border-radius: 20px;
  background: var(--hull); border: 2px solid var(--rivet); border-top: 6px solid #3ddc97; color: var(--ink); text-decoration: none; transition: transform .15s ease; }
.game-card:hover { transform: translateY(-2px); }
.game-card:focus-visible { outline: 3px solid var(--sky); outline-offset: 3px; }
.game-art { display: block; width: 100%; height: auto; }
.game-text { display: grid; gap: 6px; justify-items: start; }
.game-title { font-weight: 700; font-size: 1.4rem; }
.game-blurb { color: var(--ink-dim); }
.game-card .topic-go { --c: #3ddc97; }
@media (max-width: 640px) { .game-card { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .game-card { transition: none; } }
.game-card .topic-best, .game-card .topic-go { grid-area: auto; margin-top: 4px; }
