/* هوية «ورد تتعلم»: فاتحة ومرحة، ولكل مادة لون. خطان فقط: Baloo Bhaijaan 2 وTajawal. */
@font-face{font-family:'Tajawal';font-weight:500;font-display:swap;src:url('/shared/fonts/tajawal-arabic-500-normal.woff2') format('woff2');unicode-range:U+0600-06FF,U+200C-200E,U+2010-2011,U+204F,U+2E41,U+FB50-FDFF,U+FE70-FEFF}
@font-face{font-family:'Tajawal';font-weight:700;font-display:swap;src:url('/shared/fonts/tajawal-arabic-700-normal.woff2') format('woff2');unicode-range:U+0600-06FF,U+200C-200E,U+2010-2011,U+204F,U+2E41,U+FB50-FDFF,U+FE70-FEFF}
@font-face{font-family:'Tajawal';font-weight:500;font-display:swap;src:url('/shared/fonts/tajawal-latin-500-normal.woff2') format('woff2');unicode-range:U+0000-00FF,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215}
@font-face{font-family:'Tajawal';font-weight:700;font-display:swap;src:url('/shared/fonts/tajawal-latin-700-normal.woff2') format('woff2');unicode-range:U+0000-00FF,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215}
@font-face{font-family:'Baloo Bhaijaan 2';font-weight:700;font-display:swap;src:url('/shared/fonts/baloo-bhaijaan-2-arabic-700-normal.woff2') format('woff2');unicode-range:U+0600-06FF,U+200C-200E,U+2010-2011,U+204F,U+2E41,U+FB50-FDFF,U+FE70-FEFF}
@font-face{font-family:'Baloo Bhaijaan 2';font-weight:800;font-display:swap;src:url('/shared/fonts/baloo-bhaijaan-2-arabic-800-normal.woff2') format('woff2');unicode-range:U+0600-06FF,U+200C-200E,U+2010-2011,U+204F,U+2E41,U+FB50-FDFF,U+FE70-FEFF}
@font-face{font-family:'Baloo Bhaijaan 2';font-weight:700;font-display:swap;src:url('/shared/fonts/baloo-bhaijaan-2-latin-700-normal.woff2') format('woff2');unicode-range:U+0000-00FF,U+2000-206F,U+2080-208F,U+20AC,U+2122,U+2212}
@font-face{font-family:'Baloo Bhaijaan 2';font-weight:800;font-display:swap;src:url('/shared/fonts/baloo-bhaijaan-2-latin-800-normal.woff2') format('woff2');unicode-range:U+0000-00FF,U+2000-206F,U+2080-208F,U+20AC,U+2122,U+2212}

:root{
  --paper:#FFF9F0; --card:#FFFFFF; --ink:#2B2540; --ink-2:#5A5270; --line:#EDE4D6;
  /* ورد: من بتلات الشعار */
  --ward:#A8392A; --ward-bg:#FFE6E1; --ward-mid:#F5807D; --ward-line:#FBC3BC; --peach:#F8B57F;
  /* لكل مادة: زاهي للرسوم، وداكن للنص، وفاتح للخلفية */
  --math:#4338CA; --math-bg:#ECEBFF; --math-mid:#6C63FF;
  --english:#A01E62; --english-bg:#FCE6F1; --english-mid:#E0569B;
  --science:#0B7A50; --science-bg:#DDF5EA; --science-mid:#2BB673;
  --arabic:#0B6770; --arabic-bg:#DCF3F4; --arabic-mid:#14A3AE;
  --radius:24px;
  --shadow:0 2px 0 rgba(43,37,64,.06),0 10px 28px -12px rgba(43,37,64,.22);
  --gut:max(28px, env(safe-area-inset-left), env(safe-area-inset-right));
}
*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
html,body{margin:0}
body{
  font-family:'Tajawal',system-ui,sans-serif; color:var(--ink); background:var(--paper);
  min-height:100vh; min-height:100dvh; font-size:17px; line-height:1.6;
  -webkit-font-smoothing:antialiased; -webkit-tap-highlight-color:transparent;
}
h1,h2,h3{font-family:'Baloo Bhaijaan 2','Tajawal',sans-serif;font-weight:800;margin:0;line-height:1.25}
p{margin:0}
.ltr{direction:ltr;unicode-bidi:bidi-override;display:inline-block}
button,a{font:inherit;color:inherit}
a{text-decoration:none}
img{max-width:100%}
h1,h2,h3,b{text-wrap:balance}
p,small{text-wrap:pretty}
.pct{font-variant-numeric:tabular-nums}

