:root{--ink:#1d3557;--sub:#5b6785;--bg:#fff7e6;--card:#fff;--gold:#f5b301;--gold-d:#c68a00;--ora:#ff8a1f;--ora-d:#d96a00;--blue:#1e5aa8;--blue-d:#143f78;--green:#1f9d55;--green-d:#157340;--line:#eadfc4;--bad:#d93a3f;--bad-bg:#fde8e8;--ok-bg:#e3f6ea;--hl:#ffe08a}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{margin:0;background:var(--bg);color:var(--ink);font-family:"Cairo","Noto Naskh Arabic",Tahoma,sans-serif;font-size:19px;line-height:1.8}
body{min-height:100vh;overflow-x:hidden}
button,input{font-family:inherit;font-size:inherit;color:inherit}
button{cursor:pointer}
:focus-visible{outline:4px solid #1e5aa8;outline-offset:2px}
.hdr{position:sticky;top:0;z-index:20;background:#fff;border-bottom:3px solid var(--gold);display:flex;align-items:center;gap:10px;padding:8px 12px}
.hdr img{width:46px;height:46px;border-radius:12px;flex:none}
.hdr .tt{flex:1;min-width:0}
.hdr b{display:block;font-size:16px;line-height:1.35;font-weight:900;color:var(--blue-d)}
.hdr small{display:block;font-size:12.5px;line-height:1.3;color:var(--sub);font-weight:600}
.pill{background:#fff3cf;color:#7a5600;border-radius:99px;padding:0 10px;font-size:12px;font-weight:800;line-height:24px;white-space:nowrap}
.wrap{max-width:980px;margin:0 auto;padding:14px 14px 110px}
.nav{position:fixed;bottom:0;inset-inline:0;z-index:30;background:var(--blue-d);display:flex;justify-content:space-around;padding:6px 6px calc(6px + env(safe-area-inset-bottom))}
.nav a{flex:1;color:#cfe0ff;text-decoration:none;text-align:center;font-size:14px;font-weight:800;line-height:1.3;padding:6px 4px;border-radius:14px;min-height:52px;display:flex;flex-direction:column;align-items:center;justify-content:center}
.nav a .i{line-height:1.2;height:26px;display:flex;align-items:center}
.nav a.on{background:var(--gold);color:#3b2a00}
.hide-nav .nav{display:none}
.hide-nav .wrap{padding-bottom:30px}
h1.pg{margin:6px 0 12px;font-size:26px;line-height:1.5;font-weight:900;color:var(--blue-d)}
h2.sec{margin:18px 0 8px;font-size:21px;line-height:1.5;font-weight:900;color:var(--blue-d)}
.btn{border:0;border-radius:20px;min-height:58px;padding:6px 24px;font-size:21px;font-weight:900;color:#fff;background:var(--ora);box-shadow:0 5px 0 var(--ora-d);display:inline-flex;align-items:center;justify-content:center;gap:8px;text-decoration:none;line-height:1.4}
.btn:active{transform:translateY(4px);box-shadow:0 1px 0 var(--ora-d)}
.btn.blue{background:var(--blue);box-shadow:0 5px 0 var(--blue-d)}
.btn.green{background:var(--green);box-shadow:0 5px 0 var(--green-d)}
.btn.ghost{background:#fff;color:var(--ink);box-shadow:0 5px 0 var(--line)}
.btn.block{display:flex;width:100%}
.btn[disabled]{opacity:.45;pointer-events:none}
.card{background:var(--card);border-radius:26px;padding:16px;box-shadow:0 5px 0 var(--line),0 12px 24px #1d355710}
.back{border:0;background:#fff;border-radius:99px;min-height:48px;padding:0 18px;font-weight:800;font-size:17px;box-shadow:0 3px 0 var(--line);display:inline-flex;align-items:center;gap:6px}
.topline{display:flex;align-items:center;gap:10px;margin-bottom:10px}
.topline .sp{flex:1}
/* login */
.field{display:block;width:100%;min-height:60px;border:3px solid var(--line);border-radius:18px;padding:6px 16px;background:#fff;font-size:22px;font-weight:700}
.seg{display:grid;gap:10px;grid-template-columns:repeat(2,1fr);margin:8px 0 14px}
.seg.g3{grid-template-columns:repeat(3,1fr)}
.seg button{min-height:64px;border:3px solid var(--line);background:#fff;border-radius:18px;font-weight:900;font-size:21px;line-height:1.3}
.seg button[aria-pressed=true]{border-color:var(--ora);background:#fff0dc;color:var(--ora-d)}
.lbl{font-weight:900;font-size:18px;margin:12px 0 4px;display:block}
.err{color:var(--bad);font-weight:800;font-size:16px;min-height:24px}
/* home */
.gtabs{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin:6px 0 14px}
.gtabs button{border:3px solid var(--gold);background:#fff;border-radius:18px;min-height:64px;font-weight:900;line-height:1.25;font-size:15px;padding:4px}
.gtabs button b{display:block;font-size:26px}
.gtabs button[aria-pressed=true]{background:var(--blue);border-color:var(--blue-d);color:#fff}
.cont{display:flex;gap:14px;align-items:center;background:linear-gradient(150deg,#ffe08a,#ffb81c);border-radius:28px;padding:14px;box-shadow:0 6px 0 var(--gold-d)}
.cont img{width:92px;height:92px;border-radius:50%;border:4px solid #fff;object-fit:cover;flex:none}
.cont .tx{flex:1;min-width:0}
.cont small{display:block;font-weight:800;color:#5a4100;font-size:15px;line-height:1.4}
.cont h2{margin:2px 0 4px;font-size:22px;line-height:1.4;color:#3b2a00;font-weight:900}
.cont p{margin:0 0 8px;font-size:15.5px;color:#5a4100;font-weight:700;line-height:1.5}
.tiles{display:grid;grid-template-columns:repeat(2,1fr);gap:12px;margin-top:14px}
.tile{border:0;border-radius:24px;padding:14px 10px;min-height:120px;color:#fff;font-weight:900;font-size:21px;line-height:1.4;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;text-align:center}
.tile .i{line-height:1.2;height:40px;display:flex;align-items:center}
.tile small{font-size:15px;font-weight:700;opacity:.95}
.tile.t1{background:var(--blue);box-shadow:0 6px 0 var(--blue-d)}
.tile.t2{background:var(--ora);box-shadow:0 6px 0 var(--ora-d)}
.tile.t3{background:var(--green);box-shadow:0 6px 0 var(--green-d)}
.tile.t4{background:#e0457b;box-shadow:0 6px 0 #a82a58}
.sumbar{height:14px;border-radius:9px;background:#f3e8c9;overflow:hidden;margin:6px 0}
.sumbar i{display:block;height:100%;background:var(--green);border-radius:9px}
/* list */
.tools{display:flex;flex-direction:column;gap:10px;margin-bottom:6px}
.chips{display:flex;gap:8px;flex-wrap:wrap}
.chip{border:3px solid var(--line);background:#fff;border-radius:99px;min-height:48px;padding:0 16px;font-weight:800;font-size:16px}
.chip[aria-pressed=true]{background:var(--blue);border-color:var(--blue-d);color:#fff}
.unit{margin:18px 0 8px;font-size:21px;font-weight:900;color:var(--blue-d);line-height:1.5}
.lgrid{display:grid;gap:14px;grid-template-columns:1fr}
.lcard{position:relative;display:flex;gap:12px;align-items:center;text-align:start;width:100%;border:0;background:#fff;border-radius:26px;padding:12px;box-shadow:0 5px 0 var(--c,#eadfc4),0 12px 24px #1d355710;border-inline-start:8px solid var(--c,#ccc)}
.lcard img{width:84px;height:84px;border-radius:50%;border:4px solid var(--gold);object-fit:cover;flex:none}
.lcard .tx{flex:1;min-width:0;padding-inline-end:36px}
.lcard .lt{display:block;font-size:23px;font-weight:900;line-height:1.5;color:var(--ink)}
.lcard .lf{display:block;font-size:14.5px;line-height:1.5;color:var(--sub);font-weight:600}
.badge{display:inline-flex;align-items:center;gap:4px;border-radius:99px;padding:0 12px;font-size:15px;font-weight:900;line-height:30px;margin-top:4px}
.badge.new{background:#e5eefc;color:var(--blue-d)}
.badge.prog{background:#ffe9cc;color:#a24c00}
.badge.done{background:var(--ok-bg);color:var(--green-d)}
.badge.retry{background:var(--bad-bg);color:#a3262a}
.fav{position:absolute;top:6px;inset-inline-end:6px;width:48px;height:48px;border:0;background:transparent;font-size:26px;border-radius:50%}
.stars{display:inline-flex;gap:2px;vertical-align:middle}
.stars svg{width:22px;height:22px}
.stars.lg svg{width:64px;height:64px}
.empty{text-align:center;padding:30px 10px;font-weight:800;color:var(--sub)}
/* learn */
.lpic{width:100%;max-height:230px;object-fit:cover;border-radius:24px;border:4px solid var(--gold);display:block;margin:0 auto 12px}
.part{background:#fff;border-radius:28px;padding:18px 16px;box-shadow:0 5px 0 var(--line);border:3px dashed #f0c96a;min-height:260px}
.part .big{font-size:26px;line-height:2.2;font-weight:700}
.part .bigletter{font-size:110px;line-height:1.2;font-weight:900;color:var(--blue);text-align:center;display:block}
.part .cap{font-size:15px;font-weight:800;color:var(--sub);margin-bottom:4px;display:block}
.part ul{margin:6px 0;padding-inline-start:22px}
.part li{font-size:23px;line-height:2;font-weight:700}
mark{background:var(--hl);color:#7a3a00;border-radius:6px;padding:0;font-weight:inherit}
.strip{background:#fff3cf;color:#7a5600;text-align:center;font-size:13px;font-weight:800;line-height:26px}
.ctl{display:flex;gap:10px;flex-wrap:wrap;margin:12px 0}
.ctl .btn{flex:1;min-width:130px;font-size:18px;min-height:56px;padding:4px 12px}
.dots{display:flex;justify-content:center;gap:8px;margin:10px 0}
.dots i{width:14px;height:14px;border-radius:50%;background:#e6d9b6}
.dots i.on{background:var(--ora);width:30px;border-radius:9px}
.dots i.dn{background:var(--green)}
.nr{display:flex;gap:10px}
.nr .btn{flex:1;font-size:19px;padding:6px 8px}.nr .btn.green{flex:1.6}
.audnote{font-size:14px;color:var(--bad);font-weight:700;min-height:20px}
/* question */
.prog{height:16px;border-radius:9px;background:#f3e8c9;overflow:hidden;flex:1}
.prog i{display:block;height:100%;background:var(--green);border-radius:9px;transition:width .3s}
.qno{font-weight:900;font-size:17px;color:var(--sub);white-space:nowrap}
.qq{display:flex;gap:8px;align-items:flex-start;margin:6px 0 12px}
.qq h2{margin:0;font-size:25px;line-height:1.7;font-weight:900;color:var(--blue-d);flex:1}
.spk{border:0;background:#fff3cf;border-radius:50%;width:52px;height:52px;font-size:24px;flex:none;box-shadow:0 3px 0 #e6cf8a}
details.txt{background:#fff;border-radius:20px;border:3px dashed #f0c96a;padding:6px 14px;margin-bottom:12px}
details.txt summary{font-weight:900;font-size:18px;min-height:48px;display:flex;align-items:center;cursor:pointer}
details.txt .big{font-size:23px;line-height:2.1;font-weight:700;padding-bottom:10px}
.opts{display:grid;gap:12px}
.opt{width:100%;min-height:70px;border:3px solid var(--line);background:#fff;border-radius:22px;font-size:25px;font-weight:800;padding:8px 16px;text-align:center;line-height:1.55;box-shadow:0 4px 0 var(--line)}
.opt:active{transform:translateY(3px)}
.opt.sel{border-color:var(--blue);background:#e8f0fd}
.opt.ok{border-color:var(--green);background:var(--ok-bg);color:var(--green-d)}
.opt.bad{border-color:var(--bad);background:var(--bad-bg);color:#a3262a}
.opt.miss{border-style:dashed;border-color:var(--green)}
.opt[disabled]{pointer-events:none}
.tfrow{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.tfrow .opt{min-height:84px;font-size:27px}
.cols{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.cols .opt{font-size:19px;min-height:64px;padding:6px 8px;word-break:break-word}
.cols .opt.m0{border-color:#e0457b;background:#fde7f0}.cols .opt.m1{border-color:#1e5aa8;background:#e3edfb}.cols .opt.m2{border-color:#1f9d55;background:#e3f6ea}.cols .opt.m3{border-color:#c68a00;background:#fff3cf}.cols .opt.m4{border-color:#7c3aed;background:#efe7fd}.cols .opt.m5{border-color:#0e8a99;background:#dff5f7}
.cur{background:#fff;border:4px solid var(--gold);border-radius:26px;text-align:center;font-size:48px;font-weight:900;padding:18px 10px;margin-bottom:12px;line-height:1.4;word-break:break-word}
.bins{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.bin{border:3px solid var(--blue);background:#e8f0fd;border-radius:22px;min-height:84px;font-size:21px;font-weight:900;padding:6px;line-height:1.4;color:var(--blue-d)}
.bin .put{display:flex;gap:6px;flex-wrap:wrap;justify-content:center;margin-top:4px}
.bin .put span{background:#fff;border-radius:10px;padding:0 8px;font-size:20px;color:var(--ink);line-height:1.5}
.slots{display:flex;flex-wrap:wrap;gap:8px;justify-content:center;min-height:76px;background:#fff;border:3px dashed #f0c96a;border-radius:22px;padding:8px;margin-bottom:12px;align-items:center}
.tok{min-width:62px;min-height:62px;border:3px solid var(--line);background:#fff;border-radius:18px;font-size:26px;font-weight:900;padding:2px 12px;box-shadow:0 4px 0 var(--line);line-height:1.5}
.tok.put{border-color:var(--green);background:var(--ok-bg);box-shadow:none}
.tok.used{opacity:.25;pointer-events:none}
.pool{display:flex;flex-wrap:wrap;gap:10px;justify-content:center}
.shake{animation:shake .4s}
@keyframes shake{20%{transform:translateX(-8px)}40%{transform:translateX(8px)}60%{transform:translateX(-6px)}80%{transform:translateX(6px)}}
.fb{border-radius:22px;padding:12px 14px;margin:14px 0;font-size:19px;line-height:1.8;font-weight:700;display:none}
.fb.show{display:block}
.fb.ok{background:var(--ok-bg);color:var(--green-d)}
.fb.bad{background:var(--bad-bg);color:#8d2023}
.fb b.h{display:block;font-size:24px;font-weight:900;line-height:1.5}
.fb .q{display:block;margin-top:4px;color:var(--ink);font-weight:600}
.sticky{position:sticky;bottom:0;background:linear-gradient(180deg,#fff7e600,var(--bg) 35%);padding:14px 0 12px;margin-top:10px}
/* done */
.done{text-align:center}
.trophy{line-height:1.2;display:flex;justify-content:center}
.done h1{margin:4px 0;font-size:32px;line-height:1.5;font-weight:900;color:var(--green-d)}
.done h1.retry{color:#a24c00}
.done p{margin:4px 0;font-size:19px;font-weight:700}
.stack{display:grid;gap:12px;margin-top:16px}
.rule{background:#fff3cf;border-radius:18px;padding:8px 12px;font-size:15px;font-weight:700;line-height:1.7;margin:12px 0}
/* cert */
.cert{background:#fffdf5;border:10px double var(--gold);border-radius:18px;padding:22px 16px;text-align:center;box-shadow:0 10px 30px #1d355722;position:relative}
.cert .ctl2{font-size:36px;font-weight:900;color:#b9770e;line-height:1.5;text-shadow:0 2px 0 #fff3c4}
.cert .to{font-size:17px;color:var(--sub);font-weight:700}
.cert .nm{font-size:44px;font-weight:900;color:var(--blue-d);line-height:1.5;word-break:break-word;border-bottom:3px dashed #e6cf8a;margin:4px 8px 10px}
.cert p{font-size:19px;line-height:1.9;font-weight:700;margin:6px 0}
.cert .ls{display:inline-block;background:var(--gold);color:#3b2a00;border-radius:99px;padding:2px 20px;font-weight:900;font-size:23px;line-height:1.7;margin:6px 0}
.cert .gr{display:inline-block;background:var(--blue);color:#fff;border-radius:99px;padding:0 16px;font-weight:900;font-size:17px;line-height:1.9}
.cert .sig{margin-top:14px;font-size:17px;font-weight:800;line-height:1.6}
.cert .sig b{display:block;font-size:22px;color:var(--blue-d)}
.clist .row{display:flex;gap:10px;align-items:center;justify-content:space-between;padding:10px 0;border-bottom:1px dashed var(--line);font-weight:800;line-height:1.5}
.sgrid{display:grid;gap:12px;grid-template-columns:repeat(3,1fr)}
.sbox{background:#fff;border-radius:22px;padding:10px;text-align:center;box-shadow:0 4px 0 var(--line)}
.sbox b{display:block;font-size:30px;line-height:1.3;color:var(--blue-d)}
.sbox span{font-size:14px;font-weight:700;color:var(--sub);line-height:1.4;display:block}
.pbar{margin:8px 0}
.pbar .l{display:flex;justify-content:space-between;font-weight:800;font-size:16px;line-height:1.5}
@media(min-width:700px){.lgrid{grid-template-columns:1fr 1fr}.tiles{grid-template-columns:repeat(4,1fr)}.opts.two{grid-template-columns:1fr 1fr}}
@media(min-width:1000px){.lgrid{grid-template-columns:repeat(3,1fr)}.wrap{padding-bottom:30px}
 .hdr{padding:8px 24px}.hdr b{font-size:20px}.hdr small{font-size:14px}
 .nav{position:static;background:transparent;padding:0;gap:6px;flex:none}
 .nav a{flex:none;flex-direction:row;gap:6px;color:var(--blue-d);font-size:16px;padding:6px 14px;min-height:48px;background:#eef3fb}
 .nav a.on{background:var(--gold);color:#3b2a00}
 .hide-nav .nav{display:flex}
 .part{min-height:300px}.part .big{font-size:30px}
 .sgrid{grid-template-columns:repeat(3,1fr)}}
@media(max-width:699px){.hdr .pill{display:none}}
@media(max-width:380px){.lcard img{width:70px;height:70px}.lcard .lt{font-size:21px}.opt{font-size:23px}.cont img{width:72px;height:72px}.cont h2{font-size:20px}.tile{font-size:19px}h1.pg{font-size:23px}.cols .opt{font-size:17.5px}.hdr b{font-size:14.5px}.pill{display:none}}
@media(prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}
@media print{.hdr,.nav,.noprint{display:none!important}body{background:#fff}.wrap{padding:0}.cert{box-shadow:none}}
.bigletter mark{background:none;color:#1e5aa8}
.lpic{max-width:440px}
.hide-nav .wrap{max-width:760px}
