@font-face{font-family:'Cairo';font-weight:700;font-display:swap;src:url(fonts/cairo-arabic-700-normal.woff2) format('woff2');unicode-range:U+0600-06FF,U+0750-077F,U+08A0-08FF,U+200C-200E,U+2010-2011,U+204F,U+2E41,U+FB50-FDFF,U+FE80-FEFC}
@font-face{font-family:'Cairo';font-weight:700;font-display:swap;src:url(fonts/cairo-latin-700-normal.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2212}
@font-face{font-family:'Cairo';font-weight:800;font-display:swap;src:url(fonts/cairo-arabic-800-normal.woff2) format('woff2');unicode-range:U+0600-06FF,U+0750-077F,U+08A0-08FF,U+200C-200E,U+2010-2011,U+204F,U+2E41,U+FB50-FDFF,U+FE80-FEFC}
@font-face{font-family:'Cairo';font-weight:800;font-display:swap;src:url(fonts/cairo-latin-800-normal.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2212}
@font-face{font-family:'IBM Plex Sans Arabic';font-weight:400;font-display:swap;src:url(fonts/ibm-plex-sans-arabic-arabic-400-normal.woff2) format('woff2');unicode-range:U+0600-06FF,U+0750-077F,U+08A0-08FF,U+200C-200E,U+2010-2011,U+204F,U+2E41,U+FB50-FDFF,U+FE80-FEFC}
@font-face{font-family:'IBM Plex Sans Arabic';font-weight:400;font-display:swap;src:url(fonts/ibm-plex-sans-arabic-latin-400-normal.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2212}
@font-face{font-family:'IBM Plex Sans Arabic';font-weight:600;font-display:swap;src:url(fonts/ibm-plex-sans-arabic-arabic-600-normal.woff2) format('woff2');unicode-range:U+0600-06FF,U+0750-077F,U+08A0-08FF,U+200C-200E,U+2010-2011,U+204F,U+2E41,U+FB50-FDFF,U+FE80-FEFC}
@font-face{font-family:'IBM Plex Sans Arabic';font-weight:600;font-display:swap;src:url(fonts/ibm-plex-sans-arabic-latin-600-normal.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2212}
@font-face{font-family:'IBM Plex Sans Arabic';font-weight:700;font-display:swap;src:url(fonts/ibm-plex-sans-arabic-arabic-700-normal.woff2) format('woff2');unicode-range:U+0600-06FF,U+0750-077F,U+08A0-08FF,U+200C-200E,U+2010-2011,U+204F,U+2E41,U+FB50-FDFF,U+FE80-FEFC}
@font-face{font-family:'IBM Plex Sans Arabic';font-weight:700;font-display:swap;src:url(fonts/ibm-plex-sans-arabic-latin-700-normal.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2212}
:root{color-scheme:light;padding-top:env(safe-area-inset-top,0px)}
body{margin:0;min-height:100vh}
[hidden]{display:none!important}

/* تطبيق موبايل: عمود واحد، RTL. خط Cairo للعناوين و IBM Plex Sans Arabic للنص */
:root{--bg:#fbfaf6;--card:#fff;--ink:#1d2a33;--mut:#5d6b74;--sand:#f3eee2;--line:#e6e0d1;--green:#23805f;--gsoft:#e2f3ec;--amber:#a86c0c;--asoft:#fff3da;--red:#a93f39;--rsoft:#fae3e1;--blue:#e5f0fa;--on:#fff}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]){--bg:#11181d;--card:#1a242b;--ink:#e9eef0;--mut:#a2b0b8;--sand:#243139;--line:#33434d;--green:#5cc49d;--gsoft:#1c3b32;--amber:#e5ae4f;--asoft:#3c3017;--red:#ee8a83;--rsoft:#422624;--blue:#1e3347;--on:#10181d;color-scheme:dark}}
:root[data-theme="dark"]{--bg:#11181d;--card:#1a242b;--ink:#e9eef0;--mut:#a2b0b8;--sand:#243139;--line:#33434d;--green:#5cc49d;--gsoft:#1c3b32;--amber:#e5ae4f;--asoft:#3c3017;--red:#ee8a83;--rsoft:#422624;--blue:#1e3347;--on:#10181d;color-scheme:dark}
body{background:var(--bg);color:var(--ink);font:15px/1.65 "IBM Plex Sans Arabic",system-ui,sans-serif;direction:rtl}
*{box-sizing:border-box}
#app{max-width:640px;margin-inline:auto;padding-block:14px 32px;padding-left:max(16px,env(safe-area-inset-left,0px));padding-right:max(16px,env(safe-area-inset-right,0px));display:flex;flex-direction:column;gap:12px}
h1,h2{font-family:Cairo,system-ui,sans-serif;margin:0;line-height:1.4;font-size:26px}
p{margin:0}
button{font:inherit;color:inherit;cursor:pointer;border:0;background:none}
:focus-visible{outline:2px solid var(--green);outline-offset:2px}
.sub,.sm{color:var(--mut);font-size:13px}
.card{background:var(--card);border:1px solid var(--line);border-radius:18px;padding:16px;display:flex;flex-direction:column;gap:9px;min-width:0}
.center{align-items:center;text-align:center}
.head{display:flex;justify-content:space-between;align-items:center;gap:8px;width:100%}
.btn{border-radius:14px;min-height:48px;padding:0 22px;font-weight:600;background:var(--ink);color:var(--bg)}
.btn.ghost{background:var(--sand);color:var(--ink)}.btn.good{background:var(--green);color:var(--on)}.btn.bad{background:var(--rsoft);color:var(--red)}
.btn:disabled{opacity:.4}
.back{align-self:flex-start;background:var(--sand);border-radius:20px;padding:0 16px;min-height:42px}
.row{display:flex;gap:8px;flex-wrap:wrap;justify-content:center}
.pill{background:var(--sand);border-radius:22px;padding:0 15px;min-height:44px}.pill.on{background:var(--ink);color:var(--bg)}
.badge{flex:none;font-size:11px;font-weight:600;line-height:1;padding:5px 9px;border-radius:20px;white-space:nowrap;display:inline-block}
.strong{background:var(--gsoft);color:var(--green)}.mid{background:var(--asoft);color:var(--amber)}.weak{background:var(--sand);color:var(--mut)}.none{background:var(--rsoft);color:var(--red)}
.bar{height:10px;border-radius:6px;background:var(--line);overflow:hidden;width:100%}.bar i{display:block;height:100%;background:var(--green);transition:width .4s}
.habit{display:flex;align-items:center;gap:12px;min-height:50px;width:100%;text-align:start;border-bottom:1px solid var(--line);padding:6px 0}
.chk{flex:none;width:26px;height:26px;border-radius:8px;border:2px solid var(--line);display:grid;place-items:center;font-weight:700}
.habit.on .chk{background:var(--green);border-color:var(--green);color:var(--on)}.habit.on .nm{color:var(--mut);text-decoration:line-through}.nm{flex:1}
.grid2{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.tile{background:var(--sand);border-radius:16px;padding:14px 12px;min-height:84px;text-align:start;display:flex;flex-direction:column;justify-content:center}.tile span{font-size:12px;color:var(--mut)}
.tip{background:var(--asoft)}
.ring{width:200px;height:200px;border-radius:50%;display:grid;place-items:center}.ring span{width:164px;height:164px;border-radius:50%;background:var(--card);display:grid;place-items:center;font-size:42px;font-weight:700;font-variant-numeric:tabular-nums;direction:ltr}
.inp{width:100%;border:1px solid var(--line);border-radius:12px;padding:12px;min-height:46px;font:inherit;background:var(--bg);color:var(--ink);resize:vertical}
input[type=range]{width:100%;accent-color:var(--green);min-height:36px}
.li{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:6px 0;border-bottom:1px solid var(--line);width:100%;text-align:start}.li>*{min-width:0;overflow-wrap:anywhere}
.x{width:40px;height:40px;font-size:22px;color:var(--mut);flex:none}
.msg{color:var(--green);font-weight:600}
.q{font-size:18px;font-weight:600}.ans{background:var(--gsoft);border-radius:12px;padding:12px}
.node{display:flex;flex-direction:column;gap:4px;border-radius:12px;padding:10px;background:var(--blue);font-size:12px;font-weight:700}.node.for{background:var(--gsoft)}.node.ag{background:var(--rsoft)}
.node textarea{font-size:14px;font-weight:400}
.acc{width:100%;display:flex;justify-content:space-between;align-items:center;gap:8px;min-height:46px;font-weight:600;text-align:start}
.rule{background:var(--asoft);border-radius:10px;padding:10px}
.warn{background:var(--asoft);border-radius:14px;padding:12px 14px;font-size:13.5px}.warn.red{background:var(--rsoft)}
.breath{width:120px;height:120px;border-radius:50%;background:var(--gsoft);display:grid;place-items:center;font-weight:600;margin:24px;transition:transform 4s ease-in-out}.breath.in{transform:scale(1.35)}.breath.out{transition-duration:6s}
.game{background:var(--card);border:1px solid var(--line);border-radius:18px;padding:16px 10px;display:flex;flex-direction:column;align-items:center;gap:4px}
.sym{width:56px;height:56px;border-radius:16px;background:var(--ink);color:var(--bg);display:grid;place-items:center;font-size:21px;font-weight:700}
.hud{display:flex;justify-content:space-between;gap:6px;background:var(--sand);border-radius:14px;padding:10px 14px;font-size:13.5px}
.g4{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;direction:ltr}
.flip{aspect-ratio:1;border-radius:14px;background:#33495a;color:#cfe0ea;font-size:20px;font-weight:700;padding:0}.flip.up{color:#fff}
.nb{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;width:100%;max-width:280px;margin:0 auto;padding:10px;border-radius:18px;background:var(--sand);direction:ltr}.nb.good{background:var(--gsoft)}.nb.bad{background:var(--rsoft)}
.cell{aspect-ratio:1;border-radius:14px;background:var(--card)}.cell.lit{background:var(--green)}
.word{font-size:56px;font-weight:800;text-align:center;padding:22px 0;background:#f4f2ec;border-radius:18px}
.math{text-align:center;font-size:44px;font-weight:800;padding:20px 0;direction:ltr}
.opt{background:var(--sand);border-radius:14px;min-height:58px;font-size:18px;font-weight:600;display:flex;align-items:center;justify-content:center;gap:8px;padding:6px 10px}
.wide{width:100%;justify-content:flex-start;font-size:15px;text-align:start}
.dot{width:18px;height:18px;border-radius:50%}
.score{font-size:56px;font-weight:800;line-height:1.1}
.week{display:flex;gap:6px;align-items:flex-end}.col{flex:1;display:flex;flex-direction:column;align-items:center;font-size:11px;min-width:0}.cb{width:100%;max-width:32px;height:90px;background:var(--line);border-radius:8px;display:flex;align-items:flex-end;overflow:hidden}.cb i{width:100%;background:var(--green)}
.stats{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}.stats div{background:var(--sand);border-radius:14px;padding:12px 4px;text-align:center;display:flex;flex-direction:column}.stats b{font-size:24px}.stats span{font-size:12px;color:var(--mut)}
a{color:inherit;overflow-wrap:anywhere}
summary{min-height:40px;cursor:pointer}
@media (prefers-reduced-motion:reduce){*{transition:none!important}}

.ic{width:22px;height:22px;flex:none;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
:root{--hero:#17333b;--c1:#23805f;--c2:#2c68a8;--c3:#7650a8;--c4:#4650a0;--c5:#b2543a;--c6:#17797f;--c7:#936008;--c8:#5d6b74}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]){--hero:#1b3a43;--c1:#5cc49d;--c2:#7ab4ee;--c3:#bc9be8;--c4:#9da8f0;--c5:#f09a80;--c6:#62c8ce;--c7:#e5ae4f;--c8:#a9bac4}}
:root[data-theme="dark"]{--hero:#1b3a43;--c1:#5cc49d;--c2:#7ab4ee;--c3:#bc9be8;--c4:#9da8f0;--c5:#f09a80;--c6:#62c8ce;--c7:#e5ae4f;--c8:#a9bac4}
.t-progress{--t:var(--c1)}.t-focus{--t:var(--c2)}.t-memory{--t:var(--c3)}.t-basics{--t:var(--c4)}.t-games{--t:var(--c5)}.t-analysis{--t:var(--c6)}.t-styles{--t:var(--c7)}.t-sources,.t-settings{--t:var(--c8)}
.medal{width:46px;height:46px;border-radius:15px;display:grid;place-items:center;flex:none;color:var(--t);background:color-mix(in srgb,var(--t) 15%,transparent)}.medal .ic{width:27px;height:27px}
.banner{display:flex;gap:14px;align-items:center;padding:16px;border-radius:20px;background:color-mix(in srgb,var(--t) 9%,var(--card));border:1px solid color-mix(in srgb,var(--t) 28%,transparent)}
.hero{background:var(--hero);color:#f3f8f6;border-radius:24px;padding:18px 18px 14px;display:flex;flex-direction:column;gap:6px}
.hero p{color:#c3d6d6;font-size:13.5px}.hero .bar{background:#ffffff22}.hero .bar i{background:#6fe0b4}.hero .cap{text-align:center}
.net{width:100%;max-width:370px;height:auto;align-self:center;fill:none;stroke-linecap:round;stroke-linejoin:round}
.wire{stroke:#ffffff26;stroke-width:1.5}.wire.lit{stroke:#6fe0b4;stroke-width:2.2;stroke-dasharray:6 5;animation:flow 1.4s linear infinite}
@keyframes flow{to{stroke-dashoffset:-22}}
.core{fill:#f6c768}.coreic{stroke:#17333b;stroke-width:1.7}
.nodeg{stroke:#b4cbcc;stroke-width:1.9}.nodeg>circle{fill:#264951;stroke:#ffffff33;stroke-width:1.5}.nodeg.lit{stroke:#10352a}.nodeg.lit>circle{fill:#6fe0b4;stroke:#d5fff0}
.hic{color:var(--green);display:flex}
.ttl{display:flex;gap:8px;align-items:center}
.tile{background:var(--card);border:1px solid var(--line);align-items:flex-start;gap:3px;transition:transform .15s}.tile:active,.game:active,.btn:active,.opt:active{transform:scale(.96)}
.back{display:flex;align-items:center;gap:4px;font-size:13px}.back .ic{width:16px;height:16px}
.g-memory{background:var(--c3)}.g-nback{background:var(--c2)}.g-stroop{background:var(--c5)}.g-math{background:var(--c6)}
.sym{color:var(--card)}.sym .ic{width:32px;height:32px}
.trophy{width:90px;height:90px;fill:#f2bc42;stroke:#a87712;stroke-width:1.3;stroke-linecap:round;stroke-linejoin:round}
.okart{width:80px;height:80px;fill:var(--gsoft);stroke:var(--green);stroke-width:4;stroke-linecap:round;stroke-linejoin:round}
.nav{position:fixed;bottom:0;left:0;right:0;z-index:5;display:flex;justify-content:center;background:var(--card);border-top:1px solid var(--line);padding:6px max(8px,env(safe-area-inset-right,0px)) calc(6px + env(safe-area-inset-bottom,0px)) max(8px,env(safe-area-inset-left,0px))}
.nav button{flex:1;max-width:120px;display:flex;flex-direction:column;align-items:center;gap:1px;font-size:11.5px;color:var(--mut);min-height:48px;justify-content:center;border-radius:14px}.nav button.on{color:var(--green);background:var(--gsoft);font-weight:700}
#app{padding-bottom:100px}
@media (prefers-reduced-motion:reduce){.wire.lit{animation:none}}

.tile.t-settings{grid-column:1/-1}
body::before{content:'';position:fixed;inset:0 0 auto;height:env(safe-area-inset-top,0px);background:var(--bg);z-index:10}
