[hidden]{display:none!important}
@font-face{font-family:KufiA;src:url(fonts/kufi-bold.woff) format("woff");font-weight:600 700;font-display:swap}
@font-face{font-family:KufiA;src:url(fonts/kufi-extrabold.woff) format("woff");font-weight:800 900;font-display:swap}
:root{
  --ink:#4a2c5a;--ink2:#7b5a8c;--pink:#ff6fa8;--pink2:#e84c8b;--yel:#ffd84d;--card:#ffffffd9;
  --c-add:#ff7a8a;--c-complete:#8a7bf5;--c-count:#26b8a3;--c-pics:#ffa62b;--c-cmp:#4da3ff;--c-order:#7cc04a;
  --ok:#3cc47a;--bad:#ff9a4a;
}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent;user-select:none;-webkit-user-select:none;touch-action:manipulation}
html,body{margin:0;height:100%;overflow:hidden;overscroll-behavior:none}
body{font-family:KufiA,"Noto Kufi Arabic","Noto Sans Arabic",system-ui,sans-serif;font-weight:700;color:var(--ink);
  background:linear-gradient(180deg,#fff3b8 0%,#ffe4ef 55%,#e6f1ff 100%);}
#app{position:fixed;inset:0;display:flex;justify-content:center}
.screen{position:relative;width:100%;max-width:560px;height:100%;display:flex;flex-direction:column;padding:env(safe-area-inset-top) 12px env(safe-area-inset-bottom);animation:fadein .35s ease both;overflow:hidden}
@keyframes fadein{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:none}}
.bg-deco{position:absolute;inset:0;pointer-events:none;overflow:hidden;z-index:0}
.bg-deco i{position:absolute;font-style:normal;font-weight:800;color:#fff;opacity:.55;animation:float 7s ease-in-out infinite}
.bg-deco svg{position:absolute;animation:float 6s ease-in-out infinite;opacity:.9}
@keyframes float{0%,100%{transform:translateY(0) rotate(-4deg)}50%{transform:translateY(-14px) rotate(5deg)}}
.screen>*:not(.bg-deco){position:relative;z-index:1}

/* top bar */
.top{display:flex;align-items:center;gap:8px;padding:10px 0 6px}
.top .title{flex:1;text-align:center;font-size:20px;font-weight:800;color:#fff;background:var(--sec,var(--pink2));border-radius:20px;padding:8px 10px;box-shadow:0 4px 0 #0002;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ibtn{width:48px;height:48px;border-radius:16px;border:0;background:#fff;color:var(--ink);display:grid;place-items:center;box-shadow:0 4px 0 #0002;cursor:pointer;flex:none}
.ibtn svg{width:28px;height:28px}
.ibtn:active{transform:translateY(3px);box-shadow:0 1px 0 #0002}
.chip{display:flex;align-items:center;gap:4px;background:#fff;border-radius:16px;height:48px;padding:0 12px;font-size:22px;font-weight:800;box-shadow:0 4px 0 #0002;flex:none;color:var(--ink)}
.chip svg{width:28px;height:28px}
.chip.bump{animation:bump .5s}
@keyframes bump{40%{transform:scale(1.25)}}

/* guide */
.guide{display:flex;align-items:center;gap:10px;padding:2px 0 4px;min-height:92px}
.avatar{width:84px;height:84px;border-radius:50%;border:4px solid #fff;box-shadow:0 5px 14px #0003;object-fit:cover;background:#ffe27a;flex:none}
.avatar.hop{animation:hop .6s}
.avatar.nope{animation:wob .5s}
@keyframes hop{30%{transform:translateY(-16px) scale(1.06)}60%{transform:translateY(0)}80%{transform:translateY(-6px)}}
@keyframes wob{25%{transform:rotate(-8deg)}75%{transform:rotate(8deg)}}
.bubble{position:relative;flex:1;background:#fff;border-radius:22px;padding:12px 14px;font-size:19px;line-height:1.5;box-shadow:0 4px 0 #0001;min-height:56px;display:flex;align-items:center}
.bubble::after{content:"";position:absolute;left:100%;top:50%;margin-top:-9px;border:9px solid transparent;border-left-color:#fff;border-right:0}
.bubble{margin-right:2px;margin-left:10px}

/* progress */
.dots{display:flex;gap:8px;justify-content:center;padding:4px 0 6px}
.dots b{width:22px;height:22px;border-radius:50%;background:#fff;border:3px solid #fff;box-shadow:inset 0 0 0 3px #ffffff,0 2px 0 #0002;transition:.3s}
.dots b.now{background:var(--sec);transform:scale(1.25)}
.dots b.good{background:var(--ok)}
.dots b.miss{background:var(--bad)}

/* question */
.qarea{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:14px;min-height:0;padding:4px 0}
.qtext{background:var(--card);border-radius:20px;padding:8px 18px;font-size:22px;font-weight:800;text-align:center;box-shadow:0 3px 0 #0001}
.replay{border:0;border-radius:22px;background:var(--sec);color:#fff;font-family:inherit;font-weight:800;font-size:18px;padding:9px 18px;display:flex;align-items:center;gap:8px;box-shadow:0 4px 0 #0003;cursor:pointer}
.replay svg{width:24px;height:24px}
.replay:active{transform:translateY(3px);box-shadow:0 1px 0 #0003}
.eq{direction:ltr;display:flex;align-items:center;justify-content:center;gap:8px;unicode-bidi:isolate}
.num{min-width:76px;height:84px;padding:0 10px;border-radius:22px;background:#fff;display:grid;place-items:center;font-size:56px;font-weight:900;color:var(--sec);box-shadow:0 5px 0 #0002;line-height:1}
.num.q{background:var(--sec);color:#fff;animation:pulse 1.6s infinite}
.num.sm{min-width:64px;height:72px;font-size:46px}
.op{width:46px;height:46px;border-radius:50%;background:var(--ink);color:#fff;display:grid;place-items:center;font-size:32px;font-weight:900;line-height:1;font-family:Arial,sans-serif}
@keyframes pulse{50%{transform:scale(1.07)}}
.vis{direction:ltr;display:flex;align-items:center;justify-content:center;gap:12px;flex-wrap:wrap}
.grp{display:flex;gap:2px;flex-wrap:wrap;justify-content:center;max-width:46%;background:#ffffffaa;border-radius:16px;padding:6px}
.grp svg{width:38px;height:38px}
.grp svg.gone{opacity:.28;filter:grayscale(1)}
.grp .xw{position:relative;width:38px;height:38px}
.grp .xw svg{position:absolute;inset:0}
.grp .xw::after{content:"";position:absolute;left:4px;right:4px;top:50%;height:4px;background:#e53;border-radius:3px;transform:rotate(-35deg)}
.pm{font-size:34px;font-weight:900;color:var(--ink);font-family:Arial,sans-serif}

.objs{display:grid;grid-template-columns:repeat(5,auto);gap:6px;justify-content:center;direction:ltr;background:#ffffffaa;border-radius:22px;padding:12px}
.obj{position:relative;width:var(--os,54px);height:var(--os,54px);cursor:pointer;transition:transform .15s}
.obj svg{width:100%;height:100%}
.obj:active{transform:scale(.88)}
.obj em{position:absolute;right:-4px;top:-6px;min-width:26px;height:26px;border-radius:13px;background:var(--sec);color:#fff;font-style:normal;font-size:16px;display:grid;place-items:center;padding:0 4px;border:2px solid #fff;animation:pop .3s}
@keyframes pop{from{transform:scale(0)}}

/* choices */
.choices{display:grid;gap:12px;padding:6px 0 16px}
.choices.n3{grid-template-columns:repeat(3,1fr)}
.choices.n2{grid-template-columns:repeat(2,1fr)}
.ch{position:relative;height:104px;border:0;border-radius:26px;font-family:inherit;font-size:58px;font-weight:900;color:#fff;cursor:pointer;box-shadow:0 7px 0 #0003;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;line-height:1;transition:transform .12s}
.ch:nth-child(1){background:#ff7a8a}
.ch:nth-child(2){background:#4da3ff}
.ch:nth-child(3){background:#ffa62b}
.ch:active{transform:translateY(5px);box-shadow:0 2px 0 #0003}
.ch.right{background:var(--ok)!important;animation:hop .6s}
.ch.right::after{content:"✓";position:absolute;top:2px;left:8px;font-size:26px;font-family:Arial,sans-serif}
.ch.wrong{background:#c9bfd0!important;animation:wob .5s;opacity:.7;pointer-events:none;box-shadow:none;transform:translateY(5px)}
.ch .mini{display:flex;gap:2px;flex-wrap:wrap;justify-content:center;max-width:90%}
.ch .mini i{width:9px;height:9px;border-radius:50%;background:#fff;opacity:.9}
.ch.big{font-size:64px}

/* order */
.slots{direction:ltr;display:flex;gap:10px;justify-content:center;align-items:center}
.slot{width:76px;height:88px;border-radius:20px;border:4px dashed var(--sec);background:#ffffffaa;display:grid;place-items:center;font-size:48px;font-weight:900;color:var(--sec);cursor:pointer}
.slot.fill{border-style:solid;background:#fff;box-shadow:0 5px 0 #0002;animation:pop .25s}
.slot.fill.right{background:var(--ok);color:#fff;border-color:var(--ok)}
.slot.shake{animation:wob .5s}
.dirhint{direction:ltr;display:flex;align-items:center;gap:8px;font-size:18px;color:var(--ink2)}
.dirhint b{height:6px;width:120px;background:var(--sec);border-radius:3px;position:relative}
.dirhint b::after{content:"";position:absolute;right:-2px;top:-6px;border:9px solid transparent;border-left:14px solid var(--sec);border-right:0}
.tiles{direction:ltr;display:flex;gap:10px;justify-content:center;flex-wrap:wrap;padding:6px 0 18px;min-height:112px}
.tile{width:80px;height:92px;border-radius:24px;border:0;font-family:inherit;font-size:52px;font-weight:900;color:#fff;cursor:pointer;box-shadow:0 7px 0 #0003}
.tile:nth-child(3n+1){background:#ff7a8a}.tile:nth-child(3n+2){background:#4da3ff}.tile:nth-child(3n){background:#ffa62b}
.tile:active{transform:translateY(5px);box-shadow:0 2px 0 #0003}
.tile.used{visibility:hidden}

/* home */
.cover{align-items:center;text-align:center;justify-content:center;gap:10px}
.hero{position:relative;width:min(62vw,300px);aspect-ratio:442/590;max-height:52vh;border-radius:150px 150px 28px 28px;overflow:hidden;border:7px solid #fff;box-shadow:0 12px 30px #8a4a8a55;background:#9cc;animation:heroin .8s cubic-bezier(.2,1.4,.4,1) both}
.hero img{width:100%;height:100%;object-fit:cover;display:block}
@keyframes heroin{from{transform:scale(.6) rotate(-6deg);opacity:0}}
.h1{margin:6px 0 0;font-size:34px;font-weight:900;color:var(--pink2);text-shadow:0 3px 0 #fff;line-height:1.3}
.sub{margin:0;font-size:17px;color:var(--ink2)}
.bigbtn{border:0;border-radius:32px;font-family:inherit;font-weight:900;font-size:30px;color:#fff;background:linear-gradient(180deg,#ff8fc0,#ff4f95);padding:14px 52px;box-shadow:0 8px 0 #b02a66,0 14px 24px #b02a6655;cursor:pointer;animation:pulse 1.8s infinite}
.bigbtn:active{transform:translateY(6px);box-shadow:0 2px 0 #b02a66}
.bigbtn.sm{font-size:22px;padding:11px 26px;animation:none;box-shadow:0 6px 0 #b02a66}
.bigbtn.alt{background:linear-gradient(180deg,#9b8cff,#6b58ee);box-shadow:0 6px 0 #4535b0}
.bigbtn.grn{background:linear-gradient(180deg,#58d38d,#2fae66);box-shadow:0 6px 0 #1d7d49}
.credit{font-size:15px;color:var(--ink2);padding:6px 0 10px;text-align:center}
.menu-head{display:flex;align-items:center;gap:10px;padding:10px 0 4px}
.menu-head .avatar{width:74px;height:74px}
.menu-head h2{margin:0;font-size:24px;font-weight:900;color:var(--pink2);flex:1;line-height:1.3;text-shadow:0 2px 0 #fff}
.grid6{flex:1;display:grid;grid-template-columns:1fr 1fr;grid-auto-rows:1fr;gap:12px;padding:6px 0 4px;min-height:0}
.card{border:0;border-radius:28px;font-family:inherit;color:#fff;background:var(--sec);box-shadow:0 7px 0 #0003;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;padding:8px;cursor:pointer;position:relative;overflow:hidden;animation:cardin .5s both}
.card:active{transform:translateY(5px);box-shadow:0 2px 0 #0003}
@keyframes cardin{from{opacity:0;transform:scale(.8)}}
.card .art{height:62px;display:flex;align-items:center;justify-content:center;gap:4px;direction:ltr;font-size:38px;font-weight:900;line-height:1}
.card .art svg{width:54px;height:54px}
.card .art span{background:#fff;color:var(--sec);border-radius:14px;padding:4px 10px;box-shadow:0 3px 0 #0002;font-size:34px}
.card .art span.o{background:transparent;color:#fff;box-shadow:none;padding:0 2px;font-size:36px}
.card .name{font-size:21px;font-weight:900;line-height:1.25}
.card .sstars{font-size:14px;opacity:.95}
.install{margin:4px 0 0;text-align:center}

/* levels */
.lvls{flex:1;display:flex;flex-direction:column;gap:12px;padding:8px 0;overflow-y:auto;min-height:0}
.lvls.two{display:grid;grid-template-columns:1fr 1fr;align-content:start}
.lvl{border:0;border-radius:24px;font-family:inherit;background:#fff;color:var(--ink);font-size:21px;font-weight:800;padding:12px 16px;display:flex;align-items:center;gap:12px;box-shadow:0 6px 0 #0002;cursor:pointer;text-align:right}
.lvl .n{width:46px;height:46px;border-radius:50%;background:var(--sec);color:#fff;display:grid;place-items:center;font-size:26px;font-weight:900;flex:none}
.lvl .t{flex:1;line-height:1.3}
.lvl .st{display:flex;gap:1px;direction:ltr}
.lvl .st svg{width:16px;height:16px}
.lvl .st svg.off{filter:grayscale(1);opacity:.3}
.lvl:active{transform:translateY(4px);box-shadow:0 2px 0 #0002}
.lvls.two .lvl{flex-direction:column;text-align:center;gap:6px;padding:12px 6px}

/* count */
.cbig{align-self:center;min-width:150px;height:110px;padding:0 24px;border-radius:30px;background:#fff;box-shadow:0 7px 0 #0002;display:grid;place-items:center;font-size:84px;font-weight:900;color:var(--sec);margin:4px 0 8px;direction:ltr;line-height:1}
.cbig.pop{animation:pop .3s}
.cgrid{flex:1;overflow-y:auto;display:grid;grid-template-columns:repeat(5,1fr);gap:8px;direction:ltr;padding:6px 4px 10px;align-content:start;min-height:0;scroll-behavior:smooth;-webkit-overflow-scrolling:touch;background:#ffffff66;border-radius:22px}
.cell{height:58px;border-radius:16px;display:grid;place-items:center;font-size:26px;font-weight:900;background:#fff;color:var(--ink);box-shadow:0 3px 0 #0002;cursor:pointer;transition:transform .15s,background .25s}
.cell.done{background:var(--sec);color:#fff}
.cell.on{background:var(--yel);color:var(--ink);transform:scale(1.18);box-shadow:0 0 0 4px #fff,0 6px 14px #0003;z-index:2}
.cell.hint{animation:pulse .7s infinite;box-shadow:0 0 0 4px var(--yel)}
.cell.shake{animation:wob .4s}
.cell:nth-child(10n+1),.cell:nth-child(10n+6){border-bottom:0}
.cbar{display:flex;gap:10px;padding:10px 0 14px;justify-content:center}
.cbar .bigbtn{flex:1;padding:12px 6px;font-size:18px;white-space:nowrap;display:flex;align-items:center;justify-content:center;gap:8px;animation:none;box-shadow:0 6px 0 #0003}
.cbar .bigbtn svg{width:22px;height:22px}

/* end */
.endwrap{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:14px;text-align:center}
.endwrap .avatar{width:150px;height:150px}
.endwrap h2{margin:0;font-size:30px;font-weight:900;color:var(--pink2);text-shadow:0 2px 0 #fff}
.big5{display:flex;gap:6px;direction:ltr}
.big5 svg{width:52px;height:52px;filter:grayscale(1);opacity:.35;transform:scale(.8);transition:.4s}
.big5 svg.on{filter:none;opacity:1;transform:scale(1);animation:pop .5s both}
.btnrow{display:flex;flex-direction:column;gap:10px;align-items:stretch;width:80%}
.sticker-banner{display:flex;align-items:center;gap:10px;background:#fff;border-radius:22px;padding:8px 16px;box-shadow:0 5px 0 #0002;animation:pop .5s}
.sticker-banner svg{width:56px;height:56px}

/* stars/stickers */
.stbig{align-self:center;display:flex;align-items:center;gap:10px;font-size:46px;font-weight:900;color:var(--ink);background:#fff;border-radius:30px;padding:6px 26px;box-shadow:0 6px 0 #0002;margin:6px 0 10px}
.stbig svg{width:56px;height:56px}
.stgrid{flex:1;display:grid;grid-template-columns:repeat(5,1fr);gap:10px;align-content:start;overflow-y:auto;padding:4px 2px 10px}
.stk{aspect-ratio:1;background:#fff;border-radius:20px;display:grid;place-items:center;box-shadow:0 4px 0 #0002;position:relative}
.stk svg{width:70%;height:70%}
.stk.lock svg{filter:grayscale(1) brightness(1.4);opacity:.25}
.stk small{position:absolute;bottom:2px;left:0;right:0;text-align:center;font-size:13px;color:var(--ink2)}
.stk.lock::after{content:attr(data-need);position:absolute;font-size:18px;font-weight:900;color:var(--ink2)}
.tiny{background:none;border:0;font-family:inherit;color:var(--ink2);font-size:13px;padding:6px;opacity:.7;cursor:pointer}

#fx{position:fixed;inset:0;width:100%;height:100%;pointer-events:none;z-index:50}
.fly{position:fixed;width:34px;height:34px;z-index:60;pointer-events:none}
#toast{position:fixed;left:50%;bottom:24px;transform:translateX(-50%);background:#4a2c5aee;color:#fff;border-radius:18px;padding:10px 18px;font-size:16px;z-index:70;max-width:90%;text-align:center}
@media (max-height:640px){
  .ch{height:84px;font-size:46px}.num{height:68px;font-size:44px;min-width:62px}.guide{min-height:74px}.avatar{width:66px;height:66px}
  .bubble{font-size:16px;padding:8px 12px;min-height:44px}.qtext{font-size:19px}.grp svg,.grp .xw{width:28px;height:28px}
  .cbig{height:84px;font-size:62px}.cell{height:48px;font-size:22px}.hero{max-height:44vh}.h1{font-size:28px}
  .tile{height:78px;width:78px;font-size:42px}.slot{height:74px;width:64px;font-size:40px}
}
@media (prefers-reduced-motion:reduce){*{animation-duration:.01s!important}}
.grp.solo{max-width:92%}
.ch.big:has(.mini){font-size:46px;justify-content:center}.ch .mini i{width:8px;height:8px}
