/* Brielle's Island Adventure: turquoise sea, soft sand, big friendly buttons for a 7-year-old on a tablet */
:root { --sea1: #7fe3f0; --sea2: #1eb8cf; --deep: #0a7f9e; --sand: #f6e2b3; --sand2: #ecc987; --ink: #36214f; --pink: #ff5fa2;
  --coral: #ff8a65; --gold: #ffcf4a; --leaf: #2fbf71; --white: #fffdf8; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--sea2); font-family: "Fredoka", system-ui, sans-serif; color: var(--ink); }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
#app, .screen { position: fixed; inset: 0; }
.screen[hidden], [hidden] { display: none !important; }

/* the sea and its waves */
.sea { position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 55%, var(--sea1), var(--sea2) 55%, var(--deep)); overflow: hidden; }
.wave { position: absolute; left: -10%; width: 120%; height: 18px; border-radius: 50%; border-top: 4px solid rgba(255, 255, 255, .55); animation: wave 6s ease-in-out infinite; }
.w1 { top: 12%; } .w2 { top: 84%; animation-delay: -2s; } .w3 { top: 92%; animation-delay: -4s; opacity: .7; }
@keyframes wave { 50% { transform: translateX(4%) scaleY(1.4); } }

.bar { position: absolute; left: 0; right: 0; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px; }
.title { font: 800 clamp(22px, 3.6vw, 38px)/1.05 "Baloo 2", sans-serif; color: var(--white); text-shadow: 0 3px 0 rgba(10, 80, 110, .55); text-align: center; flex: 1; }
.chip { display: inline-flex; align-items: center; gap: 10px; height: 54px; padding: 0 20px; border-radius: 999px; background: var(--white);
  font: 700 20px "Baloo 2", sans-serif; box-shadow: 0 5px 0 rgba(10, 80, 110, .35); }
.chip b { background: var(--gold); border-radius: 999px; min-width: 34px; height: 34px; display: grid; place-items: center; }
.chip:active, .stop:active, .big:active, .tile:active, .choice:active { transform: translateY(3px); box-shadow: none; }