/* اللمس: استجابة فورية عند الضغط، بلا تحديد نص ولا قائمة صور عند الضغط المطوّل */
:root{--ease-out:cubic-bezier(.23,1,.32,1)}
a,button,.subj,.mat,.chip,.feature{touch-action:manipulation}
.pill-btn,.continue,.subj,.mat,.feature,.chip,.play,.ch-head,.btn-ghost,.brand{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
.pill-btn,.continue,.subj,.mat:not(.dim),.feature,.chip,.btn-ghost{transition:transform .16s var(--ease-out),box-shadow .16s var(--ease-out),border-color .16s var(--ease-out)}
.pill-btn:active,.continue:active,.subj:active,.mat:not(.dim):active,.chip:active,.btn-ghost:active{transform:scale(.97)}
.feature:active{transform:scale(.985)}
.ch-head:active .ch-no{transform:scale(.92)}
.ch-no{transition:transform .16s var(--ease-out)}
@media (hover:hover) and (pointer:fine){
  .subj:hover,.continue:hover,.feature:hover{transform:translateY(-3px);box-shadow:0 2px 0 rgba(43,37,64,.06),0 16px 32px -14px rgba(43,37,64,.3)}
  .mat:not(.dim):hover{border-color:var(--mid,var(--ward-line))}
  .pill-btn:hover,.btn-ghost:hover{border-color:#DCCFBB}
}
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
:focus-visible{outline:3px solid var(--math-mid);outline-offset:3px}

/* خلفية مرحة */
.bg{position:fixed;inset:0;z-index:-1;pointer-events:none;
  background:
   radial-gradient(circle at 12% 18%, #FFE6E1 0 90px, transparent 91px),
   radial-gradient(circle at 92% 8%, #FCE6F1 0 120px, transparent 121px),
   radial-gradient(circle at 85% 92%, #DCF3F4 0 110px, transparent 111px),
   radial-gradient(#EADFCB 1.2px, transparent 1.3px) 0 0/22px 22px,
   var(--paper);}

.page{min-height:100vh;min-height:100dvh;max-width:1240px;margin:0 auto;
  padding:max(20px, env(safe-area-inset-top)) var(--gut) max(28px, env(safe-area-inset-bottom))}

/* الرأس */
.top{display:flex;align-items:center;gap:14px;min-height:60px}
.brand{display:flex;align-items:center;gap:10px;font-family:'Baloo Bhaijaan 2';font-weight:800;font-size:24px}
.brand img{width:48px;height:48px}
.spacer{flex:1}
.pill-btn{display:inline-flex;align-items:center;gap:8px;min-height:48px;padding:0 18px;border-radius:999px;
  background:var(--card);border:2px solid var(--line);font-weight:700;font-size:16px;cursor:pointer;box-shadow:var(--shadow)}
.pill-btn svg{width:22px;height:22px}

/* الترحيب */
.hello{position:relative;overflow:hidden;display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:20px;margin:18px 0 26px;
  background:var(--ward-bg);border-radius:28px;padding:18px 24px}
.hello::after{content:"";position:absolute;inset-inline-end:28%;top:-60px;width:220px;height:220px;background:var(--ward-mid);opacity:.18;pointer-events:none;
  -webkit-mask:url(/shared/img/ward-logo-256.png) center/contain no-repeat;mask:url(/shared/img/ward-logo-256.png) center/contain no-repeat}
.hello > *{position:relative;z-index:1}
.hello > img{width:92px;height:92px;object-fit:contain;background:#FFFFFF;border-radius:50%;padding:4px;border:3px solid var(--ward-line)}
.hello h1{font-size:34px}
.hello p{margin:4px 0 0;color:#3E3757;font-size:18px}
.continue{display:flex;align-items:center;gap:12px;min-height:72px;padding:10px 14px;border-radius:22px;
  background:var(--card);color:var(--ink);box-shadow:var(--shadow);cursor:pointer;border:2px solid var(--ward-line)}
.continue img,.continue .tile{width:56px;height:56px;border-radius:14px;object-fit:cover;flex:none}
.continue .tile{display:grid;place-items:center;font-family:'Baloo Bhaijaan 2';font-weight:800;font-size:22px;direction:ltr}
.continue b{display:block;font-size:17px;line-height:1.35}
.continue small{font-size:14px;color:var(--ink-2)}
.continue .go{width:48px;height:48px;border-radius:50%;background:var(--ward-mid);display:grid;place-items:center;flex:none}
.continue .go svg{width:24px;height:24px}

/* بطاقات المواد */
.subjects{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:20px}
.subj{position:relative;display:flex;flex-direction:column;min-height:300px;border-radius:var(--radius);padding:22px;
  background:var(--card);border:3px solid var(--line);box-shadow:var(--shadow);overflow:hidden;cursor:pointer;text-align:start}
.subj .art{position:relative;overflow:hidden;height:130px;border-radius:18px;display:grid;place-items:center;margin-bottom:16px;background:var(--bgc)}
.subj .art::before{content:"";position:absolute;inset-inline-start:-46px;top:-46px;width:170px;height:170px;background:var(--mid);opacity:.35;
  -webkit-mask:url(/shared/img/ward-logo-256.png) center/contain no-repeat;mask:url(/shared/img/ward-logo-256.png) center/contain no-repeat}
.glyph{position:relative;font-family:'Baloo Bhaijaan 2',sans-serif;font-weight:800;font-size:60px;line-height:1;direction:ltr;color:var(--deep)}
.subj h2{font-size:28px;color:var(--deep)}
.subj p{margin:6px 0 0;color:var(--ink-2);font-size:16px;line-height:1.5}
.subj .foot{margin-top:auto;padding-top:14px;display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.subj .foot .bar{min-width:90px;background:var(--bgc)}
.subj .foot .bar i{background:var(--deep)}
.subj.open{border-color:var(--mid)}
.subj.locked{cursor:default}
.bar{flex:1;height:12px;border-radius:99px;background:#EFEAF6;overflow:hidden}
.bar i{display:block;height:100%;border-radius:99px;min-width:0}
.pct{font-weight:700;font-size:16px}
.badge-row{display:flex;gap:4px}
.badge-row span{width:28px;height:28px;border-radius:50%;display:grid;place-items:center;background:var(--peach)}
.badge-row svg{width:16px;height:16px}
.soon{display:inline-flex;align-items:center;gap:6px;min-height:36px;padding:0 14px;border-radius:999px;font-weight:700;font-size:15px;background:var(--bgc);color:var(--deep)}

.c-math{--mid:var(--math-mid);--deep:var(--math);--bgc:var(--math-bg)}
.c-english{--mid:var(--english-mid);--deep:var(--english);--bgc:var(--english-bg)}
.c-science{--mid:var(--science-mid);--deep:var(--science);--bgc:var(--science-bg)}
.c-arabic{--mid:var(--arabic-mid);--deep:var(--arabic);--bgc:var(--arabic-bg)}

/* ===== صفحة المادة ===== */
.subj-head{display:flex;align-items:center;gap:18px;margin:16px 0 22px;padding:18px 24px;border-radius:28px;background:var(--deep);color:#fff;box-shadow:var(--shadow);position:relative;overflow:hidden}
.subj-head::after{content:"";position:absolute;inset-inline-end:-40px;top:-50px;width:230px;height:230px;background:#FFFFFF;opacity:.12;pointer-events:none;
  -webkit-mask:url(/shared/img/ward-logo-256.png) center/contain no-repeat;mask:url(/shared/img/ward-logo-256.png) center/contain no-repeat}
.subj-head .hglyph{width:76px;height:76px;flex:none;border-radius:20px;background:#FFFFFF;color:var(--deep);display:grid;place-items:center;font-family:'Baloo Bhaijaan 2';font-weight:800;font-size:32px;direction:ltr}
.subj-head h1{font-size:36px}
.subj-head p{margin:2px 0 0;font-size:17px}
.subj-head .stat{margin-inline-start:auto;text-align:center;background:rgba(255,255,255,.16);border-radius:18px;padding:10px 18px;position:relative;z-index:1}
.subj-head .stat b{display:block;font-family:'Baloo Bhaijaan 2';font-size:28px;line-height:1.1}
.subj-head .stat small{font-size:14px}
.subj-head .stat.empty{display:flex;align-items:center;gap:8px;padding:10px 16px}
.subj-head .stat.empty svg{width:22px;height:22px;flex:none}
.subj-head .stat.empty small{font-size:15px;font-weight:700}

.legend{display:flex;gap:16px;flex-wrap:wrap;color:var(--ink-2);font-size:14px;margin:4px 0 14px}
.legend span{display:inline-flex;align-items:center;gap:6px}
.legend i{width:14px;height:14px;border-radius:4px;display:inline-block}

.chapter{background:var(--card);border-radius:var(--radius);box-shadow:var(--shadow);border:2px solid var(--line);margin-bottom:18px;overflow:hidden}
.ch-head{display:flex;align-items:center;gap:16px;padding:18px 22px;min-height:76px;width:100%;background:none;border:0;cursor:pointer;text-align:start}
.ch-no{width:52px;height:52px;border-radius:16px;background:var(--bgc);color:var(--deep);display:grid;place-items:center;font-family:'Baloo Bhaijaan 2';font-weight:800;font-size:26px;flex:none}
.ch-head > span:nth-child(2){flex:1;min-width:0}
.ch-head h2{font-size:23px}
.ch-head .meta{color:var(--ink-2);font-size:15px;margin-top:2px}
.ch-prog{margin-inline-start:auto;display:flex;align-items:center;gap:10px;min-width:200px}
.ch-prog .bar{background:var(--bgc)} .ch-prog .bar i{background:var(--deep)}
.chev{width:28px;height:28px;flex:none;color:var(--ink-2);transition:transform .25s var(--ease-out)}
.chapter.closed .chev{transform:rotate(90deg)}
.chapter.closed .ch-body{display:none}
.ch-body{padding:0 22px 22px}

.feature{display:grid;grid-template-columns:minmax(0,1.1fr) minmax(0,1fr);border-radius:20px;overflow:hidden;background:#17163A;color:#fff;min-height:190px;margin-bottom:16px}
.feature .pic{background:#17163A center/cover no-repeat;position:relative}
.feature .pic::after{content:"";position:absolute;inset:0;background:linear-gradient(270deg,rgba(23,22,58,0) 40%,#17163A 100%)}
.feature .txt{padding:20px 22px;display:flex;flex-direction:column;gap:6px}
.feature .kind{align-self:flex-start;background:#FFC93C;color:#2B2540;font-weight:800;font-size:14px;border-radius:999px;padding:4px 12px}
.feature h3{font-size:26px}
.feature p{margin:0;font-size:16px;color:#E6E3FF}
.stations{display:flex;gap:6px;margin-top:6px;flex-wrap:wrap}
.stations span{min-width:40px;height:34px;border-radius:10px;display:grid;place-items:center;font-size:14px;font-weight:700;padding:0 8px}
.st-done{background:#FFC93C;color:#2B2540}
.st-open{background:#fff;color:#2B2540}
.st-soon{background:rgba(255,255,255,.14);color:#D9D6FF}
.play{margin-top:auto;align-self:flex-start;display:inline-flex;align-items:center;gap:8px;min-height:52px;padding:0 22px;border-radius:999px;background:#FFC93C;color:#2B2540;font-weight:800;font-size:18px;border:0}
.play svg{width:22px;height:22px}

.mats{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:12px}
.mat{display:flex;align-items:center;gap:12px;min-height:72px;padding:12px 14px;border-radius:18px;border:2px solid var(--line);background:#FFFDF9;cursor:pointer}
.mat .ico{width:46px;height:46px;border-radius:14px;display:grid;place-items:center;flex:none}
.mat .ico svg{width:26px;height:26px}
.mat b{display:block;font-size:17px;line-height:1.35}
.mat small{color:var(--ink-2);font-size:14px}
.mat .tick{margin-inline-start:auto;width:28px;height:28px;border-radius:50%;background:#DDF5EA;color:#0B7A50;display:grid;place-items:center;flex:none}
.mat .tick svg{width:18px;height:18px}
.mat.dim{border-style:dashed;cursor:default}
.mat.dim b{color:var(--ink-2)}
.k-game .ico{background:#ECEBFF;color:#4338CA}
.k-lesson .ico{background:#FFE6E1;color:#A8392A}
.k-sheet .ico{background:#DDF5EA;color:#0B7A50}
.k-review .ico,.k-fold .ico{background:#FFF0CF;color:#8A5300}
.k-video .ico{background:#E3F1FF;color:#1D5FA8}

.lessons-title{font-weight:700;color:var(--ink-2);font-size:15px;margin:18px 0 10px}
.lessons{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}
.lesson{border:2px solid var(--line);border-radius:16px;padding:12px;background:#FFFDF9;min-height:118px;display:flex;flex-direction:column;gap:6px}
.lesson .lno{font-family:'Baloo Bhaijaan 2';font-weight:800;color:var(--deep);font-size:18px}
.lesson b{font-size:16px;line-height:1.4}
.lesson .chips{margin-top:auto;display:flex;gap:6px;flex-wrap:wrap}
.chip{display:inline-flex;align-items:center;gap:6px;min-height:44px;padding:0 14px;border-radius:999px;font-size:13px;font-weight:700}
.chip svg{width:18px;height:18px}
span.chip{min-height:36px}
.c-sheet{background:#DDF5EA;color:#0B7A50}
.c-lesson{background:#FFE6E1;color:#A8392A}
.c-none{background:#F3EEE6;color:#6A6280}

/* صفحة «قريبًا» */
.soon-page{display:grid;place-items:center;text-align:center;gap:14px;padding:48px 24px;background:var(--card);border-radius:28px;border:2px solid var(--line);box-shadow:var(--shadow)}
.soon-page .glyph{font-size:80px}
.soon-page h1{font-size:34px;color:var(--deep)}
.soon-page p{color:var(--ink-2);font-size:18px}

/* لوحة ولي الأمر */
.panel{background:var(--card);border-radius:var(--radius);border:2px solid var(--line);box-shadow:var(--shadow);padding:20px 22px;margin-bottom:18px}
.panel h2{font-size:24px;margin-bottom:10px}
.panel ol{margin:0;padding-inline-start:26px;list-style:arabic-indic;line-height:1.7}
.panel li+li{margin-top:8px}
.panel li::marker{font-weight:700;color:var(--ward)}
.panel table{width:100%;border-collapse:collapse}
.panel td,.panel th{padding:10px 8px;border-bottom:1px solid var(--line);text-align:start}
.btn-ghost{display:inline-flex;align-items:center;min-height:48px;padding:0 18px;border-radius:999px;border:2px solid var(--line);background:#fff;font-weight:700;cursor:pointer}

/* تجاوب */
@media (max-width:1100px){ .lessons{grid-template-columns:repeat(2,minmax(0,1fr))} }
@media (max-width:980px){
  .subjects{grid-template-columns:repeat(2,minmax(0,1fr))}
  .subj{min-height:250px}
  .hello{grid-template-columns:auto 1fr}
  .hello .continue{grid-column:1/-1}
  .ch-prog{min-width:140px}
}
@media (max-width:640px){
  :root{--gut:max(14px, env(safe-area-inset-left), env(safe-area-inset-right))}
  .page{padding-top:max(12px, env(safe-area-inset-top))}
  .brand{font-size:20px} .brand img{width:42px;height:42px}
  .hello{padding:16px} .hello h1{font-size:26px} .hello > img{width:68px;height:68px}
  .subjects{gap:12px}
  .subj{min-height:210px;padding:14px} .subj .art{height:84px} .glyph{font-size:40px}
  .subj .art::before{width:120px;height:120px;inset-inline-start:-34px;top:-34px}
  .subj h2{font-size:22px} .subj p{display:none} .badge-row{display:none}
  .feature{grid-template-columns:1fr} .feature .pic{min-height:130px}
  .feature .pic::after{background:linear-gradient(180deg,rgba(23,22,58,0) 40%,#17163A 100%)}
  .ch-head{flex-wrap:wrap;padding:16px;gap:12px} .ch-head h2{font-size:20px} .ch-no{width:44px;height:44px;font-size:22px;border-radius:14px}
  .ch-head .chev{order:3} .ch-prog{order:4;min-width:0;width:100%;margin:0}
  .ch-body{padding:0 16px 16px}
  .subj-head{padding:16px} .subj-head h1{font-size:28px} .subj-head .stat,.subj-head .stat.empty{display:none}
  .lessons{grid-template-columns:1fr}
}
@media (prefers-reduced-motion:reduce){ *{transition:none !important;animation:none !important} }
