@font-face{font-family:"Baloo";src:url("./fonts/Baloo.ttf") format("truetype");font-weight:400 800;font-display:block}
@font-face{font-family:"Cairo";src:url("./fonts/Cairo.ttf") format("truetype");font-weight:200 1000;font-display:swap}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent;user-select:none;-webkit-user-select:none}
html,body{margin:0;height:100%;width:100%;overflow:hidden;position:fixed;inset:0;font-family:"Cairo","Noto Naskh Arabic","Segoe UI",Tahoma,Arial,sans-serif;background:linear-gradient(#6cc8f5,#c8f0ff 60%,#fff6d8);touch-action:none}
#gl{position:fixed;inset:0;width:100%;height:100%;display:block;touch-action:none}
#ui{position:fixed;inset:0;overflow:hidden;pointer-events:none;display:flex;flex-direction:column}
#ui .pe,#ui button,#ui input,#ui canvas.pe{pointer-events:auto}
.top{display:flex;align-items:center;justify-content:space-between;padding:10px 12px;gap:8px}
.chip{background:#fff;border-radius:22px;padding:6px 14px;font-weight:800;font-size:18px;box-shadow:0 4px 0 #0002,0 8px 14px #0002;display:flex;gap:8px;align-items:center;border:0;color:#333}
.chip img{width:34px;height:34px;object-fit:contain}
.title{font-size:34px;font-weight:900;color:#fff;text-shadow:0 4px 0 #2a7fb0,0 8px 12px #0004;margin:0}
.btn{font:inherit;font-weight:900;font-size:22px;border:0;border-radius:26px;padding:14px 28px;color:#fff;background:#2fbf5b;box-shadow:0 7px 0 #1b8a3c,0 14px 18px #0003;transition:transform .08s,box-shadow .08s;cursor:pointer}
.btn:active{transform:translateY(6px);box-shadow:0 1px 0 #1b8a3c,0 4px 8px #0003}
.btn.soft{background:#ffb703;box-shadow:0 7px 0 #c98a00,0 14px 18px #0003;color:#4a3200}
.btn.soft:active{box-shadow:0 1px 0 #c98a00}
.btn.blue{background:#3a86ff;box-shadow:0 7px 0 #1f5cc4,0 14px 18px #0003}
.center{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:14px;padding:12px}
.nameform{background:#ffffffd9;border-radius:30px;padding:20px;display:flex;flex-direction:column;gap:12px;width:min(92vw,420px);box-shadow:0 10px 0 #0002,0 20px 30px #0003}
.nameform label{display:flex;flex-direction:column;font-weight:800;color:#444;gap:4px}
.nameform input{font:inherit;font-size:22px;padding:12px;border-radius:16px;border:3px solid #8ed1f0;outline:0;text-align:center}
.kids{display:flex;gap:18px;flex-wrap:wrap;justify-content:center}
.kid{border:0;border-radius:30px;padding:16px 22px;font:inherit;font-size:26px;font-weight:900;color:#fff;display:flex;flex-direction:column;align-items:center;gap:6px;box-shadow:0 10px 0 #0003,0 18px 24px #0003;cursor:pointer}
.kid img{width:110px;height:110px;object-fit:contain;filter:drop-shadow(0 6px 4px #0004)}
.salma{display:flex;align-items:flex-end;gap:8px;padding:6px 10px 12px;margin-top:auto}

.bubble{background:#fff;border-radius:22px;padding:10px 16px;font-weight:800;font-size:19px;color:#333;box-shadow:0 5px 0 #0002;max-width:70vw;pointer-events:auto}
.bubble b{display:block;color:#e0479e;font-size:15px}
@keyframes bob{50%{transform:translateY(-8px) rotate(2deg)}}
.levels{display:flex;gap:7px;flex-wrap:nowrap;justify-content:center;flex-wrap:wrap;padding:6px 10px}
.lv{width:46px;height:46px;border-radius:50%;border:0;font:inherit;font-size:22px;font-weight:900;color:#fff;box-shadow:0 5px 0 #0003,0 9px 10px #0003;cursor:pointer}
.lv:active{transform:translateY(5px)}
.lv.done{background:#2fbf5b!important}.lv.lock{background:#aaa!important;opacity:.7}
.dots{display:flex;gap:3px;min-width:0;justify-content:center;padding:2px 0}
.dot{flex:none;width:9px;height:9px;border-radius:50%;background:#fff8;box-shadow:0 2px 0 #0002}.dot.on{background:#ffb703}.dot.cur{background:#ff4d6d;transform:scale(1.35)}
.stage{position:relative;width:min(86vw,360px);aspect-ratio:1;border-radius:34px;background:#fff;box-shadow:0 10px 0 #0002,0 22px 30px #0003;overflow:hidden}
.stage canvas,.stage img{position:absolute;inset:0;width:100%;height:100%;touch-action:none}
.stage img{object-fit:contain;padding:8%}
.pads{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;width:min(94vw,430px)}
.pad{min-width:0;overflow:hidden;background:#fff;border-radius:20px;aspect-ratio:1;display:flex;flex-direction:column;align-items:center;justify-content:center;box-shadow:0 6px 0 #0003,0 10px 14px #0003;border:4px dashed #8ed1f0;transition:transform .2s}
.pad img{width:78%;height:70%;object-fit:contain}.pad.ok{border-color:#2fbf5b;background:#e8ffe8}
.items{display:flex;flex-wrap:wrap;gap:12px;justify-content:center;width:min(94vw,430px);min-height:120px}
.item{width:92px;height:92px;background:#fff;border-radius:22px;box-shadow:0 6px 0 #0003,0 12px 14px #0003;display:flex;align-items:center;justify-content:center;touch-action:none;position:relative;z-index:5}
.item img{width:84%;height:84%;object-fit:contain;pointer-events:none}
.item.shake{animation:shake .4s}@keyframes shake{25%{transform:translateX(-10px)}75%{transform:translateX(10px)}}
.hint{color:#fff;font-weight:900;font-size:18px;text-align:center;background:#2a7fb0cc;border-radius:18px;padding:6px 14px;margin:0 auto;width:fit-content;max-width:92vw;box-shadow:0 4px 0 #0002}
.pop{animation:pop .5s}@keyframes pop{50%{transform:scale(1.2)}}
.storycard{background:#fff;border-radius:30px;padding:16px;width:min(90vw,380px);display:flex;flex-direction:column;align-items:center;gap:12px;box-shadow:0 10px 0 #0002,0 22px 30px #0003}
.storycard img{width:62%;max-height:36vh;object-fit:contain}.storycard img.hop{animation:hop .8s}
@keyframes hop{30%{transform:translateY(-22px) rotate(-6deg)}60%{transform:translateY(0) rotate(5deg)}}
.stxt{font-size:25px;font-weight:900;color:#333;text-align:center;line-height:1.6}
.qpic{background:#fff;border-radius:30px;width:min(60vw,230px);aspect-ratio:1;display:flex;align-items:center;justify-content:center;box-shadow:0 8px 0 #0002,0 18px 24px #0003}
.qpic img{width:84%;height:84%;object-fit:contain}
.qchoices{display:flex;gap:12px;flex-wrap:wrap;justify-content:center;width:min(94vw,430px)}
.qb{font:inherit;font-size:54px;font-weight:900;width:84px;height:84px;border-radius:24px;border:0;background:#fff;color:#d62868;box-shadow:0 7px 0 #0003,0 12px 14px #0003;font-family:"Noto Naskh Arabic","Noto Sans Arabic",Tahoma,sans-serif;line-height:1}
.qb.good{background:#7be08f;animation:pop .5s}.qb.bad{background:#ffb3b3;animation:shake .4s}
.turn{background:#fff;color:#d62868;font-weight:900;font-size:24px;border-radius:20px;padding:4px 18px;box-shadow:0 4px 0 #0002}
.bigok{font-size:80px;font-weight:900;color:#fff;text-shadow:0 5px 0 #2a7fb0}
.duelbar{display:flex;align-items:center;justify-content:center;gap:10px;padding:0 10px}
.dp{background:#fff9;border-radius:22px;padding:6px 14px;font-weight:900;font-size:19px;display:flex;align-items:center;gap:8px;color:#333}.dp img{width:36px;height:36px;object-fit:contain}.dp b{background:#ff4d6d;color:#fff;border-radius:14px;padding:0 10px;font-size:22px}
.dp.act{background:#fff;box-shadow:0 0 0 4px #ffd23f,0 6px 0 #0002;transform:scale(1.07)}.dvs{font-size:28px}
.pal{display:flex;gap:9px;flex-wrap:wrap;justify-content:center;width:min(92vw,380px)}
.sw{width:38px;height:38px;border-radius:50%;border:3px solid #fff;box-shadow:0 4px 0 #0003}.sw.sel{transform:scale(1.25);border-color:#333}
.gwrap{flex:1;display:flex;align-items:center;justify-content:center;padding:8px}
.garden{position:relative;width:min(94vw,430px);height:min(62vh,520px);border-radius:30px;background:linear-gradient(#a8e6ff 0 18%,#7fd36f 18% 100%);box-shadow:0 10px 0 #0002,0 22px 30px #0003;overflow:hidden}
.gflow{position:absolute;top:12%;left:0;right:0;text-align:center;font-size:26px;letter-spacing:6px}
.gi{position:absolute;left:var(--x);top:calc(var(--y) + 14%);width:22%;aspect-ratio:1;animation:wander var(--d) ease-in-out var(--dl) infinite alternate}
.gi img{width:100%;height:100%;object-fit:contain;pointer-events:none;filter:drop-shadow(0 5px 3px #0004)}
@keyframes wander{from{transform:translate(-8px,-6px)}to{transform:translate(8px,8px) rotate(4deg)}}
.gi.gok{animation:none;transform:scale(1.5);transition:transform .4s;z-index:5}.gi.shake{animation:shake .4s}
/* v3.1 modern flat look */
html,body{background:linear-gradient(#b9e6ff,#e4f6ff 55%,#fff3dc)!important}
.btn{box-shadow:0 6px 0 #1b8a3c!important;border-radius:20px;letter-spacing:.2px}.btn:active{box-shadow:0 0 0 #1b8a3c!important;transform:translateY(6px)}
.btn.soft{box-shadow:0 6px 0 #d99500!important}.btn.blue{box-shadow:0 6px 0 #1f5cc4!important}
.chip{box-shadow:0 3px 0 #0001!important;border:2px solid #e6eef5}
.title{text-shadow:0 3px 0 #2a7fb066!important;color:#2b6cb0}
.stage,.storycard,.qpic,.garden,.nameform{box-shadow:0 6px 0 #0000001a!important;border:3px solid #fff}
.pad,.item,.qb{box-shadow:0 5px 0 #0000001f!important}
.bubble{box-shadow:0 3px 0 #0000001a!important;border:2px solid #f0f4f8}
.hint{background:#ffffffd9;color:#2b6cb0;box-shadow:0 3px 0 #0000001a!important}
.lv{box-shadow:0 4px 0 #0003!important;border:3px solid #fff}


/* motion */
.salsvg{width:92px;height:auto;overflow:visible;cursor:pointer;pointer-events:auto;filter:drop-shadow(0 6px 5px #0004);animation:bob 2.4s ease-in-out infinite;transform-origin:50% 100%}
.salsvg .eyes{transform-box:fill-box;transform-origin:center;transition:transform .08s}
.salsvg.blink .eyes{transform:scaleY(.1)}
.salsvg .head{transform-box:fill-box;transform-origin:50% 90%;animation:tilt 3.2s ease-in-out infinite}
@keyframes tilt{50%{transform:rotate(3deg)}}
.salsvg .wave{transform-box:fill-box;transform-origin:15% 90%;animation:wv 4s ease-in-out infinite}
@keyframes wv{0%,55%,100%{transform:rotate(0)}62%{transform:rotate(18deg)}70%{transform:rotate(-14deg)}78%{transform:rotate(18deg)}86%{transform:rotate(-10deg)}}
.salsvg.cheer .armL,.salsvg.cheer .armR{transform-box:fill-box;transform-origin:50% 90%;animation:cheerarm .6s ease-in-out infinite alternate}
@keyframes cheerarm{to{transform:rotate(10deg)}}
.salsvg.talk .mouth{transform-box:fill-box;transform-origin:center;animation:talk .28s ease-in-out infinite alternate}
@keyframes talk{to{transform:scaleY(1.6) translateY(2px)}}
.salsvg.jump{animation:jump .8s}
@keyframes jump{0%{transform:translateY(0) scale(1,1)}20%{transform:scale(1.12,.88)}45%{transform:translateY(-40px) scale(.94,1.1) rotate(-6deg)}70%{transform:translateY(0) scale(1.1,.9)}100%{transform:none}}
.salsvg.oops{animation:shake .5s}
.bubble{animation:bubin .4s both cubic-bezier(.3,1.6,.5,1);transform-origin:100% 100%}
@keyframes bubin{from{transform:scale(.3);opacity:0}}
/* screen transitions */
#ui>*{animation:enter .45s both cubic-bezier(.2,1.4,.5,1)}
#ui>*:nth-child(2){animation-delay:.05s}#ui>*:nth-child(3){animation-delay:.1s}#ui>*:nth-child(4){animation-delay:.15s}#ui>*:nth-child(5){animation-delay:.2s}
@keyframes enter{from{opacity:0;transform:translateY(30px) scale(.94)}}
/* idle life */
.storycard img,.stage img,.qb img,.item img,.dp img,.kid img{animation:float 2.6s ease-in-out infinite;transform-origin:50% 100%}
@keyframes float{0%,100%{transform:translateY(0) scale(1,1)}50%{transform:translateY(-8px) scale(.97,1.04)}}
.item:nth-child(2n) img,.dp:nth-child(2n) img{animation-delay:-.8s}.item:nth-child(3n) img{animation-delay:-1.6s}
.pad,.qb{animation:wig 3.4s ease-in-out infinite}.pad:nth-child(2n),.qb:nth-child(2n){animation-delay:-1.2s}.pad:nth-child(3n),.qb:nth-child(3n){animation-delay:-2.2s}
@keyframes wig{0%,80%,100%{transform:rotate(0)}85%{transform:rotate(-5deg) scale(1.05)}92%{transform:rotate(5deg) scale(1.05)}}
.qb:active,.pad:active,.item:active,.chip:active,.lv:active{transform:scale(.9)!important}
.lv{animation:lvp 2s ease-in-out infinite}.lv:nth-child(2n){animation-delay:-.7s}@keyframes lvp{50%{transform:scale(1.1) translateY(-4px)}}
.lv.lock{animation:none}
#next,.btn.pulse{animation:npulse 1.2s ease-in-out infinite}@keyframes npulse{50%{transform:scale(1.07)}}
.title{animation:tpop .9s both cubic-bezier(.3,1.7,.5,1)}@keyframes tpop{from{transform:scale(.2) rotate(-12deg);opacity:0}}
/* particles */
.fxp{position:fixed;z-index:99;pointer-events:none;animation:fxp .9s ease-out forwards;transform:translate(-50%,-50%)}
@keyframes fxp{to{transform:translate(calc(-50% + var(--dx)),calc(-50% + var(--dy))) rotate(var(--r)) scale(.3);opacity:0}}
.cf{position:fixed;top:-20px;z-index:98;pointer-events:none;border-radius:2px;animation:cf var(--d) ease-in forwards}
@keyframes cf{to{transform:translate(var(--x),105vh) rotate(720deg)}}

.nameform{gap:10px}.nrow{display:flex;flex-direction:column;gap:6px;font-weight:800;font-size:19px;color:#333}
.nrow input{font:inherit;font-size:24px;padding:10px 14px;border-radius:18px;border:3px solid #8fd0f2;text-align:center;font-weight:800}
.scs{display:flex;gap:6px;flex-wrap:nowrap;justify-content:center;flex:1;min-width:0}
.sc{display:flex;align-items:center;gap:5px;background:#fff9;border-radius:18px;padding:3px 9px;font-weight:900;font-size:15px;color:#333;min-width:0;transition:transform .25s}
.sc img{width:26px;height:26px;object-fit:contain}.scnm{max-width:64px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.sc b{background:#ff4d6d;color:#fff;border-radius:12px;padding:0 8px;min-width:12px;text-align:center}
.sc.act{background:#fff;box-shadow:0 0 0 3px #ffd23f,0 4px 0 #0002;transform:scale(1.1)}
.turnban{position:fixed;inset:0;z-index:200;display:flex;align-items:center;justify-content:center;background:#13335ccc;animation:tbin .25s ease-out}
.turnban.out{opacity:0;transition:opacity .28s}
.tb-card{background:#fff;border-radius:36px;padding:26px 40px;text-align:center;box-shadow:0 12px 0 #0003;animation:tbpop .5s cubic-bezier(.2,1.6,.4,1)}
.tb-card img{width:130px;height:130px;object-fit:contain;animation:float 1.4s ease-in-out infinite}
.tb-t{font-size:34px;font-weight:900;color:#d62868;margin-top:6px}.tb-s{font-size:30px;font-weight:900;color:#2a8f4a}
@keyframes tbin{from{opacity:0}to{opacity:1}}@keyframes tbpop{0%{transform:scale(.4)}100%{transform:scale(1)}}
.fxp svg,.bigok svg,.gflow svg{display:block}.bigok svg{width:1em;height:1em}.gflow{display:flex;gap:6px;justify-content:center;font-size:34px}
.chip svg{display:block}.btn svg{vertical-align:middle;margin-inline-end:6px}
.lv svg{display:block;margin:auto}

@media(max-width:480px){.dots{display:none}}

.spk{display:flex;flex-direction:column;align-items:center;gap:14px}
.bigl{font-family:"Cairo",sans-serif;font-weight:900;font-size:150px;line-height:1.1;color:#e0245e;text-shadow:0 6px 0 #0002}
.mic{width:116px;height:116px;border-radius:50%;border:0;background:#2a8f4a;box-shadow:0 8px 0 #1c6a35;display:flex;align-items:center;justify-content:center;animation:micp 1.6s ease-in-out infinite}
.mic.rec{background:#e0245e;box-shadow:0 8px 0 #a8143f;animation:micr .7s ease-in-out infinite}.mic.okm{background:#2fbf5b;animation:none}
@keyframes micp{50%{transform:scale(1.08)}}@keyframes micr{50%{transform:scale(1.18)}}
.note{position:relative;border-radius:22px;background:#fffdf5 repeating-linear-gradient(#fffdf5 0,#fffdf5 55px,#bcd9f2 56px);box-shadow:0 8px 0 #0002,inset 0 0 0 3px #e9d8b0;overflow:hidden}
.note canvas{position:absolute;inset:0;width:100%;height:100%}

.lrn{display:flex;flex-direction:column;align-items:center;gap:12px}
.lhd{font-size:28px;font-weight:900;color:#1d3557;background:#fff;border-radius:18px;padding:6px 18px;box-shadow:0 4px 0 #0002}
.hl,.hl2{color:#e0245e}.wd{font-size:46px;font-weight:900;color:#1d3557}
button.bigl{border:0;background:#fff;border-radius:34px;width:230px;height:230px;box-shadow:0 10px 0 #0002;animation:micp 2s ease-in-out infinite;font-size:170px;color:#e0245e}
.pcard{width:min(76vw,300px);aspect-ratio:1/1;border-radius:26px;overflow:hidden;box-shadow:0 8px 0 #0003;background:#fff;border:6px solid #fff}.pcard img,.pch img{width:100%;height:100%;object-fit:cover;display:block}
.pgrid{display:grid;grid-template-columns:1fr 1fr;gap:12px;width:min(88vw,340px)}
.pch{aspect-ratio:1/1;border:6px solid #fff;border-radius:22px;overflow:hidden;padding:0;background:#fff;box-shadow:0 6px 0 #0003}.pch.ok{border-color:#2fbf5b;transform:scale(1.06)}.pch.bad{border-color:#e63946;animation:shk .4s}
@keyframes shk{25%{transform:translateX(-8px)}75%{transform:translateX(8px)}}
.skp{margin-top:6px;border:0;background:#0000;color:#556;font-size:14px;text-decoration:underline}

.crd{background:#fff;border-radius:14px;padding:8px 12px;font-size:13px;max-width:88vw;box-shadow:0 3px 0 #0002}

.streak{text-align:center;font-weight:900;color:#c2410c;background:#fff;border-radius:14px;padding:4px 10px;margin:4px auto;width:fit-content;font-size:14px;box-shadow:0 3px 0 #0002}
.gq{font-size:44px;font-weight:900;color:#1d3557;background:#fff;border-radius:18px;padding:8px 22px;direction:rtl}.gopts{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:8px 0}
.pst{display:grid;grid-template-columns:1fr 1fr;gap:8px;width:min(88vw,340px)}.pst div{background:#fff;border-radius:14px;padding:8px;text-align:center;font-weight:700;box-shadow:0 3px 0 #0002}.pst b{font-size:26px;color:#e0245e;display:block}
.pbx{background:#fff;border-radius:14px;padding:8px 12px;font-weight:700;width:min(88vw,340px);box-shadow:0 3px 0 #0002}.chp{display:inline-block;font-size:26px;color:#1d3557;margin:0 4px}

.agrid{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;width:min(92vw,360px);max-height:62vh;overflow:auto;padding:4px}
.stk{background:#fff;border-radius:14px;padding:6px;box-shadow:0 3px 0 #0002;aspect-ratio:1;display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:0}.stk svg{flex:1;min-height:0}.stk small{font-weight:800;font-size:11px;color:#444}.stk:not(.on){opacity:.7}
.agrid{grid-auto-rows:108px}.stk{aspect-ratio:auto;overflow:hidden}.stk small{white-space:nowrap;font-size:10px;margin-top:2px}.stk svg{max-height:70px}
/* fit-to-viewport */
html,body,#gl{height:100vh;height:100dvh}
#ui{height:100vh;height:100dvh;inset:auto;top:0;left:0;right:0;padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left)}
.center{min-height:0;overflow-y:auto;overflow-x:hidden;touch-action:pan-y;-webkit-overflow-scrolling:touch}
.center>*{flex-shrink:0}
.top,.salma,.levels,.streak,.hint{flex-shrink:0}
.pcard{width:min(76vw,300px,36dvh)}
.pgrid{width:min(88vw,340px,56dvh)}
.bigl{font-size:min(150px,20dvh)}
button.bigl{width:min(230px,30dvh);height:min(230px,30dvh);font-size:min(170px,22dvh)}
.gq{font-size:min(44px,7dvh)}
@media (max-height:700px){
 .top{padding:6px 10px}.chip{font-size:15px;padding:4px 10px}.chip img{width:26px;height:26px}
 .title{font-size:26px}.btn{font-size:19px;padding:10px 22px;box-shadow:0 5px 0 #1b8a3c,0 9px 12px #0003}
 .salma{padding:2px 8px 6px}.salma svg{width:64px;height:auto;max-height:80px}.bubble{font-size:15px;padding:6px 12px;max-width:72vw}.bubble b{font-size:12px}
 .center{gap:8px;padding:6px}.lhd{font-size:20px!important}.hint{font-size:14px;padding:4px 10px}
 .lv{width:40px;height:40px;font-size:19px}.levels{gap:5px;padding:4px 8px}
 .pst b{font-size:20px}.pst div{padding:4px;font-size:13px}.pbx{padding:5px 10px;font-size:13px}
 .agrid{max-height:56dvh}.kid img{width:80px;height:80px}.kid{font-size:20px;padding:10px 16px}
}
.center{justify-content:flex-start}.center>:first-child{margin-top:auto}.center>:last-child{margin-bottom:auto}
#wa{position:sticky;bottom:4px;z-index:2}
@media (max-height:700px){.pst{gap:5px}.pst div{font-size:12px}.pbx{font-size:12px}#alb2{display:none}}
.center[style*="flex:0"]{flex:0 0 auto!important;overflow:visible;min-height:auto}

.stg{justify-content:flex-start;gap:0;padding:6px 10px 10px;width:100%}
.prow{display:flex;justify-content:space-between;width:min(94vw,380px);margin:0 auto 22px;position:relative;flex-shrink:0}
.prow::before{content:"";position:absolute;left:8%;right:8%;top:28px;height:8px;border-radius:4px;background:#ffffffcc;z-index:0}
.prow.rev{flex-direction:row-reverse}
.prow:not(:last-child)>.nd:last-child::after{content:"";position:absolute;top:56px;left:50%;width:8px;height:34px;margin-left:-4px;background:#ffffffcc;border-radius:4px;z-index:-1}
.nd{position:relative;z-index:1;width:62px;border:0;background:none;padding:0;display:flex;flex-direction:column;align-items:center;font:inherit;cursor:pointer}
.nd .nc{width:56px;height:56px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:24px;font-weight:900;color:#fff;background:var(--c);box-shadow:0 5px 0 #0003,0 8px 10px #0002;border:4px solid #fff}
.nd small{font-size:11px;font-weight:800;color:#445;margin-top:4px;display:none}
.nd.done .nc{background:#2fbf5b}
.nd.lock .nc{background:#d5d9df;color:#6b7280}
.nd.pay .nc{background:#cbd0f0}
.nd.cur .nc{background:#ff8a1f;width:66px;height:66px;font-size:30px;animation:cpulse 1.2s ease-in-out infinite;border-color:#fff;box-shadow:0 0 0 6px #ffd23f,0 6px 0 #0003}
.nd .bnc{position:absolute;top:-30px;animation:bnc .8s ease-in-out infinite}
@keyframes cpulse{50%{transform:scale(1.08)}}@keyframes bnc{50%{transform:translateY(6px)}}
.nd.shk{animation:shk .4s}
@media (max-height:700px){.prow{margin-bottom:18px}.nd .nc{width:50px;height:50px;font-size:21px}.nd.cur .nc{width:58px;height:58px}.prow::before{top:25px}.prow:not(:last-child)>.nd:last-child::after{top:50px;height:30px}}

.nd small{display:block!important;font-size:12px;margin-top:3px;white-space:nowrap}
.stg{padding-top:34px}
.prow{margin-bottom:14px}
.prow:not(:last-child)>.nd:last-child::after{top:56px;height:36px}
.nd.cur small{color:#e0245e;font-weight:900}
@media (max-height:700px){.prow:not(:last-child)>.nd:last-child::after{top:52px;height:30px}}

.stars{display:inline-flex;align-items:center;gap:2px;font-size:15px}.stars b{color:#b37d00}
.ptabs{display:flex;gap:8px;flex-wrap:wrap;justify-content:center;width:min(94vw,360px)}
.ptab{border:3px solid #fff;background:#ffffffcc;border-radius:18px;padding:4px 10px;font:inherit;font-weight:800;font-size:15px;display:flex;gap:6px;align-items:center}.ptab img{width:26px;height:26px;object-fit:contain}.ptab.on{background:#ff8a1f;color:#fff}
.pst{grid-template-columns:1fr 1fr!important}.pst div{font-size:12px!important}

.krow{display:flex;gap:6px;justify-content:center;flex-wrap:wrap;flex-shrink:0}
.kc{background:#ffffffcc;border:3px solid #fff;border-radius:16px;padding:2px 8px;font-weight:800;font-size:13px;display:flex;gap:4px;align-items:center}.kc img{width:24px;height:24px;object-fit:contain}.kc b{color:#b37d00}
.kc.on{background:#ff8a1f;color:#fff}.kc.on b{color:#fff}

.rstk{width:min(52vw,38dvh,220px);height:min(52vw,38dvh,220px);background:#fff;border-radius:30px;padding:14px;box-shadow:0 8px 0 #0002;animation:rpop .7s cubic-bezier(.2,1.6,.4,1)}
.rname{font-weight:900;font-size:22px;color:#1d3557;background:#fff;border-radius:16px;padding:2px 14px}
@keyframes rpop{from{transform:scale(.2) rotate(-12deg)}to{transform:scale(1)}}

.gimg{display:block;pointer-events:none;object-fit:contain}
button.bigl .gimg{width:86%;height:86%;margin:auto}
div.bigl{display:flex;align-items:center;justify-content:center}
div.bigl .gimg{width:1.3em;height:1.3em}
.qb .gimg{width:78%;height:78%;margin:auto}
.qb{display:flex;align-items:center;justify-content:center;padding:0}
button.bigl{display:flex;align-items:center;justify-content:center;padding:0}

.rep{padding:8px 16px!important;border:3px solid #ffb703!important}
.ib{width:54px;height:54px;border-radius:50%;border:2px solid #e6eef5;background:#fff;box-shadow:0 3px 0 #0001;display:flex;align-items:center;justify-content:center;padding:0}
@media(max-width:340px){.top .chip{padding:6px 9px;font-size:16px;gap:5px}.rep{padding:6px 10px!important}.top .chip img{width:28px;height:28px}}
/* weak-letter practice badge + map button */
.nd{position:relative}
.nd.wkd::after{content:'';position:absolute;top:-2px;left:-2px;width:14px;height:14px;border-radius:50%;background:#e0245e;border:2px solid #fff;box-shadow:0 1px 2px #0003}
.ib.wk{box-shadow:0 0 0 3px #ffd23f55}
/* parent: per-letter status grid */
.lgrid{display:grid;grid-template-columns:repeat(7,1fr);gap:4px}
.lg{background:#eef2f7;border-radius:9px;display:flex;align-items:center;justify-content:center;font-weight:900;font-size:17px;color:#9aa3b2;padding:5px 0;box-shadow:0 2px 0 #0001}
.lg.ms{background:#d9f7e3;color:#12703a}
.lg.pr{background:#fff1c7;color:#9a6400}
.lkey{display:flex;align-items:center;justify-content:center;gap:6px;font-size:11px;font-weight:700;color:#5b6b7f;margin-top:6px}

/* parent page: clear the sticky report button */
#pwrap{padding-bottom:104px}
/* printable worksheet */
#printwrap{display:none}
@media print{
 #ui{display:none!important}
 canvas{display:none!important}
 body>*:not(#printwrap):not(script):not(style){display:none!important}
 #printwrap{display:block!important;background:#fff}
 @page{size:A4;margin:14mm}
 .psheet{font-family:Baloo,sans-serif;color:#1d3557}
 .phead{border-bottom:3px solid #1d3557;padding-bottom:4mm;margin-bottom:6mm}
 .ptitle{font-weight:900;font-size:19pt}
 .pname{font-weight:700;font-size:12pt;margin-top:3mm}
 .prow{display:flex;align-items:center;gap:10mm;margin-bottom:7mm}
 .pimg{width:44mm;height:44mm;object-fit:contain}
 .pglyph{font-size:84pt;font-weight:900;color:#c9d6e5;line-height:1}
 .pline{display:flex;justify-content:space-between;border-bottom:1px dashed #9aa3b2;padding:0 2mm 2mm;margin-bottom:6mm}
 .pt{font-size:44pt;font-weight:900;color:#dfe7f0}
 .pfoot{font-size:10pt;color:#5b6b7f;text-align:center;margin-top:5mm}
}
@media print{
 .pcert{border:6px double #d4a017;border-radius:10px;padding:10mm}
 .pcwrap{text-align:center;font-family:Baloo,sans-serif;color:#1d3557}
 .pctop{font-size:12pt;color:#8a97a8;letter-spacing:2px}
 .pctitle{font-size:30pt;font-weight:900;margin:6mm 0 4mm}
 .pcname{font-size:26pt;font-weight:900;color:#12703a;margin-bottom:4mm}
 .pctext{font-size:14pt;font-weight:700;line-height:1.7;color:#5b6b7f}
 .pcrow{display:flex;flex-wrap:wrap;justify-content:center;gap:2mm;margin:7mm 0;font-size:15pt;font-weight:900;color:#1d3557}
 .pcdate{font-size:12pt;font-weight:700;color:#8a97a8}
}
/* mini-game choice */
.gchoice{display:flex;gap:14px;justify-content:center;margin:6px 0}
.gbtn{background:#fff;border:none;border-radius:22px;padding:16px 10px;width:min(40vw,140px);box-shadow:0 4px 0 #0002;display:flex;flex-direction:column;align-items:center;gap:8px;cursor:pointer}
.gbtn:active{transform:translateY(2px);box-shadow:0 2px 0 #0002}
.gico{font-size:54px;line-height:1}
.gtx{font-weight:900;font-size:16px;color:#1d3557}
.lexp{font-size:11px;color:#7b8798;text-align:center;margin-top:4px;font-weight:700}
/* track chips */
.trow{display:flex;gap:6px;justify-content:center;flex-wrap:wrap;width:min(94vw,380px);margin:0 auto 4px}
.tchip{background:#fff;border:none;border-radius:14px;padding:6px 10px;font-family:inherit;font-weight:800;font-size:12px;color:#5b6b7f;box-shadow:0 3px 0 #0002;display:flex;align-items:center;gap:5px;cursor:pointer}
.tchip b{font-size:16px;color:#1d3557}
.tchip.on{background:#1d3557;color:#fff}
.tchip.on b{color:#ffd23f}
/* non-arabic track cards */
.tbig{display:flex;align-items:baseline;gap:8px;justify-content:center;font-weight:900;color:#e0245e;line-height:1}
.tcap{font-size:112px}
.tsm{font-size:70px;opacity:.85}
.tcard{background:#fff;border-radius:18px;padding:12px 22px;font-size:34px;font-weight:900;color:#1d3557;box-shadow:0 4px 0 #0002}
.tch{grid-template-columns:1fr 1fr!important}
.tqb span{font-size:44px;font-weight:900;color:#1d3557}
.twb span{font-size:19px;font-weight:900;color:#1d3557;line-height:1.2}
/* track chips on white cards need an edge */
.tchip{background:#eef2f7;box-shadow:0 2px 0 #0001}
.tchip.on{background:#1d3557}

.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0;padding:0;margin:-1px}
.btn{min-height:52px}
.tqb,.twb{min-height:56px}
.tchip{min-height:44px;padding:8px 12px}
.skip{background:none;border:0;font:inherit;font-weight:800;font-size:16px;color:#33465c;text-decoration:underline;padding:12px 16px;min-height:44px;cursor:pointer;display:block;margin:6px auto 0}
@media (prefers-reduced-motion: reduce){#next,.btn.pulse,button.bigl,.bub{animation:none!important}}

.contw{display:flex;justify-content:center;padding:6px 0 2px}
.contw .btn{min-width:200px}

.cdots{display:flex;flex-wrap:wrap;gap:10px;justify-content:center;width:min(84vw,340px);margin:8px auto 14px}
.cd{width:34px;height:34px;border-radius:50%;background:#ff7aa8;box-shadow:inset 0 -4px 0 #0002,0 3px 6px #0002;border:3px solid #fff}

.plg{display:flex;gap:8px;justify-content:center;flex-wrap:wrap}
.lgi{font-weight:800;font-size:12px;padding:4px 10px;border-radius:12px;background:#eef2f7;color:#42566e}
.lgi.pr{background:#fff3cd;color:#7a5a00}
.lgi.ms{background:#d9f7e0;color:#146c2e}

.rwd{font-weight:900;font-size:20px;color:#42566e;background:#fff;border-radius:18px;padding:8px 18px;box-shadow:0 4px 0 #0001;margin:6px auto 4px;max-width:88vw;text-align:center}
.rcp{font-size:12px;color:#3a4a63;opacity:.9;text-align:center;line-height:1.5}
.rcp2{font-size:13px;font-weight:800;color:#13335c;background:#fff;border-radius:12px;padding:3px 10px;box-shadow:0 3px 0 rgba(19,51,92,.12)}

@media (max-height:620px){.center{gap:7px}.title{font-size:21px}.rwd{font-size:16px;padding:5px 12px;margin:2px auto}.rname{font-size:17px;padding:1px 10px}.rstk{width:min(38vw,25dvh,148px);height:min(38vw,25dvh,148px);padding:8px}.rname{font-size:19px}.rwd{font-size:18px;padding:6px 14px}}
.lockg{display:flex;flex-wrap:wrap;gap:6px;justify-content:center;margin-top:8px}
.lockg span{font-size:12px;font-weight:800;color:#13335c;background:#eaf3ff;border-radius:10px;padding:3px 9px}
.lockl{font-size:13px;color:#3a4a63;line-height:1.6;padding-right:14px;position:relative}
.lockl:before{content:"•";position:absolute;right:0;color:#2fbf5b;font-weight:900}
.mcard{flex-direction:column;align-items:center;gap:6px;background:#ffffffcc;border-radius:20px;padding:8px 14px;box-shadow:0 4px 0 #00000018;max-width:92vw;margin:2px auto}
.mcard .mk{font-weight:900;font-size:14px;color:#2b6cb0}
.mcard .mv{font-weight:900;font-size:17px;color:#13335c}
.mcard .mrow{display:flex;gap:10px;align-items:center;justify-content:center;flex-wrap:wrap}
.mcard .btn{padding:8px 18px;font-size:16px}
@media (max-height:600px){.mcard{padding:5px 10px;gap:3px}.mcard .mv{font-size:15px}.mcard .mk{font-size:12px}.mcard .btn{padding:6px 14px;font-size:14px}}
.gin{margin:10px 0 6px;font-size:34px;font-weight:900;color:#243b6b;letter-spacing:2px;min-height:44px}
.gpad{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;max-width:320px;margin:0 auto}
.gk{padding:12px 0;font-size:22px;min-height:52px}
@media (max-height:600px){.gin{font-size:28px;margin:6px 0 4px}.gk{padding:8px 0;min-height:44px;font-size:20px}.gpad{gap:6px}}
.hint:empty{display:none}
.rstar{display:flex;align-items:center;gap:6px;background:#fff;border-radius:999px;padding:6px 16px;font-weight:900;color:#13335c;box-shadow:0 4px 0 #0000001a;font-size:18px}
.rstar b{font-size:22px;color:#e0245e}
.rbtns{display:flex;gap:10px;flex-wrap:wrap;justify-content:center;align-items:center}
@media (max-height:700px){.rstk{width:min(40vw,26dvh,150px);height:min(40vw,26dvh,150px);padding:8px}.title{font-size:22px}.rwd{font-size:17px;padding:5px 12px;margin:2px auto}.rcp{font-size:11px}.rstar{font-size:15px;padding:4px 12px}.rstar b{font-size:18px}.rbtns .btn{font-size:17px;padding:10px 18px}}
.nameform{width:min(96vw,460px);padding:22px 18px;gap:14px;justify-content:center;min-height:min(56vh,420px)}
.nameform input::placeholder{color:#6b7480;font-weight:700;opacity:1}
.nnote{font-size:13px;font-weight:800;color:#3a4a63;line-height:1.55;text-align:center;background:#eaf3ff;border-radius:14px;padding:8px 12px}
.salma{position:relative;z-index:4}
@media (max-height:640px){.nameform{min-height:0;padding:14px 14px;gap:10px;border-radius:24px}.nrow{font-size:16px}.nrow input{font-size:20px;padding:8px 10px}.nnote{font-size:11px;padding:6px 10px;line-height:1.45}.bubble{font-size:16px;padding:8px 12px;max-width:64vw}}
@media (max-height:600px){.nameform{padding:10px 12px;gap:8px}.nrow{font-size:14px;gap:2px}.nrow input{font-size:18px;padding:6px 8px;border-width:2px}.nameform .btn{font-size:17px;padding:9px 18px}.nnote{font-size:10.5px;line-height:1.4;padding:5px 8px}.title{font-size:24px}.salma{padding:2px 8px 6px}.bubble{font-size:15px;padding:6px 10px;max-width:62vw}}
.rwdscr{gap:6px}
.rwdscr .title{max-width:92vw;line-height:1.15}
@media (max-height:600px){
 .rwdscr{gap:4px;padding:2px 6px}
 .rwdscr .title{font-size:19px}
 .rwdscr .rstk{width:min(32vw,20dvh,116px);height:min(32vw,20dvh,116px);padding:6px;border-radius:22px}
 .rwdscr .rwd{font-size:15px;padding:3px 10px;margin:2px auto}
 .rwdscr .rcp{font-size:10px;line-height:1.35}
 .rwdscr .rstar{font-size:13px;padding:3px 10px;gap:4px}
 .rwdscr .rstar b{font-size:15px}
 .rwdscr .rbtns{gap:6px}
 .rwdscr .rbtns .btn{font-size:14px;padding:8px 12px;box-shadow:0 4px 0 #1b8a3c}
}
.rwdscr .title{white-space:normal}
@media (max-height:600px){
 .rwdscr .title{font-size:17px;line-height:1.2}
 .rwdscr .rcp2{display:none}
 .rwdscr .rcp{font-size:9.5px}
 .salma{padding:0 6px 4px}
 .bubble{font-size:14px;padding:6px 10px}
}
@media (max-height:600px){
 .rwdscr .rstk{width:96px;height:96px;padding:5px;border-radius:20px;margin:0 auto}
 .rwdscr .title{font-size:16px;position:relative;z-index:3;margin-top:4px}
 .rwdscr .rwd{position:relative;z-index:3}
 .rwdscr .rstar{position:relative;z-index:3}
 .rwdscr .rbtns{position:relative;z-index:3}
}
.rwdscr .title,.rwdscr .rwd,.rwdscr .rstar,.rwdscr .rbtns,.rwdscr .rstk,.rwdscr .rcp,.rwdscr .rcp2{flex-shrink:0}
.rwdscr{min-height:0}
@media (max-height:600px){
 .rwdscr .rstk{display:none}
 .rwdscr .rcp{display:none}
 .rwdscr{gap:3px}
 .rwdscr .title{font-size:20px}
 .rwdscr .rwd{font-size:16px}
}

@keyframes cuePulse{0%,100%{box-shadow:0 0 0 0 rgba(255,210,63,0);transform:scale(1)}50%{box-shadow:0 0 0 12px rgba(255,210,63,.22);transform:scale(1.035)}}
.cue{animation:cuePulse 1.8s ease-in-out infinite}
