/* Full-width accessible gameplay — Tajawal preferred */
:root{font-family:"Tajawal",system-ui,Tahoma,Arial,sans-serif;color:#143f5b;background:#f1fbff;--navy:#128eb9;--aqua:#22bbbf;--border:#c4e9f2}*{box-sizing:border-box}body{margin:0;min-height:100vh;line-height:1.65;background:radial-gradient(circle at 12% 32%,#dff9f5 0,transparent 32%),#f2fbff}header{background:linear-gradient(110deg,#1b9ed2,#23c8b7);color:white;padding:20px clamp(18px,3.5vw,72px);position:relative;overflow:hidden}header:after{content:"★  ●  ▲";position:absolute;left:4%;top:0;font-size:4rem;opacity:.16;pointer-events:none}header h1{font-size:clamp(1.65rem,3vw,2.9rem);margin:4px 0;font-weight:900}.kicker{font-weight:800}.motto{font-weight:700}.back{display:inline-block;color:#fff;font-weight:900;margin-bottom:4px}main{width:100%;margin:0;padding:18px clamp(16px,3.5vw,72px) 24px}.tabs{display:flex;flex-wrap:wrap;gap:10px;margin:8px 0 18px}.tabs button,.actions button,.choice{font:inherit;border-radius:17px;border:2px solid var(--border);background:#fff;color:#153e59;min-height:54px;padding:10px 20px;font-weight:800;cursor:pointer}.tabs button.active{background:#138cc4;color:#fff;border-color:#138cc4}.toolbar{display:flex;flex-wrap:wrap;align-items:center;gap:12px;margin:0 0 14px;padding:16px 18px;background:#fff;border:2px solid #d4edf6;border-radius:20px}.toolbar label{font-weight:900}.toolbar select{flex:1;min-width:min(270px,100%)}select{border:2px solid #8fcad8;background:white;border-radius:14px;min-height:52px;padding:10px 15px;font:inherit;font-weight:700}.score{display:flex;justify-content:space-between;gap:12px;margin:12px 0;font-weight:900;font-size:1.1rem}.activity,#guide-view,#options-view{border:2px solid #ccebf4;background:#fff;border-radius:28px;padding:clamp(18px,2.7vw,42px);box-shadow:0 12px 30px #106a9013}.activity{min-height:54vh}.activity h2{text-align:center;font-size:clamp(1.4rem,2.4vw,2.2rem);margin:5px 0}.hint{text-align:center;color:#54778b;min-height:30px}.question{display:flex;justify-content:center;align-items:center;min-height:120px;flex-wrap:wrap;gap:15px;margin:20px 0}.group{padding:12px;border:2px solid #b6e5f1;border-radius:20px;display:flex;align-items:center;flex-wrap:wrap;gap:9px;justify-content:center;min-width:150px;background:#f4fcff}.group-label{width:100%;text-align:center;font-weight:700}.shape{display:inline-flex;justify-content:center;align-items:center;width:64px;height:64px;font:3.5rem/1 Arial,sans-serif}.small-shape{width:40px;height:40px;font-size:2.35rem}.choices{display:grid;grid-template-columns:repeat(auto-fit,minmax(145px,1fr));gap:16px;max-width:1400px;margin:0 auto}.choice{min-height:112px;font-size:1.55rem;display:flex;justify-content:center;align-items:center;gap:.4rem;flex-wrap:wrap;background:#f6fdff;border-color:#acdce9}.choice:hover:not(:disabled){background:#eafaff;border-color:#35b8cb}.choice.correct{border-color:#18a876;background:#e2faef}.choice.wrong{border-color:#e27b68;background:#fff0ea}.choice:disabled{cursor:default}.actions{display:flex;justify-content:center;gap:12px;flex-wrap:wrap}.actions button{flex:1;max-width:340px;min-width:155px}.actions .primary{background:#ffcd53;color:#173c58;border-color:#ffbd33}.feedback{font-weight:900;text-align:center;min-height:38px;font-size:1.1rem}.option{display:block;padding:12px;margin:12px 0}input[type=checkbox]{width:24px;height:24px;vertical-align:middle}details{padding:16px;border:2px solid #d5edf4;border-radius:16px;margin:12px 0;background:#f8fdff}summary{font-weight:900;cursor:pointer}.disclaimer{font-size:.9rem;color:#54798b}footer{text-align:center;color:#537c90;padding:22px}button:focus-visible,select:focus-visible,a:focus-visible,summary:focus-visible{outline:4px solid #ffad3b;outline-offset:3px}body.contrast{background:white;color:#000;--navy:#001a3a;--border:#333}body.large .choice{min-height:140px;font-size:1.8rem}body:not(.quiet) .choice:hover:not(:disabled){transform:translateY(-2px)}@media(max-width:680px){.choices{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}.choice{min-height:95px;padding:10px}.toolbar{align-items:stretch}.toolbar select{min-width:100%}.activity{min-height:45vh}.question{gap:6px}.group{min-width:100px}.tabs button{flex:1;padding:9px 8px}}@media(prefers-reduced-motion:reduce){*,*:before,*:after{transition:none!important;animation:none!important}}

/* Interactive learning experience — motion remains optional */
.coach-strip{display:flex;align-items:center;justify-content:center;gap:12px;color:#187eaa;font-weight:900;flex-wrap:wrap;margin-bottom:8px}
.coach-dot{width:38px;height:38px;display:grid;place-items:center;background:#fff0b8;border-radius:50%;color:#c98905;font-size:1.65rem}
.repeat-voice,.sound-toggle{min-height:46px;border:2px solid #c1e8f0;border-radius:999px;background:#f6fcff;color:#174360;cursor:pointer;font:inherit;font-weight:800;padding:7px 15px}
.sound-toggle{margin-inline-start:auto}.sound-toggle[aria-pressed="false"]{background:#f6f6f6;color:#555}
.coach-strip .repeat-voice{font-size:.92rem}
.shape{transition:transform .22s ease}.choice{position:relative;transition:transform .22s ease,background-color .22s ease,border-color .22s ease,box-shadow .22s ease;box-shadow:0 6px 12px #176da110}
body:not(.quiet) .choice:active:not(:disabled){transform:scale(.97)}
body:not(.quiet) .choice.correct{animation:correct-pop .45s ease}
body:not(.quiet) .choice.wrong{animation:gentle-nudge .27s ease}
body:not(.quiet) .activity.next-question .choice{animation:rise-in .36s ease both}
body:not(.quiet) .activity.next-question .choice:nth-child(2){animation-delay:.045s}
body:not(.quiet) .activity.next-question .choice:nth-child(3){animation-delay:.09s}
body:not(.quiet) .activity.next-question .choice:nth-child(4){animation-delay:.135s}
.celebration{height:0;position:relative;pointer-events:none;text-align:center;font-size:2rem;z-index:2}
body:not(.quiet) .celebration.active::before{content:'⭐  ✨  ⭐';position:absolute;top:-60px;left:50%;transform:translateX(-50%);white-space:nowrap;animation:celebrate .8s ease both}
.feedback{transition:color .2s}.feedback.success{color:#137f55}.feedback.retry{color:#955421}
@keyframes correct-pop{0%{transform:scale(1)}45%{transform:scale(1.055)}100%{transform:scale(1)}}
@keyframes gentle-nudge{0%,100%{transform:translateX(0)}35%{transform:translateX(-4px)}70%{transform:translateX(4px)}}
@keyframes rise-in{from{opacity:.45;transform:translateY(9px)}to{opacity:1;transform:translateY(0)}}
@keyframes celebrate{0%{opacity:0;transform:translate(-50%,14px) scale(.7)}50%{opacity:1}100%{opacity:0;transform:translate(-50%,-35px) scale(1.15)}}
body.quiet .celebration{display:none}
@media (prefers-reduced-motion:reduce){.choice,.shape{transition:none!important}.celebration{display:none!important}}
@media(max-width:700px){.sound-toggle{margin-inline-start:0}.coach-strip{font-size:.9rem}.coach-dot{width:32px;height:32px}}

/* Session feedback and family support */
.progress-track{height:15px;background:#dbf2f5;border:2px solid #c5e9ef;border-radius:999px;overflow:hidden;margin-bottom:18px}#progress-fill{height:100%;width:0;background:linear-gradient(90deg,#26bca8,#ffce54);border-radius:999px;transition:width .3s ease}body.quiet #progress-fill{transition:none}.quick-tip{margin:20px auto 0;max-width:940px;padding:18px 22px;background:#fff8d9;border:2px solid #f3d27a;border-radius:19px;font-weight:700;line-height:1.9}.session-summary{margin-top:22px;padding:20px;text-align:center;border:2px solid #6fcbac;background:#edfff4;border-radius:22px}.session-summary .restart{font:inherit;font-weight:900;background:#ffcd53;border:2px solid #e9ad28;padding:12px 25px;border-radius:20px;min-height:52px;cursor:pointer}.context{text-align:center}.choice:disabled:not(.correct):not(.wrong){opacity:.78}body.contrast .choice{color:#000;border-color:#222}body.contrast .feedback.success{color:#005b2f}body.contrast .feedback.retry{color:#714000}body.contrast .progress-track{border-color:#000}@media(max-width:750px){.actions button{max-width:none}.activity{padding:18px}.quick-tip{padding:14px}}

/* V3: seamless automatic progression and dedicated results screen */
#activity-main[hidden],#session-summary[hidden],#continue[hidden]{display:none!important}
.auto-status{margin:12px auto;text-align:center;color:#246381;font-weight:800;min-height:1.5em}
.continue{display:block;margin:8px auto 16px;padding:11px 24px;min-height:52px;border-radius:18px;border:2px solid #0e8dba;background:#e8faff;color:#124264;font:inherit;font-weight:900;cursor:pointer}
.session-summary:not([hidden]){max-width:850px;min-height:300px;margin:3vh auto;padding:clamp(24px,5vw,55px);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:16px}
.session-summary h2{font-size:clamp(1.65rem,3vw,2.6rem);margin:0}
.session-summary p{margin:0;text-align:center;line-height:1.9}
@media(max-width:680px){.session-summary:not([hidden]){min-height:330px}}


/* Focused game-page UI: large play area, subdued chrome around it */
body.play-page{background:#ecf8fb}
.game-header{padding:14px clamp(16px,2.6vw,48px) 12px;min-height:auto}
.game-header:after{font-size:2.3rem;top:6px;left:2%;opacity:.10}
.game-header h1{font-size:clamp(1.35rem,2vw,2.3rem);margin:2px 0 0;font-weight:900}
.game-header .kicker,.game-header .motto{font-size:.95rem;opacity:.92}
.game-header .back{font-size:.95rem;margin-bottom:2px}
.game-main{padding-top:12px}
.tabs{justify-content:flex-start;align-items:center;gap:8px;margin-bottom:12px}
.tabs button{min-height:44px;padding:8px 16px;border-radius:14px;font-size:.98rem;border-color:#cde7ef;background:#f7fdff;color:#24506b;box-shadow:none}
.tabs button:not(.active):not(.sound-toggle){font-size:.94rem;font-weight:700;opacity:.92}
.tabs button.active{background:#168ec1;color:#fff;border-color:#168ec1;box-shadow:0 4px 12px rgba(22,142,193,.18)}
.sound-toggle{margin-inline-start:auto;font-size:.92rem;background:#fffdf7;border-color:#f2dfaa;color:#6a5600}
.toolbar,.score,.progress-track,.focus-note,.activity{max-width:1280px;margin-inline:auto}
.toolbar{padding:10px 14px;border-radius:18px;background:#f7fcfe;border-color:#d7edf3;gap:10px;margin-bottom:10px}
.toolbar label{font-size:.95rem;color:#406276}
.toolbar select{min-height:46px;border-radius:12px}
.score{font-size:1rem;margin:8px auto 4px;color:#24495f}
.focus-note{margin:0 auto 12px;font-size:.92rem;color:#5d7b8c;background:#f7fcff;border:1px dashed #c7e7f0;border-radius:14px;padding:8px 12px}
.progress-track{height:12px;border-radius:999px;margin:8px auto 18px;background:#dff3f8;border:1px solid #cae9f2;overflow:hidden}
#progress-fill{height:100%;background:linear-gradient(90deg,#17c7b6,#43b0e5);border-radius:999px;transition:width .25s ease}
.activity{position:relative;border:4px solid #7fd4e4;background:#fff;border-radius:30px;box-shadow:0 16px 36px rgba(16,106,144,.10);padding:clamp(18px,2.5vw,34px);min-height:58vh}
.activity::before{content:'مساحة اللعب';position:absolute;top:-16px;right:24px;background:#fff3b8;color:#6b5600;border:2px solid #f0d975;border-radius:999px;padding:4px 14px;font-size:.9rem;font-weight:900}
.activity h2{font-size:clamp(1.8rem,3vw,2.55rem);margin-top:10px;color:#143f5b}
.hint,.context,.feedback{font-size:1.08rem}
.coach-strip{justify-content:space-between;gap:10px;background:#f8fdff;border:1px solid #d7edf3;border-radius:16px;padding:10px 12px;margin-bottom:12px}
.coach-strip span{font-size:1rem}
.repeat-voice{min-height:40px;padding:6px 12px;font-size:.88rem}
.question{min-height:140px;margin-top:24px}
.group{padding:14px 16px;border-width:3px;background:#fbfeff}
.group-label{font-size:1.02rem;font-weight:900;color:#23506a}
.choices{gap:18px}
.choice{min-height:132px;border-width:3px;border-radius:18px;background:#fbfeff;box-shadow:0 8px 16px rgba(23,109,161,.08)}
.choice:hover:not(:disabled){background:#eefbff;border-color:#2fb8cc}
.actions{margin-top:16px;gap:10px}
.actions button{min-height:48px;max-width:300px;font-size:.98rem}
.actions .soft{background:#f8fdff}
.quick-tip{margin-top:14px;padding:12px 14px;border-radius:16px;background:#fff9e7;border:2px solid #f4df95;color:#5c4b00;font-weight:700}
.session-summary{max-width:860px;margin:24px auto 0;padding:24px;border:3px solid #8ad7e6;background:#fbfeff;border-radius:24px;text-align:center}
.session-summary h2{margin-top:0;font-size:clamp(1.6rem,2.6vw,2.2rem)}
.restart{min-height:52px;border-radius:999px;border:2px solid #ffcd53;background:#ffcd53;color:#173c58;font:inherit;font-weight:900;padding:0 22px;cursor:pointer}
#guide-view,#options-view{max-width:1000px;margin-inline:auto;border-width:2px;border-color:#d7edf3}
#guide-view h2,#options-view h2{font-size:1.4rem}
footer{font-size:.92rem;padding-top:16px}
@media (max-width: 900px){
  .game-header{padding:12px 14px}
  .game-header h1{font-size:1.45rem}
  .tabs{gap:7px}
  .tabs button{min-height:42px;padding:8px 12px}
  .sound-toggle{margin-inline-start:0}
  .focus-note{font-size:.88rem}
  .activity{padding:18px 14px;border-radius:24px}
  .activity::before{right:14px}
  .coach-strip{justify-content:center}
}
@media (max-width: 680px){
  .game-header .kicker,.game-header .motto{font-size:.82rem}
  .tabs{display:grid;grid-template-columns:1fr 1fr;gap:8px}
  .tabs button,.sound-toggle{width:100%;margin:0}
  .toolbar,.score,.progress-track,.focus-note,.activity{max-width:100%}
  .focus-note{padding:8px 10px}
  .activity::before{font-size:.8rem;top:-14px}
  .choice{min-height:108px}
  .actions button{max-width:none;min-width:0;flex:1 1 calc(50% - 10px)}
}


/* V5 focused play area with single drawer menu */
.header-mini{display:flex;align-items:flex-start;justify-content:space-between;gap:14px}.header-meta{display:flex;flex-direction:column;gap:2px}.back-lite{opacity:.88;font-size:.88rem}.game-header h1{font-size:clamp(1.15rem,1.8vw,1.95rem)}
.play-topbar,.progress-track,.play-stage{max-width:1340px;margin-inline:auto}
.play-topbar{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:10px}.score.compact{margin:0;font-size:1.05rem}.menu-toggle{min-height:46px;padding:9px 18px;border-radius:999px;border:2px solid #86d3e4;background:#fff;color:#143f5b;font:inherit;font-weight:900;cursor:pointer;box-shadow:0 6px 16px rgba(20,63,91,.08)}
.game-drawer{position:fixed;top:0;right:0;height:100vh;width:min(420px,92vw);background:#ffffff;border-left:3px solid #88d8e7;box-shadow:-8px 0 28px rgba(8,60,91,.18);padding:18px 16px 24px;z-index:60;overflow:auto}.drawer-backdrop{position:fixed;inset:0;background:rgba(10,34,53,.28);z-index:55}.drawer-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px;font-weight:900;color:#153e59}.drawer-close{min-height:38px;min-width:38px;border-radius:50%;border:2px solid #c8eaf2;background:#f8fdff;font:inherit;cursor:pointer}.drawer-section{padding:12px 0;border-top:1px solid #e6f5f9}.drawer-section:first-of-type{border-top:0}.drawer-section label{display:block;font-weight:800;margin-bottom:8px;color:#214d65}.drawer-link,.drawer-button{display:inline-flex;align-items:center;justify-content:center;min-height:44px;padding:8px 16px;border:2px solid #c4e9f2;border-radius:14px;background:#f8fdff;color:#143f5b;font:inherit;font-weight:800;text-decoration:none;cursor:pointer}.drawer-button{width:100%;margin:8px 0 10px}.drawer-section summary{font-weight:900;color:#143f5b;cursor:pointer}.drawer-section p{font-size:.95rem;color:#47697d}.brand-strip{display:flex;align-items:center;justify-content:space-between;gap:14px;min-height:42px;margin-bottom:6px}.game-logo{max-height:54px;max-width:170px;object-fit:contain}.game-mascot{max-height:84px;max-width:92px;object-fit:contain}
.play-stage{padding:clamp(22px,2.9vw,40px);min-height:66vh;border-width:4px}.play-stage::before{content:'اللعبة';font-size:.95rem}.play-stage h2{font-size:clamp(2rem,3.8vw,3.15rem);margin-bottom:14px}.hint{min-height:34px;font-size:1.15rem}.question{min-height:170px;margin:28px 0}.group{min-width:200px;padding:16px 18px;border-width:3px}.shape{width:82px;height:82px;font-size:4.4rem}.small-shape{width:54px;height:54px;font-size:3rem}.choices{grid-template-columns:repeat(3,minmax(0,1fr));gap:20px;max-width:1450px}.choice{min-height:154px;font-size:1.75rem;padding:10px 16px}.feedback{font-size:1.2rem}.actions{margin-top:18px}.actions button{min-height:54px;max-width:320px;font-size:1.03rem}.repeat-voice{font-size:.92rem}
@media (max-width: 980px){.choices{grid-template-columns:repeat(2,minmax(0,1fr))}.game-logo{max-height:46px}.game-mascot{max-height:70px}.play-stage h2{font-size:2rem}.shape{width:72px;height:72px;font-size:4rem}}
@media (max-width: 680px){.header-mini{flex-direction:column;gap:6px}.play-topbar{flex-direction:row;align-items:center}.score.compact{font-size:.94rem}.menu-toggle{min-height:42px;padding:8px 14px}.brand-strip{justify-content:center}.game-logo{max-height:40px}.game-mascot{max-height:62px}.play-stage{padding:18px 12px;min-height:58vh}.play-stage h2{font-size:1.72rem}.question{min-height:130px}.choices{grid-template-columns:1fr;gap:14px}.choice{min-height:130px;font-size:1.55rem}.shape{width:70px;height:70px;font-size:3.8rem}.small-shape{width:50px;height:50px;font-size:2.8rem}.actions button{max-width:none;flex:1 1 48%}}

/* ===== V6: clean instructional game — no settings inside question card ===== */
body.v6{background:#eaf9fb;color:#113e59;min-height:100vh}
body.v6 .lesson-header{background:linear-gradient(115deg,#21b2c3,#54c89e);color:#fff;min-height:92px;padding:14px clamp(14px,2.7vw,46px);display:flex;align-items:center;justify-content:space-between;gap:16px;position:relative;overflow:visible}
body.v6 .lesson-header::after{display:none}
.identity{display:flex;align-items:center;gap:15px;min-width:0}.header-logo{width:66px;height:66px;object-fit:contain;flex-shrink:0;border-radius:14px;background:#ffffffed;padding:3px}.header-logo[hidden]{display:none}
.lesson-identity{display:flex;flex-direction:column;justify-content:center;gap:2px}.brand-small{font-size:.92rem;font-weight:800;opacity:.95}.lesson-identity h1{font-size:clamp(1.18rem,2vw,1.85rem);line-height:1.3;margin:0;color:#fff;font-weight:900}
.header-navigation{display:flex;align-items:center;gap:9px;flex-wrap:wrap}.route-button,.menu-toggle{font-family:inherit;min-height:44px;border-radius:15px;padding:8px 14px;font-size:.91rem;font-weight:800;text-decoration:none;white-space:nowrap;cursor:pointer;display:inline-flex;align-items:center;justify-content:center}
.route-button{background:#fff;color:#13617d;border:2px solid #e4f9fe}.route-button:hover{background:#e7f9ff}.menu-toggle{background:#ffcd52;color:#543809;border:2px solid #ffe590;box-shadow:0 5px 10px #08475526}.menu-toggle:hover{background:#ffe07b}
body.v6 .game-main{padding:12px clamp(12px,2.4vw,40px) 24px;width:100%;max-width:1640px;margin:auto}
.game-topline{display:flex;align-items:center;justify-content:space-between;gap:12px;max-width:1460px;margin:auto}.game-topline .score{width:100%;max-width:none;display:flex;justify-content:space-between;gap:12px;margin:2px 0 8px;color:#174963}.topline-mascot{height:42px;max-width:60px;object-fit:contain}.topline-mascot[hidden]{display:none}
body.v6 .progress-track{max-width:1460px;margin:4px auto 14px;height:10px;border-radius:999px}
.game-session{max-width:1460px;margin:auto}
body.v6 .play-stage{background:#fff;border:5px solid #49b9da;border-radius:28px;min-height:clamp(420px,66vh,790px);padding:clamp(22px,3vw,50px);display:flex;flex-direction:column;align-items:stretch;justify-content:center;box-shadow:0 16px 30px #127b9b19;position:relative}
body.v6 .play-stage::before{display:none}
body.v6 .play-stage h2{color:#123f5e;font-size:clamp(1.8rem,3.25vw,3.15rem);line-height:1.35;text-align:center;margin:0 0 22px;font-weight:900}
body.v6 .question{min-height:140px;margin:12px 0 28px;gap:22px}
body.v6 .group{padding:20px 24px;border:3px solid #b2e7f1;border-radius:22px;min-width:210px;background:#f4fdff}
body.v6 .group-label{font-size:1.18rem}
body.v6 .shape{width:96px;height:96px;font-size:5.5rem}
body.v6 .small-shape{width:64px;height:64px;font-size:3.7rem}
body.v6 .choices{width:100%;max-width:1400px;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:20px;margin:0 auto}
body.v6 .choice{border:4px solid #a6def1;background:#f4fbff;border-radius:22px;min-height:170px;padding:16px;box-shadow:0 6px 14px #0b688314;font-size:1.9rem}
body.v6 .choice:hover:not(:disabled){border-color:#10a8ca;background:#e6faff}
body.v6 .choice.correct{background:#e0faed;border-color:#16a86c}
body.v6 .choice.wrong{background:#fff1ea;border-color:#df856a}
.game-status{min-height:50px;position:relative;text-align:center;padding:4px 10px}.game-status .hint{min-height:0;margin:4px;font-size:1.02rem}.game-status .feedback{min-height:0;margin:4px;font-size:1.1rem}
.play-actions{display:flex;justify-content:center;align-items:center;gap:10px;margin-top:2px}
.play-actions button{font:inherit;border-radius:999px;min-height:46px;padding:8px 22px;border:2px solid #b7e5f1;background:#fff;color:#17506c;font-weight:800;cursor:pointer}.play-actions .hint-button{background:#fff6d7;border-color:#eed981;color:#604a07}
body.v6 .game-drawer{max-width:440px;padding:18px 18px 30px}
body.v6 .drawer-section select{width:100%}
body.v6 .drawer-section details{border:0}
body.v6 .drawer-section .option{font-size:.95rem}
body.v6 .drawer-button,body.v6 .drawer-link{width:100%;margin:8px 0;background:#f1fbff;color:#174863}
body.v6 .session-summary{background:#fff;border:4px solid #49b9da;border-radius:26px;padding:30px 20px;margin:24px auto}
body.v6 button:focus-visible, body.v6 a:focus-visible,body.v6 select:focus-visible{outline:4px solid #f59c18;outline-offset:3px}
body.v6.contrast .play-stage{border-color:#173f6d}body.v6.large .choice{min-height:185px}
@media(max-width:900px){body.v6 .lesson-header{align-items:flex-start;flex-wrap:wrap}.header-navigation{width:100%}.route-button,.menu-toggle{flex:1}.identity{width:100%}}
@media(max-width:640px){body.v6 .lesson-header{padding:10px 12px;gap:8px}.header-logo{width:48px;height:48px}.brand-small{font-size:.8rem}.lesson-identity h1{font-size:1.19rem}.header-navigation{gap:6px}.route-button,.menu-toggle{font-size:.78rem;min-height:44px;padding:6px 9px}.game-topline .score{font-size:.92rem}body.v6 .play-stage{padding:14px 10px;border-width:3px;border-radius:20px;min-height:59vh}body.v6 .play-stage h2{font-size:1.6rem;margin:12px 0}body.v6 .question{min-height:100px;gap:8px;margin:8px 0 18px}body.v6 .group{min-width:105px;padding:10px;border-width:2px}body.v6 .shape{width:66px;height:66px;font-size:3.7rem}body.v6 .small-shape{width:44px;height:44px;font-size:2.6rem}body.v6 .choices{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}body.v6 .choice{min-height:116px;padding:8px;font-size:1.4rem;border-width:3px}.play-actions button{font-size:.89rem}}
@media(prefers-reduced-motion:reduce){body.v6 .choice,body.v6 .play-stage{animation:none!important;transition:none!important}}


/* V8 — Koala is a learning companion outside the question-and-answers card. */
body.v8 .learning-layout{width:100%;max-width:1500px;margin:0 auto;display:grid;grid-template-columns:minmax(0,1fr) clamp(172px,17vw,240px);gap:16px;align-items:stretch}
body.v8 .game-session{min-width:0;width:100%;max-width:none}
body.v8 .play-stage{min-height:clamp(410px,62vh,710px)}
body.v8 .koala-panel{position:relative;align-self:stretch;min-width:0;border-radius:24px;border:2px solid #b8e7f0;background:linear-gradient(170deg,#fffef4,#e8f8ff);box-shadow:0 10px 22px #10536b13;display:flex;flex-direction:column;align-items:center;justify-content:flex-end;padding:14px 12px 18px;gap:14px;overflow:hidden}
body.v8 .koala-visual{width:100%;flex:1;min-height:150px;display:flex;align-items:flex-end;justify-content:center}
body.v8 #koala-pose{width:100%;max-height:470px;object-fit:contain;object-position:bottom center;filter:drop-shadow(0 12px 11px #19486419)}
body.v8 #koala-pose[hidden]{display:none}
body.v8 .koala-message{margin:0;width:100%;padding:12px 8px;text-align:center;border-radius:16px;background:#fff;color:#174963;font-size:clamp(.93rem,1.3vw,1.1rem);font-weight:900;border:1px solid #d6ebf2;line-height:1.5;min-height:64px}
body.v8:not(.quiet) #koala-pose.koala-pop{animation:koalaGentle .35s ease-out both}
@keyframes koalaGentle{from{opacity:.7;transform:translateY(5px)}to{opacity:1;transform:none}}
@media(max-width:1000px){body.v8 .learning-layout{grid-template-columns:minmax(0,1fr) 148px;gap:10px}body.v8 .koala-panel{padding:8px;border-radius:16px}body.v8 .koala-message{padding:8px 5px;font-size:.9rem}}
@media(max-width:680px){body.v8 .learning-layout{display:flex;flex-direction:column;gap:10px}body.v8 .koala-panel{order:-1;flex-direction:row;justify-content:flex-start;padding:5px 10px;gap:12px;min-height:86px}body.v8 .koala-visual{flex:0 0 70px;min-height:70px;height:76px;align-items:center}body.v8 #koala-pose{max-height:76px;max-width:70px}body.v8 .koala-message{text-align:right;min-height:0;flex:1}body.v8 .play-stage{min-height:48vh}}
@media(prefers-reduced-motion:reduce){body.v8 #koala-pose{animation:none!important}}

/* V9 — balance the koala companion and prevent an oversized empty side panel. */
@media (min-width:681px){
  body.v8 .learning-layout{
    grid-template-columns:minmax(0,1fr) clamp(205px,20vw,280px);
    gap:14px;
  }
  body.v8 .koala-panel{
    justify-content:center;
    padding:16px 10px;
  }
  body.v8 .koala-visual{
    flex:1 1 auto;
    min-height:0;
    max-height:540px;
    align-items:center;
    overflow:visible;
  }
  body.v8 #koala-pose{
    width:116%;
    max-width:none;
    max-height:510px;
    object-position:center;
  }
  body.v8 .koala-message{
    flex:0 0 auto;
    min-height:58px;
  }
}
@media(max-width:1000px) and (min-width:681px){
  body.v8 .learning-layout{grid-template-columns:minmax(0,1fr) 175px}
  body.v8 #koala-pose{width:112%}
}


/* V10: koala outside a card; gentle pose transitions, ample size */
body.v8 .learning-layout{grid-template-columns:minmax(0,1fr) clamp(240px,24vw,340px);gap:12px;align-items:stretch}
body.v8 .koala-panel{border:0!important;box-shadow:none!important;background:transparent!important;border-radius:0!important;padding:0!important;overflow:visible!important;justify-content:flex-end!important;gap:0!important}
body.v8 .koala-visual{width:100%;min-height:0;flex:1;max-height:none!important;display:flex;align-items:flex-end;justify-content:center;overflow:visible!important}
body.v8 #koala-pose{display:block;object-fit:contain;object-position:bottom center;width:100%;max-width:none;max-height:min(66vh,650px);height:auto;filter:drop-shadow(0 11px 10px rgba(17,60,86,.10));transform:none!important;animation:none!important;opacity:1;transition:opacity .18s ease-in-out}
body.v8 #koala-pose.pose-fading{opacity:0.08}
body.v8 .koala-message{min-height:0!important;max-width:310px;border:0!important;background:transparent!important;padding:6px!important;margin:0 auto!important;border-radius:0!important;box-shadow:none!important;font-size:1.02rem;color:#27546a}
@media(max-width:1000px) and (min-width:681px){body.v8 .learning-layout{grid-template-columns:minmax(0,1fr) 205px}body.v8 #koala-pose{max-height:58vh}}
@media(max-width:680px){body.v8 .learning-layout{display:flex;flex-direction:column;gap:4px}body.v8 .koala-panel{order:-1;display:flex;flex-direction:row;align-items:center;min-height:98px!important;padding:0!important;gap:8px!important}body.v8 .koala-visual{height:108px!important;flex:0 0 102px;max-height:108px!important;align-items:center}body.v8 #koala-pose{width:100%;height:104px;max-height:104px;object-position:center}body.v8 .koala-message{max-width:none;flex:1;font-size:.9rem}}
@media(prefers-reduced-motion:reduce){body.v8 #koala-pose{transition:none!important}}

/* V11: quicker, subtle pose exchange without a visible blank interval. */
body.v8 #koala-pose { transition: opacity .10s ease-out; }
body.v8 #koala-pose.pose-fading { opacity: .5; }
body.v8.quiet #koala-pose { transition: none !important; }
@media(prefers-reduced-motion:reduce){body.v8 #koala-pose{transition:none!important}}

/* V12 — step-by-step educational feedback outside the question card. */
.learning-explanation[hidden]{display:none!important}
.learning-explanation{max-width:100%;background:#fffbea;border:2px solid #edd476;border-radius:22px;margin:14px 0 10px;padding:14px 18px;color:#21465e;text-align:center;box-shadow:0 6px 12px #755b0812}
.explanation-heading{font-size:1.2rem;font-weight:900}
#explanation-text{font-size:1.08rem;font-weight:700;margin:6px auto 9px}
.explanation-visual{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:12px}
.learning-note{width:100%;font-weight:800;color:#41667b}
.learning-count{padding:8px 12px;border:2px solid #c6e8ec;background:#fff;border-radius:14px;display:flex;flex-direction:column;align-items:center;gap:6px}
.learning-count-items{display:flex;justify-content:center;gap:6px;flex-wrap:wrap;max-width:520px}
.learning-pairs{display:flex;flex-wrap:wrap;gap:8px;align-items:center;justify-content:center;max-width:100%}
.learning-pair{display:flex;gap:4px;align-items:center;background:#fff;border:2px solid #cde9e5;border-radius:14px;padding:5px}
.learning-pair .small-shape{width:30px;height:30px;font-size:1.8rem}
.pair-link{color:#189a86;font-size:1.2rem;font-weight:900}
.learning-count .small-shape{width:40px;height:40px;font-size:2.2rem}
@media(max-width:680px){.learning-explanation{padding:11px 8px}.learning-pairs{gap:4px}.learning-pair{padding:3px}.learning-count .small-shape{width:32px;height:32px;font-size:1.8rem}}

/* V13 - accessible interactive matching activity */
body.v8 .pairing-board{width:100%;max-width:780px;margin:0 auto;padding:8px 4px}
.pairing-instruction{font-size:clamp(1rem,1.6vw,1.25rem);text-align:center;font-weight:700;color:#31516b;margin:5px 0 12px}
.pairing-columns{display:grid;grid-template-columns:1fr 1fr;gap:18px;align-items:start}
.pairing-column{background:#f6fcff;border:2px solid #bfe5ee;border-radius:20px;padding:12px;text-align:center}
.pairing-column strong{display:block;margin-bottom:10px;color:#194e70}
.pairing-items{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.pair-item{height:78px;min-width:0;border-radius:16px;border:3px solid #a4dce9;background:#fff;display:grid;place-items:center;cursor:pointer;transition:background .13s,border-color .13s}
.pair-item .shape{font-size:3rem;width:53px;height:53px}
.pair-item.selected{background:#fff2c0;border-color:#dba62d;box-shadow:0 0 0 2px #ffe08e}
.pair-item.paired{background:#e0f7ed;border-color:#37b785;opacity:.75;cursor:default}
.pair-item.paired::after{content:'✓';font-size:1rem;color:#146e44;position:absolute;margin:-48px -52px 0 0}
.pairing-status{min-height:30px;text-align:center;font-size:1rem;font-weight:800;color:#275a72;margin:12px 0 0}
.pair-item:focus-visible{outline:4px solid #f6ae27;outline-offset:3px}
@media(max-width:680px){.pairing-columns{gap:8px}.pairing-column{padding:7px}.pairing-items{gap:6px}.pair-item{height:64px}.pair-item .shape{width:41px;height:41px;font-size:2.5rem}body.v8 .pairing-board{padding:4px 0}.pairing-column strong{font-size:.86rem}}
@media(prefers-reduced-motion:reduce){.pair-item{transition:none}}


/* V14 curriculum games: sort by one/two attributes, click object then basket */
.sorting-board{width:100%;max-width:960px;margin:auto;display:flex;flex-direction:column;gap:16px;align-items:center}
.sort-instruction,.sort-status{margin:2px;text-align:center;font-weight:800;color:#234c64;font-size:1.12rem}
.sort-objects{display:flex;justify-content:center;gap:12px;flex-wrap:wrap;width:100%;padding:14px;background:#f2fcff;border-radius:18px;border:2px solid #d1eff5}
.sort-object{display:grid;place-items:center;min-width:80px;min-height:85px;border:3px solid #93cde0;border-radius:15px;background:#fff;cursor:pointer}
.sort-object .shape{font-size:3.5rem}
.sort-object.selected{border-color:#efb32b;background:#fff8d9;outline:3px solid #fbd66b}
.sort-object.sorted{opacity:.27;background:#e2f2e8;border-color:#48ae7e}
.sort-baskets{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;width:100%}
.sort-basket{min-height:112px;padding:18px 12px;font:inherit;font-size:1.24rem;font-weight:900;border:4px dashed #62b5d1;border-radius:20px;background:#eafbff;color:#123e57;cursor:pointer}
.sort-basket:first-child{background:#fff5d5;border-color:#efbe49}
.sort-object:focus-visible,.sort-basket:focus-visible{outline:4px solid #ffad2f;outline-offset:3px}
@media(max-width:650px){.sort-objects{gap:8px;padding:9px}.sort-object{min-width:65px;min-height:70px}.sort-object .shape{font-size:2.8rem}.sort-baskets{gap:8px}.sort-basket{min-height:98px;font-size:1.03rem;padding:8px}}
