/* ===== «كيف جت» identity: self-hosted fonts (SIL OFL) ===== */
@font-face{font-family:'Plex Arabic';src:url(fonts/ibm-plex-sans-arabic-arabic-400-normal.woff2) format('woff2');font-weight:400;font-display:swap;unicode-range:U+0600-06FF,U+0750-077F,U+08A0-08FF,U+200C-200E,U+FB50-FDFF,U+FE70-FEFC}
@font-face{font-family:'Plex Arabic';src:url(fonts/ibm-plex-sans-arabic-arabic-600-normal.woff2) format('woff2');font-weight:600;font-display:swap;unicode-range:U+0600-06FF,U+0750-077F,U+08A0-08FF,U+200C-200E,U+FB50-FDFF,U+FE70-FEFC}
@font-face{font-family:'Plex Arabic';src:url(fonts/ibm-plex-sans-arabic-arabic-700-normal.woff2) format('woff2');font-weight:700 900;font-display:swap;unicode-range:U+0600-06FF,U+0750-077F,U+08A0-08FF,U+200C-200E,U+FB50-FDFF,U+FE70-FEFC}
@font-face{font-family:'Plex Arabic';src:url(fonts/ibm-plex-sans-arabic-latin-400-normal.woff2) format('woff2');font-weight:400;font-display:swap;unicode-range:U+0000-00FF,U+2000-206F,U+2212,U+2215}
@font-face{font-family:'Plex Arabic';src:url(fonts/ibm-plex-sans-arabic-latin-600-normal.woff2) format('woff2');font-weight:600;font-display:swap;unicode-range:U+0000-00FF,U+2000-206F,U+2212,U+2215}
@font-face{font-family:'Plex Arabic';src:url(fonts/ibm-plex-sans-arabic-latin-700-normal.woff2) format('woff2');font-weight:700 900;font-display:swap;unicode-range:U+0000-00FF,U+2000-206F,U+2212,U+2215}
@font-face{font-family:'Baloo Bhaijaan';src:url(fonts/baloo-bhaijaan-2-arabic-800-normal.woff2) format('woff2');font-weight:700 900;font-display:swap;unicode-range:U+0600-06FF,U+0750-077F,U+08A0-08FF,U+200C-200E,U+FB50-FDFF,U+FE70-FEFC}
@font-face{font-family:'Baloo Bhaijaan';src:url(fonts/baloo-bhaijaan-2-latin-800-normal.woff2) format('woff2');font-weight:700 900;font-display:swap;unicode-range:U+0000-00FF,U+2000-206F}
@font-face{font-family:'Plex Arabic';src:local('STIX Two Math'),local('Cambria Math'),local('Apple Symbols'),local('Segoe UI Symbol'),local('Noto Sans Math'),local('DejaVu Sans');unicode-range:U+2227-2228} /* logic ∧ ∨: a math face so they never read as ٨ ٧ */
:root{--ink:#213a36;--muted:#5e6f68;--paper:#f9f8f4;--line:#e1e3da;--brand:#315e49;--brand-d:#1d3d2d;--accent:#7a5cc0;--accent-soft:#efe9fb;--ok:#3f7a37;--ok-bg:#e5f1dc;--warn-bg:#fff2dc;--warn:#6e4d1c;--heat:#e07b3c;--cool:#4f8fc0;--ease:cubic-bezier(.2,.8,.2,1);--bounce:cubic-bezier(.3,1.5,.5,1)}
.cinema.heat{--accent:#2f8f73;--accent-soft:#e2f3ec}
*{box-sizing:border-box}
body{margin:0;background:#e9ebe5;color:var(--ink);font-family:"SF Arabic","Segoe UI",Tahoma,Arial,sans-serif;font-size:16px;-webkit-font-smoothing:antialiased}
button,a{-webkit-tap-highlight-color:transparent}button{font:inherit;cursor:pointer;color:inherit}
button:focus-visible,a:focus-visible,[tabindex]:focus-visible{outline:3px solid #285cbb;outline-offset:3px}
h1:focus,h1:focus-visible{outline:none}
button:disabled{cursor:default;opacity:.5}
.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.shell{max-width:480px;margin:auto;background:radial-gradient(ellipse at 90% 0,var(--accent-soft) 0,transparent 50%),var(--paper)}

/* ===== pages (home, book, complete) ===== */
.shell.page{min-height:100dvh;padding:18px 20px 40px}
.top{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:14px}
.brand{font-size:23px;font-weight:900;color:#264d44;text-decoration:none}
.badge{font-size:11px;background:#fff;padding:7px 10px;border-radius:20px;color:var(--muted)}
.eyebrow{font-size:12px;color:var(--muted);margin:0 0 6px;font-weight:600}
.title{font-size:31px;line-height:1.35;margin:0 0 12px}.title.center{text-align:center}
.intro{color:var(--muted);line-height:1.85;font-size:15px}
.note{font-size:12px;line-height:1.8;color:var(--muted)}
.mascot{width:110px;height:120px;flex-shrink:0;overflow:visible}
.mascot .m-all{transform-box:fill-box;transform-origin:50% 100%;animation:breathe 3.6s ease-in-out infinite}
.mascot .m-eyes{transform-box:fill-box;transform-origin:center;animation:blink 4.5s infinite}
.mascot.mood-happy .m-all{animation:hop .55s var(--bounce) 1}
.mascot.mood-oops .m-all{animation:tilt .5s ease 1}
.mascot.mood-think .m-dots circle{animation:dot 1.2s ease-in-out infinite}.mascot.mood-think .m-dots circle:nth-child(2){animation-delay:.2s}.mascot.mood-think .m-dots circle:nth-child(3){animation-delay:.4s}
.character-row{display:flex;justify-content:center;margin:10px 0 22px}.character-row .mascot{width:120px;height:130px}
.subject{display:flex;align-items:center;gap:14px;width:100%;text-align:right;margin-bottom:14px;padding:14px;border-radius:22px;border:2px solid #dcd3f6;border-bottom-width:5px;background:#f3eeff}
.subject.heat{border-color:#c0e2d4;background:#e8f6f0}.subject:active{transform:translateY(2px);border-bottom-width:3px}
.subject .mascot{width:76px;height:80px}.subject small{font-size:11px;color:var(--muted)}
.subject strong{display:block;font-size:19px;margin:2px 0 4px}.subject p{margin:0;font-size:13px;line-height:1.7;color:#5f6b65}
.subject .arrow{margin-right:auto;font-size:24px;color:#7c8b82}
.done-tag{display:inline-block;margin-top:6px;font-size:12px;font-weight:700;color:var(--ok);background:var(--ok-bg);padding:3px 9px;border-radius:9px}
.resume{width:100%;min-height:54px;border-radius:16px;background:var(--ok-bg);color:#2f5434;border:2px solid #b9d3ad;margin:0 0 14px;padding:12px;text-align:right;font-weight:700}
.text-btn{display:block;margin:6px auto;background:none;border:0;color:#3f6b4c;text-decoration:underline;min-height:46px;padding:8px 12px}
.text-link{color:var(--brand);display:inline-flex;min-height:44px;align-items:center}
.primary{flex:1;width:100%;min-height:56px;background:var(--brand);color:#fff;font-weight:800;font-size:17px;border:0;border-bottom:5px solid var(--brand-d);border-radius:16px;padding:12px 18px}
.primary:active:not(:disabled){transform:translateY(2px);border-bottom-width:3px}
.primary.go{background:#3f8a3a;border-color:#2a6526;animation:pop .35s var(--bounce) both}
.primary.ready{animation:nudge .5s ease 1}
.success-mascot{position:relative;text-align:center;margin:10px auto 0;width:170px}.success-mascot .mascot{width:150px;height:160px}
.success-mascot i{position:absolute;width:10px;height:10px;border-radius:3px;background:#e8b84a;top:40%;left:50%;opacity:0;animation:burst 1s var(--ease) .2s both}
.success-mascot i:nth-of-type(1){--x:70px;--y:-60px}.success-mascot i:nth-of-type(2){background:#7a5cc0;--x:-70px;--y:-50px}.success-mascot i:nth-of-type(3){background:#3f8a3a;--x:-60px;--y:20px}.success-mascot i:nth-of-type(4){background:#e07b3c;--x:65px;--y:15px}
.reflect{text-align:center;font-weight:700;color:var(--accent);margin:0 0 10px}
.result{padding:18px;background:#fff;border:2px solid var(--line);border-radius:22px;margin:14px 0;line-height:1.9}
.result small{color:var(--muted);font-size:12px}.result strong{display:block;font-size:17px;line-height:1.8}
.result ul,.book-card ul{margin:8px 0 0;padding-inline-start:20px;font-size:14px;color:#4b5a54}
.challenge{background:var(--accent-soft);border-radius:18px;padding:14px 16px;margin-bottom:16px}.challenge p{margin:4px 0 0;line-height:1.8;font-size:14px}
.book-card{display:flex;gap:12px;background:#fff;border:1px solid var(--line);border-radius:20px;padding:16px;margin:14px 0}
.book-card .mascot{width:64px;height:70px}.book-card h2{font-size:19px;margin:0 0 6px}.book-card .rule{margin:0;line-height:1.8;font-weight:600;font-size:14px}.book-card .text-btn{margin:6px 0 0}
.empty{padding:30px 15px;text-align:center;line-height:1.9}

/* ===== lesson: three fixed zones, no page scroll ===== */
.shell.lesson{height:100dvh;display:flex;flex-direction:column;overflow:hidden;padding:10px 14px max(10px,env(safe-area-inset-bottom))}
.lesson-top{margin-bottom:8px;flex:none}
.icon-btn{min-width:44px;min-height:44px;border-radius:14px;border:1px solid #d9ded5;background:#fff;font-size:18px}
.exit{min-height:44px;border:0;background:none;color:var(--muted);font-size:13px;white-space:nowrap}
.steps{display:flex;gap:4px;flex:1}.steps i{height:8px;flex:1;border-radius:9px;background:#e0e3dc}
.steps i.done{background:#6b9354}.steps i.now{background:linear-gradient(90deg,#e0e3dc 0 45%,#6b9354 45%)}

.stage-wrap{position:relative;flex:0 1 auto;height:min(98vw,470px);min-height:170px;border-radius:26px;background:#fff;border:2px solid var(--line);overflow:hidden;transition:border-color .4s,box-shadow .4s}
.stage-wrap.mode-do{border-color:var(--accent);box-shadow:0 0 0 4px var(--accent-soft)}
.ph0 .stage-wrap,.ph1 .stage-wrap{background:linear-gradient(#fff,#fbf8f1)}
.stage{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;padding:26px 8px 8px}
.scene{width:100%;height:100%;max-height:100%;overflow:visible}
.mode-badge{position:absolute;top:10px;right:12px;z-index:4;font-size:12px;font-weight:800;padding:4px 10px;border-radius:10px;background:var(--accent);color:#fff}
.mode-badge.watch{background:#eef0ea;color:var(--muted)}
.info-chip{position:absolute;top:6px;left:8px;z-index:5;width:36px;height:36px;border-radius:50%;border:1px solid var(--line);background:#fff;color:var(--muted);font-size:16px}
.info-pop{position:absolute;top:46px;left:8px;right:8px;z-index:6;background:#fff;border:1px solid var(--line);border-radius:14px;padding:10px 12px;font-size:13px;line-height:1.8;box-shadow:0 8px 24px #0000001a}

.subtitle{flex:none;display:flex;align-items:center;gap:10px;min-height:64px;padding:10px 4px 6px;transition:opacity .35s,transform .35s var(--ease)}
.subtitle.pending{opacity:0;transform:translateY(6px)}
.subtitle .face .mascot{width:44px;height:48px}
.subtitle .cap{margin:0;font-size:17px;line-height:1.65;font-weight:700;flex:1}
.subtitle .cap b{color:var(--accent)}
.subtitle.success,.subtitle.retry,.subtitle.info{border-radius:16px;padding:10px 12px;margin-top:8px;animation:slide-up .3s var(--ease) both}
.subtitle.success{background:var(--ok-bg);color:#284d23}.subtitle.retry{background:var(--warn-bg);color:var(--warn)}.subtitle.info{background:#eaf1f6;color:#294a5f}
.subtitle.success .cap,.subtitle.retry .cap,.subtitle.info .cap{font-size:15px;font-weight:600}
.ph0 .subtitle{opacity:0;transition:opacity .5s}.ph0 .subtitle.shown{opacity:1}
.ph0 .subtitle .cap.lead{text-align:center;font-weight:600;font-size:16px}
.ph1 .subtitle{flex-direction:column;align-items:stretch;gap:2px;text-align:center}
.ph1 .subtitle .ctx{margin:0;font-size:14px;color:var(--muted);line-height:1.7}
.ph1 .subtitle .q{margin:0;font-size:24px;line-height:1.45}
.guess-react{margin:2px 0 0;font-size:13px;font-weight:700;color:var(--accent)}

.action{flex:none;display:flex;flex-direction:column;gap:8px;padding-top:6px;margin-top:auto}
.row{display:flex;gap:10px}
.help-btn{min-height:56px;padding:0 14px;border-radius:16px;border:2px solid var(--line);border-bottom-width:5px;background:#fff;font-weight:700;white-space:nowrap}
.help-btn.nudge{border-color:var(--accent);color:var(--accent);animation:nudge 1.4s ease-in-out 2}
.row .help-btn:only-child{margin-inline-end:auto}
.skip{align-self:center;min-height:36px;border:0;background:none;color:var(--muted);font-size:13px}
.dots{display:flex;justify-content:center;gap:7px}.dots i{width:8px;height:8px;border-radius:50%;background:#d8dcd3;transition:all .3s}.dots i.seen{background:#9fb59a}.dots i.on{width:22px;border-radius:6px;background:var(--accent)}
.guess{display:flex;align-items:center;justify-content:center;gap:8px;flex-wrap:wrap;font-size:13px;font-weight:700}
.chips{display:flex;gap:6px}
.chip{min-height:44px;min-width:58px;padding:6px 12px;border-radius:14px;border:2px solid var(--line);border-bottom-width:4px;background:#fff;font-weight:700}
.chip[aria-pressed=true]{border-color:var(--accent);background:var(--accent-soft);color:var(--accent)}
.tools{display:flex;align-items:center;justify-content:space-between;gap:10px}
.tool{min-height:52px;min-width:60px;padding:0 14px;border-radius:16px;border:2px solid #d8cff0;border-bottom-width:5px;background:var(--accent-soft);color:var(--accent);font-weight:800;font-size:16px}
.tool:active:not(:disabled){transform:translateY(2px);border-bottom-width:3px}
.tool.wide{width:100%}.tool.pulse{animation:pulse 1.6s ease-in-out infinite}
.tools output{font-size:14px;color:var(--muted)}.tools output b{font-size:22px;color:var(--ink)}
.choices{display:grid;gap:8px}
.choices.slide-in .choice{animation:slide-up .35s var(--ease) both}.choices.slide-in .choice:nth-child(2){animation-delay:.07s}.choices.slide-in .choice:nth-child(3){animation-delay:.14s}
.choice{min-height:50px;border:2px solid var(--line);border-bottom-width:4px;border-radius:14px;background:#fff;padding:8px 14px;text-align:right;line-height:1.5;font-weight:600;font-size:15px}
.choice[aria-pressed=true]{border-color:var(--accent);background:var(--accent-soft)}
.reveal{min-height:46px;border-radius:12px;border:1px solid #d5b277;background:#fff;color:var(--warn);font-weight:700}

/* overlays: hero character, title card, coach hand */
.hero-buddy{position:absolute;z-index:3;left:50%;top:50%;transform:translate(-50%,-50%) scale(1.35);transition:all .7s var(--ease);pointer-events:none}
.hero-buddy .mascot{width:120px;height:126px;animation:enter .7s var(--bounce) both}
.hero-buddy.corner{left:10px;top:6px;transform:none}.hero-buddy.corner .mascot{width:58px;height:62px}
.ph1:not(.x) .stage{transition:opacity .5s}
.ph1 .stage-wrap:has(.hero-buddy:not(.corner)) .stage{opacity:.18}
.title-card{position:absolute;inset:0;z-index:7;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;border:0;background:radial-gradient(ellipse,var(--accent-soft),#fff 75%);animation:fade .3s ease both;text-align:center}
.title-card.out{animation:fade-out .28s ease both}
.title-card .mascot{width:96px;height:100px}
.title-card small{font-size:14px;font-weight:800;color:var(--accent)}
.title-card b{font-size:24px;line-height:1.4;animation:rise .45s var(--ease) .15s both}
.title-card .tc-sub{font-size:15px;color:var(--muted)}
.title-card em{font-style:normal;font-size:12px;color:var(--muted);margin-top:10px}
.coach-hand{position:absolute;z-index:6;font-size:30px;pointer-events:none;animation:tap 1.3s ease-in-out infinite;filter:drop-shadow(0 2px 2px #0003)}
.coach-hand.drag{animation:dragy 1.6s ease-in-out infinite}

/* title stage (phase 0) */
.title-stage{display:flex;flex-direction:column;align-items:center;text-align:center;gap:2px;width:100%}
.big-char .mascot{width:130px;height:136px;animation:enter .7s var(--bounce) both}
.kicker{margin:0;font-size:13px;color:var(--muted);font-weight:700;animation:rise .45s var(--ease) .3s both}
.lesson-title{margin:0;font-size:30px;animation:rise .45s var(--ease) .4s both}
.minis{display:flex;gap:10px;margin-top:10px}
.mini{width:130px;background:#faf8f2;border:1px solid var(--line);border-radius:14px;padding:6px;animation:rise .45s var(--ease) var(--d) both}
.mini-art{height:52px;display:flex;align-items:center;justify-content:center}.mini-art svg{height:52px;width:auto;max-width:100%}
.mini span{font-size:12px;font-weight:700}

/* ===== ratio scene ===== */
.ratio-scene .plate{fill:#ebe5d8}
.ratio-scene .slot{fill:#fffaf0;stroke:#c7ae86;stroke-width:1.5;stroke-dasharray:4 3}
.ratio-scene .slice{fill:#f2c27b;stroke:#c98b3f;stroke-width:2;opacity:0}
.ratio-scene .slice.on{opacity:1}
.ratio-scene .slice.on.fly{animation:fly .65s var(--ease) var(--dl,0s) both}
.ratio-scene .q{font-size:22px;font-weight:900;fill:var(--accent);text-anchor:middle;animation:bob 1.6s ease-in-out infinite}
.ratio-scene .lab{font-size:14px;font-weight:800;fill:#5c7a42;text-anchor:middle}
.ratio-scene .lab.show{animation:pop .35s var(--bounce) var(--dl,0s) both}
.ratio-scene .bag-t{font-size:13px;font-weight:800;fill:#8a6431;text-anchor:middle}
.ratio-scene .bag.target{cursor:pointer}
.ratio-scene .bag.target>path:first-of-type{animation:glowfill 1.6s ease-in-out infinite}
.ratio-scene .bag:active{transform:translateY(2px)}
.ratio-scene .sw.hinting .slot{stroke:var(--accent);stroke-width:2.5;animation:blinkop 1s ease-in-out infinite}
.ratio-scene .xlab{font-size:12px;font-weight:700;fill:#a2602b;text-anchor:middle}
.stage-card{position:absolute;bottom:12px;left:0;right:0;margin:auto;width:max-content;background:var(--accent-soft);border:2px solid #d8cff0;border-radius:16px;padding:6px 18px;text-align:center;white-space:nowrap}
.stage-card small{display:block;font-size:12px;color:var(--muted);font-weight:700}
.stage-card b{font-size:26px;color:#3e2f6e}
.stage-card.late{animation:pop .45s var(--bounce) .5s both}.stage-card.pop{animation:pop .45s var(--bounce) both}
.ph3 .ratio-scene,.ph2 .ratio-scene{padding-bottom:0}
.ratio .stage:has(.stage-card) .scene{height:calc(100% - 64px);align-self:flex-start}

/* ===== picture scene ===== */
.picture-scene .grid line{stroke:#ffffffb0;stroke-width:1}
.picture-scene .dim{font-size:13px;font-weight:800;fill:#4d5c56;text-anchor:middle}
.picture-scene .cap{font-size:12px;fill:var(--muted);text-anchor:middle}
.picture-scene .arrow-t{font-size:20px;fill:#a0aaa3;text-anchor:middle}
.picture-scene .x2{fill:var(--accent);font-weight:900;font-size:12px;text-anchor:middle}
.picture-scene .handle{cursor:ns-resize;touch-action:none}
.picture-scene .pill{fill:var(--accent);animation:glowfill2 1.6s ease-in-out infinite}
.sun-chip{position:absolute;top:10px;left:50%;transform:translateX(-50%);font-size:13px;font-weight:800;padding:4px 12px;border-radius:12px;background:#fff3dc;color:#7a5418;white-space:nowrap}
.sun-chip[data-s=round]{background:var(--ok-bg);color:var(--ok)}
.ratio.ph4 .stage{padding-top:40px}

/* ===== heat scene ===== */
.heat-scene .hobj.target{cursor:pointer}
.heat-scene .actor{opacity:0;transform:translateY(-22px)}
.heat-scene .actor.in{opacity:1;transform:none}
.heat-scene .actor.in.just{animation:reach .55s var(--ease) both}
.heat-scene .ring{fill:none;stroke:var(--accent);stroke-width:2.5;stroke-dasharray:6 6;opacity:0}
.heat-scene .hobj.target:not(.touched) .ring{animation:ringpulse 1.8s ease-in-out infinite}
.flow-arrow{fill:none;stroke:var(--heat);stroke-width:4;stroke-linecap:round;stroke-dasharray:7 5}
.flow-arrow.fast{animation:dash .45s linear infinite}.flow-arrow.slow{animation:dash 1.6s linear infinite}
.flow-arrow.just{opacity:0;animation:fade .3s ease .45s both,dash .45s linear infinite}
.skin .skin-fill{fill:#f0a35c;transform-box:fill-box;transform-origin:50% 100%;transition:none}
.skin.fast .skin-fill{transform:scaleY(.32);fill:#7fb4d8}.skin.slow .skin-fill{transform:scaleY(.8);fill:#f0b77a}
.skin.fast.just .skin-fill{animation:cool-fast 1.1s var(--ease) .5s both}.skin.slow.just .skin-fill{animation:cool-slow 2.2s ease .5s both}
.g-lab{font-size:10px;fill:var(--muted);text-anchor:middle}
.desc{font-size:12px;font-weight:800;text-anchor:middle}.desc.fast{fill:#2f6f9a}.desc.slow{fill:#a2602b}
.desc.just{animation:fade .4s ease 1.3s both}
.oname{font-size:15px;font-weight:800;fill:var(--ink);text-anchor:middle}
.t-lab{font-size:11px;font-weight:800;fill:#7a3f22;text-anchor:middle}
.th{animation:pop .4s var(--bounce) both}
.th.settle .thermo.a .merc{animation:settle-a 1.6s var(--ease) .5s both}.th.settle .thermo.b .merc{animation:settle-b 1.6s var(--ease) .5s both}
.th.settle .t-lab{animation:fade .4s ease 1.9s both}
.clock .hand-h{transform-origin:0 0;animation:spin 1.6s linear 1}
.compare .sym{font-size:30px;font-weight:900;text-anchor:middle;fill:var(--accent);animation:pop .4s var(--bounce) .3s both}.compare .ne{fill:#2f6f9a;animation-delay:.6s}
.mini-scene{height:52px;width:auto}

/* help sheet */
.sheet-backdrop{position:fixed;inset:0;background:#1b2b2566;z-index:8}
.sheet{position:fixed;bottom:0;left:50%;width:min(480px,100%);transform:translate(-50%,100%);transition:transform .35s var(--ease);background:#fff;border-radius:24px 24px 0 0;padding:8px 16px max(20px,env(safe-area-inset-bottom));z-index:9;max-height:85dvh;overflow:auto}
.sheet.open{transform:translate(-50%,0)}
.sheet-grip{width:44px;height:5px;border-radius:5px;background:#d8dcd3;margin:4px auto 8px}
.sheet-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px}
.sheet-options{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.sheet-options button{min-height:56px;border-radius:14px;border:2px solid var(--line);border-bottom-width:4px;background:#fff;font-weight:700;font-size:14px;display:flex;align-items:center;gap:8px;justify-content:center}
.sheet-options button span{font-size:18px;color:var(--accent)}.sheet-options button.on{border-color:var(--accent);background:var(--accent-soft)}
.help-card{display:flex;gap:10px;align-items:flex-start;margin-top:14px;background:#f6f2e6;border-radius:16px;padding:12px;animation:rise .35s var(--ease) both}
.help-card p{margin:0;line-height:1.85;font-size:15px}.help-face .mascot{width:50px;height:54px}

/* motion */
@keyframes rise{from{opacity:0;transform:translateY(12px)}to{opacity:1;transform:none}}
@keyframes enter{from{opacity:0;transform:translateY(24px) scale(.85)}to{opacity:1;transform:none}}
@keyframes fade{from{opacity:0}to{opacity:1}}@keyframes fade-out{to{opacity:0}}
@keyframes pop{0%{opacity:0;transform:scale(.6)}100%{opacity:1;transform:none}}
@keyframes fly{from{transform:translate(var(--fx),var(--fy)) scale(.7);opacity:0}20%{opacity:1}to{transform:none;opacity:1}}
@keyframes breathe{50%{transform:translateY(-2px) scaleY(1.015)}}
@keyframes blink{0%,94%,100%{transform:scaleY(1)}97%{transform:scaleY(.1)}}
@keyframes hop{40%{transform:translateY(-12px) rotate(-4deg)}}
@keyframes tilt{30%{transform:rotate(-6deg)}70%{transform:rotate(4deg)}}
@keyframes dot{50%{opacity:.25}}
@keyframes bob{50%{transform:translateY(-4px)}}
@keyframes blinkop{50%{stroke-opacity:.3}}
@keyframes slide-up{from{opacity:0;transform:translateY(10px)}}
@keyframes nudge{50%{transform:scale(1.04)}}
@keyframes pulse{50%{box-shadow:0 0 0 6px var(--accent-soft)}}
@keyframes glowfill{50%{fill:#f6e2b8}}
@keyframes glowfill2{50%{opacity:.7}}
@keyframes ringpulse{0%,100%{opacity:.25}50%{opacity:.9}}
@keyframes tap{0%,100%{transform:translateY(0) scale(1)}45%{transform:translateY(6px) scale(.9)}60%{transform:translateY(6px) scale(.9)}}
@keyframes dragy{0%,100%{transform:translateY(0)}50%{transform:translateY(-26px)}}
@keyframes reach{from{opacity:0;transform:translateY(-22px)}to{opacity:1;transform:none}}
@keyframes dash{to{stroke-dashoffset:-24}}
@keyframes cool-fast{from{transform:scaleY(1);fill:#f0a35c}to{transform:scaleY(.32);fill:#7fb4d8}}
@keyframes cool-slow{from{transform:scaleY(1);fill:#f0a35c}to{transform:scaleY(.8);fill:#f0b77a}}
@keyframes settle-a{from{height:30px;y:4px}to{height:20px;y:14px}}
@keyframes settle-b{from{height:8px;y:26px}to{height:20px;y:14px}}
@keyframes spin{to{transform:rotate(360deg)}}
@keyframes burst{0%{opacity:1;transform:translate(0,0) scale(.4)}100%{opacity:0;transform:translate(var(--x),var(--y)) rotate(180deg)}}
@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{animation:none!important;transition:none!important}
  .subtitle.pending{opacity:1;transform:none}
  .flow-arrow.just,.desc.just{opacity:1}
  .coach-hand{display:none}
}
@media (max-height:700px){.subtitle .cap{font-size:15px}.ph1 .subtitle .q{font-size:20px}.primary,.help-btn{min-height:50px}.tool{min-height:46px}.choice{min-height:44px;font-size:14px}.subtitle{min-height:54px;padding-top:6px}.lesson-title{font-size:26px}.big-char .mascot{width:100px;height:106px}}

.nw{white-space:nowrap;unicode-bidi:isolate}

/* ===== engine v3: home grouping, math typography ===== */
.grade-h{font-size:14px;color:var(--muted);margin:22px 0 10px;font-weight:800;letter-spacing:.02em}
.grade-h:first-of-type{margin-top:8px}
.as-link{display:flex;align-items:center;justify-content:center;text-decoration:none;text-align:center}
.frac{display:inline-flex;flex-direction:column;align-items:center;vertical-align:middle;line-height:1.05;font-size:.82em;margin:0 2px}
.frac>span:first-child{border-bottom:2px solid currentColor;padding:0 3px}
sup{font-size:.62em;line-height:0;vertical-align:.9em}
.stage-card b .frac{font-size:.7em}
.tc-char{display:block}
.help-out{min-height:4px}

/* tools for the new steps */
.order-chips{flex-wrap:wrap;justify-content:center;gap:8px}
.chip.big{min-height:52px;min-width:92px;font-size:17px;direction:rtl}
.chip.big:disabled{opacity:.35;border-style:dashed}
.tool.ghost{background:#fff;border-color:var(--line);color:var(--muted);min-height:44px;font-size:14px}
.calc{margin:0;text-align:center;font-weight:800;font-size:16px}
.tools output.expr{flex:1;text-align:center;font-size:17px;font-weight:800;color:var(--ink);line-height:1.4}
.ops{display:grid;gap:8px}
.op{width:100%;text-align:right;font-size:16px}
.pulse-eq{width:100%;height:100%;animation:eq-pulse 1.2s ease-in-out 2}

/* ===== growth scene (powers) ===== */
.growth-scene .you-t{font-size:12px;font-weight:800;fill:var(--muted);text-anchor:middle}
.growth-scene .fan path{stroke:var(--accent);stroke-width:2;stroke-dasharray:4 4;fill:none;opacity:.6}
.growth-scene .dots circle{fill:var(--accent)}
.growth-scene .round.just .dots circle{animation:pop .4s var(--bounce) calc(var(--i) * 18ms) both}
.growth-scene .r-lab{font-size:19px;font-weight:900;fill:var(--ink);text-anchor:middle}
.growth-scene .r-sub{font-size:11px;font-weight:700;fill:var(--muted);text-anchor:middle}
.growth-scene .r-top{font-size:12px;font-weight:700;fill:var(--muted);text-anchor:middle}
.growth-scene .round.just .r-lab{animation:fade .4s ease .5s both}

/* ===== cube scene (powers transfer) ===== */
.cube-scene .box-outline .ol,.cube-scene .box-outline path{fill:none;stroke:var(--accent);stroke-width:1.6;stroke-dasharray:5 4;opacity:.75}
.cube-scene .top{fill:#cdbff0;stroke:#fff;stroke-width:1}
.cube-scene .right{fill:#9a82d6;stroke:#fff;stroke-width:1}
.cube-scene .left{fill:#7a5cc0;stroke:#fff;stroke-width:1}
.cube-scene .layer.just{animation:drop .5s var(--bounce) both}
.cube-scene .dim{font-size:14px;font-weight:900;fill:var(--ink);text-anchor:middle}

/* ===== number line (rational) ===== */
.nl-scene .axis{stroke:var(--ink);stroke-width:2.5}
.nl-scene .axis-head{fill:var(--ink)}
.nl-scene .tick{stroke:var(--ink);stroke-width:2}.nl-scene .tick.minor{stroke:#a9b3ad;stroke-width:1.2}.nl-scene .tick.zero{stroke-width:3}
.nl-scene .t-num{font-size:14px;font-weight:700;fill:var(--ink);text-anchor:middle}.nl-scene .t-num.zero{font-weight:900}
.nl-scene .pt circle{stroke:#fff;stroke-width:2.5}
.nl-scene .pt.a circle{fill:#7a5cc0}.nl-scene .pt.b circle{fill:#d0683a}.nl-scene .pt.c circle{fill:#2f8f73}
.nl-scene .pt.a .p-val,.nl-scene .pt.a .p-name{fill:#5b3fa3}.nl-scene .pt.b .p-val,.nl-scene .pt.b .p-name{fill:#a74c22}.nl-scene .pt.c .p-val,.nl-scene .pt.c .p-name{fill:#1f6e57}
.nl-scene .pt.a .p-bar{stroke:#5b3fa3}.nl-scene .pt.b .p-bar{stroke:#a74c22}.nl-scene .pt.c .p-bar{stroke:#1f6e57}
.nl-scene .stem{stroke:#c9cfc8;stroke-width:1.5;stroke-dasharray:3 3}
.nl-scene .p-val{font-size:15px;font-weight:900;text-anchor:middle}
.nl-scene .p-bar{stroke-width:2}
.nl-scene .p-name{font-size:11px;font-weight:800;text-anchor:middle}
.nl-scene .p-ord{font-size:12px;font-weight:900;fill:var(--muted);text-anchor:middle}
.nl-scene .pt.just{animation:drop .5s var(--bounce) both}
.nl-scene .end-l,.nl-scene .end-r{font-size:12px;font-weight:800;fill:var(--muted)}
.nl-scene .zoom-l{font-size:11px;font-weight:700;fill:var(--muted);text-anchor:middle}

/* ===== battery (rational transfer) ===== */
.batt-scene .batt-fill{fill:#6ea85f}
.batt-scene .b-val{font-size:17px;font-weight:900;fill:var(--ink);text-anchor:middle}
.batt-scene .b-bar{stroke:var(--ink);stroke-width:2}
.batt-scene .b-name{font-size:12px;font-weight:700;fill:var(--muted);text-anchor:middle}
.batt-scene .b-q{font-size:30px;font-weight:900;fill:var(--accent);text-anchor:middle;animation:bob 1.6s ease-in-out infinite}

/* ===== balance (equations) ===== */
.bal-scene .stand{fill:#c9d0c6}
.bal-scene .pivot{fill:var(--ink)}
.bal-scene .beam{stroke:var(--ink);stroke-width:6;stroke-linecap:round}
.bal-scene .rope{stroke:#9aa59e;stroke-width:1.5}
.bal-scene .dish{fill:#e7e2d4;stroke:#b8ad91;stroke-width:1.5}
.bal-scene .bag{fill:#e9cf9c;stroke:#a97c3d;stroke-width:2}
.bal-scene .bag-tie{fill:none;stroke:#a97c3d;stroke-width:2}
.bal-scene .blk{fill:var(--accent-soft);stroke:var(--accent);stroke-width:2}
.bal-scene .it-t{font-size:15px;font-weight:900;fill:var(--ink);text-anchor:middle}
.bal-scene .item.lift{animation:lift-off .9s var(--ease) .35s both}
.bal-scene .bal-eq{font-size:22px;font-weight:900;fill:var(--accent);text-anchor:middle}
.bal-scene.tilted .bal-eq{fill:#b5532a}
.bal-scene.tilted .beam{stroke:#b5532a}
.bal-scene .bal-note{font-size:11px;fill:var(--muted);text-anchor:middle}

@keyframes drop{from{opacity:0;transform:translateY(-18px)}to{opacity:1;transform:none}}
@keyframes lift-off{0%{opacity:1;transform:none}100%{opacity:0;transform:translateY(-38px)}}
@keyframes eq-pulse{50%{transform:scale(1.03)}}
@media (prefers-reduced-motion:reduce){
  .bal-scene .item.lift{opacity:.28}
  .bal-scene .item.lift .blk,.bal-scene .item.lift .bag{stroke-dasharray:4 3}
}

/* ===== interface constants: touch states, mistake shake, sound toggle ===== */
.choice:active:not(:disabled),.chip:active:not(:disabled),.op:active:not(:disabled){transform:translateY(2px);border-bottom-width:2px}
.shake{animation:shake .38s ease 1}
@keyframes shake{20%{transform:translateX(-6px)}40%{transform:translateX(5px)}60%{transform:translateX(-3px)}80%{transform:translateX(2px)}}
.lesson-top .sound-btn{min-width:44px;font-size:16px;background:#fff}
.lesson-top .sound-btn[aria-pressed=false]{opacity:.6}
.mascot.mood-oops .m-all{animation:perk .45s var(--ease) 1}
@keyframes perk{40%{transform:translateY(-4px)}}

/* ===== lesson kit: tappable objects, sorting ===== */
.tap{cursor:pointer;outline:none}
.tap .hit{fill:transparent}
.tap .ring{fill:none;stroke:var(--accent);stroke-width:2.5;stroke-dasharray:6 6;opacity:.35}
.tap.coach .ring{animation:ringpulse 1.8s ease-in-out infinite}
.tap:focus-visible .ring{opacity:1;stroke-dasharray:none}
.tap:active>*:first-child{transform:translateY(2px)}
.tap.done{cursor:default}
.bins-row{display:flex;gap:8px}.bins-row .tool{flex:1;font-size:15px;padding:0 8px}
.sort-scene .bin rect{fill:#f6f4ee;stroke:var(--line);stroke-width:2}
.sort-scene .bin-t{font-size:14px;font-weight:900;fill:var(--ink);text-anchor:middle}
.sort-scene .slip rect{fill:var(--accent-soft);stroke:var(--accent);stroke-width:1.5}
.sort-scene .slip text{font-size:12px;font-weight:800;fill:var(--ink);text-anchor:middle}
.sort-scene .slip.just{animation:drop .4s var(--bounce) both}
.sort-scene .slip.ok rect{fill:var(--ok-bg);stroke:var(--ok)}

/* ===== shared scenes (scenes-kit.mjs) ===== */
.scene .lab{font-size:12px;fill:var(--muted);text-anchor:middle}
.scene .dim{font-size:14px;font-weight:900;fill:var(--ink);text-anchor:middle}
.scene .dimline{stroke:var(--muted);stroke-width:1.5;fill:none}.scene .dimline.dash{stroke-dasharray:4 4}
.scene .t-num{font-size:12px;font-weight:700;fill:var(--ink);text-anchor:middle}
.scene .g-name{font-size:13px;font-weight:800;fill:var(--muted);text-anchor:middle}
.scene .hub{fill:var(--ink)}
.scene .axis{stroke:var(--ink);stroke-width:2}
:is(.bar-scene,.flow-scene,.layers-scene,.cards-scene,.force-scene,.shape-scene,.beaker-scene,.circuit-scene,.atom-scene) .just{transform-box:fill-box;transform-origin:center;animation:pop .45s var(--bounce) both}
.bar-scene .seg rect{stroke:#fff;stroke-width:2}
.bar-scene .seg.a rect{fill:#b9a5e6}.bar-scene .seg.b rect{fill:#f2c27b}.bar-scene .seg.c rect{fill:#8fcbb3}.bar-scene .seg.d rect{fill:#e9e6dc}
.bar-scene .seg.ghost rect{fill:#fff;stroke:#b8b0cf;stroke-dasharray:4 3}
.bar-scene .seg-t{font-size:13px;font-weight:900;fill:var(--ink);text-anchor:middle}
.bar-scene .bar-name{font-size:12px;font-weight:800;fill:var(--muted)}
.grid-scene .cell{fill:#fff;stroke:#d7dad2;stroke-width:1}
.grid-scene .cell.on.a{fill:#b9a5e6}.grid-scene .cell.on.b{fill:#f2c27b}.grid-scene .cell.on.c{fill:#8fcbb3}
.grid-scene .cell.just{animation:fade .3s ease calc(var(--i) * 12ms) both}
.coord-scene .grid-l{stroke:#eceee8;stroke-width:1}
.coord-scene .ax-name{font-size:13px;font-weight:900;fill:var(--ink)}
.coord-scene .plot{stroke-width:3;stroke-linecap:round}.coord-scene .plot.a{stroke:#7a5cc0}.coord-scene .plot.b{stroke:#d0683a}.coord-scene .plot.dash{stroke-dasharray:6 5}
.coord-scene .plot.just{stroke-dasharray:400;animation:draw .8s var(--ease) both}
.coord-scene .pt circle,.chart-scene .pt circle{stroke:#fff;stroke-width:2}
:is(.coord-scene,.chart-scene) .pt.a circle{fill:#7a5cc0}:is(.coord-scene,.chart-scene) .pt.b circle{fill:#d0683a}:is(.coord-scene,.chart-scene) .pt.c circle{fill:#2f8f73}
.coord-scene .p-val{font-size:12px;font-weight:900;fill:var(--ink);text-anchor:middle}
.chart-scene .bar rect{fill:#b9a5e6}.chart-scene .bar.b rect{fill:#f2c27b}.chart-scene .bar.hi rect{fill:#7a5cc0}
.chart-scene .bar.just rect{transform-box:fill-box;transform-origin:50% 100%;animation:grow-y .5s var(--ease) both}
.chart-scene .bar-v{font-size:12px;font-weight:900;fill:var(--ink);text-anchor:middle}
.chart-scene .bar-l{font-size:11px;font-weight:700;fill:var(--muted);text-anchor:middle}
.chart-scene .unit{font-size:11px;fill:var(--muted)}
.chart-scene .line-path{fill:none;stroke:#7a5cc0;stroke-width:3;stroke-linejoin:round}
.chart-scene .pt.hi circle{fill:#d0683a}
.gauge-scene .zone{fill:none;stroke-width:14;stroke-linecap:butt}.gauge-scene .zone.base{stroke:#eceee8}
.gauge-scene .zone.a{stroke:#e8a0a0}.gauge-scene .zone.b{stroke:#bfe0a8}.gauge-scene .zone.c{stroke:#a9c6ec}.gauge-scene .zone.d{stroke:#f2d38f}
.gauge-scene .tick{stroke:var(--ink);stroke-width:2}
.gauge-scene .needle{stroke:#b5532a;stroke-width:4;stroke-linecap:round}
.gauge-scene .g-val{font-size:20px;font-weight:900;fill:var(--ink);text-anchor:middle}
.beaker-scene .glass{fill:none;stroke:#8c9a92;stroke-width:3}
.beaker-scene .solute{fill:#7a5cc0;opacity:.75}
.beaker-scene .bubble{fill:none;stroke:#fff;stroke-width:1.5}
.beaker-scene .bubble{animation:rise-b 1.6s ease-in infinite calc(var(--i) * .25s)}
.beaker-scene .b-val{font-size:15px;font-weight:900;fill:var(--ink);text-anchor:middle}
.beaker-scene .b-name{font-size:12px;font-weight:800;fill:var(--muted);text-anchor:middle}
.flow-scene .node rect{fill:#fff;stroke:var(--line);stroke-width:2}
.flow-scene .node.hi rect{fill:var(--accent-soft);stroke:var(--accent)}
.flow-scene .n-icon{font-size:22px;text-anchor:middle}
.flow-scene .n-t{font-size:12px;font-weight:800;fill:var(--ink);text-anchor:middle}
.flow-scene .arrow{stroke:var(--muted);stroke-width:2.5;fill:none}.flow-scene .arrow-h{fill:var(--muted)}
.layers-scene .layer rect{stroke:#fff;stroke-width:2}
.layers-scene .layer.hi rect{stroke:var(--accent);stroke-width:3}
.layers-scene .l-name{font-size:13px;font-weight:900;fill:var(--ink);text-anchor:middle}
.layers-scene .l-note{font-size:11px;font-weight:700;fill:var(--muted)}
.cards-scene .card rect{fill:#fff;stroke:var(--line);stroke-width:2}
.cards-scene .card.hi rect{fill:var(--accent-soft);stroke:var(--accent)}
.cards-scene .c-icon{font-size:28px;text-anchor:middle}
.cards-scene .c-title{font-size:13px;font-weight:800;fill:var(--ink);text-anchor:middle}
.cards-scene .c-val{font-size:18px;font-weight:900;fill:var(--accent);text-anchor:middle}
.angle-scene .protractor{fill:#f6f4ee;stroke:#d7d2c2;stroke-width:1.5}
.angle-scene .p-tick{stroke:#b9b29c;stroke-width:1.2}
.angle-scene .arm{stroke:var(--ink);stroke-width:4;stroke-linecap:round}
.angle-scene .ang-arc{fill:none;stroke:var(--accent);stroke-width:3}
.angle-scene .ang-t{font-size:16px;font-weight:900;fill:var(--accent);text-anchor:middle}
.force-scene .ground{stroke:#b8b2a2;stroke-width:3}
.force-scene .obj{fill:#e9cf9c;stroke:#a97c3d;stroke-width:2}
.force-scene .force line{stroke-width:5;stroke-linecap:round}.force-scene .force.a line{stroke:#7a5cc0}.force-scene .force.a path{fill:#7a5cc0}
.force-scene .force.b line{stroke:#d0683a}.force-scene .force.b path{fill:#d0683a}.force-scene .force.c line{stroke:#2f8f73}.force-scene .force.c path{fill:#2f8f73}
.force-scene .f-lab{font-size:12px;font-weight:800;fill:var(--ink)}
.force-scene .f-net{font-size:14px;font-weight:900;fill:var(--accent);text-anchor:middle}
.wave-scene .mid{stroke:#d7dad2;stroke-width:1.5;stroke-dasharray:4 4}
.wave-scene .wave{fill:none;stroke-width:3.5;stroke-linecap:round}.wave-scene .wave.a{stroke:#7a5cc0}.wave-scene .wave.b{stroke:#d0683a;opacity:.8}
.wave-scene .wave.just{stroke-dasharray:900;animation:draw 1s var(--ease) both}
.circuit-scene .wire{fill:none;stroke:var(--ink);stroke-width:3}
.circuit-scene .sw.open{stroke:#b5532a}
.circuit-scene .node-dot{fill:var(--ink)}
.circuit-scene .cell-b line{stroke:var(--ink)}.circuit-scene .cell-b .pos{stroke-width:3}.circuit-scene .cell-b .neg{stroke-width:6}
.circuit-scene .bulb circle:first-child{fill:#fff;stroke:var(--ink);stroke-width:2.5}
.circuit-scene .bulb.on circle:first-child{fill:#ffe9a3}
.circuit-scene .bulb .glow{fill:#ffd95c;opacity:.35}
.circuit-scene .fil{fill:none;stroke:#a97c3d;stroke-width:2}
.circuit-scene .c-note{font-size:12px;font-weight:800;fill:var(--muted);text-anchor:middle}
.atom-scene .nucleus{fill:#f2c27b;stroke:#c98b3f;stroke-width:2}
.atom-scene .nuc-t{font-size:13px;font-weight:900;fill:var(--ink);text-anchor:middle}
.atom-scene .nuc-n{font-size:11px;font-weight:700;fill:var(--muted);text-anchor:middle}
.atom-scene .shell{fill:none;stroke:#c9cfc8;stroke-width:1.5}
.atom-scene .electron{fill:#4f8fc0}
.shape-scene .shape{stroke-width:3;stroke-linejoin:round}.shape-scene .shape.a{fill:#e6ddf8;stroke:#7a5cc0}.shape-scene .shape.b{fill:#fdeccd;stroke:#c98b3f}.shape-scene .shape.c{fill:#d9efe6;stroke:#2f8f73}
.mini-scene .mini-glyph{font-size:30px;font-weight:900;fill:var(--accent);text-anchor:middle}
@keyframes draw{from{stroke-dashoffset:900}to{stroke-dashoffset:0}}
@keyframes grow-y{from{transform:scaleY(0)}to{transform:none}}
@keyframes rise-b{from{transform:translateY(0);opacity:1}to{transform:translateY(-30px);opacity:0}}

/* ===== home for many lessons: grade and subject filters ===== */
.filters{display:flex;gap:6px;overflow-x:auto;padding:2px 0 8px;margin:0 0 6px;scrollbar-width:none}
.filters::-webkit-scrollbar{display:none}
.filter{flex:none;min-height:44px;padding:0 14px;border-radius:22px;border:2px solid var(--line);background:#fff;font-weight:800;font-size:14px;white-space:nowrap}
.filter[aria-pressed=true]{border-color:var(--accent);background:var(--accent-soft);color:var(--accent)}
.lesson-row{display:flex;align-items:center;gap:12px;width:100%;text-align:right;min-height:64px;margin-bottom:8px;padding:10px 14px;border-radius:18px;border:2px solid var(--line);border-bottom-width:4px;background:#fff}
.lesson-row strong{display:block;font-size:16px;line-height:1.5}
.lesson-row small{display:block;font-size:12px;color:var(--muted);line-height:1.6}
.lesson-row .arrow{margin-right:auto;color:#7c8b82;font-size:20px}
.lesson-row .done-tag{margin:2px 0 0}
.lesson-row:active{transform:translateY(2px);border-bottom-width:2px}
.unit-h{font-size:12px;color:var(--muted);font-weight:800;margin:14px 2px 8px}
.loading{display:grid;place-items:center;height:100dvh;color:var(--muted);font-weight:700}
h1[tabindex]:focus,h1[tabindex]:focus-visible{outline:none}

/* ===== utility classes for lesson-specific SVG (lessons/<batch>/_scenes.mjs). Use these instead of new CSS. ===== */
.scene .tx{font-size:12px;fill:var(--muted);text-anchor:middle}
.scene .tx-b{font-size:14px;font-weight:800;fill:var(--ink);text-anchor:middle}
.scene .tx-big{font-size:20px;font-weight:900;fill:var(--accent);text-anchor:middle}
.scene .tx-s{font-size:11px;font-weight:700;fill:var(--muted);text-anchor:middle}
.scene .ln{stroke:var(--ink);stroke-width:2.5;fill:none;stroke-linecap:round;stroke-linejoin:round}
.scene .ln-soft{stroke:#c9cfc8;stroke-width:1.5;fill:none}
.scene .ln-dash{stroke:var(--muted);stroke-width:1.5;fill:none;stroke-dasharray:5 4}
.scene .ln-accent{stroke:var(--accent);stroke-width:3;fill:none;stroke-linecap:round}
.scene .fill-accent{fill:var(--accent)}.scene .fill-soft{fill:var(--accent-soft)}
.scene .fill-a{fill:#b9a5e6}.scene .fill-b{fill:#f2c27b}.scene .fill-c{fill:#8fcbb3}.scene .fill-d{fill:#a9c6ec}.scene .fill-e{fill:#e8a0a0}.scene .fill-n{fill:#eceee8}
.scene .box{fill:#fff;stroke:var(--line);stroke-width:2}
.scene .box-hi{fill:var(--accent-soft);stroke:var(--accent);stroke-width:2}
.scene .fx-pop{transform-box:fill-box;transform-origin:center;animation:pop .45s var(--bounce) both}
.scene .fx-fade{animation:fade .4s ease both}
.scene .fx-late{animation:fade .4s ease .6s both}
.scene .fx-rise{transform-box:fill-box;animation:drop .5s var(--bounce) both}
.scene .fx-draw{stroke-dasharray:900;animation:draw 1s var(--ease) both}
.scene .fx-pulse{animation:glowfill2 1.6s ease-in-out infinite}
.scene .fx-spin{transform-box:fill-box;transform-origin:center;animation:spin 3s linear infinite}
.scene .fx-bob{transform-box:fill-box;animation:bob 1.6s ease-in-out infinite}

/* ===== learning loop: أربط · أثبت · أكافأ ===== */
.subtitle .cap .ctx-line{display:block;font-size:13px;font-weight:600;color:var(--muted);line-height:1.6}
.mode-badge.prove{background:#b07a1a}
.stage-wrap.mode-prove{border-color:#d9b46a;box-shadow:0 0 0 4px #fbf0d9}
.prove-stage{display:flex;flex-direction:column;align-items:center;gap:6px;text-align:center;padding:0 18px}
.prove-stage small{font-size:13px;font-weight:800;color:#8a5f12}
.prove-stage b{font-size:34px;color:var(--ink)}
.prove-stage span{font-size:15px;color:var(--muted);line-height:1.7}
.choice:disabled{opacity:1;cursor:default}
.ph11 .choice[aria-pressed=true]:disabled{border-color:#b07a1a;background:#fbf0d9}
.proof-score{display:flex;justify-content:center;gap:8px;margin:0 0 10px}
.proof-score i{font-style:normal;width:34px;height:34px;border-radius:50%;display:grid;place-items:center;font-weight:900}
.proof-score i.ok{background:var(--ok-bg);color:var(--ok)}.proof-score i.no{background:#f1ece4;color:#8a7a62}
.result.proven{border-color:#d9b46a;background:#fffaf0}
.result.locked{background:#f6f5f1;border-style:dashed}
.result.locked strong{font-size:16px}
.success-mascot.calm .mascot{width:120px;height:128px}
.grow{display:flex;align-items:center;gap:12px;background:#fff;border:1px solid var(--line);border-radius:20px;padding:12px 14px;margin:0 0 14px}
.grow-char{position:relative;flex:none}.grow-char .mascot{width:70px;height:74px}
.grow.up .grow-char .mascot{animation:hop .6s var(--bounce) .3s 2}
.grow .lvl{position:absolute;bottom:-2px;left:-4px;min-width:26px;height:26px;padding:0 6px;border-radius:13px;background:#b07a1a;color:#fff;font-weight:900;font-size:14px;display:grid;place-items:center;border:2px solid #fff}
.grow b{display:block;font-size:16px}.grow small{display:block;font-size:12px;color:var(--muted);line-height:1.7}
.lvl-bar{height:8px;border-radius:8px;background:#efe8d9;margin:6px 0 4px;overflow:hidden}.lvl-bar i{display:block;height:100%;background:#d9a23a;border-radius:8px}
.proof-tag,.done-tag.proof{display:inline-block;font-size:12px;font-weight:800;color:#8a5f12;background:#fbf0d9;padding:3px 9px;border-radius:9px;margin-bottom:4px}
.book-card.locked{background:#f6f5f1;border-style:dashed}
.book-card .lock-ic{font-size:28px;width:64px;text-align:center;flex:none}

/* ===== المعمورة (colony) ===== */
.colony-card{display:flex;align-items:center;gap:12px;width:100%;text-align:right;margin:0 0 14px;padding:12px 14px;border-radius:20px;border:2px solid #d9c9a3;border-bottom-width:5px;background:#fbf6ea}
.colony-card.has-wait{border-color:#d9a23a;background:#fff4dc}
.colony-card strong{display:block;font-size:18px}.colony-card small{font-size:13px;color:var(--muted);line-height:1.6}
.colony-card .arrow{margin-right:auto;font-size:22px;color:#8d7b55}
.cc-faces{display:flex;flex:none}.cc-face{width:34px;height:42px;margin-inline-start:-8px}.cc-faces .cc-face:first-child{margin:0}.cc-egg{font-size:30px}
.tank-wrap{margin:6px 0 14px}
.terrarium{width:100%;height:auto;display:block}
.terrarium .sky{fill:#e3f0f6}.terrarium.night .sky{fill:#24324a}.terrarium .sun{fill:#f3c95c}.terrarium .moon{fill:#e9e4cf}
.terrarium .soil.s1{fill:#ead9b6}.terrarium .soil.s2{fill:#e2cda4}.terrarium .soil.s3{fill:#d8c194}.terrarium .soil.s4{fill:#cdb385}
.terrarium .glass{fill:none;stroke:#9fb1aa;stroke-width:5}.terrarium .shine{stroke:#ffffff;stroke-opacity:.55;stroke-width:5;stroke-linecap:round}
.terrarium .plant{fill:none;stroke:#5e9a4c;stroke-width:3;stroke-linecap:round}
.terrarium .shaft{fill:none;stroke:#b79b6c;stroke-width:14;stroke-linejoin:round;stroke-linecap:round;opacity:.55}
.terrarium .chamber{fill:#b89c6b;opacity:.55}
.terrarium .dug{stroke:#a98a58;stroke-linecap:round;opacity:.8}
.terrarium .block{fill:#8fb3d9;stroke:#5b80a8;stroke-width:1}
.terrarium .rope-b{stroke:#7d6a4b;stroke-width:2}.terrarium .plank{fill:#9c7a4c}
.terrarium .shelf{stroke:#7d6a4b;stroke-width:2.5}.terrarium .loaf{fill:#e8b469}.terrarium .jar{fill:#b5d0c8}
.terrarium .glow{fill:#f6c26b}.terrarium .hut{fill:#b07a4a;stroke:#7d5230;stroke-width:1.5}.terrarium .hut-door{fill:#7d5230}
.terrarium .build.faded{opacity:.35;filter:grayscale(1)}
.res.st-dim{opacity:.6;filter:saturate(.35)}.res.st-asleep{opacity:.55;filter:grayscale(.8)}
.res .zz{font-size:12px;font-weight:900;fill:#5e6f68}.res .zz.s{font-size:9px}
.res-hit{cursor:pointer;outline:none}.res-hit:focus-visible .res{filter:drop-shadow(0 0 0 #285cbb) drop-shadow(0 0 3px #285cbb)}
.res-hit .r-wave{transform-box:fill-box;transform-origin:0 100%;animation:wave 1.2s ease-in-out infinite}
.knock-b circle{fill:#d9a23a;stroke:#fff;stroke-width:2}.knock-b text{fill:#fff;font-weight:900;font-size:15px;text-anchor:middle}
.knock-b{animation:bob 1.6s ease-in-out infinite}
.sign{cursor:pointer}.sign rect{fill:#fff;stroke:#b07a1a;stroke-width:1.5}.sign text{font-size:12px;font-weight:800;fill:#8a5f12;text-anchor:middle}.sign line{stroke:#7d6a4b;stroke-width:2}
.knocks{display:grid;gap:8px;margin-bottom:12px}
.knock{display:flex;align-items:center;gap:10px;width:100%;text-align:right;padding:8px 12px;border-radius:16px;border:2px solid #e3c98e;border-bottom-width:4px;background:#fffaf0;min-height:62px}
.knock svg{width:40px;height:50px;flex:none}.knock b{display:block;font-size:15px}.knock small{font-size:12px;color:var(--muted)}.knock .arrow{margin-right:auto;color:#8d7b55;font-size:20px}
.calm-note{color:var(--muted);text-align:center;font-size:14px;margin:0 0 12px}
.legend{background:#fff;border:1px solid var(--line);border-radius:16px;padding:6px 14px;margin:0 0 12px}.legend summary{min-height:44px;display:flex;align-items:center;font-weight:800;cursor:pointer}
.legend ul{margin:0 0 8px;padding-inline-start:18px;font-size:14px;line-height:1.9;color:#45544e}
.preview-tools{border:2px dashed #c9cfc8;border-radius:16px;padding:10px 12px;margin:0 0 12px;background:#f6f7f3}.preview-tools>b{font-size:13px;color:#6b5b2e}
.pt-row{display:flex;gap:8px;flex-wrap:wrap;margin-top:8px}.pt-row .tool{flex:1;min-height:44px;font-size:14px;padding:0 10px}
.res-sheet .rs-head{display:flex;align-items:center;gap:12px}.rs-art{width:64px;height:76px;flex:none}.rs-head h2{margin:0;font-size:22px}.rs-head small{color:var(--muted);font-size:12px}.rs-head .icon-btn{margin-right:auto}
.rs-hello{margin:8px 0 10px;font-size:15px;line-height:1.8;color:#45544e}
.rs-facts{margin:0 0 14px;display:grid;gap:6px}.rs-facts div{display:flex;gap:10px;font-size:14px}.rs-facts dt{min-width:64px;color:var(--muted);font-weight:700}.rs-facts dd{margin:0;font-weight:600}
.mem{display:inline-flex;gap:3px;vertical-align:middle}.mem i{width:12px;height:8px;border-radius:3px;background:#e4e1d6}.mem i.on{background:#d9a23a}
.visit-stage{display:flex;align-items:center;justify-content:center}
.visit-art{display:flex;flex-direction:column;align-items:center;gap:6px}.visit-art svg{width:130px;height:146px}
.visit-art .bubble{margin:0;background:#fff;border:2px solid #e3c98e;border-radius:16px;padding:6px 14px;font-weight:800;font-size:15px}
.mini-res{width:40px;height:48px}
.visit-done{text-align:center;padding-top:20px}.visit-done .visit-art{margin-bottom:6px}
.title.center,.intro.center{text-align:center}
.idea-wrap .stage{padding-top:34px}
.hatch{display:flex;align-items:center;gap:12px;background:#fffaf0;border:2px solid #e3c98e;border-radius:20px;padding:10px 14px;margin:0 0 12px}
.hatch svg{width:76px;height:86px;flex:none}.hatch b{display:block;font-size:17px}.hatch small{font-size:13px;color:#5e5b4a;line-height:1.7}
.hatch .egg{fill:#f4ead6;stroke:#c9b48a;stroke-width:1.5}.hatch:not(.locked) .shell{animation:crack .9s ease 0s both}
.hatch.new .res{animation:pop .5s var(--bounce) .7s both}.hatch.locked{background:#f6f5f1;border-style:dashed}
.shell.page.colony .title{margin-bottom:6px}
@keyframes wave{50%{transform:rotate(-18deg)}}
@keyframes crack{0%{opacity:1;transform:none}60%{opacity:1;transform:rotate(-6deg)}100%{opacity:0;transform:translateY(16px) scale(.9)}}
@media (prefers-reduced-motion:reduce){.hatch:not(.locked) .shell{opacity:0}}

/* ===== navigation: tab bar, onboarding, lessons tab ===== */
.shell.page.has-tabs{padding-bottom:calc(96px + env(safe-area-inset-bottom,0px))}
.tabbar{position:fixed;bottom:0;left:50%;transform:translateX(-50%);width:min(480px,100%);z-index:7;display:grid;grid-template-columns:1fr 1fr;background:#fffdf8;border-top:1px solid var(--line);padding:6px 10px calc(6px + env(safe-area-inset-bottom,0px));box-shadow:0 -6px 20px #1b2b2510}
.tabbar button{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;min-height:56px;border:0;background:none;border-radius:14px;color:var(--muted);font-weight:700;font-size:13px}
.tabbar button svg{width:24px;height:24px}
.tabbar button[aria-current=page]{color:var(--brand);background:#eef3ec}
.tab-badge{position:absolute;top:4px;right:calc(50% - 26px);min-width:20px;height:20px;padding:0 6px;border-radius:10px;background:#d9a23a;color:#fff;font-size:12px;display:grid;place-items:center;border:2px solid #fffdf8}
.ob{display:flex;flex-direction:column;align-items:center;padding-top:20px}
.ob-back{position:absolute;top:16px;right:16px}
.ob-chars{display:flex;gap:4px;margin-bottom:6px}.ob-chars .mascot{width:96px;height:104px}
.ob-grades{display:grid;gap:10px;width:100%;margin:10px 0 16px}
.ob-grade{display:flex;flex-direction:column;align-items:flex-start;gap:2px;width:100%;min-height:72px;padding:12px 18px;border-radius:18px;border:2px solid var(--line);border-bottom-width:5px;background:#fff;text-align:right}
.ob-grade b{font-size:20px}.ob-grade small{font-size:13px;color:var(--muted)}
.ob-grade.on{border-color:var(--brand);background:#eef3ec}
.ob-grade:active{transform:translateY(2px);border-bottom-width:3px}
.note.center{text-align:center}
.grade-chip{min-height:40px;padding:0 14px;border-radius:20px;border:1px solid var(--line);background:#fff;font-weight:800;font-size:14px;color:var(--ink)}
.next-card{display:flex;flex-direction:column;align-items:flex-start;gap:4px;width:100%;text-align:right;padding:16px 18px;margin:4px 0 16px;border-radius:22px;border:2px solid #d8cff0;border-bottom-width:5px;background:var(--accent-soft)}
.next-card.heat{border-color:#c0e2d4;background:#e8f6f0}.next-card.done{border-style:dashed;background:#f6f5f1;border-color:var(--line)}
.next-card small{font-size:12px;font-weight:800;color:var(--muted)}.next-card strong{font-size:21px;line-height:1.5}
.next-card span{font-size:14px;color:#56635d;line-height:1.7}.next-card em{font-style:normal;align-self:flex-end;font-weight:900;color:var(--brand);margin-top:4px}
.next-card:active{transform:translateY(2px);border-bottom-width:3px}
.seg{display:flex;gap:4px;padding:4px;border-radius:16px;background:#ecebe4;margin:0 0 10px}
.seg-b{flex:1;min-height:44px;border:0;border-radius:12px;background:none;font-weight:800;color:var(--muted)}
.seg-b[aria-selected=true]{background:#fff;color:var(--ink);box-shadow:0 1px 3px #0000001a}
.progress-line{font-size:13px;color:var(--muted);margin:0 2px 10px}
.unit{background:#fff;border:1px solid var(--line);border-radius:18px;margin:0 0 10px;overflow:hidden}
.unit summary{display:flex;align-items:center;gap:10px;min-height:54px;padding:0 16px;cursor:pointer;list-style:none;font-weight:800}
.unit summary::-webkit-details-marker{display:none}
.unit summary::after{content:'›';margin-right:auto;transform:rotate(90deg);color:var(--muted);font-size:20px;transition:transform .2s}
.unit[open] summary::after{transform:rotate(-90deg)}
.u-name{flex:1;font-size:16px}.u-prog{font-size:12px;color:var(--muted);font-weight:700}
.u-list{display:grid;padding:0 8px 8px}
.unit .lesson-row{display:flex;align-items:center;gap:12px;width:100%;min-height:52px;padding:8px 10px;border:0;border-top:1px solid #f0efe9;background:none;text-align:right;border-radius:0;margin:0}
.unit .lesson-row strong{font-size:15px;font-weight:700;line-height:1.5}.unit .lesson-row small{display:block;font-size:12px;color:var(--brand);font-weight:800}
.unit .lesson-row.is-next{background:#f3f7f1;border-radius:12px;border-top-color:transparent}
.lr-dot{flex:none;width:24px;height:24px;border-radius:50%;border:2px solid #cfd4cc;display:grid;place-items:center;font-size:13px;font-weight:900}
.lr-dot.done{border-color:#9fb59a;color:#5c7a52;background:#eef3ec}.lr-dot.proven{border-color:#d9a23a;background:#fbf0d9;color:#a87412}
.lr-res{flex:none;width:28px;height:34px}
details.preview-tools summary{min-height:40px;display:flex;align-items:center;font-size:13px;font-weight:800;color:#6b5b2e;cursor:pointer}

/* ===== ants: the colony behaves like an ant farm ===== */
.terrarium .grain{fill:#b99d6e;opacity:.45}
.terrarium .tun{fill:none;stroke:#bfa173;stroke-width:15;stroke-linecap:round;opacity:.9}
.terrarium .tun.main{stroke-width:16}.terrarium .tun.tip{stroke-width:11;opacity:.8}
.terrarium .room{fill:#bfa173}.terrarium .room.nursery{fill:#c9ae80}
.terrarium .room-floor{fill:none;stroke:#a88b5c;stroke-width:3;stroke-linecap:round;opacity:.7}
.terrarium .pellet{fill:#8f6e43;stroke:#6f532f;stroke-width:.8}.terrarium .pellet.seed{fill:#e3c27a;stroke:#b08d42}
.terrarium .pellet.new{animation:pellet 1.4s ease .6s 3}
.terrarium .egg-n{fill:#fbf6ea;stroke:#d7c7a2;stroke-width:1}
.terrarium .mound{fill:#cfb07d;stroke:#b39461;stroke-width:1.5}
.terrarium .seed-s{fill:#e3c27a;stroke:#b08d42;stroke-width:.8}
.terrarium .star{fill:#f4f1df}
.terrarium.night .soil{filter:brightness(.88)}
.terrarium .sign line{stroke:#8a5f12;stroke-width:2}
.ant .lg{stroke-width:2.1;stroke-linecap:round;fill:none}
.ant .ld{display:none}.ant .ld.soil{fill:#8f6e43;stroke:#6f532f;stroke-width:.8}.ant .ld.seed{fill:#e3c27a;stroke:#b08d42;stroke-width:.8}.ant .ld.egg{fill:#fbf6ea;stroke:#cdbd96;stroke-width:.8}
.c-soil .ld.soil,.c-seed .ld.seed,.c-egg .ld.egg{display:inline}
.ant.st-dim{opacity:.62;filter:saturate(.3)}.ant.st-asleep{opacity:.6;filter:grayscale(.75)}
.ant .zz{font-size:11px;font-weight:900;fill:#5e6f68}.ant .zz.s{font-size:8px}
.ant-hit{cursor:pointer;outline:none}.ant-hit:focus-visible .ant{filter:drop-shadow(0 0 2px #285cbb) drop-shadow(0 0 2px #285cbb)}
.ant-pos .kb{transition:opacity .3s}.ant-pos.walk .kb{opacity:0}
/* gait: two leg sets swing in turn while walking */
.ant .lg{transform-box:view-box}
.walk .ant .lg.a{animation:gaitA .32s linear infinite}
.walk .ant .lg.c,.walk .ant .lg.b{animation:gaitB .32s linear infinite}
.walk .ant{animation:bobA .32s ease-in-out infinite}
.walk .ant .antn,.greet .ant .antn,.look .ant .antn{transform-box:fill-box;transform-origin:0 100%;animation:feel .9s ease-in-out infinite}
.greet .ant .antn{animation-duration:.35s}
.dig .ant{transform-box:fill-box;transform-origin:50% 100%;animation:digA .45s ease-in-out infinite}
.tend .ant{animation:bobA 1.2s ease-in-out infinite}
.rear .ant{transform-box:fill-box;transform-origin:30% 100%;animation:tap 1.4s ease-in-out infinite}
.hatching .ant{animation:pop .8s var(--bounce) both}
@keyframes gaitA{0%,100%{transform:translateX(-1.6px)}50%{transform:translateX(1.6px)}}
@keyframes gaitB{0%,100%{transform:translateX(1.6px)}50%{transform:translateX(-1.6px)}}
@keyframes bobA{50%{transform:translateY(-.8px)}}
@keyframes feel{50%{transform:rotate(-12deg)}}
@keyframes digA{50%{transform:rotate(14deg) translateY(1px)}}
@keyframes tap{0%,60%,100%{transform:none}70%{transform:translateX(-2px)}80%{transform:none}90%{transform:translateX(-2px)}}
@keyframes pellet{50%{fill:#f6d77a;transform:translateY(-2px)}}
.tank-wrap{position:relative}
.life-log{min-height:22px;margin:8px 4px 0;font-size:13px;font-weight:700;color:#6b5b2e;text-align:center}
.life-log.pop{animation:rise .35s var(--ease) both}
.col-stats{display:flex;gap:8px;margin:0 0 12px}
.col-stats span{flex:1;background:#fff;border:1px solid var(--line);border-radius:14px;padding:8px 6px;text-align:center;font-size:12px;color:var(--muted);font-weight:700}
.col-stats b{display:block;font-size:19px;color:var(--ink)}
.knock svg{width:44px;height:38px;flex:none}
.roster{background:#fff;border:1px solid var(--line);border-radius:18px;margin:12px 0;overflow:hidden}
.roster summary{min-height:50px;display:flex;align-items:center;padding:0 16px;font-weight:800;cursor:pointer}
.roster ul{list-style:none;margin:0;padding:0 8px 8px;display:grid}
.roster li button{display:flex;align-items:center;gap:10px;width:100%;min-height:52px;border:0;border-top:1px solid #f0efe9;background:none;text-align:right;padding:6px 8px}
.roster li svg{width:40px;height:34px;flex:none}.roster li span{flex:1;min-width:0}.roster li b{display:block;font-size:15px}.roster li small{display:block;font-size:12px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.roster em{font-style:normal;font-size:12px;font-weight:800;padding:3px 9px;border-radius:10px;background:#eef3ec;color:#3f7a37}
.roster em.st-waiting,.roster em.st-dim{background:#fbf0d9;color:#8a5f12}.roster em.st-asleep{background:#eceef0;color:#5e6f68}.roster em.st-gone{background:#f8e4dc;color:#a4462a}
/* lesson rows: the lesson's character beside its title */
.lr-char{flex:none;width:40px;height:34px}
.lr-char.new{opacity:.85}
.unit .lesson-row small{font-weight:700;color:var(--muted)}.unit .lesson-row.is-next small{color:var(--brand);font-weight:800}
.unit .lesson-row>div{flex:1;min-width:0}
.lr-tick{flex:none;width:22px;text-align:center;font-weight:900;color:#5c7a52}.st-proven .lr-tick{color:#a87412}
.next-card{position:relative}
.nc-egg{position:absolute;top:12px;left:14px;width:48px;height:52px;animation:wobble 2.6s ease-in-out infinite}
.next-card .nc-hatch{font-size:12px;font-weight:800;color:var(--brand)}
@keyframes wobble{0%,70%,100%{transform:none}76%{transform:rotate(-8deg)}84%{transform:rotate(7deg)}92%{transform:rotate(-3deg)}}
.egg-line{display:flex;align-items:center;gap:6px;justify-content:center;margin:4px 0 0;font-size:13px;font-weight:700;color:var(--muted);animation:rise .45s var(--ease) .5s both}
.egg-line svg{width:30px;height:32px;flex:none}
.hatch svg{overflow:visible}
/* first run */
.ob{padding-top:8px}
.ob-brand{margin:0 0 8px;font-weight:900;font-size:17px;color:var(--brand)}
.ob-hero{width:100%;border-radius:22px;overflow:hidden}
.ob-hero .terrarium{border-radius:22px}
.ob-hero .life-log{margin-top:6px}
.ob .title{margin:8px 0 4px;font-size:25px}
.ob .intro{margin:0 0 6px;max-width:34ch}
.ob-q{margin:6px 0 0;font-weight:900;font-size:17px}
.ob-grades{margin:8px 0 10px}
.ob-grade{min-height:64px;padding:10px 18px}
@media (prefers-reduced-motion:reduce){.walk .ant,.walk .ant .lg,.ant .antn,.dig .ant,.tend .ant,.rear .ant,.nc-egg,.terrarium .pellet.new{animation:none!important}}
/* the lesson's egg inside the lesson */
.egg-stage .ps-egg{width:118px;height:124px;animation:wobble 2.4s ease-in-out infinite;transform-origin:50% 90%}
.egg-stage.cracked2 .ps-egg{animation:shake .5s ease-in-out infinite}
.egg-stage.just .ps-egg{animation:pop .5s var(--bounce) both}
.egg-stage b{font-size:28px}
@keyframes shake{25%{transform:rotate(-6deg)}75%{transform:rotate(6deg)}}
.egg-line svg{width:40px;height:42px;animation:wobble 2.6s ease-in-out 1s infinite;transform-origin:50% 90%}
.egg-line{font-size:14px}
/* home: the next egg is the hero; the collection strip */
.next-card{padding-left:112px;min-height:150px}
.nc-egg{top:50%;left:16px;width:84px;height:92px;margin-top:-46px;transform-origin:50% 90%}
.next-card::before{content:'';position:absolute;left:10px;bottom:16px;width:96px;height:22px;border-radius:50%;background:#0000000f}
.collection{display:flex;gap:4px;overflow-x:auto;padding:4px 2px 8px;margin:0 0 2px;scrollbar-width:none}
.collection::-webkit-scrollbar{display:none}
.cl-i{flex:none;width:46px;height:46px;border-radius:14px;border:1px solid var(--line);background:#fff;display:grid;place-items:center;padding:0}
.cl-i .lr-char{width:38px;height:32px}.cl-i.proven{background:#fbf3df;border-color:#ecd59c}.cl-i.is-next{border:2px solid var(--brand)}
@media (prefers-reduced-motion:reduce){.egg-stage .ps-egg,.egg-line svg{animation:none!important}}

/* ===== characters (not ants) with ant-colony behaviour ===== */
.terrarium .tun{stroke-width:24}.terrarium .tun.main{stroke-width:26}.terrarium .tun.tip{stroke-width:18}
.char .ft,.char .eyes,.char .arm-up,.char .arm-down{transform-box:fill-box}
.char .arm-up{display:none}
.c-soil .char .arm-up,.c-seed .char .arm-up,.c-egg .char .arm-up,.char.wave .arm-up,.climb .char .arm-up,.rear .char .arm-up{display:inline}
.c-soil .char .arm-down,.c-seed .char .arm-down,.c-egg .char .arm-down,.char.wave .arm-down,.climb .char .arm-down,.rear .char .arm-down{display:none}
.char .eyes{transform-origin:50% 50%;animation:blink 4.2s infinite}
.walk .char{animation:bobC .34s ease-in-out infinite}
.walk .char .ft.a{animation:stepA .34s ease-in-out infinite}.walk .char .ft.b{animation:stepB .34s ease-in-out infinite}
.climb .char{animation:climbC .5s ease-in-out infinite}
.climb .char .arm-up{transform-origin:50% 100%;animation:reach .5s ease-in-out infinite}
.greet .char{animation:hop .55s ease-in-out 2}
.greet .char .antn{transform-origin:50% 100%;animation:feel .3s ease-in-out infinite}
.dig .char{transform-origin:50% 100%;animation:digC .42s ease-in-out infinite}
.tend .char{transform-origin:50% 100%;animation:sway 1.4s ease-in-out infinite}
.look .char .pupil{animation:lookC 3s ease-in-out infinite}
.rear .char{animation:knockC 1.2s ease-in-out infinite}
.rest .char .eyes{animation:none;transform:scaleY(.15)}
.char .lamp{animation:lamp 2s ease-in-out infinite}
.hatching .char{animation:pop .8s var(--bounce) both}
@keyframes blink{0%,94%,100%{transform:none}97%{transform:scaleY(.1)}}
@keyframes bobC{50%{transform:translateY(-1.6px)}}
@keyframes stepA{0%,100%{transform:translate(-1.5px,0)}50%{transform:translate(1.5px,-2px)}}
@keyframes stepB{0%,100%{transform:translate(1.5px,-2px)}50%{transform:translate(-1.5px,0)}}
@keyframes climbC{50%{transform:translateY(-1.5px) rotate(-3deg)}}
@keyframes reach{50%{transform:scaleY(.85)}}
@keyframes hop{50%{transform:translateY(-4px)}}
@keyframes digC{50%{transform:scale(1.05,.9) rotate(6deg)}}
@keyframes sway{25%{transform:rotate(-4deg)}75%{transform:rotate(4deg)}}
@keyframes lookC{0%,100%{transform:none}30%{transform:translateX(-1.6px)}60%{transform:translateX(1px)}}
@keyframes knockC{0%,55%,100%{transform:none}65%{transform:translateX(2px)}75%{transform:none}85%{transform:translateX(2px)}}
@keyframes lamp{50%{opacity:.6}}
.lr-char{width:40px;height:36px}
@media (prefers-reduced-motion:reduce){.char,.char *{animation:none!important}}

/* =====================================================================
   «كيف جت» identity — white backgrounds, saturated blue for identity and interaction,
   saturated yellow for buttons and discovery, navy for text and equations.
   ===================================================================== */
:root{--ink:#14213D;--muted:#56617a;--paper:#fff;--line:#e3e8f3;--brand:#2457FF;--brand-d:#1638c9;--accent:#2457FF;--accent-soft:#eef3ff;
  --yel:#FFD43B;--yel-d:#e2b400;--ok:#13804f;--ok-bg:#e4f6ec;--warn-bg:#fff6d3;--warn:#5e4a00;--soft:#f5f7fc}
body{background:#fff;color:var(--ink);font-family:'Plex Arabic','SF Arabic','Segoe UI',Tahoma,Arial,sans-serif}
.shell{background:#fff}
.title,.lesson-title,h1,h2,.sec-h,.today strong,.subj-card b{font-family:'Baloo Bhaijaan','Plex Arabic',sans-serif;font-weight:800;color:var(--ink)}
.title{font-size:28px;line-height:1.35;margin:4px 0 12px;text-wrap:balance}
.intro{color:var(--muted)}
/* buttons: yellow primary, blue interaction */
.primary{background:var(--yel);color:var(--ink);border-bottom-color:var(--yel-d);font-weight:800;font-family:'Plex Arabic',sans-serif}
.primary:disabled{background:#f1f2f6;color:#9aa3b5;border-bottom-color:#dfe2ea}
.primary.go{background:var(--brand);color:#fff;border-color:var(--brand-d)}
.primary.sm{flex:none;width:auto;min-height:40px;font-size:14px;padding:6px 14px;border-bottom-width:3px;border-radius:12px}
.text-btn{color:var(--brand);font-weight:700}.text-btn.sm{min-height:40px;font-size:14px}.text-btn.strong{font-weight:800}.text-btn.danger{color:#a53b2a}
.choice{border-color:var(--line);color:var(--ink)}
.choice[aria-pressed=true]{border-color:var(--brand);background:var(--accent-soft);box-shadow:0 0 0 1px var(--brand) inset}
.chip[aria-pressed=true]{border-color:var(--brand);background:var(--accent-soft);color:var(--brand)}
.help-btn{border-color:var(--line);color:var(--brand)}
.steps i.done{background:var(--brand)}.steps i.now{background:var(--yel)}
.stage-wrap{border-color:var(--line);background:#fff}
.mode-badge{background:var(--brand);color:#fff}.mode-badge.prove{background:var(--yel);color:var(--ink)}
.subtitle.success{background:var(--ok-bg)}.subtitle.info{background:var(--accent-soft)}
/* the main character */
.mascot{width:96px;height:118px;overflow:visible}
.mascot .m-all{transform-box:fill-box;transform-origin:50% 100%;animation:breathe 3.6s ease-in-out infinite}
.mascot .eye{transform-box:fill-box;transform-origin:center;animation:blinkF 4.6s infinite}
.mascot.mood-happy .m-all{animation:hop .55s var(--bounce) 1}
@keyframes blinkF{0%,94%,100%{transform:none}97%{transform:scaleY(.12)}}
.subtitle .face .mascot{width:46px;height:56px}
.big-char .mascot{width:104px;height:128px}
.hero-buddy .mascot,.tc-char .mascot{width:110px;height:136px}
/* header: logo at the start, the character in the corner (one short gesture on arrival) */
.top{align-items:center}
.brand{display:flex;align-items:center;border:0;background:none;padding:0;cursor:pointer}
.brand-logo{height:38px;width:auto;display:block}
.corner-mascot{margin-inline-start:auto;width:56px;height:66px;display:block;position:relative}
.corner-mascot .mascot{width:56px;height:68px}
.corner-mascot .m-all{animation:peek .9s var(--bounce) both,breathe 3.6s ease-in-out .9s infinite}
@keyframes peek{0%{transform:translateY(14px) scale(.8);opacity:0}100%{transform:none;opacity:1}}
.grade-chip{border-color:var(--line);color:var(--ink);background:var(--soft)}
.sec-h{font-size:18px;margin:22px 2px 10px}
/* home */
.today{position:relative;display:grid;grid-template-columns:1fr auto;gap:6px 10px;align-items:center;padding:16px;border-radius:22px;background:linear-gradient(160deg,#f2f6ff,#e7eeff);border:1px solid #d9e3ff;margin:4px 0 6px}
.today .td-text{display:flex;flex-direction:column;gap:3px;min-width:0}
.today small{color:var(--brand);font-weight:800;font-size:13px}.today strong{font-size:22px;line-height:1.4}
.today span{font-size:14px;color:var(--muted);line-height:1.7}.today .td-egg{color:var(--ink);font-weight:700;font-size:13px}
.today .td-art{width:74px;height:82px;animation:wobble 2.6s ease-in-out infinite;transform-origin:50% 90%}
.today .go-btn{grid-column:1/-1;margin-top:6px}
.subj-list{display:grid;gap:10px}
.subj-card{display:flex;align-items:center;gap:14px;width:100%;padding:14px 16px;border-radius:20px;border:1px solid var(--line);background:#fff;text-align:right;box-shadow:0 2px 0 #e9edf6}
.subj-card:active{transform:translateY(1px)}
.sc-icon{flex:none;width:54px;height:54px;border-radius:16px;background:var(--accent-soft);display:grid;place-items:center}.sc-icon svg{width:40px;height:40px}
.sc-text{flex:1;min-width:0;display:flex;flex-direction:column;gap:4px}.sc-text b{font-size:19px}.sc-text small{color:var(--muted);font-size:13px}
.bar{display:block;height:7px;border-radius:4px;background:#e8ecf6;overflow:hidden}.bar i{display:block;height:100%;background:var(--brand);border-radius:4px}
.arrow{color:var(--brand);font-weight:900}
.colony-card{display:flex;align-items:center;gap:12px;width:100%;padding:12px 14px;border-radius:20px;border:1px solid var(--line);background:#fff;text-align:right}
.colony-card.has-wait{border-color:var(--yel);box-shadow:0 0 0 2px #fff3c4 inset}
.colony-card>span:nth-child(2){flex:1;display:flex;flex-direction:column}.colony-card small{color:var(--muted);font-size:13px}
.cc-faces{display:flex}.cc-face{width:36px;height:44px;margin-inline-start:-10px}.cc-faces .cc-face:first-child{margin:0}
.restore-link{display:block;margin:10px auto 0;border:0;background:none;color:var(--brand);font-weight:800;min-height:44px}
/* reminder (safe screens only) */
.reminder{display:flex;align-items:center;gap:10px;padding:10px 12px;margin:6px 0 10px;border-radius:18px;background:#fff8dc;border:1px solid #f4dc7c;animation:rise .4s var(--ease) both}
.reminder .rm-art{width:44px;height:54px;flex:none}.reminder>div:nth-child(2){flex:1;min-width:0}.reminder b{display:block;font-size:15px}.reminder small{color:var(--muted);font-size:13px}
.rm-acts{display:flex;flex-direction:column;gap:2px;align-items:stretch}
/* lessons list */
.lesson-row.ls-gone strong{color:var(--muted)}.lr-char.got{width:40px;height:48px}.lr-char.got.gone,.cl-i.ls-gone .lr-char{opacity:.4;filter:grayscale(.6)}
.cl-i{width:50px;height:56px}.cl-i .lr-char.got{width:44px;height:52px}.cl-i.is-next{border-color:var(--brand)}
.unit .lesson-row.is-next{background:var(--accent-soft)}.unit .lesson-row.is-next small{color:var(--brand)}
.st-proven .lr-tick{color:var(--yel-d)}.ls-gone .lr-tick{color:var(--brand)}
.egg-line .egg-line-art{width:38px;height:44px;flex:none}
/* colony page */
.crow{display:flex;align-items:center;gap:10px;padding:8px 10px;border-radius:16px;border:1px solid var(--line);margin:0 0 8px;background:#fff}
.crow .res-ic{width:42px;height:52px;flex:none}.crow>span:nth-child(2){flex:1;min-width:0;display:flex;flex-direction:column}.crow b{font-size:15px}.crow small{color:var(--muted);font-size:12.5px;line-height:1.6}
.crow-acts{display:flex;flex-direction:column;gap:2px}
.res-ic{display:block}.res.is-gone{opacity:.45;filter:grayscale(.7)}
.tap-chip{display:flex;align-items:center;justify-content:center;gap:8px;min-height:24px;font-size:13px;color:var(--ink)}
.roster em{background:var(--accent-soft);color:var(--brand)}.roster em.ls-due,.roster em.ls-decide{background:#fff4c7;color:#6b5300}
.roster li .res-ic{width:38px;height:46px;flex:none}
.col-stats span{border-color:var(--line)}
.rs-art{width:72px;height:88px}.rs-acts{display:grid;gap:4px;margin-top:10px}
.hatch.got svg{width:88px;height:106px}.hatch.got.new svg .fig{animation:pop .6s var(--bounce) both}
.hatch{border-color:#d9e3ff;background:var(--accent-soft)}.hatch.locked{background:#f7f8fb}
.reward-acts{display:grid;gap:4px;margin:6px 0 10px}
.visit-art svg{width:120px;height:146px}.book-res{width:62px;height:76px;flex:none}
.visit-done .subtitle{margin:8px 0}
/* tab bar */
.tabbar{background:#fff;border-top-color:var(--line)}.tabbar button[aria-current=page]{color:var(--brand);background:var(--accent-soft)}
.tab-badge{background:var(--yel);color:var(--ink)}
/* intro (scene animation; never the device camera) */
.kj-intro{position:fixed;inset:0;z-index:50;background:#fff;display:flex;align-items:center;justify-content:center}
.kj-intro-svg{width:100%;height:100%}
.kj-intro-skip{position:absolute;top:calc(14px + env(safe-area-inset-top,0px));left:14px;z-index:2;min-height:40px;padding:0 16px;border-radius:20px;border:1px solid var(--line);background:#ffffffe6;color:var(--ink);font-weight:700;font-family:inherit}
.kj-intro .i-say-t{font-family:'Baloo Bhaijaan','Plex Arabic',sans-serif;font-size:22px;font-weight:800;fill:#14213D}
.kj-intro .mark-q,.kj-intro .mark-bang{font-family:'Baloo Bhaijaan',sans-serif}
.kj-intro .pop{animation:markPop .35s var(--bounce) both;transform-box:fill-box;transform-origin:50% 100%}
.kj-intro .i-marks.fade{opacity:0;transition:opacity .15s}
.kj-intro.beckoning .beckon-hand{transform-box:fill-box;transform-origin:20% 90%;animation:beckon .4s ease-in-out infinite}
@keyframes markPop{0%{transform:scale(0) translateY(6px);opacity:0}100%{transform:none;opacity:1}}
@keyframes beckon{50%{transform:rotate(-28deg)}}
/* ---------- the colony (characters behave like an ant farm) ---------- */
.terrarium .sky-a{stop-color:#cfe3ff}.terrarium .sky-b{stop-color:#eef6ff}.terrarium.night .sky-a{stop-color:#1c2a52}.terrarium.night .sky-b{stop-color:#2e3f6e}
.terrarium .tun{fill:none;stroke:#e8d3aa;stroke-linecap:round;opacity:1}
.terrarium .tun.shaft{stroke-width:34}.terrarium .tun.row{stroke-width:46;stroke-linecap:butt}.terrarium .tun.dig{stroke-width:28}
.terrarium .room{fill:#e8d3aa}.terrarium .room.nursery{fill:#efdcb6}
.terrarium .room-name{font-size:9px;font-weight:700;fill:#a0835a;text-anchor:middle;font-family:'Plex Arabic',sans-serif}
.terrarium .wood{fill:#b07a49}.terrarium .wood-l{stroke:#8a5a30;stroke-width:3;fill:none;stroke-linecap:round}
.terrarium .stool{fill:#c9935e}.terrarium .bowl{fill:#FFD43B;stroke:#c99a00;stroke-width:.8}
.terrarium .shelf{stroke:#8a5a30;stroke-width:3}.terrarium .jar{stroke:#14213D;stroke-width:.6}.terrarium .jar.j0{fill:#f0c55a}.terrarium .jar.j1{fill:#e8453c}.terrarium .jar.j2{fill:#8fd19e}
.terrarium .book{stroke:#14213D;stroke-width:.4}.terrarium .book.b0{fill:#2457FF}.terrarium .book.b1{fill:#FFD43B}.terrarium .book.b2{fill:#e8453c}.terrarium .book.b3{fill:#22b07d}
.terrarium .cushion{fill:#9db7ff}.terrarium .bedframe{fill:#a87447}.terrarium .pillow{fill:#fff;stroke:#d9d2c2;stroke-width:.6}
.terrarium .bush ellipse{fill:#5fae55}.terrarium .berry{fill:#e8453c}
.terrarium .tool.out{opacity:0;transition:opacity .2s}
.terrarium .soil.s1{fill:#d9b98a}.terrarium .soil.s2{fill:#cfac7a}.terrarium .soil.s3{fill:#c39f6c}.terrarium .soil.s4{fill:#b8935f}
.terrarium .grain{fill:#a17e50;opacity:.35}.terrarium .mound{fill:#c9a473;stroke:#a88552}
.terrarium .egg-n{fill:#fffaf0;stroke:#d7c7a2}
.terrarium .glass{stroke:#b9c7e6}
.cz{cursor:pointer}.cz-hit{fill:transparent;outline:none}.cz:focus-within .fig{filter:drop-shadow(0 0 3px #2457FF)}
.cz.left{animation:fadeLeft .8s ease forwards}@keyframes fadeLeft{to{opacity:0}}
.cz .fig .leg,.cz .fig .arm{transform-box:fill-box}
.cz.walk .fig .leg.l{transform-origin:50% 0;animation:legA .36s ease-in-out infinite}.cz.walk .fig .leg.r{transform-origin:50% 0;animation:legB .36s ease-in-out infinite}
.cz.walk .fig{animation:bobW .36s ease-in-out infinite}
.cz.climb .fig{animation:climbW .5s ease-in-out infinite}.cz.climb .fig .arm.r{transform-origin:10% 100%;animation:reachW .5s ease-in-out infinite}
.cz.dig .fig{transform-box:fill-box;transform-origin:50% 100%;animation:digW .5s ease-in-out infinite}
.cz.gather .fig{animation:bobW .8s ease-in-out infinite}
.cz.sit .fig .leg{transform:scaleY(.55);transform-origin:50% 0}
.cz.eat .fig .arm.r,.cz.sit.eat .fig .arm.r{transform-origin:10% 100%;animation:spoonW 1.1s ease-in-out infinite}
.cz.chat .fig .arm.r{transform-origin:10% 100%;animation:waveW .6s ease-in-out infinite}
.cz.tend .fig{transform-box:fill-box;transform-origin:50% 100%;animation:swayW 1.6s ease-in-out infinite}
.cz.guard .fig .pupil{animation:lookW 3s ease-in-out infinite}
.cz.respond .fig{transform-box:fill-box;transform-origin:50% 100%;animation:hopW .5s ease-in-out 3}.cz.respond .fig .arm.r{transform-origin:10% 100%;animation:waveW .4s ease-in-out infinite}
.cz.knock .fig .arm.r{transform-origin:10% 100%;animation:knockW 1s ease-in-out infinite}
.cz.stir .fig{animation:stirW .8s ease 1}
.cz.hatching .fig{animation:pop .9s var(--bounce) both}
.cz .lamp{animation:lampW 2s ease-in-out infinite}
.cz .eye{transform-box:fill-box;transform-origin:center;animation:blinkF 5s infinite}
@keyframes legA{0%,100%{transform:rotate(16deg)}50%{transform:rotate(-16deg)}}
@keyframes legB{0%,100%{transform:rotate(-16deg)}50%{transform:rotate(16deg)}}
@keyframes bobW{50%{transform:translateY(-5px)}}
@keyframes climbW{50%{transform:translateY(-6px)}}
@keyframes reachW{50%{transform:scaleY(.8)}}
@keyframes digW{0%,100%{transform:none}50%{transform:rotate(9deg) translateY(4px)}}
@keyframes spoonW{0%,100%{transform:none}50%{transform:rotate(-14deg)}}
@keyframes waveW{0%,100%{transform:none}50%{transform:rotate(-20deg)}}
@keyframes swayW{25%{transform:rotate(-4deg)}75%{transform:rotate(4deg)}}
@keyframes lookW{0%,100%{transform:none}30%{transform:translateX(-4px)}65%{transform:translateX(3px)}}
@keyframes hopW{50%{transform:translateY(-14px)}}
@keyframes knockW{0%,60%,100%{transform:none}70%{transform:translateX(-6px)}80%{transform:none}90%{transform:translateX(-6px)}}
@keyframes stirW{40%{transform:rotate(-4deg)}70%{transform:rotate(3deg)}}
@keyframes lampW{50%{opacity:.6}}
.bb rect{fill:#fff;stroke:#14213D;stroke-width:1}.bb .tail{fill:#fff;stroke:#14213D;stroke-width:1}
.bb .bb-t{font-size:12px;font-weight:900;fill:#2457FF;text-anchor:middle;font-family:'Baloo Bhaijaan',sans-serif}.bb .bb-t.warn{fill:#c99a00}.bb .bb-t.z{fill:#56617a;font-size:10px}.bb .bb-t.name{fill:#14213D;font-size:10px;font-family:'Plex Arabic',sans-serif}
.bb .bb-s{fill:none;stroke:#13804f;stroke-width:2.2;stroke-linecap:round}.bb .bb-h{fill:#ff6f91}.bb .bb-star{fill:#FFD43B;stroke:#c99a00;stroke-width:.6}
.bb.bang rect{fill:#FFD43B}.bb.bang .tail{fill:#FFD43B}.bb.bang .bb-t{fill:#14213D}
.life-log{color:var(--ink)}
@media (prefers-reduced-motion:reduce){.cz .fig,.cz .fig *,.corner-mascot .m-all,.today .td-art,.mascot .m-all{animation:none!important}}
.terrarium .tun.shaft{stroke-linecap:butt}.terrarium .hole{fill:#8a6a43;opacity:.55}
/* the situation (data for the question) stands out from the question itself */
.ph1 .subtitle{gap:6px}
.story{position:relative;text-align:right;background:#f3f7ff;border:1px solid #d7e2ff;border-inline-start:5px solid var(--brand);border-radius:14px;padding:8px 12px 9px}
.story-tag{display:inline-block;font-size:11.5px;font-weight:800;color:#fff;background:var(--brand);border-radius:8px;padding:1px 9px;margin-bottom:3px}
.ph1 .subtitle .story .ctx{margin:0;font-size:17px;font-weight:600;color:var(--ink);line-height:1.75}
.story .num,.story-line .num{color:var(--brand);font-weight:800;font-size:1.08em}
.story .var,.story-line .var{display:inline-block;min-width:1.4em;text-align:center;background:var(--yel);color:var(--ink);border-radius:7px;padding:0 4px;font-weight:800;line-height:1.45}
.ph1 .subtitle .q{font-size:22px}
.subtitle .cap .ctx-line.story-line{display:block;font-size:14px;font-weight:600;color:var(--ink);background:#f3f7ff;border-inline-start:4px solid var(--brand);border-radius:10px;padding:4px 10px;margin-bottom:4px}
@media (max-height:700px){.ph1 .subtitle .story .ctx{font-size:15.5px;line-height:1.65}.story{padding:6px 10px 7px}.ph1 .subtitle .q{font-size:19px}}
/* the character peeks over the «اكتشافك التالي» card (reference: hands on the edge, body hidden) */
.today{margin-top:76px;overflow:visible}
.td-peek{position:absolute;left:8px;top:-94px;width:118px;height:101px;pointer-events:none}
.td-peek .m-all{transform-box:fill-box;transform-origin:50% 100%;animation:peekUp .8s var(--bounce) .2s both}
@keyframes peekUp{0%{transform:translateY(40px);opacity:0}100%{transform:none;opacity:1}}
.mascot .x-spark,.peek .x-spark{animation:spark 1.6s ease-in-out infinite}
@keyframes spark{50%{opacity:.35}}
@media (prefers-reduced-motion:reduce){.td-peek .m-all,.x-spark{animation:none!important}}
/* phase 1: lamps at night, empty jars, activity icons */
.terrarium .jar.off{opacity:.12}
.terrarium .lamp-r .bulb{fill:#fff3c4;stroke:#c99a00;stroke-width:.6}.terrarium .lamp-r .glow-r{fill:#FFE27A;opacity:0}
.terrarium.night .lamp-r .glow-r{opacity:.28}.terrarium.night .lamp-r .bulb{fill:#FFD43B}
.terrarium.night .room{fill:#d9c39a}
.bb .bb-i{fill:none;stroke:#14213D;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}.bb .bb-dot{fill:#14213D}
.bb .bb-seed{fill:#f0c55a;stroke:#14213D;stroke-width:1}.bb .bb-bowl{fill:#FFD43B;stroke:#14213D;stroke-width:1}
.bb .bb-book{fill:#fff;stroke:#2457FF;stroke-width:1.4}.bb .bb-egg{fill:#fffaf0;stroke:#14213D;stroke-width:1}
.bb{animation:bbIn .25s var(--bounce) both}@keyframes bbIn{0%{opacity:0}100%{opacity:1}}

/* =====================================================================
   «تحديات» — live group challenge. Excitement before the question (ready, 3-2-1) and at the results;
   the question itself is calm: no motion, letters on every option (never colour alone).
   ===================================================================== */
.tabbar{grid-template-columns:repeat(3,1fr)}
.ch .title{margin-top:6px}
.ch-back{background:none;border:0;color:var(--brand);font-weight:700;min-height:44px;padding:4px 0;font-size:15px}
.ch-hero{display:flex;align-items:center;gap:12px;background:var(--soft);border-radius:20px;padding:12px 14px;margin:0 0 16px}
.ch-hero-av{width:84px;flex:none}.ch-hero p{margin:0;font-size:16px;line-height:1.7;font-weight:600}
.ch-entry{display:grid;gap:12px}
.ch-big{display:flex;flex-direction:column;align-items:flex-start;gap:4px;text-align:start;border:2px solid var(--line);background:#fff;border-radius:20px;padding:16px 18px;min-height:88px;color:var(--ink);font:inherit}
.ch-big b{font-family:'Baloo Bhaijaan','Plex Arabic',sans-serif;font-size:22px}.ch-big small{color:var(--muted);font-size:14px}
.ch-big.ch-create{background:var(--yel);border-color:var(--yel-d);border-bottom-width:5px}.ch-big.ch-create small{color:#3d3410}
.ch-big.ch-join{border-color:var(--brand);border-bottom-width:5px}
.ch-big:active{transform:translateY(2px)}
.ch-how{margin-top:16px;border:1px solid var(--line);border-radius:14px;padding:4px 14px}.ch-how summary{min-height:44px;display:flex;align-items:center;font-weight:700;cursor:pointer}
.ch-how p{font-size:14px;line-height:1.8;color:var(--muted);margin:4px 0 10px}
.ch-demo{margin-top:16px;font-size:13px;line-height:1.8;background:var(--warn-bg);color:var(--warn);border-radius:12px;padding:10px 12px}
.ch-demo b{display:inline-block;background:var(--ink);color:#fff;border-radius:6px;padding:0 8px;margin-inline-end:6px;font-size:12px}
.ch-flash{background:var(--accent-soft);border-radius:12px;padding:10px 12px;font-weight:600}
.ch-err{background:#fde9e7;color:#8a1f12;border-radius:12px;padding:10px 12px;font-weight:600;line-height:1.7}
.ch-field{border:0;margin:0 0 16px;padding:0;display:block}.ch-field>legend,.ch-field>span{font-weight:800;margin-bottom:8px;display:block;padding:0}
.ch-input{width:100%;box-sizing:border-box;min-height:52px;border:2px solid var(--line);border-radius:14px;padding:10px 14px;font:inherit;font-size:17px;color:var(--ink);background:#fff}
.ch-input:focus{outline:3px solid #2457FF55;border-color:var(--brand)}
.ch-code-in{font-family:'Baloo Bhaijaan',monospace;letter-spacing:.35em;text-align:center;font-size:26px;text-transform:uppercase}
.ch-hint{display:block;color:var(--muted);font-size:13px;line-height:1.7;margin:6px 0}.ch-hint.center,.center{text-align:center}
.ch-chips{display:flex;flex-wrap:wrap;gap:8px}
.ch-chip{min-height:44px;border:2px solid var(--line);background:#fff;border-radius:999px;padding:6px 14px;font:inherit;font-weight:700;color:var(--ink)}
.ch-chip.on{background:var(--brand);border-color:var(--brand);color:#fff}
.ch-pickall{display:flex;justify-content:flex-end;margin:-6px 0 2px}.ch-pickall .text-btn{margin:0}
.ch-unit{margin-bottom:8px}.ch-unit>b{display:block;font-size:13px;color:var(--muted);margin:8px 0 4px}
.ch-lesson{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:10px;min-height:48px;border-bottom:1px solid var(--line);padding:4px 2px;cursor:pointer}
.ch-lesson input{width:22px;height:22px;accent-color:var(--brand)}.ch-lesson span{line-height:1.5}.ch-lesson small{color:var(--muted);white-space:nowrap}
.ch-count{display:flex;align-items:center;gap:16px}
.ch-step{width:52px;height:52px;border-radius:50%;border:2px solid var(--brand);background:#fff;color:var(--brand);font-size:26px;font-weight:800;line-height:1}
.ch-step:disabled{opacity:.35}
.ch-count output{min-width:48px;text-align:center;font-family:'Baloo Bhaijaan',sans-serif;font-size:32px;font-weight:800}
.ch-seg{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.ch-seg button{border:2px solid var(--line);background:#fff;border-radius:14px;padding:10px 12px;text-align:start;min-height:56px;font:inherit;color:var(--ink);display:flex;flex-direction:column;gap:2px}
.ch-seg button small{color:var(--muted);font-size:12px;line-height:1.5}
.ch-seg button.on{border-color:var(--brand);background:var(--accent-soft);box-shadow:inset 0 0 0 1px var(--brand)}
.ch-seg.sm{margin:10px 0}.ch-seg.sm button{min-height:46px;align-items:center;justify-content:center;text-align:center}
.ch-chars{display:flex;gap:8px;overflow-x:auto;padding:2px 2px 8px;scroll-snap-type:x proximity}
.ch-char{flex:none;width:86px;scroll-snap-align:start;border:2px solid var(--line);background:#fff;border-radius:16px;padding:6px 4px;display:flex;flex-direction:column;align-items:center;gap:2px;font:inherit;color:var(--ink)}
.ch-char.on{border-color:var(--brand);background:var(--accent-soft)}
.ch-char-av{width:58px;height:66px}.ch-char small{font-size:11px;line-height:1.3;text-align:center}
.ch-go{margin-top:8px}
/* room */
.ch-top{display:flex;align-items:center;gap:8px;margin-bottom:8px}
.ch-room{font-family:'Baloo Bhaijaan',monospace;font-weight:800;letter-spacing:.18em;background:var(--soft);border-radius:999px;padding:4px 12px;margin-inline-end:auto}
.ch-icon-btn{width:44px;height:44px;border-radius:50%;border:1px solid var(--line);background:#fff;color:var(--ink);display:grid;place-items:center}.ch-icon-btn svg{width:22px;height:22px}
.ch-mini{min-height:40px;border:1px solid var(--line);background:#fff;border-radius:999px;padding:4px 14px;font:inherit;font-weight:700;color:var(--ink)}
.ch-mini.danger{background:#c8321f;border-color:#c8321f;color:#fff}
.ch-net{display:flex;align-items:center;gap:8px;background:var(--warn-bg);color:var(--warn);border-radius:12px;padding:8px 12px;font-weight:700;margin-bottom:8px}
.ch-spin{width:14px;height:14px;border:2px solid currentColor;border-inline-end-color:transparent;border-radius:50%;animation:chspin 1s linear infinite}
@keyframes chspin{to{transform:rotate(360deg)}}
.ch-invite{display:grid;grid-template-columns:132px 1fr;gap:14px;align-items:center;background:var(--soft);border-radius:20px;padding:12px;margin-bottom:10px}
.ch-qr{width:132px;height:132px;border-radius:10px;background:#fff}
.ch-inv-text{min-width:0}.ch-inv-text small{color:var(--muted)}
.ch-code-big{display:block;font-family:'Baloo Bhaijaan',monospace;font-size:32px;letter-spacing:.16em;line-height:1.2;margin:2px 0 8px}
.ch-link{display:flex;gap:6px;align-items:center}.ch-link-in{min-height:40px;font-size:12px;padding:6px 8px;min-width:0}
.ch-count-line{text-align:center;font-weight:700;color:var(--muted);margin:6px 0 10px}
.ch-pods{list-style:none;margin:0 0 14px;padding:0;display:grid;grid-template-columns:repeat(auto-fill,minmax(98px,1fr));gap:10px}
.ch-pod{position:relative;display:flex;flex-direction:column;align-items:center;text-align:center;padding:6px 4px 8px}
.ch-pod-av{width:70px;height:80px;position:relative;z-index:1}
.ch-pod-base{display:block;width:78px;height:14px;margin-top:-8px;border-radius:50%;background:var(--brand);box-shadow:0 6px 0 var(--brand-d)}
.ch-pod.mine .ch-pod-base{background:var(--yel);box-shadow:0 6px 0 var(--yel-d)}
.ch-pod b{margin-top:10px;font-size:14px;line-height:1.4;word-break:break-word}.ch-pod b small{font-weight:600;color:var(--muted)}
.ch-pod>small{font-size:11px;color:var(--muted);min-height:1.4em}
.ch-pod.off .ch-pod-av{opacity:.45;filter:grayscale(.6)}
.ch-dot{position:absolute;top:6px;inset-inline-start:10px;width:10px;height:10px;border-radius:50%;background:#b8bfcc;border:2px solid #fff}.ch-dot.on{background:#13a05f}
.ch-x{position:absolute;top:0;inset-inline-end:2px;width:32px;height:32px;border-radius:50%;border:1px solid var(--line);background:#fff;color:var(--muted);font-size:18px;line-height:1}
.ch-rm-confirm{display:flex;gap:4px;margin-top:4px}.ch-rm-confirm .ch-mini{min-height:34px;padding:2px 10px;font-size:12px}
.ch-pod.arrive .ch-pod-av{animation:charrive .6s var(--bounce) both}.ch-pod.arrive .ch-pod-base{animation:pop .35s var(--bounce) both}
@keyframes charrive{0%{transform:translateY(40px) scale(.6);opacity:0}100%{transform:none;opacity:1}}
.ch-wait{display:flex;flex-direction:column;align-items:center;gap:6px;text-align:center}.ch-wait-av{width:110px;margin:0 auto}
/* countdown */
.ch-cd{min-height:70dvh;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;text-align:center}
.ch-qno{font-weight:800;color:var(--muted);margin:0}
.ch-cd-av{width:150px}
.ch-cd-n{margin-top:12px;font-family:'Baloo Bhaijaan',sans-serif;font-size:96px;font-weight:800;line-height:1;color:var(--brand);min-height:1.1em}
.ch-cd-n.ready{font-size:44px;color:var(--ink);background:var(--yel);border-radius:18px;padding:10px 26px}
.ch-cd-n.beat{animation:chbeat .45s var(--bounce)}
@keyframes chbeat{0%{transform:scale(1.25);opacity:.3}100%{transform:none;opacity:1}}
/* question (calm) */
.ch-q{display:flex;flex-direction:column;gap:10px}
.ch-qhead{display:flex;align-items:center;gap:10px}.ch-qhead .ch-qno{color:var(--ink)}
.ch-lessonname{flex:1;min-width:0;font-size:12px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ch-time{font-family:'Baloo Bhaijaan',sans-serif;font-weight:800;font-size:24px;min-width:48px;height:48px;border-radius:50%;display:grid;place-items:center;background:var(--soft);color:var(--ink)}
.ch-time.low{background:var(--yel)}
.ch-bar{height:6px;border-radius:3px;background:var(--line);overflow:hidden}.ch-bar i{display:block;height:100%;width:100%;background:var(--brand);margin-inline-start:auto}
.ch-ctx{margin:0;background:var(--soft);border-radius:14px;padding:10px 12px;line-height:1.8}
.ch-pic{border:1px solid var(--line);border-radius:14px;padding:6px;background:#fff;max-height:170px;display:flex;justify-content:center;overflow:hidden}
.ch-pic svg{max-height:156px;width:auto;max-width:100%;height:auto}
.ch-prompt{font-family:'Plex Arabic',sans-serif;font-size:20px;font-weight:700;line-height:1.75;margin:4px 0;color:var(--ink)}.ch-prompt.sm{font-size:16px;margin:6px 0}
.ch-opts{display:grid;gap:10px;list-style:none;margin:0;padding:0}
.ch-opt{display:flex;align-items:center;gap:12px;min-height:62px;width:100%;text-align:start;border:2px solid var(--line);border-bottom-width:4px;background:#fff;border-radius:16px;padding:10px 12px;font:inherit;font-size:17px;color:var(--ink)}
.ch-letter{flex:none;width:38px;height:38px;border-radius:12px;background:var(--ink);color:#fff;display:grid;place-items:center;font-weight:800;font-size:18px}
.ch-olabel{flex:1;line-height:1.6}
.ch-tag{flex:none;font-size:12px;font-weight:800;border-radius:999px;padding:2px 10px;background:var(--accent-soft);color:var(--brand)}
.ch-tag.ok{background:var(--ok-bg);color:var(--ok)}
.ch-opt:disabled{opacity:1}.ch-opts:not(.done) .ch-opt:disabled:not(.chosen){opacity:.6}
.ch-opt.chosen{border-color:var(--brand);background:var(--accent-soft)}.ch-opt.chosen .ch-letter{background:var(--brand)}
.ch-lock{margin:0;text-align:center;font-weight:800;padding:10px;border-radius:12px;background:var(--soft)}
.ch-lock.ok{background:var(--accent-soft);color:var(--brand)}.ch-lock.late{background:var(--warn-bg);color:var(--warn)}.ch-lock.spect{font-weight:600;color:var(--muted)}
.ch-qfoot{display:flex;align-items:center;justify-content:space-between;gap:8px;color:var(--muted);font-weight:700;font-size:14px}
.ch-me{display:flex;align-items:center;gap:6px;color:var(--ink)}.ch-me-av{width:34px;height:40px}
/* reveal */
.ch-rv-head{display:flex;align-items:center;gap:12px}.ch-rv-av{width:96px;flex:none}
.ch-rv-av.cheer{animation:chcheer .7s var(--bounce) both}@keyframes chcheer{0%{transform:translateY(24px) scale(.8)}100%{transform:none}}
.ch-rv-title{font-family:'Baloo Bhaijaan','Plex Arabic',sans-serif;font-size:28px;margin:0}
.ch-rv.good .ch-rv-title{color:var(--brand)}
.ch-rv-sub{margin:2px 0;font-weight:800;font-size:18px}.ch-total{margin:0;color:var(--muted);font-weight:700}
.ch-opt.right{border-color:var(--ok);background:var(--ok-bg)}.ch-opt.right .ch-letter{background:var(--ok)}
.ch-opt.wrong{border-style:dashed}
.ch-why{background:var(--soft);border-radius:14px;padding:10px 12px;line-height:1.8;margin:10px 0}
.ch-stat{font-size:14px;color:var(--muted);line-height:1.7}
/* board */
.ch-rows{list-style:none;margin:0 0 8px;padding:0;display:grid;gap:8px}
.ch-row{display:grid;grid-template-columns:32px 44px 1fr auto auto;align-items:center;gap:8px;border:1px solid var(--line);border-radius:14px;padding:6px 10px;background:#fff;animation:chmove .6s var(--ease) both}
@keyframes chmove{0%{transform:translateY(calc(var(--from,0) * 56px));opacity:.6}100%{transform:none;opacity:1}}
.ch-row.mine{border:2px solid var(--brand);background:var(--accent-soft)}
.ch-rank{font-family:'Baloo Bhaijaan',sans-serif;font-weight:800;font-size:20px;text-align:center}
.ch-row-av{width:40px;height:46px}.ch-row b{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ch-mv{font-size:12px;font-weight:800}.ch-mv.up{color:var(--ok)}.ch-mv.down{color:#a2461a}.ch-mv.same{color:var(--muted)}
.ch-score{font-family:'Baloo Bhaijaan',sans-serif;font-weight:800;font-size:18px}
.ch-rows.me-only{border-top:2px dashed var(--line);padding-top:8px}
/* final */
.ch-podium{display:flex;justify-content:center;align-items:flex-end;gap:8px;margin:10px 0 16px}
.ch-place{display:flex;flex-direction:column;align-items:center;text-align:center;width:31%;max-width:130px}
.ch-place-av{width:76px;height:88px}.ch-place.r1 .ch-place-av{width:96px;height:110px}
.ch-place b{font-size:14px;line-height:1.4;word-break:break-word}.ch-place small{color:var(--muted);font-size:12px}
.ch-place [class^="ch-step-"]{display:grid;place-items:center;width:100%;border-radius:12px 12px 0 0;margin-top:4px;color:#fff;font-family:'Baloo Bhaijaan',sans-serif;font-weight:800;font-size:24px}
.ch-step-1{height:96px;background:var(--brand)}.ch-step-2{height:70px;background:#5b7cff}.ch-step-3{height:52px;background:#8ea4ff}
.ch-step-1 i{color:var(--yel);font-style:normal}.ch-place i{font-style:normal}
.ch-place.rise{animation:charrive .7s var(--bounce) both}.ch-place.r1.rise{animation-delay:.25s}.ch-place.r3.rise{animation-delay:.12s}
.ch-mine{background:var(--soft);border-radius:18px;padding:12px 14px}.ch-mine p{margin:0 0 6px;line-height:1.8}
.ch-review{display:grid;gap:8px}
.ch-rev{display:flex;justify-content:space-between;align-items:center;min-height:52px;border:2px solid var(--line);border-radius:14px;background:#fff;padding:8px 14px;font:inherit;font-weight:700;color:var(--ink);text-align:start}
.ch-end-acts{display:grid;gap:4px;margin-top:12px}
@media (prefers-reduced-motion: reduce){.ch-pod.arrive .ch-pod-av,.ch-pod.arrive .ch-pod-base,.ch-cd-n.beat,.ch-rv-av.cheer,.ch-row,.ch-place.rise{animation:none}.ch-spin{animation-duration:3s}}
@media (max-width:360px){.ch-invite{grid-template-columns:1fr;justify-items:center;text-align:center}.ch-seg{grid-template-columns:1fr}}
.ch-unit{border-bottom:1px solid var(--line)}.ch-unit summary{display:flex;justify-content:space-between;align-items:center;min-height:48px;cursor:pointer;list-style-position:inside}
.ch-unit summary b{font-size:15px;color:var(--ink);margin:0}.ch-unit summary small{color:var(--muted);font-weight:700}
.ch-x,.ch-rm-confirm,.ch-dot{z-index:2}.ch-x{position:absolute}.ch-rm-confirm{position:relative}.ch-pod-av{pointer-events:none}

/* =====================================================================
   المعمورة (v3) — a living cross-section in a glass box. Static world drawn once; residents animate with
   short CSS loops chosen by their current activity (data-anim). Walking step time matches the walking speed
   (20 units/s, stride ≈ 7.8 units) so feet do not slide.
   ===================================================================== */
.mw-host{margin:0 -10px}
.mw{position:relative;user-select:none;-webkit-user-select:none}
.mw-svg{display:block;width:100%;height:auto;aspect-ratio:400/640;touch-action:pan-y;-webkit-tap-highlight-color:transparent}
.mw-res{cursor:pointer;outline:none}
.mw-res:focus-visible .mw-shadow{stroke:#2457FF;stroke-width:1.6;opacity:1}
.mw-res .fig .leg,.mw-res .fig .arm,.mw-res .fig .pupil{transform-box:fill-box}
.mw-res[data-anim=walk] .fig .leg.l{transform-origin:50% 0;animation:mwLegA .39s linear infinite}
.mw-res[data-anim=walk] .fig .leg.r{transform-origin:50% 0;animation:mwLegB .39s linear infinite}
.mw-res[data-anim=walk] .fig{animation:mwBob .195s ease-in-out infinite alternate}
@keyframes mwLegA{0%,100%{transform:rotate(24deg)}50%{transform:rotate(-24deg)}}
@keyframes mwLegB{0%,100%{transform:rotate(-24deg)}50%{transform:rotate(24deg)}}
@keyframes mwBob{from{transform:translateY(0)}to{transform:translateY(-6px)}}
.mw-res[data-anim=climb] .fig .arm.l{transform-origin:50% 100%;animation:mwReach .6s ease-in-out infinite}
.mw-res[data-anim=climb] .fig .arm.r{transform-origin:50% 100%;animation:mwReach .6s ease-in-out -.3s infinite}
.mw-res[data-anim=climb] .fig .leg.l{transform-origin:50% 0;animation:mwKnee .6s ease-in-out infinite}
.mw-res[data-anim=climb] .fig .leg.r{transform-origin:50% 0;animation:mwKnee .6s ease-in-out -.3s infinite}
@keyframes mwReach{0%,100%{transform:translateY(0)}50%{transform:translateY(-14px)}}
@keyframes mwKnee{0%,100%{transform:scaleY(1)}50%{transform:scaleY(.72)}}
.mw-res[data-anim=eat] .fig .arm.r{transform-origin:10% 100%;animation:mwSpoon 1.2s ease-in-out infinite}
@keyframes mwSpoon{0%,60%,100%{transform:rotate(0)}30%{transform:rotate(-18deg)}}
.mw-res[data-anim=read] .fig .head{transform-box:fill-box;transform-origin:50% 90%;animation:mwNod 3.2s ease-in-out infinite}
@keyframes mwNod{0%,100%{transform:rotate(0)}50%{transform:rotate(4deg)}}
.mw-res[data-anim=sleep] .fig,.mw-res[data-anim=doze] .fig,.mw-res[data-anim=rest].lying .fig{transform-box:fill-box;transform-origin:50% 100%;animation:mwBreath 3.4s ease-in-out infinite}
@keyframes mwBreath{0%,100%{transform:scale(1,1)}50%{transform:scale(1.035,1)}}
.mw-res[data-anim=dig] .fig{transform-box:fill-box;transform-origin:50% 100%;animation:mwDig .55s ease-in-out infinite}
@keyframes mwDig{0%,100%{transform:rotate(0)}50%{transform:rotate(7deg)}}
.mw-res[data-anim=hammer] .mw-swing{transform-box:view-box;transform-origin:196px 158px;animation:mwHammer .55s ease-in infinite}
@keyframes mwHammer{0%,100%{transform:rotate(0)}45%{transform:rotate(26deg)}62%{transform:rotate(-8deg)}}
.mw-res[data-anim=tidy] .fig .arm.r,.mw-res[data-anim=gather] .fig .arm.r{transform-origin:10% 100%;animation:mwReachSide 1.1s ease-in-out infinite}
@keyframes mwReachSide{0%,100%{transform:rotate(0)}50%{transform:rotate(-16deg)}}
.mw-res[data-anim=chat] .fig .arm.r{transform-origin:10% 100%;animation:mwTalk .9s ease-in-out infinite}
@keyframes mwTalk{0%,100%{transform:rotate(0)}50%{transform:rotate(12deg)}}
.mw-res[data-anim=guard] .fig .pupil,.mw-res[data-anim=look] .fig .pupil{animation:mwLook 3s ease-in-out infinite}
@keyframes mwLook{0%,100%{transform:translateX(-4px)}50%{transform:translateX(5px)}}
.mw-res[data-anim=respond] .fig{transform-box:fill-box;transform-origin:50% 100%;animation:mwHi .5s cubic-bezier(.3,1.5,.5,1) 1}
.mw-res[data-anim=respond] .fig .arm.r{transform-origin:10% 100%;animation:mwTalk .45s ease-in-out 4}
@keyframes mwHi{0%{transform:translateY(0)}45%{transform:translateY(-14px)}100%{transform:translateY(0)}}
.mw-res[data-anim=knock] .fig .arm.r{transform-origin:10% 100%;animation:mwKnock 1.2s ease-in-out infinite}
@keyframes mwKnock{0%,30%,60%,100%{transform:rotate(0)}15%,45%{transform:rotate(-12deg)}}
.mw-res[data-anim=celebrate] .fig{transform-box:fill-box;transform-origin:50% 100%;animation:mwHi .6s cubic-bezier(.3,1.5,.5,1) 1}
.mw-res.leave{opacity:0;transition:opacity .8s}
.mw-dust{animation:mwDust .9s ease-out forwards}
@keyframes mwDust{from{opacity:.8;transform:translateY(0)}to{opacity:0;transform:translateY(-8px)}}
.mw-item[data-tap]{cursor:pointer}
.mw-item.poke{transform-box:fill-box;transform-origin:50% 100%;animation:mwPoke .6s cubic-bezier(.3,1.5,.5,1)}
@keyframes mwPoke{0%,100%{transform:scale(1)}40%{transform:scale(1.08,.94)}}
.mw.reduce .mw-res .fig,.mw.reduce .mw-res .fig *{animation:none!important}
@media (prefers-reduced-motion:reduce){.mw-res .fig,.mw-res .fig *,.mw-dust,.mw-item.poke{animation:none!important}}
.mw-hud{position:absolute;inset:0;pointer-events:none}
.mw-zoom{position:absolute;top:10px;inset-inline-start:10px;display:flex;flex-direction:column;gap:6px;pointer-events:auto}
.mw-btn{width:40px;height:40px;border-radius:12px;border:1px solid #d9e1ef;background:#ffffffee;color:#14213D;font-size:22px;font-weight:800;line-height:1;box-shadow:0 2px 8px #14213d18}
.mw-all{position:absolute;top:10px;inset-inline-end:10px;pointer-events:auto;min-height:40px;border-radius:999px;border:0;background:#2457FF;color:#fff;font:inherit;font-weight:800;font-size:13px;padding:6px 14px;box-shadow:0 2px 10px #2457ff44}
.mw-chip{position:absolute;bottom:12px;inset-inline:12px;pointer-events:none;background:#ffffffee;border:1px solid #e3e8f3;border-radius:14px;padding:8px 12px;box-shadow:0 4px 14px #14213d1a;display:flex;flex-direction:column;gap:2px}
.mw-chip b{font-size:15px;color:#14213D}.mw-chip span{font-size:12.5px;color:#56617a;line-height:1.6}
.col-next{margin:-4px 0 10px}
.mw-chip[hidden],.mw-all[hidden]{display:none}
.mw-zoom{top:auto;bottom:8px;flex-direction:row;inset-inline-start:12px}
.mw-all{top:auto;bottom:8px;inset-inline-end:12px}
.mw-chip{bottom:auto;top:10px}
.mw-btn{width:36px;height:36px;font-size:20px}
.mw-res.lying .mw-shadow{display:none}
/* ---------------- account + paid chapters ---------------- */
.acct-btn{display:inline-flex;align-items:center;gap:6px;min-height:40px;padding:4px 12px;border-radius:999px;border:1.5px solid var(--line);background:#fff;color:var(--ink);font:inherit;font-weight:800;font-size:14px;cursor:pointer}
.acct-btn.on{border-color:var(--brand)}
.acct-btn b{display:grid;place-items:center;width:26px;height:26px;border-radius:50%;background:var(--brand);color:#fff;font-size:13px}
.top .acct-btn+.corner-mascot{margin-inline-start:0}
.top .acct-btn{margin-inline-start:auto}
.lock-ic{width:1em;height:1em;vertical-align:-0.12em;color:#14213D}
.lesson-row.is-locked{opacity:.72;background:#f6f7fb}
.lesson-row.is-locked strong{color:var(--muted)}
.lr-lock{font-size:18px}
.cl-i.is-locked{opacity:.45;filter:grayscale(.6)}
.u-free{display:inline-block;margin-inline-start:8px;padding:1px 8px;border-radius:999px;background:#e8f8ec;color:#1f6b3a;font-size:12px;font-weight:800;vertical-align:2px}
.unit.is-locked>summary .u-name{color:var(--muted)}
.u-buy{display:flex;flex-wrap:wrap;align-items:center;gap:8px 12px;margin:8px 0 10px;padding:12px 14px;border-radius:14px;background:#fff8dc;border:1px solid #f3e2a3}
.u-buy p{margin:0;flex:1 1 180px;font-size:14px;line-height:1.6}
.u-buy .primary{flex:0 0 auto;width:auto;min-height:44px}
.lock-page{display:grid;gap:14px;justify-items:center;padding-block:6px 20px}
.lock-badge{display:grid;place-items:center;width:64px;height:64px;border-radius:20px;background:#fff8dc;font-size:30px}
.lock-page .title{margin:0}.lock-page .intro{margin:0;max-width:34ch}
.lock-facts{list-style:none;margin:0;padding:0;display:grid;gap:8px;width:100%;max-width:420px}
.lock-facts li{padding:10px 14px;border-radius:12px;background:#f4f6fb;font-size:15px}
.lock-facts b{font-size:17px}
.lock-list{display:flex;flex-wrap:wrap;gap:6px;justify-content:center;max-width:460px}
.lock-list span{padding:4px 10px;border-radius:999px;border:1px solid var(--line);font-size:13px;color:var(--muted)}
.lock-page .primary{max-width:420px}
.acct-page{display:grid;gap:14px;padding-block:4px 24px;max-width:460px;margin-inline:auto}
.acct-page .title{margin:0}.acct-page .intro{margin:0}
.acct-form{display:grid;gap:12px}
.acct-form label{display:grid;gap:6px;font-weight:700;font-size:14px}
.acct-form input,.acct-form select{min-height:50px;border-radius:12px;border:1.5px solid var(--line);padding:0 14px;font:inherit;font-size:16px;background:#fff;color:var(--ink)}
.acct-form input:focus,.acct-form select:focus{outline:3px solid #c9d7ff;border-color:var(--brand)}
.acct-form input[readonly]{background:#f4f6fb}
.acct-form .check{display:flex;align-items:flex-start;gap:10px;font-weight:600}
.acct-form .check input{min-height:auto;width:22px;height:22px;margin-top:2px;accent-color:var(--brand)}
.acct-msg{margin:0;padding:10px 12px;border-radius:10px;background:#fdecea;color:#8a2a1c;font-weight:700;font-size:14px}
.acct-facts{display:grid;gap:8px;margin:0}
.acct-facts div{display:flex;justify-content:space-between;gap:12px;padding:10px 0;border-bottom:1px solid var(--line)}
.acct-facts dt{color:var(--muted)}.acct-facts dd{margin:0;font-weight:700;text-align:start}
.ghost{min-height:48px;border-radius:14px;border:1.5px solid var(--line);background:#fff;color:var(--ink);font:inherit;font-weight:800}
.text-btn.inline{display:inline;margin:0;padding:0;min-height:0}
/* English listening: «استمع» reads the sentence with the phone's English voice (speech.mjs) */
.say-btn{display:inline-flex;align-items:center;gap:8px;min-height:44px;padding:8px 16px;border-radius:999px;border:1.5px solid var(--line);background:#fff;color:var(--ink);font:inherit;font-weight:800;cursor:pointer}
.say-btn svg{width:22px;height:22px;color:var(--brand);flex:none}
.say-btn:active{transform:scale(.97)}
.say-btn.no-voice{font-weight:600;color:var(--muted)}
.en{direction:ltr;unicode-bidi:isolate;font-family:inherit}
/* link to the full platform (primary grades, videos, English lab) — the homepage now opens «اكتشف» */
.classic-link{box-sizing:border-box;width:100%;display:flex;align-items:center;justify-content:space-between;gap:12px;margin:18px 0 6px;padding:14px 16px;border-radius:16px;border:1.5px dashed var(--line);background:var(--paper);color:var(--ink);text-decoration:none}
.classic-link strong{display:block;font-weight:800}.classic-link small{display:block;color:var(--muted);margin-top:2px}
.classic-link>span:last-child{font-weight:800;color:var(--brand)}
/* a lesson's character before it joins the colony: a silhouette that gains colour as the student proves understanding */
.res.is-wait{opacity:.5;filter:grayscale(1) brightness(1.08)}
.res.is-wait.wait-near{opacity:.72;filter:grayscale(.55)}
.res.is-wait.wait-near2{opacity:.92;filter:grayscale(.12)}
.code-input{box-sizing:border-box;width:100%;min-width:0;font-size:24px;letter-spacing:6px;text-align:center;font-variant-numeric:tabular-nums}
