@font-face{font-family:Cairo;src:url(assets/cairo-arabic.woff2) format("woff2");font-weight:200 1000;font-display:swap;unicode-range:U+0600-06FF,U+0750-077F,U+0870-089F,U+08A0-08FF,U+FB50-FDFF,U+FE70-FEFC}
@font-face{font-family:Cairo;src:url(assets/cairo-latin.woff2) format("woff2");font-weight:200 1000;font-display:swap;unicode-range:U+0000-00FF,U+2000-206F}
:root{font-family:Cairo,Tahoma,Arial,sans-serif;color:#173d34;background:#f8faf4;--ink:#173d34;--muted:#4b645b;--green:#166451;--line:#dce6d8;--white:#fffefa;line-height:1.7;font-weight:600}
*{box-sizing:border-box}
body{margin:0;min-height:100dvh}
[hidden]{display:none!important}
img{display:block;max-width:100%;height:auto}
button,a{-webkit-tap-highlight-color:transparent}
button{font:inherit;color:inherit;cursor:pointer}
a{color:inherit;text-decoration:none}
:focus-visible{outline:3px solid #174c9e;outline-offset:4px}
h1,h2,h3,p{margin:0}
h1,h2,h3{line-height:1.37;font-weight:900}
.wrap{width:min(1160px,calc(100% - 64px));margin-inline:auto}
.skip{position:fixed;inset:8px auto auto 8px;z-index:4;background:#fff;padding:10px;transform:translateY(-150%)}
.skip:focus{transform:none}
.header{background:var(--white);border-block-end:1px solid var(--line)}
.top{min-height:86px;display:flex;justify-content:space-between;align-items:center;gap:18px}
.brand{display:inline-flex;align-items:center;gap:10px;white-space:nowrap;font-size:1.48rem;font-weight:760}
.brand b{font-weight:950;color:#126751}
.brand img{width:52px;aspect-ratio:1;border-radius:50%;filter:drop-shadow(0 2px 3px #3a2d1030)}
.nav{display:flex;align-items:center;gap:8px}
.nav a{padding:8px 16px;border-radius:12px;font-weight:800;color:var(--muted);min-height:44px;white-space:nowrap}
.nav a span{margin-inline-end:4px;font-size:1.08em}
.nav a:hover,.nav [aria-current="page"]{background:#e8f3e8;color:#12634e}
.star-chip{display:flex;align-items:center;gap:7px;min-height:44px;padding:5px 14px;border:1px solid #ecd397;border-radius:27px;background:#fff3d1;color:#5b430d;white-space:nowrap}
.star-chip [aria-hidden]{color:#94610a;font-size:1.27rem}
.main{min-height:calc(100dvh - 175px);padding-block:28px 52px}
.hero{display:grid;grid-template-columns:minmax(0,2fr) minmax(0,3fr);align-items:center;gap:clamp(12px,2vw,28px);overflow:hidden;border:1px solid #ead9a6;border-radius:32px;background:#f8e9bd;box-shadow:0 6px 0 #efe4c6;padding:clamp(16px,3vw,38px)}
.hero-art{min-width:0}
.hero-art img{width:100%;height:auto;aspect-ratio:1376/768;object-fit:contain;border-radius:18px}
.hero-copy{min-width:0}
.hero h1{font-size:clamp(2.7rem,5vw,4.3rem);line-height:1.14;letter-spacing:-.045em;color:#143a2e}
.hero h1 span{display:block;color:#17634b}
.hero p{max-width:29ch;color:#385247;font-size:1.11rem;line-height:1.9;margin:16px 0 23px}
.button{border:1px solid transparent;border-radius:15px;min-height:51px;padding:8px 21px;font-weight:850;display:inline-flex;align-items:center;justify-content:center;gap:9px;text-align:center;transition:transform .15s,box-shadow .15s,background .15s}
.button:active{transform:translateY(2px)}
.button.primary{color:#fff;background:#166451;box-shadow:0 4px 0 #0e4739}
.button.primary:hover{background:#105944}
.button.secondary{background:#fff;color:var(--green);border-color:#b8d1c2}
.button.secondary:hover{background:#eff8ee}
.section-heading{display:flex;justify-content:space-between;gap:16px;align-items:end;margin:34px 0 16px}
.section-heading.standalone{margin-top:12px;margin-bottom:22px}
.section-heading h1{font-size:2.75rem}
.section-heading h2,.friends h2{font-size:2.05rem}
.section-heading p,.friends p{color:var(--muted);margin-top:4px}
.text-link{color:var(--green);font-weight:850;text-decoration:underline;text-decoration-thickness:2px;text-underline-offset:5px;white-space:nowrap;padding:9px 0}
.cards{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px}
.card{--accent:#5c438e;--tint:#efe5ff;background:#fff;border:1px solid var(--line);border-radius:24px;overflow:hidden;display:flex;flex-direction:column;box-shadow:0 4px 0 #e7eee2}
.card.blue{--accent:#17577d;--tint:#e5f3ff}
.card.peach{--accent:#87421d;--tint:#fceadf}
.card.mint{--accent:#17624d;--tint:#e0f3e5}
.card-cover{display:grid;place-items:center;height:192px;background:var(--tint);padding:8px}
.card-cover img{width:100%;height:100%;min-height:0;object-fit:contain;border-radius:8px}
.category{align-self:flex-start;display:inline-flex;gap:6px;align-items:center;border-radius:20px;background:var(--tint);color:var(--accent);padding:2px 10px;font-weight:850;font-size:.87rem}
.card-body{padding:14px 17px 16px;display:flex;flex-direction:column;gap:6px;flex:1;min-width:0}
.card h3{font-size:1.35rem;line-height:1.35}
.card p{color:var(--muted);font-size:.97rem;min-height:3.25em}
.card .button{color:var(--accent);background:var(--tint);width:100%;box-shadow:0 3px 0 color-mix(in srgb,var(--accent) 19%,var(--tint));margin-top:auto}
.card .button:hover{box-shadow:0 3px 0 color-mix(in srgb,var(--accent) 38%,var(--tint))}
.card.complete .card-body::after{content:"";display:none}
.featured{display:grid;grid-template-columns:205px 1fr auto;align-items:center;gap:21px;border:1px solid #c9dfd1;border-radius:22px;margin-top:26px;padding:14px;background:#edf7ec;overflow:hidden}
.featured img{width:205px;height:132px;object-fit:contain;border-radius:13px;background:#e0efe3}
.featured h3{font-size:1.55rem}
.featured p{color:var(--muted);margin-top:4px}
.featured .button{margin-inline-end:10px}
.friends{margin-top:33px}
.friends-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin-top:15px}
.friends-grid article{display:flex;min-width:0;align-items:center;gap:13px;padding:10px;background:#fff;border:1px solid var(--line);border-radius:17px}
.friends-grid img{width:84px;height:75px;object-fit:contain;border-radius:10px;flex:none;background:#f1e9d8}
.friends-grid p{font-size:.90rem}
.progress-summary{display:grid;grid-template-columns:100px 1fr;align-items:center;gap:21px;background:#fff4ce;border:1px solid #e8d397;border-radius:24px;padding:23px;max-width:670px}
.big-star{font-size:4.4rem;color:#985e06;line-height:1;text-align:center}
.progress-summary h2{font-size:1.65rem}
.progress-summary p{margin-block:4px 10px;color:#614a2b}
progress{display:block;width:100%;height:10px;border:0;border-radius:20px;overflow:hidden;appearance:none;background:#dce9e0}
progress::-webkit-progress-bar{background:#dce9e0;border-radius:20px}
progress::-webkit-progress-value{background:#20866a;border-radius:20px}
progress::-moz-progress-bar{background:#20866a;border-radius:20px}
.progress-list{display:grid;gap:11px;max-width:670px;margin-top:19px}
.progress-row{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 15px;border:1px solid var(--line);border-radius:16px;background:#fff}
.progress-row h3{font-size:1.09rem}
.progress-row p{font-size:.89rem;color:var(--muted)}
.progress-row .button{min-height:43px;padding:5px 12px}
.footer{border-top:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;gap:12px;padding-block:16px 22px;color:var(--muted);font-size:.89rem}
.footer span:first-child{font-weight:850;color:var(--green)}
dialog{padding:0;border:1px solid #c4d6cb;border-radius:24px;color:var(--ink);width:min(620px,calc(100% - 26px));max-height:calc(100dvh - 30px);background:#fffefa;box-shadow:0 18px 70px #142e3f50;overflow:auto}
dialog::backdrop{background:#142f2c9e}
body.has-dialog{overflow:hidden}
.dialog-bar{position:sticky;top:0;z-index:2;display:grid;grid-template-columns:44px 1fr minmax(55px,auto);align-items:center;gap:10px;background:#fffefa;padding:10px 17px;border-block-end:1px solid var(--line)}
.close-button{width:44px;height:44px;border:1px solid var(--line);border-radius:12px;background:#f5f8f3;font-size:1.85rem;line-height:1;color:#285647}
#player-title{font-weight:900;text-align:center}
.dialog-counter{color:var(--muted);font-weight:800;text-align:end;font-size:.89rem}
.play{padding:20px 25px 26px}
.play .mission-meter{margin-bottom:16px}
.play-head{display:flex;gap:12px;align-items:center;justify-content:space-between}
.play-head h2{font-size:clamp(1.45rem,4vw,1.95rem)}
.listen{white-space:nowrap;min-height:44px;padding:5px 12px;border:1px solid #c5d9cc;background:#f4faf3;border-radius:11px;font-weight:750}
.symbol{font-size:3.5rem;font-weight:950;text-align:center;background:#eee5ff;border-radius:20px;color:#563783;margin:14px 0 16px;line-height:1.4;padding:7px;direction:ltr}
.choices{display:grid;gap:9px;margin-block:15px 12px}
.choice{min-height:55px;text-align:start;width:100%;padding:8px 15px;background:#fff;border:2px solid #d6e5db;border-radius:14px;font-size:1.13rem;font-weight:820;display:flex;align-items:center;justify-content:space-between;gap:10px}
.choice:hover:not(:disabled){background:#f1f9ee;border-color:#82b59d}
.choice.incorrect{background:#fff4dc;border-color:#c79943}
.choice.correct{background:#e2f5e9;border-color:#258161}
.choice:disabled{cursor:default;opacity:.66}
.choice.correct:disabled{opacity:1}
.feedback{min-height:58px;color:var(--muted);padding:8px 11px;border-radius:11px;margin-block:8px 11px}
.feedback.good{background:#e2f5e9;color:#185744}
.feedback.try{background:#fff4dc;color:#6c4710}
.play .next{width:100%}
.story-art{width:100%;height:min(45svh,340px);object-fit:contain;border-radius:15px;background:#e8eee5;margin-bottom:16px}
.story-text{font-size:1.22rem;line-height:1.9;font-weight:740}
.story-actions,.finish-actions{display:flex;justify-content:space-between;gap:9px;margin-top:15px;align-items:center}
.finish{text-align:center;padding-block:32px}
.finish .big-star{display:block;margin-bottom:12px}
.finish h2{font-size:1.9rem}
.finish p{color:var(--muted);margin-top:8px}
.finish-actions{justify-content:center;flex-wrap:wrap}
@media (max-width:940px){
  .wrap{width:calc(100% - 42px)}
  .card-cover{height:166px}
}
@media (max-width:720px){
  .wrap{width:calc(100% - 28px)}
  .top{min-height:69px}
  .brand{font-size:1.28rem}
  .brand img{width:44px}
  .nav{position:fixed;inset:auto 0 0;z-index:3;justify-content:space-evenly;padding:6px 8px calc(6px + env(safe-area-inset-bottom));border-top:1px solid var(--line);background:#fffefa}
  .nav a{display:flex;flex-direction:column;align-items:center;line-height:1.4;min-width:84px;padding:4px 11px;font-size:.86rem}
  .nav a span{font-size:1.1rem;margin:0}
  .main{padding-block:17px 28px}
  .hero{grid-template-columns:minmax(0,1fr);border-radius:24px;padding:12px}
  .hero-art{grid-row:1}
  .hero-art img{border-radius:13px}
  .hero-copy{padding:2px 8px 10px}
  .hero h1{font-size:clamp(1.95rem,7.5vw,3.35rem)}
  .hero h1 span{display:inline}
  .hero p{margin:8px 0 13px;max-width:48ch;font-size:1rem}
  .hero .button{min-height:46px}
  .section-heading{margin-block:23px 13px;align-items:center}
  .section-heading h2,.friends h2{font-size:1.58rem}
  .section-heading h1{font-size:2rem}
  .text-link{font-size:.88rem}
  .cards{grid-template-columns:1fr;gap:13px}
  .card{display:grid;grid-template-columns:minmax(106px,34%) 1fr;border-radius:17px}
  .card-cover{height:auto;min-height:128px;padding:5px}
  .card-cover img{height:auto;max-height:200px}
  .category{padding:2px 7px;font-size:.8rem}
  .card-body{padding:10px 11px 11px;gap:4px}
  .card h3{font-size:1.15rem}
  .card p{font-size:.89rem;min-height:0;margin-bottom:4px}
  .card .button{min-height:42px;font-size:.91rem}
  .featured{grid-template-columns:89px 1fr;gap:11px;padding:10px;margin-top:19px;border-radius:16px}
  .featured img{width:89px;height:auto;max-height:150px;grid-row:span 2}
  .featured h3{font-size:1.22rem}
  .featured p{font-size:.9rem}
  .featured .button{margin:0;min-height:43px}
  .friends-grid{grid-template-columns:1fr}
  .progress-summary{grid-template-columns:55px 1fr;padding:14px;gap:14px}
  .progress-summary .big-star{font-size:3rem}
  .progress-summary h2{font-size:1.4rem}
  .footer{padding-bottom:calc(70px + env(safe-area-inset-bottom))}
  .play{padding:15px 15px 20px}
  .story-text{font-size:1.13rem}
}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;transition:none!important}}
#audio-note:empty{display:none}

.question-guide{--lesson-bg:#edf6eb;display:grid;grid-template-columns:minmax(82px,24%) minmax(0,1fr);gap:15px;align-items:center;padding:14px;border-radius:20px;background:var(--lesson-bg);border:1px solid #dae5d8}
.question-guide.violet{--lesson-bg:#f2ecfc}
.question-guide.blue{--lesson-bg:#eaf4ff}
.question-guide.peach{--lesson-bg:#fff0e7}
/* Every sprite is cropped from its approved character sheet. */
.guide-avatar{position:relative;aspect-ratio:1;min-width:0;isolation:isolate}
.guide-movement,.guide-poses,.guide-pose{position:absolute;inset:0}
.guide-movement,.guide-poses{transform-origin:center 80%}
.guide-poses{isolation:isolate;overflow:hidden;border:1px solid #e4d5b6;border-radius:26%;background:#f5e8ce;box-shadow:0 3px 0 #e5dacb}
.guide-pose{background-image:var(--guide-sheet);background-repeat:no-repeat;opacity:0;transition:opacity .15s}
.guide-avatar[data-state=still] .pose-idle,.guide-avatar[data-state=idle] .pose-idle,
.guide-avatar[data-state=think] .pose-think,.guide-avatar[data-state=celebrate] .pose-celebrate{opacity:1}
.guide-avatar[data-state=idle] .guide-movement{animation:guide-step-in .44s ease-out both}
.guide-avatar[data-state=idle][data-entrance=float] .guide-movement{animation-name:guide-float-in}
.guide-avatar[data-state=idle][data-entrance=fly] .guide-movement{animation-name:guide-fly-in}
.guide-avatar[data-state=idle] .guide-poses{animation:guide-breathe 3s .44s ease-in-out both}
.guide-avatar[data-state=think] .guide-movement{animation:guide-think .5s ease-out both}
.guide-avatar[data-state=celebrate] .guide-movement{animation:guide-celebrate .65s cubic-bezier(.2,.65,.25,1) both}
.guide-mouth{transition:opacity .035s,transform .035s;display:none;position:absolute;left:var(--mouth-x);top:var(--mouth-y);width:var(--mouth-width);height:7%;border-radius:45% 45% 55% 55%;background:radial-gradient(ellipse at 50% 115%,#b95b59 0 31%,#411f22 58%);transform:translate(-50%,-20%) scaleY(calc(.19 + var(--mouth-open,0) * .81));opacity:var(--mouth-open,0);transform-origin:center 26%;pointer-events:none}
.guide-avatar[data-speaking][data-state=idle] .guide-mouth{display:block}
.guide-spark{position:absolute;inset-block-start:-8%;inset-inline-end:-6%;color:#a76b03;line-height:1;font-size:clamp(1rem,4vw,2rem);opacity:0;transform-origin:center}
.guide-avatar[data-state=celebrate] .guide-spark{animation:guide-spark .74s ease-out both}
@keyframes guide-step-in{from{opacity:0;transform:translateY(9px) scale(.89)}80%{opacity:1;transform:translateY(-2px) scale(1.02)}to{transform:none}}
@keyframes guide-float-in{from{opacity:0;transform:translateY(13px) rotate(-5deg)}70%{opacity:1;transform:translateY(-3px)}to{transform:none}}
@keyframes guide-fly-in{from{opacity:0;transform:translate(-20%,12%) rotate(-10deg)}70%{opacity:1;transform:translate(2%,-3%) rotate(2deg)}to{transform:none}}
@keyframes guide-breathe{0%,100%{transform:scale(1)}50%{transform:translateY(-3%) scale(1.025)}}
@keyframes guide-think{0%,100%{transform:none}54%{transform:translateY(2%) rotate(-4deg)}}
@keyframes guide-celebrate{0%,100%{transform:none}15%{transform:scale(1.04,.94)}45%{transform:translateY(-12%) rotate(3deg) scale(1.05)}71%{transform:scale(.98,1.035)}}
@keyframes guide-spark{0%,100%{opacity:0;transform:translateY(3px) scale(.65)}38%{opacity:1;transform:translateY(-6px) scale(1.15)}82%{opacity:.8;transform:translateY(-9px) scale(.95)}}
.friends-grid .guide-avatar{width:84px;flex:none}
.character-preview{display:block;margin-top:4px;min-height:38px;padding:0 8px;background:#edf6ed;border:1px solid #cee5d3;color:#17634b;font-size:.83rem;font-weight:850;border-radius:9px}
.guide-preview{text-align:center}
.guide-preview .guide-avatar{width:min(200px,69%);margin:18px auto 23px}
.motion-controls{display:flex;justify-content:center;gap:8px;flex-wrap:wrap}
.motion-controls button{min-height:44px;padding-inline:13px}
.motion-controls button[aria-pressed=true]{background:#e0f2e5;border-color:#24775e}
@media(prefers-reduced-motion:reduce){.guide-avatar .guide-movement,.guide-avatar .guide-poses,.guide-avatar .guide-spark{animation:none!important}.guide-mouth{display:none!important}}
.guide-name{font-size:.89rem;color:#396453;font-weight:900}
.guide-message h2{font-size:clamp(1.24rem,3.5vw,1.72rem);line-height:1.5}
.guide-message .listen{margin-top:8px;background:#fffefa}
.guide-message .listen[aria-pressed=true]{background:#d6f0df}
.token-grid{display:flex;flex-wrap:wrap;justify-content:center;gap:10px;margin-top:14px}
.token{background:#f2f7ee;color:#21724b;border:2px solid #bed4c3;border-radius:16px;min-height:52px;min-width:50px;font-size:1.55rem;padding:2px 7px}
.token[aria-pressed=true]{background:#c9efcf;border-color:#24774f;color:#0e5b39;box-shadow:0 2px 0 #24774f}
.token:disabled{cursor:default}
.check-tokens{width:100%;margin-top:12px}
.feedback:empty{display:none}
.feedback.count{background:#eff6f1}
.choice.correct span{color:#176451;font-weight:950}
#account-panel{background:#eef6ee;border:1px solid var(--line);border-radius:18px;padding:14px 16px;margin-block:16px;max-width:670px}
#account-panel h2{font-size:1.1rem;margin-bottom:4px}
#account-panel p{color:var(--muted);margin-bottom:8px}
@media(max-width:420px){
  .question-guide{gap:9px;padding:9px;grid-template-columns:minmax(64px,26%) minmax(0,1fr)}
  .guide-message h2{font-size:1.12rem}
  .guide-message .listen{padding:2px 9px;min-height:38px}
}
.top-actions{display:flex;align-items:center;gap:9px}
.language-switch{appearance:none;min-height:44px;padding:5px 11px;border:1px solid var(--line);border-radius:12px;background:#f5f8f3;color:var(--ink);font:inherit;font-size:.88rem;font-weight:850;text-align:center;cursor:pointer}
@media(max-width:440px){.top-actions{gap:5px}.star-name{display:none}.star-chip{padding-inline:8px}.language-switch{padding-inline:7px}.top{gap:6px}}

/* Configured color and picture cues remain large enough to tap on phones. */
.visual-choices{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.visual-choices .choice{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;min-height:106px;padding:12px 5px;text-align:center}
.visual-choices .choice-cue{font-size:clamp(1.8rem,7vw,3.2rem);line-height:1.25}
.visual-choices .choice-label{font-size:.9rem}
.visual-choices .choice-result{position:absolute;inset-block-start:3px;inset-inline-end:4px}
.color-sample{display:grid;place-items:center;min-height:105px;margin-block:6px 12px}
.color-swatch{display:block;width:clamp(38px,11vw,68px);aspect-ratio:1;border-radius:50%;border:2px solid #161f273d;box-shadow:inset 0 -5px 0 #161f2722;background:var(--swatch)}
.color-sample .color-swatch{width:83px;outline:4px solid #e8f3ed;outline-offset:3px}
.color-swatch[data-color=blue]{--swatch:#2d76ed}
.color-swatch[data-color=yellow]{--swatch:#f9c734}
.color-swatch[data-color=red]{--swatch:#ec514d}
.color-swatch[data-color=green]{--swatch:#21a858}
.color-swatch[data-color=purple]{--swatch:#a25cdb}

.game-cards{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}
.game-card{
  --game-bg:#efe6fc;--game-edge:#d4bde9;--game-ink:#553580;
  display:block;min-width:0;padding:0;overflow:hidden;text-align:start;
  border:2px solid var(--game-edge);border-radius:22px;background:#fff;
  box-shadow:0 4px 0 var(--game-edge);transition:transform .16s ease,box-shadow .16s ease;
}
.game-card.mint{--game-bg:#dff4e7;--game-edge:#b5dfc7;--game-ink:#15674b}
.game-card.blue{--game-bg:#e0f0ff;--game-edge:#b4d4f3;--game-ink:#1e5f96}
.game-card.peach{--game-bg:#ffe8d7;--game-edge:#ecc7ae;--game-ink:#843f24}
.game-card:hover{transform:translateY(-3px);box-shadow:0 7px 0 var(--game-edge)}
.game-card:active{transform:translateY(3px);box-shadow:0 1px 0 var(--game-edge)}
.game-art{
  display:grid;grid-template-columns:minmax(0,1.25fr) minmax(0,1fr);
  align-items:center;justify-items:center;gap:10px;padding:14px;
  background:radial-gradient(ellipse at 73% 38%,#fff9 0,transparent 72%),var(--game-bg);
}
.game-art .guide-avatar{width:min(100%,120px)}
.game-symbol{color:var(--game-ink);font-size:clamp(2.2rem,6vw,4.8rem);font-weight:950;line-height:1;filter:drop-shadow(0 3px 0 #fff8)}
.game-name{display:flex;align-items:center;justify-content:space-between;gap:6px;min-height:65px;padding:8px 14px;font-size:clamp(.94rem,2.6vw,1.36rem);font-weight:950}
.game-play{display:grid;place-items:center;flex:0 0 32px;aspect-ratio:1;border-radius:50%;background:var(--game-bg);color:var(--game-ink);font-size:.85rem}
.guide-avatar{display:block}
#audio-note:empty,#feedback:empty{display:none}
.letter-choices .choice-label{font-size:clamp(2rem,7vw,3.75rem);line-height:1.1;font-weight:950}
.sentence-slots{display:flex;flex-wrap:wrap;gap:7px;justify-content:center;margin:10px 0}
.sentence-slot{
  flex:1 1 52px;min-width:52px;min-height:46px;display:grid;place-items:center;
  padding:3px 7px;border:2px dashed #cbbda6;border-radius:11px;background:#fbf1e4;color:#774e38;
}
.sentence-slot.filled{border:2px solid #7bb99d;background:#e7f7ec;color:#175942;font-weight:900}
.word-choices{grid-template-columns:repeat(auto-fit,minmax(min(92px,43%),1fr))}
.visual-choices.word-choices .choice{min-height:76px}
.word-choices .choice-cue{font-size:clamp(1.5rem,5vw,2.25rem)}
.basket-count{display:grid;grid-template-columns:auto auto minmax(0,1fr);align-items:center;gap:12px;padding:6px 13px;margin-top:12px;background:#fff4da;border:1px solid #e8d3a3;border-radius:16px}
.basket-icon{font-size:2.3rem;line-height:1.4}
.basket-meter{font-size:1.3rem;font-weight:950;color:#6d4817;white-space:nowrap}
.basket-apples{font-size:1.25rem;line-height:1.45;overflow-wrap:anywhere}
.basket-count + .token-grid .token[aria-pressed=true]{background:#e7f3e8;color:#245e43}
.basket-count + .token-grid .token[aria-pressed=true] span{opacity:.34}
@media(max-width:620px){
  .game-cards{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
  .game-art{padding:8px;gap:5px}
  .game-name{padding:6px 8px;min-height:54px;line-height:1.35}
  .game-play{flex-basis:25px;font-size:.72rem}
  .game-symbol{font-size:1.85rem}
  .word-choices{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(prefers-reduced-motion:reduce){.game-card:hover,.game-card:active{transform:none}}

.memory-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(6px, 2vw, 12px);
  max-inline-size: 29rem;
  margin: 1rem auto;
}

.memory-card {
  display: grid;
  place-items: center;
  min-block-size: clamp(52px, 15vw, 86px);
  border: 2px solid #376caa;
  border-radius: 14px;
  background: #315782;
  color: #fff0a7;
  font: inherit;
  font-size: clamp(1.6rem, 6vw, 2.6rem);
  line-height: 1;
  cursor: pointer;
}

.memory-card[data-state="up"],
.memory-card[data-state="matched"] {
  background: #f0f7ff;
  color: #1e385d;
}

.memory-card[data-state="matched"] {
  border-color: #35774e;
  background: #e2f4e5;
  box-shadow: inset 0 -4px 0 #b6ddbe;
  cursor: default;
}

.player-path {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin-block-end: .5rem;
  color: #26456c;
  font-weight: 800;
}

.path-link {
  min-block-size: 44px;
  padding-inline: .9rem;
  border: 1px solid #acc1d9;
  border-radius: 999px;
  background: white;
  color: #26456c;
  font: inherit;
  cursor: pointer;
}

.section-path {
  display: grid;
  gap: .65rem;
  max-inline-size: 32rem;
  margin: 1rem auto 0;
}

.path-step {
  display: flex;
  align-items: center;
  gap: .9rem;
  inline-size: 100%;
  min-block-size: 64px;
  padding: .6rem .85rem;
  border: 2px solid #b2cfdb;
  border-radius: 16px;
  background: #f0faf8;
  color: #1f3955;
  font: inherit;
  text-align: start;
  cursor: pointer;
}

.path-step:disabled {
  background: #f4f6f8;
  border-color: #d5dfe7;
  color: #506173;
  cursor: default;
}

.path-icon {
  display: grid;
  flex: 0 0 3.5rem;
  place-items: center;
  min-block-size: 2.6rem;
  border-radius: 11px;
  background: #d9eef7;
  color: #315782;
  white-space: nowrap;
}

.path-step strong,
.path-step small {
  display: block;
}

/* Family: child chip, parent corner, review card, stickers */
.child-chip,.parent-button{display:inline-flex;align-items:center;gap:6px;min-height:48px;border:1px solid var(--line);border-radius:14px;background:#fff;color:var(--ink);font:inherit;font-weight:850;padding:3px 10px 3px 6px;cursor:pointer}
.child-chip .guide-avatar{inline-size:38px;block-size:38px;flex:0 0 38px}
.child-chip span:last-child{max-inline-size:8em;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.parent-button{inline-size:48px;justify-content:center;padding:0;font-size:1.35rem;color:var(--muted)}
.guide-outfit{position:absolute;inset-block-start:2%;inset-inline-start:50%;translate:-50% 0;font-size:clamp(1.1rem,32%,2.6rem);line-height:1;pointer-events:none;z-index:3}
[dir=rtl] .guide-outfit{translate:50% 0}
.review-card{display:flex;align-items:center;gap:14px;inline-size:100%;margin-block:18px 4px;padding:14px 18px;border:2px solid #cdb8f3;border-radius:22px;background:#f3ecff;color:#45307a;font:inherit;text-align:start;cursor:pointer;box-shadow:0 4px 0 #e0d2fa;min-height:72px}
.review-card strong,.review-card small{display:block}
.review-card strong{font-size:1.15rem}
.review-card small{color:#5d4a8c}
.review-icon{font-size:2.2rem}
.review-card .game-play{margin-inline-start:auto}
.sticker-book{margin-block:22px;padding:18px;border:1px solid var(--line);border-radius:24px;background:#fff}
.sticker-book h2{font-size:1.2rem;margin-block:4px 10px}
.sticker-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(88px,1fr));gap:10px;margin-block-end:14px}
.sticker{display:grid;justify-items:center;gap:2px;padding:10px 4px;border:1px dashed #cbd8cf;border-radius:18px;background:#f6f8f4;color:var(--muted);font:inherit;min-height:88px}
.sticker span{font-size:2rem;filter:grayscale(1);opacity:.55}
.sticker.open{border-style:solid;border-color:#f1d27a;background:#fff8df;color:#6b5210}
.sticker.open span{filter:none;opacity:1}
.sticker small{font-size:.8rem;text-align:center;line-height:1.3}
.sticker.outfit{cursor:pointer}
.sticker.outfit[aria-pressed=true]{outline:3px solid var(--green);outline-offset:2px}
.sticker.outfit:disabled{cursor:default}
.parent h3{margin-block:20px 8px;font-size:1.1rem}
.parent .muted{color:var(--muted);font-size:.92rem}
.gate{display:flex;flex-wrap:wrap;gap:10px;align-items:center}
.gate label{display:flex;align-items:center;gap:10px}
.gate-sum{font-size:1.6rem;font-weight:900}
.gate input,.add-child input,.add-child select,.limit{min-height:48px;border:1px solid #b8d1c2;border-radius:12px;padding:6px 12px;font:inherit;background:#fff;color:var(--ink)}
.gate input[name=answer]{inline-size:6em;font-size:1.4rem;text-align:center}
.gate input[type=email]{flex:1 1 220px}
.add-child{display:flex;flex-wrap:wrap;gap:10px;margin-block-start:12px}
.add-child input{flex:1 1 160px}
.reports{display:grid;gap:12px}
.report-card{border:1px solid var(--line);border-radius:18px;padding:12px 14px;background:#fbfcf9}
.report-card header{display:flex;gap:12px;align-items:center}
.report-card img{inline-size:52px;block-size:52px;border-radius:14px;object-fit:cover;background:#eef4ee}
.report-card h3{margin:0;font-size:1.05rem}
.report-card p{margin:0;color:var(--muted)}
.report-card ul{margin:8px 0;padding-inline-start:1.2em;color:var(--muted)}
.report-actions{display:flex;flex-wrap:wrap;gap:8px}
.button.danger{background:#fff;color:#a12c2c;border-color:#e7b9b9}
.child-pick{display:grid;grid-template-columns:repeat(auto-fill,minmax(130px,1fr));gap:12px;margin-block:12px 18px}
.child-card{display:grid;justify-items:center;gap:4px;padding:12px;border:2px solid var(--line);border-radius:20px;background:#fff;font:inherit;color:var(--ink);cursor:pointer;min-height:150px}
.child-card img{inline-size:84px;block-size:84px;border-radius:18px;object-fit:cover}
.child-card.active{border-color:var(--green);background:#eef8f1}
.footer a{color:var(--green);font-weight:800}
/* Big, forgiving touch targets for small hands */
.choice,.token,.memory-card,.path-step{min-block-size:64px}
@media (max-width:560px){.child-chip span:last-child{display:none}.child-chip{padding:3px 6px}}
.trace-box{display:grid;justify-items:center;gap:10px;margin-block:8px}
.trace-canvas{inline-size:min(100%,360px);aspect-ratio:1;border:2px dashed #b8d1c2;border-radius:24px;background:#fff;touch-action:none;cursor:crosshair}
.child-face,.report-face{display:block;background-repeat:no-repeat;background-color:#eef4ee}
.child-face{inline-size:84px;block-size:84px;border-radius:18px}
.report-face{inline-size:52px;block-size:52px;flex:0 0 52px;border-radius:14px}
/* Phones with a notch (and the iOS/Android app): keep the header below the status bar */
.header{padding-top:env(safe-area-inset-top)}
.chip-face{display:block;inline-size:38px;block-size:38px;flex:0 0 38px;border-radius:11px;background-repeat:no-repeat;background-color:#eef4ee}
/* Small phones: logo only, so the buttons never cover the name */
@media (max-width:440px){.brand span{display:none}.top-actions{gap:6px}.language-switch{max-inline-size:5.2rem}}
/* Focus moves to the question for screen readers; no box around it for touch users */
h2[tabindex="-1"]:focus:not(:focus-visible){outline:none}

/* ===== Welcome: language → companion → hello ===== */
.welcome{width:min(760px,calc(100% - 20px));max-height:calc(100dvh - 20px);border:0;border-radius:32px;background:linear-gradient(180deg,#fff8e6,#f3fbf4)}
.welcome::backdrop{background:#1d3b34e6}
.welcome-body{display:grid;justify-items:center;gap:18px;padding:28px 18px 26px;text-align:center}
.welcome-body h1{margin:0;font-size:clamp(1.4rem,4.5vw,2.1rem);line-height:1.5;outline:none}
.welcome-logo{inline-size:min(46vw,190px);block-size:auto;filter:drop-shadow(0 8px 14px #4a3a1530)}
.welcome-choices{display:grid;grid-template-columns:1fr 1fr;gap:14px;inline-size:min(100%,460px)}
.welcome-lang{display:grid;justify-items:center;gap:6px;min-block-size:150px;padding:16px;border:3px solid #cfe3d5;border-radius:26px;background:#fff;font:inherit;font-size:1.5rem;font-weight:900;color:var(--ink);cursor:pointer;box-shadow:0 6px 0 #dbe9df}
.welcome-lang span{display:grid;place-items:center;inline-size:64px;block-size:64px;border-radius:50%;background:#e2f3e8;color:var(--green);font-size:2rem}
.welcome-lang:active,.companion-option:active{transform:translateY(4px);box-shadow:0 2px 0 #dbe9df}
.companion-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(118px,1fr));gap:12px;inline-size:100%}
.companion-option{display:grid;justify-items:center;gap:6px;padding:12px 8px;border:3px solid #dfe9e2;border-radius:24px;background:#fff;font:inherit;font-weight:900;font-size:1.1rem;color:var(--ink);cursor:pointer;box-shadow:0 5px 0 #e3ece6;min-block-size:150px}
.companion-option.chosen{border-color:#2f9e72;background:#ecfaf1;box-shadow:0 5px 0 #b5e0c8}
.companion-big{display:block;inline-size:96px;block-size:96px;border-radius:22px;background-repeat:no-repeat;background-color:#eef4ee}
.companion-option.chosen .companion-big{animation:hop .6s ease}
.welcome-go{min-inline-size:220px;min-block-size:60px;font-size:1.25rem}
.welcome-go:disabled{opacity:.45}
.welcome-body.hello .guide-avatar{inline-size:min(60vw,240px);block-size:min(60vw,240px)}
@keyframes hop{40%{transform:translateY(-10px) scale(1.05)}}

/* ===== Companion on the home screen ===== */
.companion-dock{position:fixed;z-index:20;inset-inline-end:14px;inset-block-end:calc(16px + env(safe-area-inset-bottom));display:flex;align-items:flex-end;gap:8px;max-inline-size:min(360px,calc(100% - 28px));padding:0;border:0;background:none;font:inherit;color:var(--ink);cursor:pointer;text-align:start}
.companion-dock.behind{display:none}
.companion-face{display:block;flex:0 0 76px;inline-size:76px;block-size:76px;border-radius:50%;border:4px solid #fff;background-repeat:no-repeat;background-color:#e8f5ec;box-shadow:0 6px 16px #1d3b3440}
.companion-bubble{position:relative;margin-block-end:30px;padding:10px 14px;border-radius:18px;background:#fff;border:2px solid #cfe3d5;font-weight:800;font-size:.98rem;line-height:1.55;box-shadow:0 6px 16px #1d3b3426}
.companion-bubble:empty{display:none}
.companion-dock.talking .companion-face{animation:hop .7s ease 2}
.feedback-face{display:inline-block;vertical-align:middle;inline-size:34px;block-size:34px;margin-inline-end:8px;border-radius:50%;background-repeat:no-repeat;background-color:#eef4ee}
@media (max-width:720px){.companion-dock{inset-block-end:calc(84px + env(safe-area-inset-bottom))}.companion-face{flex-basis:62px;inline-size:62px;block-size:62px}.companion-bubble{font-size:.9rem;margin-block-end:22px}}
main.main{padding-block-end:120px}

/* ===== Path: locked, next, done ===== */
.game-card{position:relative}
.game-card.locked{filter:grayscale(.85);opacity:.6;box-shadow:none}
.game-card.locked:hover{transform:none}
.game-lock,.game-badge{position:absolute;z-index:2;inset-block-start:8px;inset-inline-start:8px;display:grid;place-items:center;inline-size:38px;block-size:38px;border-radius:50%;background:#fff;font-size:1.2rem;box-shadow:0 2px 6px #0002}
.game-badge{color:#c79300}
.game-card.is-next{outline:4px solid #f5c542;outline-offset:3px;animation:glow 1.8s ease-in-out infinite}
.game-card.nudge{animation:shake .5s ease 2}
@keyframes glow{50%{outline-color:#ffe28a;box-shadow:0 0 0 8px #f5c54233}}
@keyframes shake{25%{transform:rotate(-2deg)}75%{transform:rotate(2deg)}}
.button.locked{filter:grayscale(1);opacity:.6}
#mission-cards:empty,#mission-cards:empty+#featured-mission,.section-heading:has(+#mission-cards:empty){display:none}
.choice.helper-glow{outline:4px solid #f5c542;outline-offset:2px;animation:glow 1.2s ease-in-out infinite}
.intro .intro-text{margin:4px 0;color:var(--muted)}
.intro .intro-howto{margin:8px 0;font-weight:900;font-size:1.15rem}
.intro-go{inline-size:100%;min-block-size:64px;font-size:1.3rem;margin-block-start:14px}
.toggle{display:flex;align-items:center;gap:10px;min-block-size:48px;font-weight:800}
.toggle input{inline-size:24px;block-size:24px}
@media(prefers-reduced-motion:reduce){.game-card.is-next,.choice.helper-glow,.companion-dock.talking .companion-face,.game-card.nudge{animation:none}}

/* ===== Tablets and iPad ===== */
@media (min-width:768px){
  .game-cards{grid-template-columns:repeat(3,minmax(0,1fr));gap:20px}
  dialog#player,dialog#parent{width:min(900px,calc(100% - 48px));max-height:calc(100dvh - 40px)}
  .choices{gap:16px}
  .choice{min-block-size:96px;font-size:1.35rem}
  .letter-choices .choice,.visual-choices .choice{min-block-size:120px}
  .token{min-block-size:84px;min-inline-size:84px;font-size:2.2rem}
  .question-guide .guide-avatar{inline-size:150px;block-size:150px}
  .guide-message h2{font-size:1.7rem}
  .trace-canvas{inline-size:min(100%,480px)}
  .memory-board{gap:14px}
  .memory-card{min-block-size:110px;font-size:2.4rem}
  .companion-face{flex-basis:96px;inline-size:96px;block-size:96px}
  .companion-bubble{font-size:1.1rem}
}
@media (min-width:1100px){
  .game-cards{grid-template-columns:repeat(4,minmax(0,1fr))}
}
/* Tablet on its side: guide on one side, the game on the other */
@media (min-width:900px) and (orientation:landscape) and (max-height:900px){
  dialog#player .play:has(.question-guide){display:grid;grid-template-columns:minmax(240px,34%) 1fr;column-gap:22px;align-items:start}
  dialog#player .play:has(.question-guide)>*{grid-column:2}
  dialog#player .play:has(.question-guide)>.question-guide{grid-column:1;grid-row:1 / span 8;grid-template-columns:1fr;justify-items:center;text-align:center}
}
@media (max-width:560px){
  .companion-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
  .companion-option{min-block-size:0;padding:8px 4px;border-radius:18px;font-size:.95rem}
  .companion-big{inline-size:72px;block-size:72px;border-radius:16px}
}
.welcome-body .welcome-go[data-welcome="confirm"]{position:sticky;inset-block-end:10px;box-shadow:0 6px 18px #1d3b3440}
/* iPad portrait: nav + buttons share the header, keep only the round logo */
@media (max-width:1040px){.brand span{display:none}}
.sticker-art{display:block;inline-size:56px;block-size:56px;object-fit:contain}
.guide-outfit .sticker-art{inline-size:100%;block-size:auto;max-inline-size:3em}
.companion-more{inline-size:100%;text-align:start}
.companion-more summary{cursor:pointer;min-block-size:52px;display:flex;align-items:center;justify-content:center;gap:8px;border:2px dashed #cfe3d5;border-radius:18px;background:#fff;font-weight:900;font-size:1.1rem;margin-block:4px 12px}
/* Flow move videos: portrait clip shown head-to-waist inside the square guide spot */
.guide-video{position:relative;overflow:visible;background:none}
.guide-video canvas,.guide-video video{display:block;inline-size:100%;block-size:100%;object-fit:cover;object-position:50% 8%;transform:scale(1.25);transform-origin:50% 20%;pointer-events:none}
.guide-video video[hidden]{display:block;position:absolute;inset:0;inline-size:2px;block-size:2px;opacity:0;transform:none}
.welcome-body.hello .guide-video canvas,.intro .guide-video canvas{transform:scale(1.1)}
/* Focus is moved to titles for screen readers only; never draw a box on them */
h1[tabindex="-1"]:focus,h2[tabindex="-1"]:focus{outline:none}
