:root { --ink:#1f2340; --muted:#585e7a; --bg:#f4f5fb; --card:#fff; --line:#d9dcec; --brand:#232a5c; --accent:#ffb703; --ok:#1d7a46; --warn:#8a5a00; --c:#232a5c; }
* { box-sizing:border-box; }
[hidden] { display:none !important; }
html { -webkit-text-size-adjust:100%; }
body { margin:0; background:var(--bg); color:var(--ink); font:17px/1.45 ui-rounded,"SF Pro Rounded","Nunito","Segoe UI",system-ui,sans-serif; }
#app { max-width:920px; margin:0 auto; min-height:100dvh; }
main { padding:12px 16px 40px; }
h1 { font-size:1.55rem; line-height:1.25; margin:.4rem 0; } h1:focus { outline:none; } h2 { font-size:1.15rem; }
a { color:inherit; }
button,.button { font:inherit; font-weight:700; min-height:48px; padding:10px 18px; border-radius:16px; border:2px solid var(--line); background:var(--card); color:var(--ink); cursor:pointer; text-decoration:none; text-align:center; display:inline-block; }
button:disabled { opacity:.45; cursor:default; }
:focus-visible { outline:3px solid #1c7ed6; outline-offset:2px; }
.primary { background:var(--brand); border-color:var(--brand); color:#fff; }
.link { background:none; border:0; text-decoration:underline; min-height:44px; padding:10px 4px; font-weight:600; display:inline-block; }
.danger { border-color:#c92a2a; color:#c92a2a; }
.sr-only { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
.skip { position:absolute; left:-999px; } .skip:focus { left:8px; top:8px; background:#fff; padding:8px; z-index:9; }
.small { font-size:.88rem; color:var(--muted); } .center { text-align:center; }
.bar { display:flex; align-items:center; gap:10px; padding:10px 16px; position:sticky; top:0; background:var(--bg); z-index:2; }
.brand { font-weight:900; font-size:1.2rem; margin-right:auto; }
.round { width:48px; height:48px; min-height:48px; padding:0; border-radius:50%; display:inline-flex; align-items:center; justify-content:center; font-size:1.2rem; border:2px solid var(--line); background:var(--card); text-decoration:none; flex:none; }
.ghost { visibility:hidden; }
.buddy svg { width:48px; height:48px; display:block; }
.pill { background:var(--accent); border-radius:999px; padding:6px 14px; font-weight:800; white-space:nowrap; }
.welcome { text-align:center; padding-top:28px; }
.buddies { display:flex; justify-content:center; gap:10px; flex-wrap:wrap; }
.buddy-pick { padding:8px; width:76px; height:76px; } .buddy-pick svg { width:100%; height:100%; }
.buddy-pick[aria-pressed=true] { border-color:var(--brand); background:#e7e9fb; box-shadow:0 0 0 3px var(--brand); }
.classes { display:grid; grid-template-columns:repeat(5,1fr); gap:10px; max-width:480px; margin:0 auto; }
.class-pick { font-size:1.7rem; padding:8px 0; line-height:1.1; } .class-pick small { display:block; font-size:.7rem; color:var(--muted); }
.daily { display:flex; align-items:center; gap:14px; background:var(--brand); color:#fff; border-radius:22px; padding:14px 18px; text-decoration:none; }
.daily > span:nth-child(2) { flex:1; display:flex; flex-direction:column; } .daily strong { font-size:1.2rem; } .daily.done { background:#2b5a46; }
.daily-art svg { width:56px; height:56px; display:block; }
.daily .go { background:var(--accent); color:var(--ink); border-radius:50%; width:48px; height:48px; display:grid; place-items:center; flex:none; }
.worlds { display:grid; grid-template-columns:repeat(2,1fr); gap:12px; margin-top:14px; }
@media (min-width:720px) { .worlds { grid-template-columns:repeat(3,1fr); } }
.world { background:var(--card); border-radius:20px; overflow:hidden; text-decoration:none; border:2px solid var(--line); display:flex; flex-direction:column; }
.world:hover { border-color:var(--c); }
.scene svg { width:100%; aspect-ratio:16/10; display:block; }
.world-text { padding:10px 12px 12px; display:flex; flex-direction:column; gap:4px; flex:1; }
.world-text strong { font-size:1.08rem; line-height:1.2; } .world-text > span { font-size:.85rem; color:var(--muted); }
.world-text small { font-size:.78rem; font-weight:700; }
.meter { display:block; height:8px; background:#e9ebf5; border-radius:9px; overflow:hidden; margin-top:auto; } .meter i { display:block; height:100%; background:var(--c); }
footer { text-align:center; margin-top:18px; }
.hero { display:flex; gap:14px; align-items:center; } .hero svg { width:120px; height:84px; border-radius:16px; flex:none; } .hero p { margin:0; color:var(--muted); }
.levels { display:grid; grid-template-columns:repeat(5,1fr); gap:8px; margin-top:14px; }
@media (min-width:720px) { .levels { grid-template-columns:repeat(10,1fr); } }
.levels button { padding:0; } .levels [aria-pressed=true] { background:var(--c); border-color:var(--c); color:#fff; }
.path { list-style:none; padding:0; max-width:520px; margin:12px auto; }
.path li { margin-bottom:12px; }
.path li:nth-child(even) { padding-left:28px; } .path li:nth-child(odd) { padding-right:28px; }
.path li > * { display:flex; align-items:center; gap:14px; background:var(--card); border:2px solid var(--line); border-radius:999px; padding:10px 16px 10px 10px; text-decoration:none; }
.path li > * > span:nth-child(2) { flex:1; display:flex; flex-direction:column; }
.path .node { width:52px; height:52px; border-radius:50%; background:var(--c); color:#fff; display:grid; place-items:center; font-weight:900; font-size:1.3rem; flex:none; }
.path .locked > * { opacity:.6; } .path .locked .node { background:#8d93a8; }
.path .next > * { border-color:var(--c); box-shadow:0 4px 0 var(--c); }
.path .go { font-weight:800; white-space:nowrap; }
.stars { color:#d98e00; letter-spacing:2px; } .stars .dim { color:#c9ccdb; }
.dots { flex:1; display:flex; gap:6px; justify-content:center; } .dots i { width:100%; max-width:36px; height:10px; border-radius:9px; background:var(--line); }
.dots .now { background:var(--accent); } .dots .yes { background:var(--ok); } .dots .no { background:#8d93a8; }
.play { max-width:640px; margin:0 auto; text-align:center; padding-bottom:110px; }
.tag { display:inline-block; margin:0; padding:3px 12px; border-radius:999px; background:var(--c); color:#fff; font-size:.8rem; font-weight:700; }
.prompt { font-size:clamp(1.2rem,4.4vw,1.6rem); text-wrap:balance; }
.art { display:flex; justify-content:center; margin:8px 0; color:var(--ink); } .art > svg { width:100%; max-height:34dvh; }
.matrix { display:flex; flex-direction:column; gap:4px; width:100%; align-items:center; } .matrix svg { width:216px; }
.choices { display:grid; grid-template-columns:1fr; gap:10px; margin-top:12px; }
@media (min-width:560px) { .choices { grid-template-columns:1fr 1fr; } }
.choices.pictures { grid-template-columns:repeat(4,1fr); } .choices.pictures svg { width:100%; max-width:64px; } .choices.pictures .choice { padding:10px 4px; }
.choice { min-height:58px; font-size:1.1rem; }
.choice[aria-pressed=true] { border-color:var(--brand); background:#e7e9fb; box-shadow:0 0 0 2px var(--brand); }
.choice.correct { border-color:var(--ok); background:#dff4e7; opacity:1; box-shadow:0 0 0 2px var(--ok); } .choice.correct::after { content:" ✓"; }
.choice.wrong { text-decoration:line-through; }
output.typed { display:block; margin:10px auto; min-width:180px; max-width:260px; min-height:52px; font-size:1.8rem; font-weight:900; border-bottom:4px solid var(--brand); }
.keypad { display:grid; grid-template-columns:repeat(3,1fr); gap:8px; max-width:300px; margin:0 auto; } .keypad button { font-size:1.35rem; }
.pads { display:grid; grid-template-columns:1fr 1fr; gap:12px; max-width:280px; margin:12px auto; }
.pad { aspect-ratio:1; padding:22px; opacity:1; } .pad:disabled { opacity:1; } .pad svg { width:100%; height:100%; opacity:.45; }
.pad.lit { background:#fff3bf; border-color:var(--accent); transform:scale(1.05); } .pad.lit svg { opacity:1; }
.feedback { margin-top:12px; scroll-margin-bottom:100px; } .feedback:not(:empty) { padding:12px 16px; border-radius:16px; border:2px solid; text-align:left; }
.feedback.right { background:#dff4e7; border-color:var(--ok); } .feedback.retry,.feedback.hint { background:#fff3d6; border-color:var(--warn); } .feedback.shown { background:#e7e9fb; border-color:var(--brand); }
.actions { position:fixed; left:0; right:0; bottom:0; display:flex; gap:10px; justify-content:center; padding:12px 16px calc(12px + env(safe-area-inset-bottom)); background:var(--bg); border-top:1px solid var(--line); }
.actions .primary { flex:1; max-width:420px; }
.result { text-align:center; padding-top:36px; } .big { font-size:3rem; margin:0; } .big-buddy svg { width:110px; height:110px; }
.stack { display:flex; flex-direction:column; gap:10px; max-width:320px; margin:20px auto; }
.confetti i { position:fixed; top:-12px; left:calc(var(--x) * 1%); width:9px; height:14px; background:hsl(var(--h) 80% 55%); animation:fall 2.2s var(--d) ease-in forwards; pointer-events:none; }
@keyframes fall { to { transform:translateY(105vh) rotate(540deg); } }
.sheet { max-width:640px; margin:0 auto; } .sheet input { font:inherit; font-size:1.2rem; padding:10px; width:120px; margin:0 8px; border:2px solid var(--line); border-radius:12px; }
table { width:100%; border-collapse:collapse; background:var(--card); font-size:.92rem; } th,td { text-align:left; padding:8px; border-bottom:1px solid var(--line); }
@media (prefers-reduced-motion:reduce) { * { animation:none !important; transition:none !important; } .confetti { display:none; } .pad.lit { transform:none; } }
.again { display:flex; flex-wrap:wrap; gap:4px 10px; margin-top:12px; padding:12px 18px; border-radius:18px; background:var(--card); border:2px dashed var(--brand); text-decoration:none; }
.types { display:flex; flex-wrap:wrap; gap:8px; justify-content:center; } .types .button { font-size:.92rem; padding:10px 14px; }
.num { display:inline-block; min-width:1.6em; margin-right:6px; border-radius:99px; background:var(--brand); color:#fff; font-size:.85rem; }
.match { display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-top:8px; } .match > div { display:flex; flex-direction:column; gap:8px; }
.choice svg { max-width:64px; vertical-align:middle; }
.sort { display:flex; flex-direction:column; gap:8px; margin-top:10px; }
.sort-row { display:grid; grid-template-columns:1.2fr 1fr 1fr; gap:6px; align-items:center; text-align:left; font-weight:800; } .sort-row .choice { font-size:.88rem; min-height:48px; padding:6px; }
.tiles { display:flex; flex-wrap:wrap; gap:8px; justify-content:center; } .tiles button { min-width:52px; font-size:1.35rem; padding:8px; }
.grid { display:grid; gap:6px; max-width:360px; margin:12px auto; } .cell { padding:4px; min-height:52px; aspect-ratio:1; } .cell svg { width:100%; height:100%; max-width:none; }
.worldmap{display:block;width:100%;height:auto;border-radius:12px}
.map-box{cursor:crosshair;touch-action:manipulation;border-radius:12px}
.art .worldmap{max-width:640px;margin:0 auto}
.map-card{display:grid;gap:.6rem;justify-items:stretch;margin:0 0 1.2rem}

/* Playful layer for young children: sky, hills, colour and gentle motion. Text stays dark on light. */
:root { --muted:#454b6b; }
html { background:#cdeeff; }
body { background:linear-gradient(180deg,#bfe7ff 0%,#e8f7ff 42%,#fff6d9 100%) fixed; min-height:100dvh; position:relative; isolation:isolate; overflow-x:hidden; }
body::before { content:""; position:fixed; top:90px; left:-120px; right:-120px; height:240px; z-index:-1; pointer-events:none; animation:drift 26s ease-in-out infinite alternate;
  background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 480 240'%3E%3Cg fill='%23fff'%3E%3Cpath d='M40 70a22 22 0 0 1 40-12 28 28 0 0 1 52 6 18 18 0 0 1-2 36H48a15 15 0 0 1-8-30z'/%3E%3Cpath d='M300 150a18 18 0 0 1 33-9 22 22 0 0 1 42 5 14 14 0 0 1-2 28h-67a12 12 0 0 1-6-24z' opacity='.8'/%3E%3C/g%3E%3Cpath fill='%23ffd43b' d='M220 40l5 11 12 1-9 8 3 12-11-6-11 6 3-12-9-8 12-1z'/%3E%3Ccircle cx='420' cy='60' r='7' fill='%23ffd43b'/%3E%3Ccircle cx='180' cy='180' r='6' fill='%23ff8fab'/%3E%3C/svg%3E") repeat-x 0 0/480px 240px; }
body::after { content:""; position:fixed; left:0; right:0; bottom:0; height:130px; z-index:-1; pointer-events:none;
  background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 130'%3E%3Cpath d='M0 70Q100 10 200 62T400 70V130H0Z' fill='%23b2e59b'/%3E%3Cpath d='M0 104Q90 62 190 100T400 104V130H0Z' fill='%238fd67c'/%3E%3Cg fill='%23fff'%3E%3Ccircle cx='52' cy='108' r='4'/%3E%3Ccircle cx='260' cy='114' r='4'/%3E%3C/g%3E%3Cg fill='%23ff6b8a'%3E%3Ccircle cx='120' cy='112' r='3.5'/%3E%3Ccircle cx='315' cy='118' r='3.5'/%3E%3C/g%3E%3C/svg%3E") repeat-x bottom left/400px 130px; }
@keyframes drift { to { transform:translateX(100px); } }
.bar { background:rgba(255,255,255,.85); border-radius:0 0 24px 24px; box-shadow:0 4px 14px rgba(35,42,92,.10); }
.brand { color:#5f2bb8; }
button,.button,.round { box-shadow:0 4px 0 rgba(35,42,92,.16); transition:transform .12s; }
button:not(:disabled):active,.button:active,.round:active { transform:translateY(3px); box-shadow:0 1px 0 rgba(35,42,92,.16); }
.link { box-shadow:none; }
.primary { background:linear-gradient(135deg,#6741d9,#1c53b5); border-color:#3b3aa8; }
.pill { box-shadow:0 3px 0 #d98e00; }
.welcome h1 { font-size:2.2rem; color:#5f2bb8; text-shadow:0 3px 0 #fff; }
.buddy-pick { border-radius:50%; width:78px; height:78px; animation:bob 3s ease-in-out infinite; }
.buddy-pick:where(:nth-child(1)) { background:#ffe8cc; } .buddy-pick:where(:nth-child(2)) { background:#fff3bf; animation-delay:.4s; }
.buddy-pick:where(:nth-child(3)) { background:#d0ebff; animation-delay:.8s; } .buddy-pick:where(:nth-child(4)) { background:#d3f9d8; animation-delay:1.2s; }
.classes { grid-template-columns:repeat(4,1fr); }
.class-pick:where(:nth-child(1)) { background:#ffd8d8; } .class-pick:where(:nth-child(2)) { background:#ffe8a3; }
.class-pick:where(:nth-child(3)) { background:#c7f0c2; } .class-pick:where(:nth-child(4)) { background:#c5e3ff; }
.class-pick small { color:var(--ink); }
@keyframes bob { 50% { transform:translateY(-7px); } }
.daily { background:linear-gradient(120deg,#6741d9,#c2255c); box-shadow:0 6px 0 rgba(35,42,92,.2); }
.daily.done { background:#2b5a46; }
.daily-art svg { animation:bob 2.6s ease-in-out infinite; }
.world { border:3px solid var(--c); background:color-mix(in srgb,var(--c) 9%,#fff); box-shadow:0 6px 0 color-mix(in srgb,var(--c) 45%,transparent); transition:transform .15s; }
.world:hover { transform:translateY(-4px) rotate(-.6deg); }
.world-text > span { color:var(--ink); }
main[style] { background:linear-gradient(180deg,color-mix(in srgb,var(--c) 15%,#fff),rgba(255,255,255,0) 70%); border-radius:24px; }
.hero { background:#fff; border-radius:22px; padding:10px; border:3px solid var(--c); }
.path li > * { box-shadow:0 5px 0 rgba(35,42,92,.12); }
.path .next .node { animation:bob 1.6s ease-in-out infinite; }
.path li:where(:nth-child(2)) .node { background:#c2255c; } .path li:where(:nth-child(3)) .node { background:#2b8a3e; }
.path li:where(:nth-child(4)) .node { background:#6741d9; } .path li:where(:nth-child(5)) .node { background:#b45309; }
.path li.locked .node { background:#6f7591; }
.levels button { border-color:color-mix(in srgb,var(--c) 40%,#fff); }
footer,.small.center { background:rgba(255,255,255,.82); border-radius:14px; padding:6px 10px; }
.play .prompt { background:#fff; border:3px solid var(--c); border-radius:22px; padding:14px 16px; box-shadow:0 5px 0 color-mix(in srgb,var(--c) 35%,transparent); }
.play .art > svg:not(.worldmap) { background:#fff; border-radius:18px; padding:6px; }
.choice,.keypad button,.tiles button,.types .button,.cell,.pad { background:#fff; }
.choice:where(:nth-child(4n+1)),.keypad button:where(:nth-child(4n+1)),.tiles button:where(:nth-child(4n+1)),.types .button:where(:nth-child(4n+1)) { background:#ffe3e3; border-color:#f08c8c; }
.choice:where(:nth-child(4n+2)),.keypad button:where(:nth-child(4n+2)),.tiles button:where(:nth-child(4n+2)),.types .button:where(:nth-child(4n+2)) { background:#fff0b3; border-color:#e8b407; }
.choice:where(:nth-child(4n+3)),.keypad button:where(:nth-child(4n+3)),.tiles button:where(:nth-child(4n+3)),.types .button:where(:nth-child(4n+3)) { background:#d8f5d0; border-color:#69bd5c; }
.choice:where(:nth-child(4n)),.keypad button:where(:nth-child(4n)),.tiles button:where(:nth-child(4n)),.types .button:where(:nth-child(4n)) { background:#d6ebff; border-color:#6bb0ea; }
.choice[aria-pressed=true] { border-color:var(--brand); background:#fff; box-shadow:0 0 0 4px var(--brand); transform:scale(1.03); }
:where(.match,.grid) .choice { background:#fff; border-color:var(--line); }
.choice.correct { background:#b2f2bb; border-color:var(--ok); box-shadow:0 0 0 4px var(--ok); animation:pop .45s; }
.choice.wrong { background:#eceef4; }
.sort-row { background:#fff; border-radius:16px; padding:6px 8px; }
.play .small { background:rgba(255,255,255,.88); border-radius:10px; width:fit-content; margin-left:auto; margin-right:auto; padding:3px 10px; }
output.typed { background:#fff; border-radius:14px 14px 0 0; }
.feedback.right { animation:pop .45s; }
.actions { background:rgba(255,255,255,.94); }
@keyframes pop { 40% { transform:scale(1.05); } }
.result { background:repeating-conic-gradient(from 0deg at 50% 120px,rgba(255,212,59,.35) 0 10deg,transparent 10deg 20deg); border-radius:24px; min-height:100dvh; }
.result h1,.result > p { background:rgba(255,255,255,.9); border-radius:14px; width:fit-content; margin-left:auto; margin-right:auto; padding:4px 14px; }
.big-buddy svg { animation:bob 1.4s ease-in-out infinite; }
.sheet { background:#fff; border-radius:22px; margin-top:8px; }
@media (prefers-reduced-motion:reduce) { *,*::before,*::after { animation:none !important; transition:none !important; } .world:hover,.choice[aria-pressed=true] { transform:none; } }