/* the island */
.island { position: absolute; left: 50%; top: 54%; width: min(92vw, 140vh); height: min(70vh, 60vw); transform: translate(-50%, -50%); }
.sand { position: absolute; inset: 6% 3% 4%; background: radial-gradient(ellipse at 45% 40%, #fff3d2, var(--sand) 45%, var(--sand2));
  border-radius: 48% 52% 46% 54% / 55% 48% 52% 45%; box-shadow: 0 0 0 14px rgba(255, 255, 255, .35), 0 0 0 30px rgba(255, 255, 255, .15); }
.palm { position: absolute; font-size: clamp(54px, 9vmin, 96px); filter: drop-shadow(0 6px 0 rgba(0, 0, 0, .12)); animation: sway 4s ease-in-out infinite; transform-origin: 50% 100%; }
.p1 { left: 6%; top: 8%; } .p2 { right: 9%; top: 4%; animation-delay: -1.5s; } .p3 { left: 44%; bottom: 2%; font-size: clamp(40px, 7vmin, 70px); animation-delay: -3s; }
@keyframes sway { 50% { transform: rotate(-6deg); } }
.princess { position: absolute; left: 50%; top: 50%; height: 46%; transform: translate(-50%, -50%); filter: drop-shadow(0 8px 6px rgba(0, 0, 0, .18)); animation: bob 3s ease-in-out infinite; }
@keyframes bob { 50% { transform: translate(-50%, -54%); } }
.stop { position: absolute; width: clamp(150px, 22vmin, 230px); padding: 14px 10px 12px; border-radius: 28px; background: var(--white);
  display: flex; flex-direction: column; align-items: center; gap: 4px; box-shadow: 0 7px 0 rgba(150, 100, 40, .35), 0 12px 24px rgba(0, 0, 0, .12); animation: pop .5s backwards; }
.stop .ic { font-size: clamp(46px, 8vmin, 72px); line-height: 1; animation: bounce 2.4s ease-in-out infinite; }
.stop .nm { font: 800 clamp(17px, 2.6vmin, 23px)/1.1 "Baloo 2", sans-serif; text-align: center; }
.stop .lv { font-size: 15px; color: #8a6b3a; }
.s-spell { left: 6%; top: 30%; } .s-math { right: 7%; top: 26%; animation-delay: .1s; } .s-read { left: 14%; bottom: 6%; animation-delay: .2s; } .s-write { right: 13%; bottom: 8%; animation-delay: .3s; }
.s-math .ic { animation-delay: -.6s; } .s-read .ic { animation-delay: -1.2s; } .s-write .ic { animation-delay: -1.8s; }
@keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes pop { from { transform: scale(.4); opacity: 0; } }
.gulls { position: absolute; top: 14%; left: 0; right: 0; pointer-events: none; }
.gulls span { position: absolute; font-size: 30px; animation: fly 22s linear infinite; }
.gulls span + span { top: 40px; animation-delay: -11s; font-size: 24px; }
@keyframes fly { from { transform: translateX(-60px); } to { transform: translateX(110vw); } }
.sound { position: absolute; right: 16px; bottom: calc(14px + env(safe-area-inset-bottom)); width: 58px; height: 58px; border-radius: 50%; background: var(--white); font-size: 28px; box-shadow: 0 4px 0 rgba(10, 80, 110, .35); }

/* a game screen */
#play { background: linear-gradient(#bff4fb, #7fe3f0 40%, var(--sand) 41%, var(--sand2)); }
.dots { display: flex; gap: 8px; }
.dots i { width: 22px; height: 22px; border-radius: 50%; background: rgba(255, 255, 255, .6); box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .9); }
.dots i.on { background: var(--gold); }
.dots i.miss { background: #ffc0a8; }
.stage { position: absolute; inset: 84px 0 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: clamp(14px, 3vh, 30px); padding: 10px 16px 24px; }
.ask { font: 800 clamp(26px, 4.6vmin, 44px)/1.2 "Baloo 2", sans-serif; text-align: center; max-width: 900px; }
.say { width: 66px; height: 66px; border-radius: 50%; background: var(--white); font-size: 32px; box-shadow: 0 5px 0 rgba(10, 80, 110, .3); flex: none; }
.row { display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; }
.pic { font-size: clamp(90px, 18vmin, 170px); line-height: 1; filter: drop-shadow(0 8px 0 rgba(0, 0, 0, .08)); animation: pop .4s; }

/* spelling */
.slots { display: flex; gap: 10px; }
.slot { width: clamp(58px, 10vmin, 84px); height: clamp(66px, 11vmin, 92px); border-radius: 18px; background: rgba(255, 255, 255, .55); border: 4px dashed rgba(120, 80, 30, .35);
  display: grid; place-items: center; font: 800 clamp(36px, 7vmin, 60px) "Baloo 2", sans-serif; text-transform: lowercase; }
.slot.full { background: var(--white); border: 4px solid var(--leaf); animation: pop .25s; }
.tiles { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; max-width: 820px; }
.tile { width: clamp(70px, 12vmin, 100px); height: clamp(70px, 12vmin, 100px); border-radius: 50% 50% 46% 46%; position: relative;
  background: radial-gradient(circle at 35% 30%, #fff, #ffd9e6 60%, #ffb3c9); box-shadow: 0 6px 0 #e98aa8;
  font: 800 clamp(34px, 6.4vmin, 54px) "Baloo 2", sans-serif; text-transform: lowercase; color: var(--ink); }
.tile.used { visibility: hidden; }
.tile.hint { animation: glow 1s ease-in-out infinite; }
@keyframes glow { 50% { box-shadow: 0 6px 0 #e98aa8, 0 0 0 8px rgba(255, 207, 74, .9); } }
.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-10px); } 40%, 80% { transform: translateX(10px); } }

/* math */
.fruits { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; max-width: 760px; font-size: clamp(44px, 8vmin, 70px); }
.fruits span { animation: pop .3s backwards; }
.op { font: 800 clamp(44px, 8vmin, 72px) "Baloo 2", sans-serif; color: var(--deep); }
.blender { font-size: clamp(70px, 13vmin, 120px); }
.choice { min-width: clamp(110px, 18vmin, 170px); height: clamp(90px, 15vmin, 130px); border-radius: 50%; padding: 0 18px;
  background: radial-gradient(circle at 35% 30%, #fff, #d9f7ff 60%, #9ee7f5); box-shadow: 0 7px 0 #49b8cc;
  font: 800 clamp(40px, 8vmin, 66px) "Baloo 2", sans-serif; }
.choice.pic-choice { border-radius: 30px; font-size: clamp(54px, 10vmin, 90px); background: var(--white); box-shadow: 0 7px 0 rgba(150, 100, 40, .35); }
.choice.right { background: radial-gradient(circle at 35% 30%, #fff, #c9f7d6 60%, #7be2a0); box-shadow: 0 7px 0 #2fbf71; }

/* reading */
.sentence { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 12px; max-width: 980px; background: var(--white); border-radius: 26px; padding: 18px 26px;
  box-shadow: 0 7px 0 rgba(150, 100, 40, .3); }
.word { font: 700 clamp(30px, 5.4vmin, 50px)/1.25 "Baloo 2", sans-serif; padding: 0 4px; border-radius: 10px; }
.word.lit { background: #fff1a8; }

/* writing */
.trace-wrap { position: relative; width: min(84vw, 70vh); height: min(52vh, 56vw); border-radius: 30px; background: linear-gradient(#f9e8bf, #efd398);
  box-shadow: inset 0 4px 14px rgba(120, 80, 20, .25), 0 7px 0 rgba(150, 100, 40, .3); touch-action: none; overflow: hidden; }
.trace-wrap canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; }
.meter { width: min(84vw, 70vh); height: 18px; border-radius: 9px; background: rgba(255, 255, 255, .6); overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--leaf), var(--gold)); transition: width .15s; }
.small-btn { height: 56px; padding: 0 22px; border-radius: 999px; background: var(--white); font: 700 20px "Baloo 2", sans-serif; box-shadow: 0 5px 0 rgba(150, 100, 40, .3); }

/* feedback */
.yay { position: fixed; left: 50%; top: 46%; transform: translate(-50%, -50%); font: 800 clamp(48px, 10vmin, 96px) "Baloo 2", sans-serif; color: var(--white);
  text-shadow: 0 5px 0 var(--pink), 0 10px 20px rgba(0, 0, 0, .2); pointer-events: none; animation: yay 1.1s forwards; z-index: 30; white-space: nowrap; }
@keyframes yay { 0% { transform: translate(-50%, -50%) scale(.3); opacity: 0; } 25% { transform: translate(-50%, -50%) scale(1.15); opacity: 1; } 70% { opacity: 1; } 100% { transform: translate(-50%, -80%) scale(1); opacity: 0; } }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 40; overflow: hidden; }
.confetti i { position: absolute; top: -20px; width: 12px; height: 18px; border-radius: 3px; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }

/* the prize and the cabana */
.prize { position: fixed; inset: 0; z-index: 35; display: grid; place-items: center; background: rgba(20, 60, 90, .55); }
.prize-card { position: relative; width: min(520px, 90vw); padding: 36px 26px 28px; border-radius: 36px; background: var(--white); text-align: center; animation: pop .4s; box-shadow: 0 12px 0 rgba(0, 0, 0, .15); }
.burst { position: absolute; left: 50%; top: 92px; width: 230px; height: 230px; transform: translate(-50%, -50%); border-radius: 50%;
  background: repeating-conic-gradient(#fff3b0 0 12deg, transparent 12deg 24deg); animation: spin 8s linear infinite; opacity: .9; }
@keyframes spin { to { transform: translate(-50%, -50%) rotate(360deg); } }
.prize-ic { position: relative; font-size: 120px; line-height: 1; animation: bounce 1.6s ease-in-out infinite; }
.prize-card h2 { position: relative; margin: 18px 0 4px; font: 800 34px "Baloo 2", sans-serif; }
.prize-card p { margin: 0 0 20px; font-size: 20px; color: #6d5a80; }
.big { height: 70px; padding: 0 40px; border-radius: 999px; background: linear-gradient(#ff8fc0, var(--pink)); color: #fff; font: 800 28px "Baloo 2", sans-serif; box-shadow: 0 7px 0 #c53f7c; }
#cabana { background: linear-gradient(#bff4fb, #7fe3f0 34%, var(--sand) 35%, var(--sand2)); }
.cabana { position: absolute; inset: 84px 0 0; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 0 16px 20px; overflow: auto; }
.hut { font-size: clamp(90px, 16vmin, 150px); }
.hint { margin: 0; font: 600 22px "Fredoka", sans-serif; text-align: center; }
.shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 14px; width: min(980px, 100%); }
.shelf div { aspect-ratio: 1; border-radius: 26px; background: rgba(255, 255, 255, .75); display: grid; place-items: center; font-size: 62px; box-shadow: 0 5px 0 rgba(150, 100, 40, .25); position: relative; }
.shelf div.empty { background: rgba(255, 255, 255, .3); font-size: 36px; color: rgba(120, 80, 30, .35); box-shadow: none; }
.shelf small { position: absolute; bottom: 6px; left: 0; right: 0; font: 600 13px "Fredoka", sans-serif; text-align: center; color: #6d5a80; }
@media (prefers-reduced-motion: reduce) { * { animation-duration: .01s !important; } }

/* ---- upgrades (11/03, after watching it): a living map, Coco the parrot, the sky, flying letters, tap-to-count */
.sky-deco { position: absolute; left: 0; right: 0; top: 0; height: 40%; pointer-events: none; overflow: hidden; }
.sun { position: absolute; right: 7%; top: 70px; font-size: clamp(60px, 10vmin, 96px); animation: spin 40s linear infinite; }
.cloud { position: absolute; font-size: clamp(50px, 9vmin, 90px); opacity: .9; animation: drift 38s linear infinite; }
.cloud.c2 { top: 120px; animation-duration: 52s; animation-delay: -20s; font-size: clamp(40px, 7vmin, 70px); }
.cloud.c1 { top: 70px; }
@keyframes drift { from { transform: translateX(-140px); } to { transform: translateX(110vw); } }
.coco { position: absolute; left: 3%; bottom: 4%; z-index: 6; display: flex; align-items: flex-end; gap: 6px; pointer-events: auto; }
.coco .bird { font-size: clamp(66px, 11vmin, 110px); line-height: 1; transform-origin: 50% 100%; cursor: pointer; }
.coco .bird.happy { animation: hop .5s 2; }
.coco .bird.sad { animation: tilt .8s; }
@keyframes hop { 50% { transform: translateY(-26px) rotate(-8deg); } }
@keyframes tilt { 30% { transform: rotate(-14deg); } 60% { transform: rotate(10deg); } }
.coco .bubble { max-width: min(300px, 40vw); padding: 12px 16px; margin-bottom: 70px; border-radius: 20px 20px 20px 4px; background: var(--white);
  font: 700 clamp(17px, 2.6vmin, 22px)/1.2 "Baloo 2", sans-serif; box-shadow: 0 5px 0 rgba(0, 0, 0, .1); opacity: 0; transform: scale(.6); transition: .2s; }
.coco .bubble.on { opacity: 1; transform: none; }
.streak { position: absolute; right: 16px; top: 74px; z-index: 6; font: 800 22px "Baloo 2", sans-serif; color: #fff; background: linear-gradient(#ffb347, #ff6a3d);
  padding: 6px 16px; border-radius: 999px; box-shadow: 0 4px 0 #c84b1f; animation: pop .3s; }
.fly { position: fixed; z-index: 20; pointer-events: none; transition: transform .35s cubic-bezier(.3, 1.4, .5, 1); }
.slot.done { animation: jump .45s; }
@keyframes jump { 40% { transform: translateY(-18px); } }
.fruits span { display: inline-block; position: relative; cursor: pointer; transition: transform .15s; }
.fruits span.counted { transform: translateY(-10px) scale(1.12); }
.fruits span b { position: absolute; left: 50%; top: -28px; transform: translateX(-50%); font: 800 26px "Baloo 2", sans-serif; color: var(--deep); }
.swimmer { position: fixed; left: -160px; bottom: 18%; font-size: 110px; z-index: 25; pointer-events: none; animation: swim 2s ease-in-out forwards; }
@keyframes swim { to { transform: translateX(calc(100vw + 300px)); } }
.wash { position: absolute; top: 0; bottom: 0; left: -40%; width: 40%; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .95) 40%, #9ee7f5 70%, transparent);
  animation: washing .9s ease-in forwards; z-index: 3; }
@keyframes washing { to { left: 110%; } }
/* the map comes alive */
.princess { transition: left .7s ease-in-out, top .7s ease-in-out; cursor: pointer; }
.princess.twirl { animation: twirl .8s; }
@keyframes twirl { 50% { transform: translate(-50%, -50%) rotateY(180deg) scale(1.08); } }
.palm { cursor: pointer; }
.coconut { position: absolute; font-size: 40px; z-index: 4; animation: drop .7s cubic-bezier(.5, 0, 1, 1) forwards; pointer-events: none; }
@keyframes drop { to { transform: translateY(120px) rotate(200deg); } }
.gulls span { pointer-events: auto; cursor: pointer; padding: 10px; }
.ripple { position: absolute; width: 20px; height: 20px; border-radius: 50%; border: 4px solid rgba(255, 255, 255, .8); transform: translate(-50%, -50%); animation: ripple .9s forwards; pointer-events: none; z-index: 2; }
@keyframes ripple { to { width: 180px; height: 180px; opacity: 0; } }
.crab { position: absolute; font-size: 46px; bottom: 30%; z-index: 1; cursor: pointer; animation: scuttle 14s linear infinite; }
@keyframes scuttle { 0% { left: 18%; } 45% { left: 70%; } 50% { left: 70%; transform: scaleX(-1); } 95% { left: 18%; transform: scaleX(-1); } 100% { left: 18%; } }
.crab.pinch { animation-play-state: paused; }
.crab.pinch::after { content: "✨"; position: absolute; left: 30px; top: -24px; font-size: 28px; }
.shelf div { cursor: pointer; }
.shelf div.dance { animation: dance .7s; }
@keyframes dance { 25% { transform: rotate(-12deg) scale(1.15); } 50% { transform: rotate(10deg) scale(1.2); } 75% { transform: rotate(-6deg); } }
.ask .tapword { cursor: pointer; border-radius: 8px; }
.ask .tapword.lit { background: #fff1a8; }

/* ---- the painted art (11/03, "Upgrade the graphics like 5x"): art/*.webp scenes, art/*.png characters */
#map .sea { background: #2bb7cf url(art/map.webp) center / cover no-repeat; }
#map .wave, .sand, .palm { display: none; }
.island { width: 100vw; height: 100vh; left: 0; top: 0; transform: none; }
.princess { left: 47%; top: 52%; height: 34%; }
.s-spell { left: 14%; top: 34%; } .s-math { right: 14%; top: 26%; } .s-read { left: 18%; bottom: 10%; } .s-write { right: 16%; bottom: 10%; }
.stop { background: rgba(255, 253, 248, .9); backdrop-filter: blur(4px); }
.stop .ic img { height: clamp(52px, 9vmin, 84px); display: block; }
.crab { font-size: 0; width: clamp(70px, 11vmin, 110px); height: clamp(70px, 11vmin, 110px); background: url(art/crab.png) center / contain no-repeat; bottom: 34%; }
#play { background: #7fe3f0 center / cover no-repeat; }
#play[data-game=spell] { background-image: url(art/bg_spell.webp); }
#play[data-game=math] { background-image: url(art/bg_math.webp); }
#play[data-game=read] { background-image: url(art/bg_read.webp); }
#play[data-game=write] { background-image: url(art/bg_write.webp); }
#play .sky-deco { display: none; }
.stage { inset: 84px max(6vw, 16px) 16px; }
.stage::before { content: ""; position: absolute; inset: 2% 4% 4%; z-index: -1; border-radius: 34px; background: rgba(255, 253, 248, .55);
  backdrop-filter: blur(3px); box-shadow: 0 18px 40px rgba(0, 60, 90, .22); }
.stage { z-index: 1; }
.coco .bird { font-size: 0; width: clamp(110px, 17vmin, 170px); height: clamp(110px, 17vmin, 170px); background: url(art/coco.png) center bottom / contain no-repeat; }
.swimmer { font-size: 0; width: 220px; height: 220px; background: url(art/turtle.png) center / contain no-repeat; }
.mascot { height: clamp(110px, 18vmin, 170px); animation: bounce 2.4s ease-in-out infinite; filter: drop-shadow(0 8px 6px rgba(0, 0, 0, .15)); }
#cabana { background: #f6e2b3 url(art/bg_cabana.webp) center / cover no-repeat; }
#cabana .hut { display: none; }
.cabana { inset: 84px max(5vw, 16px) 16px; }
.cabana .hint { background: rgba(255, 253, 248, .85); padding: 8px 20px; border-radius: 999px; }
.shelf div { background: rgba(255, 253, 248, .88); }
.shelf div.empty { background: rgba(255, 255, 255, .45); }

/* ---- the three new stops (11/03): Dolphin Dock, Pirate Cove, Message in a Bottle; seven stops on the map */
.stop { width: clamp(124px, 17vmin, 184px); padding: 10px 8px 9px; border-radius: 24px; }
.stop .ic img { height: clamp(44px, 7.4vmin, 70px); }
.stop .nm { font-size: clamp(15px, 2.2vmin, 20px); }
.stop .lv { font-size: 13px; }
.s-spell { left: 4%; top: 38%; } .s-math { right: 4%; top: 24%; } .s-read { left: 9%; bottom: 5%; top: auto; } .s-write { left: 34%; right: auto; bottom: 3%; }
.s-sound { right: 5%; bottom: 6%; animation-delay: .4s; } .s-coins { left: 13%; top: 13%; animation-delay: .5s; } .s-bottle { right: 25%; top: 9%; animation-delay: .6s; }
.s-sound .ic { animation-delay: -.4s; } .s-coins .ic { animation-delay: -1s; } .s-bottle .ic { animation-delay: -1.4s; }
#play[data-game=sound] { background-image: url(art/bg_dock.webp); }
#play[data-game=coins] { background-image: url(art/bg_pirate.webp); }
#play[data-game=bottle] { background-image: url(art/bg_bottle.webp); }

/* Dolphin Dock */
.dolphin { height: clamp(110px, 19vmin, 180px); filter: drop-shadow(0 8px 6px rgba(0, 0, 0, .15)); }
.dolphin.leap { animation: leap 1s ease-in-out; }
@keyframes leap { 40% { transform: translateY(-30px) rotate(-12deg); } 70% { transform: translateY(4px) rotate(6deg); } }
.bubbles { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.bub { min-width: clamp(64px, 11vmin, 92px); height: clamp(64px, 11vmin, 92px); padding: 0 12px; border-radius: 999px; position: relative;
  background: radial-gradient(circle at 32% 28%, #fff, #d4f6ff 55%, #8fdcf0); box-shadow: inset 0 -6px 0 rgba(30, 140, 170, .25), 0 5px 0 rgba(10, 80, 110, .25);
  font: 800 clamp(32px, 6vmin, 52px) "Baloo 2", sans-serif; color: var(--deep); transition: transform .15s; }
.bub.lit { transform: translateY(-14px) scale(1.15); background: radial-gradient(circle at 32% 28%, #fff, #fff4b8 55%, #ffd34a); }
.bub.full { color: var(--ink); animation: pop .25s; }
.bub.quiet.full { opacity: .45; }
.bub.quiet.full::after { content: "🤫"; position: absolute; right: -8px; top: -14px; font-size: 26px; }
.bub.done { animation: jump .45s; }
.tile.chunk { width: auto; min-width: clamp(70px, 12vmin, 100px); padding: 0 16px; border-radius: 40px; }

/* Pirate Cove */
.coin { display: inline-grid; place-items: center; border-radius: 50%; font: 800 15px/1 "Baloo 2", sans-serif; flex: none; vertical-align: middle;
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .18), 0 3px 0 rgba(0, 0, 0, .18); cursor: pointer; }
.coin.penny { width: 62px; height: 62px; background: radial-gradient(circle at 35% 30%, #ffd2a8, #d27d3f 60%, #a3561f); color: #5a2a08; }
.coin.nickel { width: 72px; height: 72px; background: radial-gradient(circle at 35% 30%, #fff, #c9d0d6 60%, #8f99a3); color: #3c4650; }
.coin.dime { width: 54px; height: 54px; background: radial-gradient(circle at 35% 30%, #fff, #d7dde2 60%, #a2acb5); color: #3c4650; font-size: 14px; }
.coin.fly { position: fixed; z-index: 20; pointer-events: none; transition: transform .35s cubic-bezier(.3, 1.4, .5, 1); }
.tray { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; max-width: 860px; min-height: 76px; }
.chest-box { display: flex; align-items: center; gap: 18px; }
.chest { width: clamp(220px, 36vmin, 340px); min-height: clamp(130px, 20vmin, 180px); position: relative; padding: 46px 14px 14px;
  background: url(art/chest.png) center bottom / contain no-repeat; }
.chest .inside { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; align-content: flex-start; min-height: 70px; }
.chest .inside .coin { transform: scale(.75); margin: -6px; }
.chest.shut { animation: jump .5s; }
.total { font: 800 clamp(40px, 7vmin, 64px) "Baloo 2", sans-serif; color: var(--deep); background: var(--white); border-radius: 24px; padding: 0 18px; box-shadow: 0 5px 0 rgba(10, 80, 110, .25); min-width: 110px; text-align: center; }
.total.ok { color: var(--leaf); animation: jump .45s; }
.coin-key { font: 600 18px "Fredoka", sans-serif; background: rgba(255, 253, 248, .85); border-radius: 999px; padding: 6px 16px; }
.coin-key .coin { transform: scale(.7); margin: -8px -4px; cursor: default; }
.two-chests { gap: 30px; }
.chest-pick { display: flex; flex-direction: column; align-items: center; gap: 8px; border-radius: 30px; padding: 8px; }
.chest-pick.right { background: rgba(123, 226, 160, .45); }

/* Message in a Bottle */
.bottle-pic { height: clamp(90px, 15vmin, 140px); filter: drop-shadow(0 8px 6px rgba(0, 0, 0, .15)); animation: bob2 2.6s ease-in-out infinite; }
.bottle-pic.pop { animation: bob2 2.6s ease-in-out infinite, pop .5s; }
@keyframes bob2 { 50% { transform: translateY(-8px) rotate(-6deg); } }
.note { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; align-items: center; max-width: 1000px; padding: 22px 26px; border-radius: 18px;
  background: linear-gradient(#fffaf0, #f6e6c4); box-shadow: 0 7px 0 rgba(150, 100, 40, .3), inset 0 0 0 3px rgba(160, 110, 40, .15); }
.note.done { animation: jump .5s; box-shadow: 0 7px 0 #2fbf71, inset 0 0 0 3px rgba(47, 191, 113, .4); }
.wslot { min-width: clamp(80px, 13vmin, 120px); height: clamp(62px, 10vmin, 84px); border-radius: 16px; border: 3px dashed rgba(120, 80, 30, .35); display: grid; place-items: center; }
.wtray { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; min-height: 80px; max-width: 1000px; }
.wtile { height: clamp(58px, 9.6vmin, 80px); padding: 0 20px; border-radius: 16px; background: var(--white); box-shadow: 0 5px 0 rgba(150, 100, 40, .35);
  font: 700 clamp(28px, 5vmin, 44px) "Baloo 2", sans-serif; color: var(--ink); }
.wslot .wtile { box-shadow: none; background: #fff; }
.wtile.locked { background: #dcfce7; }
.wtile.grow { animation: jump .45s; color: var(--pink); }
.wtile.dot { min-width: 90px; font-size: 56px; line-height: .5; animation: glow 1s ease-in-out infinite; }
.sentence-note { font: 700 clamp(28px, 5vmin, 46px)/1.3 "Baloo 2", sans-serif; }
.blank { border-bottom: 4px solid var(--deep); padding: 0 6px; color: var(--deep); }
.blank.filled { color: var(--leaf); animation: pop .3s; }
.choice.word-choice { border-radius: 30px; font-size: clamp(34px, 6.4vmin, 56px); }
/* (11/03) Coco's hidden speech bubble sat over the tiles at the bottom left and ate her taps: only the bird takes taps */
.coco { pointer-events: none; }
.coco .bird { pointer-events: auto; }
/* (11/03, Albert: "3 of the icons are below the threshhold and are cut off") the map is the screen the tablet really shows
   (100vh counted the browser's bar too, so the bottom row slid under it); the bottom stops sit inside the safe area */
.island { height: auto; top: 0; bottom: 0; }
.s-read { bottom: calc(3% + env(safe-area-inset-bottom)); } .s-write { bottom: calc(2% + env(safe-area-inset-bottom)); }
.s-sound { bottom: calc(3% + env(safe-area-inset-bottom)); right: calc(5% + 64px); }
@media (max-height: 640px) { .stop { width: clamp(108px, 15vmin, 150px); padding: 6px 6px 7px; } .stop .ic img { height: clamp(36px, 6.5vmin, 54px); } .stop .lv { font-size: 12px; } }
@media (orientation: portrait) {
  .s-spell { left: 3%; top: 30%; } .s-math { right: 3%; top: 30%; } .s-coins { left: 3%; top: 12%; } .s-bottle { right: 3%; top: 12%; }
  .s-read { left: 3%; } .s-write { left: 50%; transform: translateX(-50%); } .s-sound { right: 3%; bottom: calc(12% + env(safe-area-inset-bottom)); }
  .princess { height: 26%; }
}
/* (11/03) the logo (painted: the island, the dolphin, Coco) beside the title on the map */
.logo-title { display: flex; align-items: center; justify-content: center; gap: 12px; }
.logo-title img { height: clamp(44px, 7vmin, 64px); width: auto; border-radius: 22%; box-shadow: 0 4px 0 rgba(10, 80, 110, .35), 0 0 0 3px rgba(255, 255, 255, .9); }
/* (11/03) difficulty 1-5: its chip on the map; quarters; groups for times; the sum written out */
.chip.diff { background: #fff3c4; height: 44px; padding: 0 16px; font-size: 18px; box-shadow: 0 4px 0 rgba(10, 80, 110, .25); }
.coin.quarter { width: 78px; height: 78px; background: radial-gradient(circle at 35% 30%, #fff, #cfd6dc 60%, #8a949e); color: #3c4650; font-size: 16px; }
.groups { gap: 18px; }
.fruits.group { padding: 6px 10px; border-radius: 18px; background: rgba(255, 255, 255, .6); font-size: clamp(30px, 5vmin, 46px); max-width: 260px; }
.ask.eq { font-size: clamp(48px, 9vmin, 84px); color: var(--deep); }

/* ---- the Shop (11/03): a customer at the counter, the dish, ingredients onto it, Done, a sum, the hand-over */
#play[data-game=shop] { background-image: url(art/bg_shop.webp); background-color: #f3d9a8; }
.s-shop { right: 24%; top: 47%; animation-delay: .7s; } .s-shop .ic { animation-delay: -2s; }
@media (orientation: portrait) { .s-shop { right: 3%; top: 52%; } }
.counter-top { gap: 12px; align-items: center; }
.customer { font-size: clamp(70px, 12vmin, 120px); line-height: 1; filter: drop-shadow(0 6px 4px rgba(0, 0, 0, .15)); }
.customer.walkin { animation: walkin .8s ease-out; }
.customer.happy { animation: hop .5s 3; }
@keyframes walkin { from { transform: translateX(-60vw); } }
.order-bubble { max-width: min(640px, 62vw); background: #fff; border-radius: 26px 26px 26px 6px; padding: 14px 20px; box-shadow: 0 6px 0 rgba(150, 100, 40, .25); }
.order-text { font: 700 clamp(22px, 3.6vmin, 34px)/1.3 "Baloo 2", sans-serif; }
.ticket-title { font: 800 22px "Baloo 2", sans-serif; color: #8a6b3a; }
.ticket-line { display: flex; align-items: center; gap: 10px; font: 800 clamp(26px, 4.4vmin, 40px) "Baloo 2", sans-serif; }
.ticket-line b { font-weight: 700; }
.ing-ic { width: clamp(38px, 6vmin, 56px); height: clamp(38px, 6vmin, 56px); object-fit: contain; }
span.emo { display: inline-grid; place-items: center; font-size: clamp(30px, 5vmin, 48px); line-height: 1; }
.shop-area { display: flex; flex-direction: column; align-items: center; gap: 14px; width: 100%; }
.dishes { gap: 12px; }
.dish-choice { border-radius: 26px; background: #fff; box-shadow: 0 7px 0 rgba(150, 100, 40, .35); width: clamp(110px, 17vmin, 160px); height: clamp(110px, 17vmin, 160px); padding: 8px; }
.dish-ic { width: 100%; height: 100%; object-fit: contain; }
.dish-choice span.emo, .deliver span.emo { font-size: clamp(70px, 12vmin, 110px); }
.build { display: flex; align-items: center; justify-content: center; gap: clamp(14px, 3vw, 40px); flex-wrap: wrap; }
.dish-big { position: relative; width: min(44vh, 40vw); height: min(44vh, 40vw); }
.dish-base { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 10px 8px rgba(0, 0, 0, .18)); }
.dish-big > span.emo { width: 100%; height: 100%; font-size: min(36vh, 32vw); }
.pieces { position: absolute; inset: 0; }
.piece { position: absolute; width: 15%; height: 15%; object-fit: contain; cursor: pointer; animation: pop .25s; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .2)); }
span.piece { font-size: min(5.5vh, 5vw); display: grid; place-items: center; }
.bins { display: grid; grid-template-columns: repeat(2, minmax(120px, 1fr)); gap: 10px; }
.bin { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; background: rgba(255, 255, 255, .92); border-radius: 20px; padding: 8px 10px; box-shadow: 0 5px 0 rgba(150, 100, 40, .3); }
.bin-pic { width: 64px; height: 64px; touch-action: none; }
.ing-big { width: 64px; height: 64px; object-fit: contain; pointer-events: none; }
.bin-name { font: 700 17px "Baloo 2", sans-serif; }
.bin-arrow { width: 52px; height: 52px; border-radius: 50%; background: var(--sea2); color: #fff; font: 800 26px sans-serif; box-shadow: 0 4px 0 #0f8aa0; }
.ing-drag { position: fixed; width: 70px; height: 70px; object-fit: contain; transform: translate(-50%, -50%); pointer-events: none; z-index: 50; }
span.ing-drag { font-size: 50px; display: grid; place-items: center; }
.done-btn { height: 66px; padding: 0 42px; border-radius: 999px; background: linear-gradient(#5be38c, #22b35e); color: #fff; font: 800 28px "Baloo 2", sans-serif; box-shadow: 0 7px 0 #168444; }
.math-card { background: rgba(255, 255, 255, .92); border-radius: 26px; padding: 14px 22px; display: flex; flex-direction: column; align-items: center; gap: 6px; box-shadow: 0 6px 0 rgba(150, 100, 40, .25); }
.eq-row { gap: 12px; }
.eq-item { display: flex; align-items: center; gap: 6px; font: 800 clamp(34px, 6vmin, 56px) "Baloo 2", sans-serif; }
.six { max-width: 760px; }
.six .choice { min-width: clamp(90px, 14vmin, 130px); height: clamp(80px, 12vmin, 110px); font-size: clamp(36px, 6.5vmin, 56px); }
.deliver { width: clamp(140px, 24vmin, 220px); height: clamp(140px, 24vmin, 220px); transition: transform 1.2s ease-in, opacity 1.2s; }
.deliver.go { transform: translate(-40vw, -24vh) scale(.5); opacity: 0; }
#play.shop-on .stage { justify-content: flex-start; padding-top: 18px; }

/* ---- eleven stops on the map (11/03: + Treasure Map Hunt, Sunset Clock, Sandcastle Builder) */
.stop { width: clamp(100px, 14vmin, 156px); padding: 7px 6px 7px; border-radius: 20px; gap: 2px; }
.stop .ic { font-size: clamp(34px, 6vmin, 56px); }
.stop .ic img { height: clamp(34px, 6vmin, 56px); }
.stop .nm { font-size: clamp(13px, 1.9vmin, 18px); }
.stop .lv { font-size: 11.5px; }
.s-coins { left: 2%; top: 12%; } .s-hunt { left: 17%; top: 11%; right: auto; } .s-bottle { right: 31%; top: 10%; }
.s-clock { right: 17%; top: 10%; } .s-math { right: 2%; top: 22%; }
.s-spell { left: 2%; top: 40%; } .s-castle { left: 18%; top: 38%; } .s-shop { right: 18%; top: 44%; }
.s-read { left: 3%; bottom: calc(3% + env(safe-area-inset-bottom)); } .s-write { left: 23%; bottom: calc(2% + env(safe-area-inset-bottom)); }
.s-sound { right: calc(2% + 64px); bottom: calc(3% + env(safe-area-inset-bottom)); }
.s-hunt .ic { animation-delay: -.3s; } .s-clock .ic { animation-delay: -.9s; } .s-castle .ic { animation-delay: -1.6s; }
@media (orientation: portrait) {
  .stop { width: clamp(96px, 21vw, 150px); }
  .s-coins { left: 2%; top: 10%; } .s-hunt { left: 27%; top: 10%; } .s-bottle { right: 27%; top: 10%; } .s-clock { right: 2%; top: 10%; }
  .s-spell { left: 2%; top: 28%; } .s-castle { left: 2%; top: 46%; } .s-math { right: 2%; top: 28%; } .s-shop { right: 2%; top: 46%; }
  .s-read { left: 2%; bottom: 4%; } .s-write { left: 50%; transform: translateX(-50%); bottom: 4%; } .s-sound { right: 2%; bottom: 12%; }
}

/* Treasure Map Hunt */
#play[data-game=hunt] { background-image: url(art/bg_write.webp); }
.hunt-note { background: linear-gradient(#fff8e4, #f3dfae); border-radius: 18px; padding: 12px 18px; box-shadow: 0 5px 0 rgba(150, 100, 40, .3); max-width: 620px; }
.hunt-board { position: relative; display: grid; gap: 4px; width: min(80vw, 64vh); padding: 8px; border-radius: 20px;
  background: linear-gradient(#f6e1b0, #e9c98a); box-shadow: inset 0 0 0 4px rgba(150, 100, 40, .35), 0 6px 0 rgba(150, 100, 40, .3); }
.hcell { aspect-ratio: 1; border-radius: 8px; background: rgba(255, 255, 255, .35); border: 2px dashed rgba(150, 100, 40, .25); position: relative; }
.hcell.walked { background: rgba(255, 220, 120, .55); }
.hcell.rock::after { content: "🪨"; position: absolute; inset: 0; display: grid; place-items: center; font-size: min(5vh, 4vw); }
.hcell.x::after { content: "❌"; position: absolute; inset: 0; display: grid; place-items: center; font-size: min(4.6vh, 4vw); }
.hcell.found { background: rgba(123, 226, 160, .6); }
.hunt-chest { position: absolute; inset: 6%; width: 88%; height: 88%; object-fit: contain; animation: pop .4s; }
.hcrab { position: absolute; width: min(9vh, 8vw); transform: translate(-50%, -50%); transition: left .3s, top .3s; pointer-events: none; z-index: 2; }
.hunt-ctrl { gap: 10px; }
.arrow-btn { width: 74px; height: 74px; border-radius: 22px; background: #fff; font-size: 38px; box-shadow: 0 5px 0 rgba(150, 100, 40, .35); }
.plan-row { display: flex; flex-wrap: wrap; gap: 6px; min-height: 48px; justify-content: center; padding: 6px 12px; border-radius: 14px; background: rgba(255, 255, 255, .7); min-width: 200px; }
.plan-chip { font-size: 30px; animation: pop .2s; }

/* Sunset Clock: the sky changes with the time of day */
#play[data-game=clock] { background-image: none; background: linear-gradient(#9fe3ff, #e8f9ff); transition: background .8s; }
#play[data-game=clock][data-sky=morning] { background: linear-gradient(#ffd9a0, #fff4d6 60%, #bdeeff); }
#play[data-game=clock][data-sky=day] { background: linear-gradient(#5ccdf5, #c9f1ff); }
#play[data-game=clock][data-sky=sunset] { background: linear-gradient(#ff9a62, #ffcf8a 50%, #c78bd8); }
#play[data-game=clock][data-sky=night] { background: radial-gradient(circle at 80% 15%, #fff7c2 0 3%, transparent 4%), linear-gradient(#1b2350, #3b3f8c); }
.clock { width: min(46vh, 42vw); height: min(46vh, 42vw); touch-action: none; filter: drop-shadow(0 8px 10px rgba(0, 0, 0, .2)); }
.clock.ro { width: min(34vh, 34vw); height: min(34vh, 34vw); }
.clock .rim { fill: #ff8fc0; } .clock .face { fill: #fffdf6; }
.clock .tick { stroke: #c9b8d8; stroke-width: 2; } .clock .tick.big { stroke: #6d5a80; stroke-width: 4; }
.clock .num { font: 800 20px "Baloo 2", sans-serif; fill: #36214f; text-anchor: middle; }
.clock .hand { stroke-linecap: round; } .clock .hand.hour { stroke: #36214f; stroke-width: 10; } .clock .hand.min { stroke: #1eb8cf; stroke-width: 6; }
.clock .pin { fill: #ff5fa2; }
.clock-row { gap: 24px; }
.clock-side { display: flex; flex-direction: column; gap: 10px; max-width: 460px; background: rgba(255, 255, 255, .88); border-radius: 22px; padding: 14px 18px; }
.clock-digits { font: 800 clamp(44px, 8vmin, 72px) "Baloo 2", sans-serif; color: var(--deep); }
.muted-hint { font: 500 16px "Fredoka", sans-serif; color: #6d5a80; }
.choice.time-choice { border-radius: 26px; font-size: clamp(34px, 6vmin, 52px); }

/* Sandcastle Builder */
#play[data-game=castle] { background-image: url(art/bg_write.webp); }
.castle-scene { position: relative; width: min(64vw, 78vh); height: min(40vh, 34vw); }
.castle-scene .c-tower { position: absolute; bottom: 0; width: 22%; height: 78%; border-radius: 10px 10px 4px 4px; background: linear-gradient(90deg, #e8c47e, #f3d89c 50%, #e0b86c);
  box-shadow: inset 0 -8px 0 rgba(150, 100, 40, .25); }
.castle-scene .c-tower.l { left: 14%; } .castle-scene .c-tower.r { right: 14%; }
.castle-scene .c-wall { position: absolute; bottom: 0; left: 30%; right: 30%; height: 52%; background: linear-gradient(90deg, #e3bd75, #efd393 50%, #e3bd75); border-radius: 6px 6px 0 0; }
.castle-scene .c-door { position: absolute; left: 50%; bottom: 0; width: 34%; height: 56%; transform: translateX(-50%); border-radius: 50% 50% 0 0 / 40% 40% 0 0; background: #a0703a; }
.castle-scene .win { position: absolute; left: 50%; top: 30%; width: 34%; height: 18%; transform: translateX(-50%); border-radius: 50% 50% 4px 4px; background: #8a5d2c; }
.c-spot { position: absolute; width: 13%; aspect-ratio: 1; border-radius: 50%; border: 3px dashed rgba(120, 80, 30, .45); background: rgba(255, 255, 255, .25); transform: translate(-50%, -50%); }
.castle-scene.choosing .c-spot:not(.full) { animation: glow 1s ease-in-out infinite; }
.c-spot.full { border: 0; background: none; }
.c-spot .shape { width: 100%; height: 100%; }
.c-spot.s-ltop { left: 25%; top: 12%; } .c-spot.s-rtop { left: 75%; top: 12%; } .c-spot.s-mid { left: 50%; top: 38%; } .c-spot.s-door { left: 50%; top: 80%; }
.c-spot.s-lside { left: 5%; top: 78%; } .c-spot.s-rside { left: 95%; top: 78%; } .c-spot.s-lwin { left: 25%; top: 46%; width: 9%; } .c-spot.s-rwin { left: 75%; top: 46%; width: 9%; }
.palette { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; max-width: 820px; }
.pal-btn { width: clamp(64px, 10vmin, 90px); height: clamp(64px, 10vmin, 90px); border-radius: 20px; background: #fff; padding: 8px; box-shadow: 0 5px 0 rgba(150, 100, 40, .3); }
.pal-btn.on { box-shadow: 0 0 0 5px var(--gold), 0 5px 0 rgba(150, 100, 40, .3); transform: translateY(-4px); }
.pal-btn .shape { width: 100%; height: 100%; }
.flags { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.flag i, .flag-choice i { display: block; width: clamp(40px, 7vmin, 64px); height: clamp(30px, 5vmin, 46px); clip-path: polygon(0 0, 100% 20%, 0 100%); }
.flag { display: flex; flex-direction: column; align-items: flex-start; padding-left: 4px; border-left: 5px solid #8a5d2c; height: clamp(70px, 12vmin, 110px); }
.flag.q i { background: #fff; clip-path: none; font: 800 28px "Baloo 2", sans-serif; text-align: center; border-radius: 8px; border: 3px dashed #c9a46a; }
.choice.flag-choice { border-radius: 26px; display: grid; place-items: center; }
.castles { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 10px; }
.castle-scene.mini { width: 220px; height: 130px; background: rgba(255, 255, 255, .55); border-radius: 18px; }
.castle-scene.mini .c-spot { border: 0; }

/* (11/03) the hunt fits one screen: the board, then one row of arrows + Dig / Go */
#play[data-game=hunt] .stage { gap: 10px; justify-content: flex-start; padding-top: 10px; }
.hunt-ctrl .done-btn, .hunt-ctrl .small-btn { margin-left: 8px; }

/* (11/03) the hunt's step count sits on the crab */
.hbadge { position: absolute; transform: translate(-50%, -50%); z-index: 3; min-width: 34px; height: 34px; padding: 0 8px; border-radius: 999px; background: var(--gold);
  color: var(--ink); font: 800 22px/34px "Baloo 2", sans-serif; text-align: center; box-shadow: 0 3px 0 rgba(0, 0, 0, .2); pointer-events: none; }
.hbadge:empty { display: none; }
.hbadge.pop2 { animation: pop .25s; }

/* ---- (11/03) the "For parents" door and its QR panel */
.parents-btn { position: absolute; left: 50%; bottom: calc(10px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 4; display: flex; flex-direction: column;
  align-items: center; gap: 2px; padding: 6px 14px 6px; border-radius: 18px; background: rgba(255, 253, 248, .9); box-shadow: 0 5px 0 rgba(150, 100, 40, .3); }
.parents-btn img { height: clamp(40px, 7vmin, 62px); display: block; }
.parents-btn .pemo { font-size: clamp(34px, 6vmin, 52px); line-height: 1; }
.parents-btn span:last-child { font: 700 14px "Baloo 2", sans-serif; color: #6d5a80; }
.parents { position: fixed; inset: 0; z-index: 45; display: grid; place-items: center; background: rgba(20, 30, 60, .55); backdrop-filter: blur(6px); }
.parents-card { position: relative; width: min(440px, 92vw); padding: 26px 26px 20px; border-radius: 30px; background: #fff; text-align: center; animation: pop .3s;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .3); }
.parents-card h2 { margin: 0 0 6px; font: 800 30px "Baloo 2", sans-serif; color: #0a7f9e; }
.parents-card p { margin: 0 0 10px; font: 500 16px/1.4 "Fredoka", sans-serif; color: #5f6f8a; }
.parents-card .x { position: absolute; right: 14px; top: 12px; width: 44px; height: 44px; border-radius: 50%; background: #f1f5f9; font-size: 20px; }
.qr { width: min(260px, 70vw); aspect-ratio: 1; margin: 8px auto 6px; border-radius: 18px; padding: 10px; background: #fff; box-shadow: 0 0 0 2px #e2e8f0; display: grid; place-items: center; }
.qr svg { width: 100%; height: 100%; }
.qr-wait { font-size: 40px; color: #94a3b8; }
.qr-note { overflow-wrap: anywhere; }
.parents-card .dev { font-size: 14px; color: #94a3b8; }
@media (orientation: portrait) { .parents-btn { bottom: calc(4% + 70px); } }

/* ================================================================ phones (Albert 11/03: "I need all the pages to be mobile friendly
   ... the main screen has so many games so this will require a redesign ... Tablet mode looks great right now"). Tablets keep
   the painted map with the stops around the island; a phone (narrow, or short in landscape) gets the same painted island
   behind a scrolling grid of big stop cards. */
@media (max-width: 700px), (max-height: 500px) {
  .bar { padding: calc(6px + env(safe-area-inset-top)) 10px 6px; gap: 8px; }
  .title { font-size: clamp(17px, 4.6vw, 24px); }
  .logo-title img { height: 34px; }
  .chip { height: 42px; padding: 0 12px; font-size: 16px; gap: 6px; }
  .chip b { min-width: 28px; height: 28px; }
  .chip.diff { height: 34px; font-size: 14px; padding: 0 10px; }
  #map .island { position: absolute; left: 0; right: 0; top: calc(56px + env(safe-area-inset-top)); bottom: calc(76px + env(safe-area-inset-bottom)); height: auto; width: auto;
    overflow-y: auto; -webkit-overflow-scrolling: touch; display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; padding: 10px 14px 18px; align-content: start; }
  #map .princess, #map .crab { display: none; }
  #map .stop { position: static; width: auto; transform: none !important; flex-direction: row; justify-content: flex-start; gap: 10px; padding: 10px 12px; border-radius: 20px; text-align: left; }
  #map .stop .ic { font-size: 38px; flex: none; }
  #map .stop .ic img { height: 44px; }
  #map .stop .nm { font-size: 16px; text-align: left; }
  #map .stop .lv { font-size: 12px; }
  #map .stop > .nm, #map .stop > .lv { display: block; }
  #map .stop { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center; }
  #map .stop .ic { grid-row: 1 / 3; }
  .parents-btn { flex-direction: row; gap: 8px; bottom: calc(10px + env(safe-area-inset-bottom)); padding: 8px 16px; }
  .parents-btn img { height: 36px; } .parents-btn .pemo { font-size: 30px; }
  .sound { width: 50px; height: 50px; font-size: 24px; bottom: calc(12px + env(safe-area-inset-bottom)); right: 12px; }
  .gulls { display: none; }

  /* a game screen */
  .stage { inset: calc(56px + env(safe-area-inset-top)) 8px 8px; gap: 10px; padding: 8px 8px 14px; overflow-y: auto; justify-content: flex-start; }
  .stage::before { inset: 0; border-radius: 22px; }
  .dots { gap: 5px; } .dots i { width: 14px; height: 14px; }
  .chip.back { height: 40px; padding: 0 12px; font-size: 15px; }
  .ask { font-size: clamp(20px, 5.4vw, 30px); }
  .say { width: 52px; height: 52px; font-size: 24px; }
  .coco { left: 4px; bottom: 4px; }
  .coco .bird { width: 70px; height: 70px; }
  .coco .bubble { margin-bottom: 40px; font-size: 15px; max-width: 60vw; }
  .yay { font-size: 44px; }
  .streak { top: 54px; font-size: 16px; }
  .choice { min-width: 76px; height: 70px; font-size: 32px; padding: 0 12px; }
  .choice.pic-choice { font-size: 44px; }
  .tile { width: 54px; height: 54px; font-size: 28px; }
  .tiles { gap: 8px; }
  .slot { width: 46px; height: 54px; font-size: 30px; }
  .slots { gap: 6px; }
  .pic { font-size: 74px; }
  .sentence { padding: 12px 14px; } .word { font-size: 22px; }
  .fruits { font-size: 34px; }
  .mascot, .dolphin, .bottle-pic { height: 74px; }
  .trace-wrap { width: 92vw; height: 44vh; }
  .meter { width: 92vw; }
  .bub { min-width: 50px; height: 50px; font-size: 26px; padding: 0 8px; }
  .tile.chunk { min-width: 54px; padding: 0 10px; }
  .coin.penny { width: 46px; height: 46px; font-size: 12px; } .coin.nickel { width: 54px; height: 54px; } .coin.dime { width: 40px; height: 40px; font-size: 11px; } .coin.quarter { width: 58px; height: 58px; }
  .chest { width: 200px; min-height: 110px; padding-top: 34px; }
  .total { font-size: 34px; min-width: 80px; }
  .coin-key { font-size: 14px; }
  .wtile { height: 46px; padding: 0 12px; font-size: 22px; } .wslot { min-width: 54px; height: 48px; }
  .note { padding: 12px; gap: 6px; }
  /* the shop */
  .customer { font-size: 56px; }
  .order-bubble { max-width: 100%; padding: 10px 14px; } .order-text { font-size: 18px; }
  .counter-top { flex-wrap: wrap; }
  .dish-choice { width: 92px; height: 92px; }
  .dish-big { width: min(70vw, 34vh); height: min(70vw, 34vh); }
  .bins { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; width: 100%; }
  .bin { padding: 6px; gap: 4px; } .bin-pic, .ing-big { width: 44px; height: 44px; } .bin-name { font-size: 13px; } .bin-arrow { width: 40px; height: 40px; font-size: 20px; }
  .done-btn { height: 56px; padding: 0 28px; font-size: 22px; }
  .six .choice { min-width: 70px; height: 64px; font-size: 30px; }
  .eq-item { font-size: 30px; }
  /* treasure map, clock, castle */
  .arrow-btn { width: 56px; height: 56px; font-size: 28px; }
  .hunt-ctrl { gap: 6px; } .hunt-ctrl .small-btn { height: 48px; padding: 0 12px; font-size: 15px; }
  .clock { width: min(78vw, 42vh); height: min(78vw, 42vh); } .clock.ro { width: min(60vw, 32vh); height: min(60vw, 32vh); }
  .clock-row { flex-direction: column; gap: 10px; } .clock-side { padding: 10px 14px; } .clock-digits { font-size: 38px; }
  .castle-scene { width: 92vw; height: 30vh; }
  .pal-btn { width: 52px; height: 52px; padding: 5px; } .palette { gap: 6px; }
  /* the cabana and the prize */
  .shelf { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; } .shelf div { font-size: 44px; border-radius: 18px; }
  .prize-card { padding: 26px 18px 20px; } .prize-ic { font-size: 84px; } .prize-card h2 { font-size: 26px; } .big { height: 58px; font-size: 24px; padding: 0 30px; }
  .burst { width: 170px; height: 170px; top: 70px; }
}
/* a phone held sideways: three or four cards a row, the game screens use the width */
@media (max-height: 500px) and (orientation: landscape) {
  #map .island { grid-template-columns: repeat(4, 1fr); }
  .stage { inset: calc(48px + env(safe-area-inset-top)) 8px 6px; }
  .clock-row { flex-direction: row; }
  .build { flex-wrap: nowrap; }
  .dish-big { width: 34vh; height: 34vh; }
  .castle-scene { height: 36vh; width: 70vw; }
}
@media (max-width: 380px) { #map .stop .nm { font-size: 14px; } #map .island { gap: 8px; padding: 8px 10px 14px; } }

/* (11/03) phones: the main buttons stay on screen (pinned to the bottom of the game panel), the board fits */
@media (max-width: 700px), (max-height: 500px) {
  .done-btn, .hunt-ctrl { position: sticky; bottom: 4px; z-index: 3; }
  .hunt-ctrl { background: rgba(255, 253, 248, .85); border-radius: 18px; padding: 4px 6px; }
  #play[data-game=hunt] { --hb: 40vh; --hbw: 94vw; }
  .dish-big { width: min(60vw, 28vh); height: min(60vw, 28vh); }
}
@media (max-height: 500px) and (orientation: landscape) {
  #play[data-game=hunt] { --hb: 50vh; }
  #play[data-game=hunt] .stage { flex-direction: row; flex-wrap: wrap; justify-content: center; align-content: flex-start; }
  #play[data-game=hunt] .stage > .row:first-child { width: 100%; }
  .hunt-ctrl { flex-direction: column; position: static; }
  .hunt-ctrl .arrow-btn { width: 50px; height: 44px; }
  .dish-big { width: 30vh; height: 30vh; }
}

/* (11/03) the map's top bar on phones: nothing wraps */
.chip, .title { white-space: nowrap; }
.cab-word { font-style: normal; }
@media (max-width: 700px), (max-height: 500px) {
  #map .bar .title { justify-content: flex-start; font-size: 18px; overflow: hidden; }
  #map .bar .title-words { overflow: hidden; text-overflow: ellipsis; }
  .cab-word { display: none; }
}
@media (max-width: 480px) { #map .bar .title-words { display: none; } }
#play .title { overflow: hidden; text-overflow: ellipsis; }

/* (11/03) the link under the parents' QR code */
.qr-link { display: inline-block; margin: 2px 0 10px; padding: 10px 22px; border-radius: 999px; background: #1eb8cf; color: #fff; text-decoration: none; font: 700 17px "Baloo 2", sans-serif;
  box-shadow: 0 4px 0 #0f8aa0; }
.qr-link[hidden] { display: none; }

/* ================================================================ (11/03, Albert: "scrolling should not be needed on mobile") every
   screen fits the part of the phone the browser leaves (Safari's bars too): the map's cards share the height, the bigger
   games shrink their pieces to the height they have */
@media (max-width: 700px), (max-height: 500px) {
  #map .island { overflow: hidden; grid-template-rows: repeat(6, minmax(0, 1fr)); align-content: stretch; }
  #map .stop { min-height: 0; padding: 4px 10px; }
  #map .stop .ic img { height: min(44px, 6.5vh); } #map .stop .ic { font-size: min(36px, 5.5vh); }
  #map .stop .nm { font-size: min(16px, 2.5vh); line-height: 1.1; }
  #map .stop .lv { font-size: min(12px, 1.9vh); }
  /* the Shop: the customer, the order and the speaker on one line; the dish and the bins share what is left */
  #play.shop-on .stage { gap: 6px; padding-top: 6px; }
  .counter-top { flex-wrap: nowrap; gap: 6px; width: 100%; }
  .customer { font-size: min(44px, 6vh); flex: none; }
  .order-bubble { flex: 1; min-width: 0; padding: 6px 10px; border-radius: 18px 18px 18px 4px; }
  .order-text { font-size: min(16px, 2.4vh); line-height: 1.25; }
  .ticket-title { font-size: 13px; } .ticket-line { font-size: min(20px, 3vh); gap: 6px; } .ticket-line .ing-ic { width: 26px; height: 26px; }
  .counter-top .say { width: 42px; height: 42px; font-size: 20px; flex: none; }
  .shop-area { gap: 8px; }
  .dishes { gap: 8px; max-width: 340px; } .dish-choice { width: min(96px, 13vh); height: min(96px, 13vh); padding: 4px; }
  .build { gap: 8px; }
  .dish-big { width: min(52vw, 26vh); height: min(52vw, 26vh); }
  .bins { gap: 6px; } .bin { padding: 4px 6px; border-radius: 14px; } .bin-pic, .ing-big { width: min(40px, 5.6vh); height: min(40px, 5.6vh); }
  .bin-arrow { width: min(40px, 5.6vh); height: min(40px, 5.6vh); font-size: 18px; }
  .done-btn { height: min(52px, 7.4vh); padding: 0 26px; font-size: min(22px, 3.2vh); }
  .math-card { padding: 8px 12px; } .eq-item { font-size: min(30px, 4.4vh); } .eq-item .ing-ic { width: 30px; height: 30px; }
  .six { max-width: 330px; gap: 8px; } .six .choice { min-width: 90px; height: min(60px, 8.4vh); font-size: min(30px, 4.4vh); }
  .deliver { width: min(140px, 20vh); height: min(140px, 20vh); }
  /* the treasure map's hard plan */
  #play[data-game=hunt] { --hb: 34vh; }
  .plan-row { min-height: 36px; padding: 2px 8px; } .plan-chip { font-size: 22px; }
}
/* a phone held sideways (short): side by side where it helps, everything sized to the height */
@media (max-height: 500px) and (orientation: landscape) {
  #map .island { grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(3, minmax(0, 1fr)); }
  #map .stop .ic img { height: min(40px, 9vh); } #map .stop .ic { font-size: min(32px, 8vh); }
  #map .stop .nm { font-size: min(15px, 4vh); } #map .stop .lv { font-size: min(12px, 3vh); }
  .stage { gap: 6px; padding: 4px 8px 6px; }
  .ask { font-size: min(24px, 6vh); }
  .say { width: 40px; height: 40px; font-size: 18px; }
  .fruits { font-size: min(34px, 8vh); } .fruits.group { font-size: min(26px, 6vh); }
  .op { font-size: min(40px, 9vh); }
  .choice { height: min(64px, 15vh); min-width: 70px; font-size: min(30px, 8vh); }
  .choice.pic-choice { font-size: min(40px, 10vh); }
  .mascot, .dolphin, .bottle-pic { height: min(70px, 16vh); }
  .pic { font-size: min(70px, 17vh); }
  .tile { width: min(54px, 13vh); height: min(54px, 13vh); font-size: min(28px, 7vh); }
  .slot { width: min(46px, 12vh); height: min(52px, 13vh); font-size: min(28px, 7vh); }
  .bub { height: min(48px, 12vh); min-width: min(48px, 12vh); font-size: min(26px, 6.5vh); }
  .coin.penny { width: min(46px, 11vh); height: min(46px, 11vh); } .coin.nickel { width: min(54px, 13vh); height: min(54px, 13vh); }
  .coin.dime { width: min(40px, 10vh); height: min(40px, 10vh); } .coin.quarter { width: min(58px, 14vh); height: min(58px, 14vh); }
  .tray { min-height: 0; gap: 6px; } .chest-box { gap: 10px; } .chest { width: min(200px, 44vh); min-height: min(110px, 26vh); padding-top: 6vh; }
  .total { font-size: min(32px, 8vh); } .coin-key { font-size: 12px; padding: 2px 10px; }
  #play[data-game=coins] .stage { flex-direction: row; flex-wrap: wrap; justify-content: center; align-content: flex-start; }
  #play[data-game=coins] .stage > .row:first-child { width: 100%; }
  /* the Shop: dish and bins side by side */
  .counter-top .customer { font-size: min(40px, 10vh); }
  .build { flex-wrap: nowrap; } .dish-big { width: min(30vw, 44vh); height: min(30vw, 44vh); }
  .dishes { max-width: none; } .dish-choice { width: min(80px, 19vh); height: min(80px, 19vh); }
  .six { max-width: none; } .six .choice { min-width: 70px; height: min(56px, 14vh); }
  .done-btn { height: min(48px, 12vh); font-size: min(20px, 5vh); }
  .eq-item { font-size: min(28px, 7vh); }
  /* the treasure map: the board, and the arrows in a block beside it */
  #play[data-game=hunt] { --hb: 58vh; }
  .hunt-ctrl { display: grid; grid-template-columns: repeat(2, auto); gap: 6px; align-content: center; flex-direction: unset; }
  .hunt-ctrl .arrow-btn { width: min(52px, 12vh); height: min(48px, 12vh); font-size: 22px; }
  .hunt-ctrl .done-btn, .hunt-ctrl .small-btn { grid-column: 1 / 3; margin: 0; height: min(44px, 11vh); font-size: 16px; padding: 0 12px; }
  .hunt-note { padding: 4px 12px; } .hunt-note .order-text { font-size: min(18px, 4.6vh); }
}

/* (11/03 audit) phones: a game that fits is centred, not stuck to the top; the Shop's topping names never overlap their picture */
@media (max-width: 700px), (max-height: 500px) {
  .stage, #play.shop-on .stage, #play[data-game=hunt] .stage { justify-content: safe center; }
  .bin { grid-template-columns: auto minmax(0, 1fr) auto; }
  .bin-name { font-size: 12px; line-height: 1.1; min-width: 0; overflow-wrap: anywhere; }
}
/* (11/03 audit) the Shop on phones: room between a topping's picture and its name; the hard order's ticket fits sideways */
@media (max-width: 700px), (max-height: 500px) {
  .bin { gap: 6px; } .bin-pic { flex: none; overflow: hidden; border-radius: 10px; }
}
@media (max-height: 500px) and (orientation: landscape) {
  .ticket-line { font-size: min(16px, 4.6vh); } .ticket-line .ing-ic { width: 22px; height: 22px; } .ticket-title { font-size: 11px; }
  .order-bubble { padding: 4px 10px; }
}
@media (max-height: 500px) and (orientation: landscape) { .dish-big { width: min(30vw, 40vh); height: min(30vw, 40vh); } }
