/* ==========================================================
   مكتبتي الرقمية — نظام التصميم
   الفكرة: مكتبة حكايات ساحرة؛ نافذة مقوّسة على سماء الغروب
   تحيط بها رفوف الكتب، وأجنحة على هيئة أبواب مقوّسة.
   الواجهة غنية، وصفحات القراءة واللعب هادئة على ورق عاجي.
   ========================================================== */
:root {
  --ivory: #FFF9F0;
  --paper: #FFFDF8;
  --ink: #2F2A4A;
  --ink-soft: #6A6386;
  --line: #EDE3D6;
  --peach: #FFD6C6;  --peach-deep: #E58466;
  --sky: #CBE8F5;    --sky-deep: #3F8DB3;
  --mint: #CDEEDD;   --mint-deep: #2F8A64;
  --lavender: #E3DBFA; --lav-deep: #6F5BC7;
  --cream: #FFF1BF;  --gold: #E5B23C;
  --rose: #FFDDE6;   --rose-deep: #C25A7E;
  --wood: #C99A6B;   --wood-dark: #A0724A;
  --good: #2F9E6A;   --bad: #D9655A;

  --font-display: "Aref Ruqaa", "Noto Naskh Arabic", serif;
  --font-ui: "Baloo Bhaijaan 2", "Tajawal", "Segoe UI", "Geeza Pro", system-ui, sans-serif;
  --font-read: "Noto Naskh Arabic", "Amiri", "Geeza Pro", "Times New Roman", serif;

  --r-lg: 28px; --r-md: 20px; --r-sm: 14px;
  --shadow-soft: 0 10px 30px -12px rgba(76, 58, 120, .25);
  --shadow-lift: 0 22px 44px -18px rgba(76, 58, 120, .38);
  --gutter: max(16px, env(safe-area-inset-left, 0px));
  --gutter-r: max(16px, env(safe-area-inset-right, 0px));
  --maxw: 1180px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 90px; }
body {
  margin: 0; background: var(--ivory); color: var(--ink);
  font-family: var(--font-ui); font-size: 1.125rem; line-height: 1.7;
  background-image: radial-gradient(circle at 12% 8%, #FFF1E6 0, transparent 40%), radial-gradient(circle at 90% 30%, #F1ECFF 0, transparent 38%);
  background-attachment: fixed;
  min-height: 100vh; display: flex; flex-direction: column;
}
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 60; background: rgba(255, 249, 240, .96); }
img { max-width: 100%; display: block; }
a { color: var(--lav-deep); }
button { font: inherit; color: inherit; }
h1, h2, h3 { line-height: 1.35; text-wrap: balance; margin: 0; }
p { margin: 0; }
:focus-visible { outline: 4px solid #8C78E8; outline-offset: 3px; border-radius: 10px; }
.skip { position: absolute; inset-inline-start: 12px; top: -60px; background: var(--ink); color: #fff; padding: 8px 16px; border-radius: 12px; z-index: 100; }
.skip:focus { top: 12px; }
[hidden] { display: none !important; }
main { flex: 1; outline: none; }

/* ---------- الشريط العلوي ---------- */
.topbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 50; background: rgba(255, 249, 240, .86); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid rgba(201, 154, 107, .22); }
.topbar-inner { max-width: var(--maxw); margin: 0 auto; display: flex; align-items: center; gap: 12px; padding-block: 10px; padding-left: var(--gutter); padding-right: var(--gutter-r); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); flex-shrink: 0; }
.brand-mark svg { width: 42px; height: 42px; display: block; }
.brand-name { font-family: var(--font-display); font-size: 1.55rem; line-height: 1; color: var(--lav-deep); padding-top: 4px; }
.nav { display: flex; gap: 2px; margin-inline-start: auto; flex-wrap: nowrap; }
.nav a { text-decoration: none; color: var(--ink); font-weight: 600; font-size: 1rem; padding: 8px 12px; border-radius: 999px; display: inline-flex; align-items: center; gap: 6px; transition: background .2s; white-space: nowrap; }
.nav a span { font-size: 1.05rem; }
.nav a:hover { background: var(--lavender); }
.nav a[aria-current] { background: var(--ink); color: #FFF9F0; }
.top-tools { display: flex; align-items: center; gap: 8px; margin-inline-start: 8px; }
.star-badge { display: inline-flex; align-items: center; gap: 4px; text-decoration: none; color: var(--ink); background: var(--cream); border: 2px solid #F5DE8E; border-radius: 999px; padding: 4px 14px 2px; font-weight: 800; }
.round-btn { width: 46px; height: 46px; border-radius: 50%; border: 2px solid var(--line); background: var(--paper); cursor: pointer; font-size: 1.2rem; display: grid; place-items: center; }
.round-btn:hover { background: var(--lavender); }
.menu-btn { display: none; }
.settings { position: absolute; inset-inline-end: max(16px, env(safe-area-inset-right, 0px)); top: calc(100% + 6px); background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-lift); padding: 10px; display: grid; gap: 6px; min-width: 270px; }
.settings button { display: flex; justify-content: space-between; align-items: center; gap: 16px; border: 0; background: transparent; padding: 10px 12px; border-radius: 12px; cursor: pointer; font-weight: 600; text-align: start; }
.settings button:hover { background: var(--ivory); }
.settings i { width: 48px; height: 28px; border-radius: 99px; background: #DCD6E6; position: relative; flex-shrink: 0; transition: background .2s; }
.settings i::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: inset-inline-start .2s; }
.settings [aria-checked="true"] i { background: var(--mint-deep); }
.settings [aria-checked="true"] i::after { inset-inline-start: 23px; }

/* ---------- عناصر عامة ---------- */
.section { max-width: var(--maxw); margin: 0 auto; padding-block: 44px; padding-left: var(--gutter); padding-right: var(--gutter-r); }
.section.calm { padding-block: 24px 56px; }
.section-head { text-align: center; margin-bottom: 28px; }
.section-head h2 { font-size: clamp(1.7rem, 3.4vw, 2.4rem); font-weight: 800; display: inline-flex; align-items: center; gap: 14px; }
.section-head h2::before, .section-head h2::after { content: "✦"; color: var(--gold); font-size: .7em; }
.section-head p { color: var(--ink-soft); margin-top: 4px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 8px 26px; border-radius: 999px; border: 0; cursor: pointer; text-decoration: none; font-weight: 800; font-size: 1.12rem; background: var(--ink); color: #FFF9F0; box-shadow: 0 6px 0 #18142F, 0 12px 24px -10px rgba(47, 42, 74, .6); transition: transform .15s, box-shadow .15s; }
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(3px); box-shadow: 0 2px 0 #18142F; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn.alt { background: var(--mint-deep); box-shadow: 0 6px 0 #1E6849; }
.btn.ghost { background: var(--paper); color: var(--ink); border: 2px solid var(--line); box-shadow: 0 4px 0 var(--line); }
.btn.sm { min-height: 42px; padding: 4px 16px; font-size: 1rem; box-shadow: 0 3px 0 #18142F; }
.btn.ghost.sm { box-shadow: 0 3px 0 var(--line); }
.btn.danger { background: var(--bad); box-shadow: 0 3px 0 #A44038; }
.btn-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.btn-row.center { justify-content: center; }
.chip { display: inline-flex; align-items: center; gap: 4px; font-size: .86rem; font-weight: 700; padding: 2px 12px; border-radius: 999px; background: var(--lavender); color: var(--lav-deep); white-space: nowrap; }
.chip.soft { background: var(--ivory); color: var(--ink-soft); border: 1px solid var(--line); }
.chip.done { background: var(--mint); color: var(--mint-deep); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-btn { border: 2px solid var(--line); background: var(--paper); border-radius: 999px; padding: 6px 18px; cursor: pointer; font-weight: 700; font-size: 1.02rem; min-height: 46px; transition: all .15s; }
.chip-btn:hover { border-color: #C9BDF0; }
.chip-btn.on { background: var(--ink); color: #FFF9F0; border-color: var(--ink); }
.card-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.stars { display: inline-flex; gap: 1px; letter-spacing: 0; }
.star { color: #DDD5C8; font-size: 1.1em; }
.star.on { color: var(--gold); text-shadow: 0 1px 0 #B9861A; }
.empty { text-align: center; padding: 40px 16px; color: var(--ink-soft); }
.empty span { font-size: 3rem; display: block; }
.loading { display: grid; place-items: center; gap: 12px; padding: 120px 16px; color: var(--ink-soft); }
.loading-book { width: 56px; height: 42px; border-radius: 6px; background: linear-gradient(90deg, var(--peach) 50%, var(--lavender) 50%); animation: bob 1.2s ease-in-out infinite; }

/* ---------- البطل: النافذة المقوّسة ---------- */
.hero { padding-block: 28px 8px; padding-left: var(--gutter); padding-right: var(--gutter-r); overflow: hidden; }
.hero-stage { max-width: var(--maxw); margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2.2fr) minmax(0, 1fr); gap: clamp(10px, 2vw, 26px); align-items: end; perspective: 1400px; }
.shelf-col { background: linear-gradient(180deg, #D6AB7C, var(--wood)); border-radius: 22px 22px 10px 10px; padding: 14px 12px 8px; box-shadow: inset 0 0 0 6px #B98858, var(--shadow-lift); display: grid; gap: 10px; height: 92%; align-content: space-between; }
.shelf-col.start { transform: rotateY(14deg); transform-origin: right center; }
.shelf-col.end { transform: rotateY(-14deg); transform-origin: left center; }
.shelf-row { display: flex; align-items: flex-end; gap: 3px; height: 72px; border-bottom: 9px solid var(--wood-dark); padding-inline: 4px; overflow: hidden; }
.shelf-row i { display: block; width: var(--w); height: var(--h); background: var(--c); border-radius: 3px 3px 1px 1px; box-shadow: inset -3px 0 0 rgba(0,0,0,.08), inset 0 8px 0 rgba(255,255,255,.35); transform: rotate(var(--tilt)); transform-origin: bottom; flex-shrink: 0; }
.arch-window { position: relative; border-radius: 999px 999px 30px 30px; padding: 12px; background: linear-gradient(180deg, #FFFFFF, #F4E9DC); box-shadow: 0 0 0 4px #F1DFC9, var(--shadow-lift); }
.arch-sky { position: absolute; inset: 12px; border-radius: 999px 999px 22px 22px; overflow: hidden; background: linear-gradient(180deg, #8C7BD9 0%, #B9A5F0 30%, #F3B6C6 64%, #FFD9B8 100%); }
.arch-sky::after { content: ""; position: absolute; inset: auto 0 0; height: 30%; background: radial-gradient(120% 90% at 50% 120%, rgba(255, 246, 220, .95), transparent 70%); }
.moon { position: absolute; top: 14%; left: 18%; width: 54px; height: 54px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #FFFBEA, #FFE7A3); box-shadow: 0 0 40px 10px rgba(255, 236, 170, .55); }
.spark { position: absolute; left: var(--x); top: var(--y); width: 6px; height: 6px; background: #FFF8DC; border-radius: 50%; transform: scale(var(--s)); box-shadow: 0 0 10px 2px rgba(255, 248, 220, .9); animation: twinkle 3s ease-in-out infinite; animation-delay: var(--d); }
.float-book { position: absolute; width: 58px; height: 42px; animation: floaty 6s ease-in-out infinite; }
.float-book b, .float-book::before, .float-book::after { content: ""; position: absolute; top: 0; width: 50%; height: 100%; border-radius: 4px; }
.float-book::before { right: 50%; background: #FFF6EA; transform: skewY(8deg); box-shadow: inset -3px 0 0 #EBD9C4; }
.float-book::after { left: 50%; background: #FFF6EA; transform: skewY(-8deg); box-shadow: inset 3px 0 0 #EBD9C4; }
.float-book b { left: 46%; width: 8%; background: #E9B949; z-index: 1; border-radius: 2px; }
.fb1 { top: 20%; right: 12%; transform: rotate(-12deg); }
.fb2 { top: 52%; left: 8%; animation-delay: -2s; scale: .8; }
.fb3 { top: 64%; right: 6%; animation-delay: -4s; scale: .65; }
.hero-copy { position: relative; z-index: 2; text-align: center; padding: clamp(110px, 16vw, 170px) 20px 54px; display: grid; justify-items: center; gap: 8px; }
.brand-title { font-family: var(--font-display); font-weight: 700; font-size: clamp(3rem, 8.5vw, 6.2rem); line-height: 1.15; color: #FFFDF8; text-shadow: 0 3px 0 #6F5BC7, 0 8px 30px rgba(62, 40, 120, .45); outline: none; }
.slogan { display: flex; gap: 12px; align-items: center; justify-content: center; font-weight: 800; font-size: clamp(1.15rem, 2.6vw, 1.6rem); color: #3B2E6E; background: rgba(255, 253, 248, .82); padding: 6px 22px; border-radius: 999px; box-shadow: 0 6px 20px -10px rgba(60, 40, 120, .4); }
.slogan i { font-style: normal; color: var(--gold); }
.welcome { font-size: clamp(1.15rem, 2.4vw, 1.45rem); color: #2F2A4A; font-weight: 700; margin-top: 6px; }
.btn-hero { margin-top: 14px; font-size: 1.3rem; min-height: 62px; padding-inline: 38px; background: linear-gradient(180deg, #FFD978, #F2B83A); color: #3B2E15; box-shadow: 0 7px 0 #C38B1A, 0 18px 30px -12px rgba(150, 100, 20, .7); }
.btn-hero span { animation: twinkle 2s infinite; }
.arch-sill { position: absolute; inset: auto -14px -12px; height: 22px; border-radius: 12px; background: linear-gradient(180deg, #E7CBA8, var(--wood)); box-shadow: 0 8px 18px -8px rgba(100, 60, 20, .5); }

/* ---------- الأجنحة: أبواب مقوّسة ---------- */
.wings { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 26px; perspective: 1200px; }
.wing { --tilt: 0deg; display: grid; justify-items: center; text-align: center; gap: 4px; text-decoration: none; color: var(--ink); padding: 0 8px 18px; transition: transform .35s cubic-bezier(.2, .8, .2, 1); transform: rotateX(var(--tilt)); }
.wing:hover { transform: translateY(-8px) rotateX(6deg); }
.door { position: relative; width: min(100%, 230px); aspect-ratio: 3 / 3.6; border-radius: 999px 999px 18px 18px; background: linear-gradient(160deg, var(--wa), var(--wb)); box-shadow: inset 0 0 0 8px rgba(255, 255, 255, .55), inset 0 -20px 40px rgba(0, 0, 0, .06), 0 18px 34px -16px var(--wc); display: grid; place-items: center; overflow: hidden; margin-bottom: 10px; max-width: 100%; }
.door::before { content: ""; position: absolute; inset: 18px 18px 0; border-radius: 999px 999px 0 0; border: 2px dashed rgba(255, 255, 255, .7); border-bottom: 0; }
.door::after { content: ""; position: absolute; bottom: 0; inset-inline: 0; height: 14px; background: rgba(255, 255, 255, .5); }
.door-glow { position: absolute; width: 70%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, rgba(255, 255, 255, .95), rgba(255, 255, 255, 0) 70%); top: 22%; }
.door-emoji { position: relative; font-size: clamp(3.6rem, 7vw, 5rem); filter: drop-shadow(0 10px 10px rgba(0, 0, 0, .15)); transition: transform .4s; }
.wing:hover .door-emoji { transform: scale(1.12) translateY(-6px); }
.wing strong { font-size: 1.32rem; font-weight: 800; }
.wing > span:last-child { color: var(--ink-soft); font-size: 1rem; }

/* ---------- جديد مكتبتنا: رف أفقي ---------- */
.shelf-scroll { overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 12px; scrollbar-width: thin; }
.shelf-track { display: flex; gap: 22px; padding: 18px 6px 34px; width: max-content; position: relative; }
.shelf-track::after { content: ""; position: absolute; inset-inline: 0; bottom: 20px; height: 18px; border-radius: 6px; background: linear-gradient(180deg, #DDB487, var(--wood)); box-shadow: 0 10px 18px -8px rgba(110, 70, 30, .55); z-index: -1; }
.shelf-item { scroll-snap-align: start; width: 178px; position: relative; flex-shrink: 0; }
.shelf-item > a { height: 100%; }
.shelf-item .game-card, .shelf-item .topic-card, .shelf-item .medal-card { justify-content: center; align-content: center; }
.shelf-item .game-body > span:not(.card-meta), .shelf-item .medal-card > span:not(.medal):not(.card-meta), .shelf-item .card-meta .chip:not(:first-child) { display: none; }
.shelf-item .card-meta { justify-content: center; }
.new-tag { position: absolute; top: -10px; inset-inline-start: 10px; z-index: 3; background: var(--ink); color: #FFF9F0; font-size: .8rem; font-weight: 800; padding: 1px 12px; border-radius: 999px; }

/* ---------- الأغلفة ---------- */
.book-card { display: grid; gap: 10px; text-decoration: none; color: var(--ink); }
.cover { position: relative; aspect-ratio: 3 / 4; border-radius: 8px 18px 18px 8px; overflow: hidden; box-shadow: -8px 0 0 -2px var(--cover-deep, #6F5BC7) inset, var(--shadow-soft); transition: transform .35s cubic-bezier(.2, .8, .2, 1), box-shadow .35s; transform-origin: right center; background: #fff; }
.cover svg, .cover img { width: 100%; height: 100%; display: block; object-fit: cover; }
.cover::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 14px; background: linear-gradient(90deg, rgba(0,0,0,.18), rgba(255,255,255,.25) 60%, transparent); z-index: 1; }
.cover-title { position: absolute; inset: auto 0 0; padding: 26px 12px 12px; background: linear-gradient(0deg, rgba(255, 253, 248, .97) 55%, rgba(255, 253, 248, 0)); text-align: center; }
.cover-title span { font-weight: 800; font-size: 1.08rem; line-height: 1.35; color: var(--ink); display: block; }
.book-card:hover .cover { transform: rotateY(-10deg) translateY(-6px); box-shadow: -8px 0 0 -2px var(--cover-deep) inset, var(--shadow-lift); }

.shelf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 34px 26px; }
.shelf-grid .book-card { position: relative; padding-bottom: 6px; perspective: 900px; }
.shelf-grid .book-card .cover::after { content: none; }

/* ---------- بطاقات الألعاب ---------- */
.game-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 22px; }
.game-card { display: flex; gap: 16px; align-items: center; text-decoration: none; color: var(--ink); background: var(--paper); border-radius: var(--r-lg); padding: 16px; border: 2px solid var(--line); transition: transform .25s, box-shadow .25s; }
.game-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); }
.game-emoji { flex-shrink: 0; width: 96px; height: 96px; border-radius: 28px; display: grid; place-items: center; font-size: 3.2rem; background: radial-gradient(circle at 30% 25%, #fff 0, var(--ga) 45%, var(--gb) 100%); box-shadow: inset 0 -6px 0 rgba(0,0,0,.08); transform: rotate(-4deg); }
.game-body { display: grid; gap: 4px; min-width: 0; }
.game-body strong { font-size: 1.25rem; }
.game-body > span:not(.card-meta) { color: var(--ink-soft); font-size: .98rem; line-height: 1.5; }
.shelf-item .game-card { flex-direction: column; text-align: center; }

/* ---------- بطاقات الاكتشاف ---------- */
.topic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 22px; }
.topic-card { display: grid; justify-items: center; text-align: center; gap: 6px; padding: 24px 16px 18px; border-radius: var(--r-lg); text-decoration: none; color: var(--ink); background: linear-gradient(180deg, var(--ta), var(--paper) 70%); border: 2px solid rgba(255, 255, 255, .8); box-shadow: var(--shadow-soft); transition: transform .25s; }
.topic-card:hover { transform: translateY(-5px); }
.topic-orb { width: 96px; height: 96px; border-radius: 50%; display: grid; place-items: center; font-size: 3rem; background: radial-gradient(circle at 35% 30%, #fff, var(--tb)); box-shadow: 0 0 0 8px rgba(255,255,255,.6), 0 12px 24px -10px var(--tb); }
.topic-orb.big { width: 120px; height: 120px; font-size: 3.8rem; }
.topic-card strong { font-size: 1.22rem; margin-top: 8px; }
.topic-name { color: var(--ink-soft); font-size: .95rem; }

/* ---------- الشارات ---------- */
.medal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 22px; }
.medal-card { display: grid; justify-items: center; text-align: center; gap: 6px; padding: 24px 18px; background: var(--paper); border: 2px solid var(--line); border-radius: var(--r-lg); text-decoration: none; color: var(--ink); transition: transform .25s; }
.medal-card:hover { transform: translateY(-4px); }
.medal-card > span:not(.medal):not(.card-meta) { color: var(--ink-soft); font-size: .98rem; }
.medal { width: 92px; height: 92px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(from 0deg, #F7DA86, #E5B23C, #F7DA86, #E5B23C, #F7DA86); box-shadow: 0 0 0 6px #FFF1BF, 0 10px 20px -8px rgba(160, 110, 20, .6); position: relative; }
.medal span { width: 70%; height: 70%; border-radius: 50%; background: var(--paper); display: grid; place-items: center; font-size: 2.3rem; }
.medal-card:not(.got) .medal, .medal-tile:not(.got) .medal { filter: grayscale(.85); opacity: .65; }
.medal.huge { width: 140px; height: 140px; margin: 0 auto; }
.medal.huge span { font-size: 3.5rem; }
.my-badges { display: inline-flex; margin-bottom: 18px; font-weight: 800; text-decoration: none; background: var(--cream); color: var(--ink); padding: 8px 18px; border-radius: 999px; border: 2px solid #F5DE8E; }

/* ---------- مختارات الأسبوع ---------- */
.spots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.spot { position: relative; background: var(--paper); border-radius: var(--r-lg); padding: 30px 20px 22px; display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 16px; align-items: start; border: 2px solid var(--line); box-shadow: var(--shadow-soft); }
.spot::before { content: ""; position: absolute; inset: 8px; border-radius: 22px; border: 1.5px dashed #E8D9C4; pointer-events: none; }
.ribbon { position: absolute; top: -14px; inset-inline-start: 18px; background: var(--peach-deep); color: #fff; font-weight: 800; padding: 3px 16px; border-radius: 10px; font-size: .95rem; box-shadow: 0 4px 0 #B85F44; }
.s-book .ribbon { background: var(--sky-deep); box-shadow: 0 4px 0 #2B6A88; }
.s-game .ribbon { background: var(--mint-deep); box-shadow: 0 4px 0 #1E6849; }
.spot-cover .cover-title { display: none; }
.spot-game { display: grid; place-items: center; aspect-ratio: 3 / 4; border-radius: 22px; font-size: 3.6rem; background: radial-gradient(circle at 30% 25%, #fff 0, var(--ga) 45%, var(--gb) 100%); }
.spot-body { display: grid; gap: 8px; min-width: 0; position: relative; }
.spot-body h3 { font-size: 1.25rem; }
.spot-body p { color: var(--ink-soft); font-size: .98rem; line-height: 1.6; }
.spot-body .btn { justify-self: start; min-height: 46px; font-size: 1rem; padding-inline: 20px; }

/* ---------- شريط المعلمات ---------- */
.teacher-band { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.4fr); gap: 34px; align-items: center; margin-bottom: 30px; }
.board-art { aspect-ratio: 16 / 10; border-radius: 18px; background: #3F7A60; border: 12px solid var(--wood); box-shadow: inset 0 0 0 3px rgba(255,255,255,.1), var(--shadow-lift); display: grid; place-content: center; text-align: center; color: #EAF6EE; gap: 4px; position: relative; }
.board-art span { font-family: var(--font-display); font-size: clamp(1.8rem, 3.5vw, 2.6rem); }
.board-art b { font-weight: 600; opacity: .85; }
.board-art::after { content: ""; position: absolute; bottom: -12px; inset-inline-start: 18%; width: 50px; height: 8px; border-radius: 4px; background: #FFF6EA; box-shadow: 60px 0 0 #F7B7C8; }
.tb-copy { display: grid; gap: 14px; }
.tb-copy h2 { font-size: clamp(1.7rem, 3.4vw, 2.3rem); }
.tb-copy p { color: var(--ink-soft); }
.tb-count { color: var(--ink-soft); font-size: .95rem; }

/* ---------- رأس الصفحات الداخلية ---------- */
.page-head { max-width: var(--maxw); margin: 18px auto 0; padding-block: 18px 26px; padding-left: var(--gutter); padding-right: var(--gutter-r); }
.page-head-row { display: flex; gap: 18px; align-items: center; background: linear-gradient(120deg, var(--ha), var(--paper) 75%); border-radius: var(--r-lg); padding: 22px 26px; border: 2px solid rgba(255,255,255,.9); box-shadow: var(--shadow-soft); }
.head-orb { width: 82px; height: 82px; flex-shrink: 0; border-radius: 999px 999px 18px 18px; background: linear-gradient(180deg, var(--paper), var(--hb)); display: grid; place-items: center; font-size: 2.6rem; box-shadow: inset 0 0 0 5px rgba(255,255,255,.7); }
.page-head h1 { font-size: clamp(1.7rem, 3.5vw, 2.4rem); outline: none; }
.page-head p { color: var(--ink-soft); max-width: 62ch; }
.back-link { display: inline-block; margin-bottom: 10px; font-weight: 700; text-decoration: none; color: var(--ink-soft); }
.toolbar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 26px; }
.count { color: var(--ink-soft); font-weight: 700; }

/* ---------- القارئ ---------- */
.reader, .play, .activity, .challenge { max-width: 1100px; margin: 0 auto; padding-block: 18px 40px; padding-left: var(--gutter); padding-right: var(--gutter-r); }
.reader-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.reader-title { font-size: clamp(1.3rem, 2.6vw, 1.75rem); flex: 1; min-width: 180px; outline: none; }
.reader-tools { display: flex; gap: 8px; flex-wrap: wrap; }
.pill { display: inline-flex; align-items: center; gap: 6px; min-height: 46px; padding: 4px 18px; border-radius: 999px; background: var(--paper); border: 2px solid var(--line); text-decoration: none; color: var(--ink); font-weight: 700; cursor: pointer; white-space: nowrap; }
.pill:hover { border-color: #C9BDF0; }
.pill.icon { min-width: 52px; justify-content: center; font-weight: 800; }
.pill.listen { background: var(--mint); border-color: #A9DCC2; }
.pill.listen[aria-pressed="true"] { background: var(--mint-deep); color: #fff; }
.stage { position: relative; perspective: 1600px; }
.spread { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); background: var(--paper); border-radius: 26px; box-shadow: 0 0 0 1px var(--line), 0 30px 60px -30px rgba(76, 58, 120, .45); overflow: hidden; position: relative; min-height: 380px; }
.spread::after { content: ""; position: absolute; top: 0; bottom: 0; inset-inline-start: 52.4%; width: 36px; transform: translateX(50%); background: linear-gradient(90deg, rgba(0,0,0,0), rgba(80, 60, 40, .10), rgba(0,0,0,0)); pointer-events: none; }
.leaf { position: relative; margin: 0; }
.leaf.art { background: #F7EEE3; }
.leaf.art .scene, .leaf.art img { width: 100%; height: 100%; min-height: 320px; object-fit: cover; display: block; }
.zoom { position: absolute; top: 12px; inset-inline-start: 12px; z-index: 2; width: 48px; height: 48px; border-radius: 50%; border: 0; background: rgba(255, 253, 248, .9); font-size: 1.4rem; cursor: pointer; box-shadow: var(--shadow-soft); }
.leaf.text { display: grid; align-content: center; padding: clamp(24px, 4vw, 56px); background: repeating-linear-gradient(180deg, transparent 0 calc(2.2em * var(--read-scale, 1) - 1px), rgba(201, 154, 107, .12) calc(2.2em * var(--read-scale, 1) - 1px) calc(2.2em * var(--read-scale, 1))); }
.read-text { font-family: var(--font-read); font-size: calc(clamp(1.45rem, 2.6vw, 1.95rem) * var(--read-scale, 1)); line-height: 2.05; font-weight: 600; color: #2A2440; }
.folio { position: absolute; bottom: 14px; inset-inline-end: 22px; color: var(--ink-soft); font-weight: 700; }
.cover-spread { grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); }
.cover-spread::after { display: none; }
.cover-big { padding: 28px; background: linear-gradient(160deg, #F3EAFE, #FFF1E6); display: grid; place-items: center; }
.cover-big .cover { width: min(100%, 280px); }
.leaf.intro { display: grid; align-content: center; gap: 12px; padding: 32px; }
.leaf.intro h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
.leaf.intro .btn { justify-self: start; }
.kind-tag { display: inline-block; font-weight: 800; color: var(--lav-deep); background: var(--lavender); padding: 2px 14px; border-radius: 999px; font-size: .92rem; justify-self: start; }
.summary { color: var(--ink-soft); font-size: 1.12rem; }
.facts { list-style: none; padding: 0; margin: 0; display: flex; gap: 14px; flex-wrap: wrap; font-weight: 700; color: var(--ink-soft); }
.reader-nav { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 18px; }
.nav-btn { min-height: 58px; min-width: 130px; padding: 6px 22px; border-radius: 999px; border: 2px solid var(--line); background: var(--paper); font-weight: 800; font-size: 1.15rem; cursor: pointer; }
.nav-btn.primary { background: var(--ink); color: #FFF9F0; border-color: var(--ink); }
.nav-btn:disabled { opacity: .35; cursor: default; }
.dots { display: grid; justify-items: center; gap: 6px; text-align: center; }
.page-no { font-weight: 700; color: var(--ink-soft); }
.dot-row { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.dot-row i { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.dot-row i.past { background: #C9BDF0; }
.dot-row i.on { background: var(--lav-deep); width: 26px; border-radius: 6px; }
.turn-next { animation: turnNext .55s cubic-bezier(.2, .7, .2, 1); }
.turn-prev { animation: turnPrev .55s cubic-bezier(.2, .7, .2, 1); }
.finale { text-align: center; display: grid; gap: 14px; justify-items: center; padding: 40px 16px; background: var(--paper); border-radius: 26px; box-shadow: 0 0 0 1px var(--line); }
.finale.small { padding: 20px; box-shadow: none; background: transparent; }
.finale h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
.finale p { color: var(--ink-soft); }
.finale-burst { font-size: 4rem; animation: pop .6s cubic-bezier(.2, 1.6, .4, 1); }
.big-stars { font-size: 3rem; }
.gain { color: var(--good) !important; font-weight: 800; }
.badge-name { font-family: var(--font-display); font-size: 1.8rem; color: var(--lav-deep) !important; }
.pdf-stage { background: var(--paper); border-radius: 26px; padding: 16px; box-shadow: 0 0 0 1px var(--line); overflow: auto; }
.pdf-wrap { width: 100%; display: grid; justify-items: center; }
.pdf-wrap canvas { max-width: none; border-radius: 6px; box-shadow: var(--shadow-soft); }
.pdf-msg { text-align: center; padding: 30px; color: var(--ink-soft); }
.lightbox { position: fixed; inset: 0; z-index: 90; background: rgba(30, 24, 52, .82); display: grid; place-items: center; padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); }
.lightbox-inner { width: min(96vw, 1100px); border-radius: 22px; overflow: hidden; background: #fff; }
.lightbox-inner svg, .lightbox-inner img { width: 100%; height: auto; max-height: 80vh; object-fit: contain; display: block; }
.close-lb { position: absolute; top: max(16px, env(safe-area-inset-top, 0px)); inset-inline-end: max(16px, env(safe-area-inset-right, 0px)); }

/* ---------- اللعب والأسئلة ---------- */
.levels { display: flex; gap: 8px; flex-wrap: wrap; }
.play-card, .quiz-panel { background: var(--paper); border-radius: 26px; box-shadow: 0 0 0 1px var(--line), 0 30px 60px -34px rgba(76, 58, 120, .45); padding: clamp(18px, 3vw, 34px); }
.play-top { display: grid; grid-template-columns: minmax(0, 1fr) 200px auto; align-items: center; gap: 14px; margin-bottom: 18px; }
.play-desc { color: var(--ink-soft); }
.progress { height: 14px; border-radius: 99px; background: var(--ivory); border: 1px solid var(--line); overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--gold), #F7DA86); border-radius: 99px; transition: width .4s; }
.progress-text { font-weight: 800; color: var(--ink-soft); text-align: center; }
.play-area, .quiz-area { min-height: 320px; display: grid; align-content: start; justify-items: center; gap: 20px; text-align: center; }
.activity .quiz-area { min-height: 0; }
.quiz-head { display: grid; gap: 6px; justify-items: center; text-align: center; margin-bottom: 14px; }
.hint { color: var(--ink-soft); }
.prompt { font-size: 1.3rem; font-weight: 700; color: var(--ink-soft); }
.question { font-size: clamp(1.4rem, 3vw, 1.9rem); font-weight: 800; max-width: 34ch; }
.question.sm { font-size: 1.2rem; max-width: none; text-align: start; }
.big-letter { font-family: var(--font-read); font-size: clamp(6rem, 16vw, 9rem); line-height: 1.2; width: 1.6em; height: 1.6em; border-radius: 40px; display: grid; place-items: center; background: radial-gradient(circle at 30% 25%, #fff, var(--lavender)); color: var(--lav-deep); box-shadow: inset 0 -10px 0 rgba(111, 91, 199, .12), var(--shadow-soft); }
.pic-card { width: 170px; height: 170px; border-radius: 40px; display: grid; place-items: center; background: radial-gradient(circle at 30% 25%, #fff, var(--cream)); box-shadow: var(--shadow-soft); }
.pic-card.sm { width: 110px; height: 110px; border-radius: 30px; }
.emo { font-size: 3.4rem; line-height: 1; }
.emo.xl { font-size: 6rem; }
.choices { display: grid; gap: 14px; width: 100%; max-width: 720px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.choices.text, .choices.tf { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.choice { min-height: 74px; border-radius: 22px; border: 3px solid var(--line); background: #fff; cursor: pointer; font-weight: 800; font-size: 1.25rem; padding: 12px 16px; display: grid; justify-items: center; gap: 4px; box-shadow: 0 5px 0 var(--line); transition: transform .12s, border-color .2s, background .2s; }
.choice:hover:not(:disabled) { border-color: #C9BDF0; transform: translateY(-2px); }
.choice:disabled:not(.is-right) { opacity: .4; }
.choices.pics .choice { min-height: 140px; }
.choices.pics .emo { font-size: 4rem; }
.choice .cap { font-size: 1.1rem; }
.num-opt { font-size: 2.4rem; font-weight: 800; line-height: 1.1; }
.is-right { background: #E4F7EC !important; border-color: var(--good) !important; box-shadow: 0 5px 0 #A8DDBF !important; opacity: 1 !important; }
.shake { animation: shake .45s; border-color: var(--bad) !important; }
.slots { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.slot { width: 66px; height: 74px; border-radius: 18px; border: 3px dashed #CFC3EE; background: var(--ivory); font-family: var(--font-read); font-size: 2.3rem; font-weight: 600; display: grid; place-items: center; cursor: pointer; }
.slot.filled { border-style: solid; background: #fff; border-color: #B9A5F0; }
.slot.gap { border-color: var(--gold); background: var(--cream); color: var(--gold); }
.slots.read-only .slot { cursor: default; }
.joined { font-family: var(--font-read); font-size: 2rem; min-height: 1.6em; color: var(--lav-deep); font-weight: 600; }
.tiles { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; max-width: 640px; }
.tile { width: 70px; height: 74px; border-radius: 18px; border: 0; background: linear-gradient(180deg, #FFE7A8, #F5CF6A); font-family: var(--font-read); font-size: 2.3rem; font-weight: 600; cursor: pointer; box-shadow: 0 6px 0 #C9A13D; transition: transform .1s; }
.tile:active { transform: translateY(4px); box-shadow: 0 2px 0 #C9A13D; }
.tile:disabled { opacity: .2; }
.tiles.words { gap: 10px; }
.word { border: 0; border-radius: 16px; padding: 10px 20px; min-height: 60px; font-family: var(--font-read); font-size: 1.6rem; font-weight: 600; background: linear-gradient(180deg, #DCEFFC, #A9D5EE); box-shadow: 0 5px 0 #6FAED2; cursor: pointer; }
.word:disabled { opacity: .2; }
.answer-line { min-height: 92px; width: 100%; max-width: 760px; border-radius: 22px; border: 3px dashed #CFC3EE; background: var(--ivory); display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; align-items: center; padding: 12px; }
.word.placed { background: linear-gradient(180deg, #fff, #EFE9FF); box-shadow: 0 4px 0 #CFC3EE; }
.placeholder { color: #B5AEC7; }
.memory-grid { display: grid; gap: 12px; width: 100%; max-width: 620px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.memory-grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); max-width: 540px; }
.mcard { position: relative; aspect-ratio: 1; border: 0; background: transparent; cursor: pointer; perspective: 600px; padding: 0; }
.mface { position: absolute; inset: 0; border-radius: 20px; display: grid; place-items: center; backface-visibility: hidden; -webkit-backface-visibility: hidden; transition: transform .45s; font-size: clamp(2rem, 7vw, 3.2rem); }
.mface.front { background: linear-gradient(135deg, var(--lav-deep), #9C8BE6); color: #FFF1BF; box-shadow: inset 0 0 0 5px rgba(255,255,255,.25); }
.mface.back { background: #fff; border: 3px solid var(--line); transform: rotateY(180deg); }
.mface.back.is-word { font-family: var(--font-read); font-size: clamp(1.2rem, 4vw, 1.7rem); font-weight: 600; }
.mcard.open .front { transform: rotateY(-180deg); }
.mcard.open .back { transform: rotateY(0); }
.mcard.matched .back { border-color: var(--good); background: #E4F7EC; }
.moves { color: var(--ink-soft); font-weight: 700; }
.seq-slots { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; width: 100%; max-width: 620px; }
.seq-slot { display: flex; gap: 10px; align-items: center; }
.seq-slot .num { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--cream); font-weight: 800; flex-shrink: 0; }
.seq-slot button { flex: 1; min-height: 58px; border-radius: 16px; border: 3px dashed #CFC3EE; background: var(--ivory); font-weight: 700; font-size: 1.12rem; text-align: start; padding: 8px 16px; cursor: pointer; color: var(--ink); }
.seq-slot.filled button { border-style: solid; background: #fff; border-color: #B9A5F0; }
.seq-pool { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; max-width: 760px; }
.seq-card { border: 0; border-radius: 16px; padding: 10px 18px; min-height: 58px; background: linear-gradient(180deg, #FFE3D6, #F7B9A2); box-shadow: 0 5px 0 #DD8E73; font-weight: 700; font-size: 1.1rem; cursor: pointer; }
.seq-card:disabled { opacity: .2; }
.classify-item { display: grid; justify-items: center; gap: 4px; padding: 18px 30px; background: #fff; border-radius: 30px; box-shadow: var(--shadow-soft); min-width: 180px; }
.classify-item .cap { font-size: 1.4rem; font-weight: 800; }
.pop { animation: pop .45s cubic-bezier(.2, 1.6, .4, 1); }
.bins { display: grid; gap: 14px; width: 100%; max-width: 860px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.bins.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.bins.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.bin { min-height: 130px; border-radius: 24px; border: 3px solid var(--line); background: linear-gradient(180deg, #fff, var(--ivory)); cursor: pointer; display: grid; align-content: start; gap: 8px; padding: 14px; box-shadow: 0 6px 0 var(--line); }
.bin-name { font-weight: 800; font-size: 1.2rem; }
.bin-items { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; font-size: 1.6rem; }
.count-box, .eq-objs { display: flex; gap: 18px; align-items: center; justify-content: center; flex-wrap: wrap; }
.eq-objs b { font-size: 2.6rem; color: var(--lav-deep); }
.objs { display: flex; flex-wrap: wrap; gap: 6px; max-width: 280px; justify-content: center; font-size: 2.2rem; padding: 12px; background: var(--ivory); border-radius: 22px; }
.equation { font-size: clamp(2.4rem, 7vw, 3.4rem); font-weight: 800; letter-spacing: .05em; }
.equation .q { color: var(--gold); }
.riddle { position: relative; max-width: 640px; background: linear-gradient(160deg, var(--lavender), var(--paper)); border-radius: 30px; padding: 28px 30px 26px 74px; text-align: start; }
.riddle-mark { position: absolute; left: 20px; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%; background: var(--lav-deep); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 1.6rem; }
.riddle p { font-family: var(--font-read); font-size: clamp(1.4rem, 3vw, 1.8rem); font-weight: 600; line-height: 1.9; }

/* ---------- الأنشطة ---------- */
.act-intro { display: flex; gap: 22px; align-items: center; background: linear-gradient(120deg, var(--ta), var(--paper) 70%); border-radius: 26px; padding: 22px 26px; margin-bottom: 8px; }
.act-intro p { font-size: 1.25rem; font-weight: 600; }
.act-h { font-size: 1.5rem; margin: 30px 0 14px; display: flex; align-items: center; gap: 10px; }
.act-h::before { content: ""; width: 12px; height: 12px; border-radius: 4px; transform: rotate(45deg); background: var(--gold); }
.act-h.sm { font-size: 1.2rem; margin-top: 10px; }
.fact-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 18px; }
.fact { position: relative; background: var(--paper); border-radius: 24px; padding: 22px 20px; border: 2px solid var(--line); display: grid; gap: 8px; align-content: start; }
.fact-no { position: absolute; top: 14px; inset-inline-end: 16px; color: #CFC3EE; font-weight: 800; font-size: 1.4rem; }
.fact-emo { font-size: 2.6rem; }
.fact h3 { font-size: 1.25rem; }
.fact p { font-family: var(--font-read); font-size: 1.2rem; line-height: 1.9; color: #3A3354; }
.task-box { background: linear-gradient(160deg, var(--cream), var(--paper)); border-radius: 24px; padding: 22px; display: grid; gap: 12px; border: 2px solid #F5DE8E; }
.task-box > p:first-child { font-family: var(--font-read); font-size: 1.3rem; line-height: 1.9; font-weight: 600; }
.safety { background: #FFF1EE; border-radius: 14px; padding: 10px 14px; color: #9A3E33; font-weight: 600; }
.check { display: inline-flex; gap: 10px; align-items: center; font-weight: 800; cursor: pointer; }
.check input { width: 28px; height: 28px; accent-color: var(--mint-deep); }

/* ---------- التحديات ---------- */
.passage { font-family: var(--font-read); font-size: clamp(1.3rem, 2.6vw, 1.6rem); line-height: 2.3; font-weight: 600; text-align: start; background: var(--ivory); border-radius: 22px; padding: 22px 26px; max-width: 820px; border: 1px solid var(--line); }
.blank { font: inherit; border: 0; border-bottom: 3px solid var(--gold); background: var(--cream); border-radius: 8px; padding: 0 10px; cursor: pointer; color: var(--lav-deep); }
.blank.set { background: #EFE9FF; border-color: var(--lav-deep); }
.blank-rows { display: grid; gap: 10px; width: 100%; max-width: 820px; }
.blank-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.blank-row .num { font-weight: 800; color: var(--ink-soft); min-width: 86px; text-align: start; }
.endings { display: grid; gap: 10px; width: 100%; max-width: 820px; }
.ending { text-align: start; padding: 14px 18px; border-radius: 18px; border: 3px solid var(--line); background: #fff; cursor: pointer; font-weight: 600; font-size: 1.1rem; }
.ending.on { border-color: var(--lav-deep); background: #F3EFFF; }
.q-list { width: 100%; max-width: 820px; display: grid; gap: 18px; margin: 0; padding-inline-start: 1.6em; text-align: start; }
.q-list li::marker { font-weight: 800; color: var(--lav-deep); }
.q-list .chips { margin-top: 8px; }
.star-total { display: flex; align-items: center; gap: 12px; justify-content: center; font-size: 1.3rem; font-weight: 700; background: var(--cream); border-radius: 999px; padding: 10px 26px; width: fit-content; margin: 0 auto 30px; }
.star-total .star { font-size: 2.2rem; }
.star-total b { font-size: 2.2rem; }
.medal-shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 26px 18px; }
.medal-tile { display: grid; justify-items: center; text-align: center; gap: 6px; text-decoration: none; color: var(--ink); }
.medal-tile small { color: var(--ink-soft); font-size: .92rem; line-height: 1.5; }
.reset-zone { margin-top: 40px; text-align: center; display: flex; gap: 10px; justify-content: center; align-items: center; flex-wrap: wrap; }

/* ---------- ركن المعلمة ---------- */
.board-toggle { display: flex; justify-content: space-between; align-items: center; gap: 18px; flex-wrap: wrap; background: #3F7A60; color: #EAF6EE; border-radius: 22px; padding: 22px 26px; border: 10px solid var(--wood); }
.board-toggle p { opacity: .85; }
.board-toggle .btn { background: #FFF6EA; color: #234A39; box-shadow: 0 5px 0 #CFC0A6; }
.filters { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; background: var(--paper); border: 2px solid var(--line); border-radius: 22px; padding: 16px; }
.filters label { display: grid; gap: 4px; font-weight: 800; font-size: .95rem; color: var(--ink-soft); }
.filters select { font: inherit; font-weight: 700; color: var(--ink); min-height: 48px; border-radius: 14px; border: 2px solid var(--line); background: var(--ivory); padding: 4px 12px; }
.teacher .count { margin: 14px 0; }
.t-results { display: grid; gap: 12px; }
.t-results > .btn { justify-self: center; margin-top: 6px; }
.t-row { display: flex; gap: 14px; align-items: center; background: var(--paper); border: 2px solid var(--line); border-radius: 20px; padding: 12px 14px; }
.t-emo { width: 60px; height: 60px; border-radius: 18px; flex-shrink: 0; display: grid; place-items: center; font-size: 2rem; background: linear-gradient(160deg, var(--ta), var(--tb)); }
.t-info { flex: 1; min-width: 0; display: grid; gap: 4px; }
.t-info strong { font-size: 1.15rem; }
.t-actions { display: flex; gap: 8px; flex-shrink: 0; }
.plans { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; }
.plan { background: var(--paper); border-radius: 24px; border: 2px solid var(--line); padding: 20px; display: grid; gap: 10px; align-content: start; }
.plan header { display: flex; gap: 6px; flex-wrap: wrap; }
.plan h3 { font-size: 1.35rem; }
.goal { color: var(--ink-soft); }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; border-inline-start: 3px solid var(--lavender); padding-inline-start: 14px; }
.steps li { display: flex; gap: 10px; font-size: 1rem; line-height: 1.6; }
.steps b { flex-shrink: 0; background: var(--lavender); color: var(--lav-deep); border-radius: 999px; padding: 0 10px; height: fit-content; font-size: .9rem; }
.tips ul { margin: 0; padding-inline-start: 1.2em; display: grid; gap: 6px; color: var(--ink-soft); }
.admin-link { margin-top: 16px; font-size: .95rem; color: var(--ink-soft); }

/* ---------- التذييل ---------- */
.footer { padding-left: var(--gutter); padding-right: var(--gutter-r); padding-block: 30px 0; }
.footer-arch { max-width: 760px; margin: 0 auto; text-align: center; display: grid; gap: 4px; justify-items: center; background: linear-gradient(180deg, #4A3F86, #2F2A4A); color: #FFF6E6; border-radius: 999px 999px 0 0; padding: 70px 24px calc(30px + env(safe-area-inset-bottom, 0px)); position: relative; overflow: hidden; }
.footer-arch::before { content: "✦  ✧  ✦"; position: absolute; top: 28px; left: 50%; transform: translateX(-50%); color: #F7DA86; letter-spacing: .4em; }
.footer-brand { font-family: var(--font-display); font-size: 2rem; }
.footer-slogan { opacity: .8; font-weight: 700; }
.credit { margin-top: 14px; display: grid; gap: 2px; }
.credit span { font-size: .95rem; opacity: .8; }
.credit strong { font-family: var(--font-display); font-size: 1.7rem; color: #F7DA86; font-weight: 700; }
.fine { margin-top: 12px; font-size: .85rem; opacity: .65; }

/* ---------- التنبيهات والاحتفال ---------- */
.toast { position: fixed; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); left: 50%; transform: translate(-50%, 140%); z-index: 95; padding: 12px 28px; border-radius: 999px; font-weight: 800; font-size: 1.25rem; background: var(--good); color: #fff; box-shadow: var(--shadow-lift); transition: transform .3s cubic-bezier(.2, 1.4, .4, 1); pointer-events: none; white-space: nowrap; }
.toast.toast-retry { background: #8C78E8; }
.toast.show { transform: translate(-50%, 0); }
.burst { position: fixed; z-index: 96; pointer-events: none; }
.burst span { position: absolute; color: var(--gold); font-size: 1.3rem; animation: burst .85s ease-out forwards; }
.board-exit { position: fixed; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); inset-inline-start: max(18px, env(safe-area-inset-left, 0px)); z-index: 80; border: 0; border-radius: 999px; padding: 12px 22px; font-weight: 800; background: var(--ink); color: #fff; cursor: pointer; box-shadow: var(--shadow-lift); }

/* ---------- تثبيت التطبيق ---------- */
.settings .install-item { background: var(--lavender); color: var(--lav-deep); justify-content: center; }
.install-sheet { position: fixed; inset: 0; z-index: 92; background: rgba(30, 24, 52, .6); display: grid; place-items: end center; padding: 16px max(16px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); }
.install-card { width: min(100%, 480px); background: var(--paper); border-radius: 28px; padding: 26px 22px 22px; display: grid; gap: 14px; justify-items: center; text-align: center; box-shadow: var(--shadow-lift); animation: pop .35s cubic-bezier(.2, 1.4, .4, 1); }
.install-card img { border-radius: 22px; box-shadow: var(--shadow-soft); }
.install-card h2 { font-size: 1.35rem; }
.install-steps { width: 100%; text-align: start; background: var(--ivory); border-radius: 18px; padding: 12px 16px; }
.install-steps h3 { font-size: 1.05rem; color: var(--lav-deep); }
.install-steps ol { list-style-type: arabic-indic; margin: 6px 0 0; padding-inline-start: 1.3em; display: grid; gap: 4px; }
.install-note { color: var(--ink-soft); font-size: .98rem; }
@media (min-width: 700px) { .install-sheet { place-items: center; } }

/* ---------- الحركة ---------- */
@keyframes twinkle { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
@keyframes floaty { 0%, 100% { translate: 0 0; } 50% { translate: 0 -14px; } }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes turnNext { from { transform: rotateY(-14deg) translateX(-30px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes turnPrev { from { transform: rotateY(14deg) translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes pop { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes shake { 0%, 100% { translate: 0; } 20% { translate: -8px; } 40% { translate: 8px; } 60% { translate: -6px; } 80% { translate: 4px; } }
@keyframes burst { from { transform: translate(0, 0) scale(1); opacity: 1; } to { transform: translate(var(--dx), var(--dy)) scale(.4); opacity: 0; } }
.scene .bob { animation: bob 3.2s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.scene .bob.slow { animation-duration: 4.6s; }
.scene .twinkle { animation: twinkle 3s ease-in-out infinite; }
.scene .rainline { animation: rain 1.1s linear infinite; }
@keyframes rain { from { transform: translateY(-10px); } to { transform: translateY(14px); } }
.no-motion *, .no-motion *::before, .no-motion *::after { animation: none !important; transition: none !important; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; } }

/* ---------- وضع السبورة الذكية ---------- */
html.board { font-size: 125%; }
html.board .nav, html.board .footer { display: none; }
html.board .reader, html.board .play, html.board .activity, html.board .challenge { max-width: 1500px; }
html.board .choice { min-height: 96px; }

/* ---------- الشاشات المتوسطة (آيباد) ---------- */
@media (max-width: 1080px) {
  .nav { display: none; }
  .menu-btn { display: grid; }
  .top-tools { margin-inline-start: auto; }
  body.menu-open .nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; position: absolute; top: 100%; inset-inline: 0; background: var(--paper); padding: 14px max(16px, env(safe-area-inset-right, 0px)) 18px max(16px, env(safe-area-inset-left, 0px)); border-bottom: 1px solid var(--line); box-shadow: var(--shadow-lift); }
  body.menu-open .nav a { font-size: 1.15rem; padding: 14px 16px; background: var(--ivory); border-radius: 18px; }
  html.board body.menu-open .nav { display: grid; }
  .spots { grid-template-columns: 1fr; max-width: 680px; margin: 0 auto; }
  .filters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .play-top { grid-template-columns: 1fr auto; }
  .play-top .progress { grid-column: 1 / -1; grid-row: 2; }
}
@media (max-width: 820px) {
  .hero-stage { grid-template-columns: minmax(0, .45fr) minmax(0, 2fr) minmax(0, .45fr); }
  .shelf-row { height: 54px; }
  .wings { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
  .teacher-band { grid-template-columns: 1fr; }
  .board-art { max-width: 420px; }
  .spread, .cover-spread { grid-template-columns: 1fr; }
  .spread::after { display: none; }
  .leaf.art .scene, .leaf.art img { min-height: 0; aspect-ratio: 4 / 3; height: auto; }
  .leaf.text { padding: 22px 24px 40px; }
  .cover-big { padding: 20px; }
  .cover-big .cover { width: min(70%, 230px); }
  .bins.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* ---------- الجوال ---------- */
@media (max-width: 560px) {
  body { font-size: 1.05rem; }
  .brand-name { font-size: 1.3rem; }
  .brand-mark svg { width: 36px; height: 36px; }
  .round-btn { width: 42px; height: 42px; }
  .star-badge { padding-inline: 10px; }
  .hero { padding-top: 14px; }
  .hero-stage { grid-template-columns: 1fr; }
  .shelf-col { display: none; }
  .hero-copy { padding: 120px 12px 46px; }
  .moon { width: 40px; height: 40px; }
  .wings { gap: 14px; }
  .wing strong { font-size: 1.1rem; }
  .wing > span:last-child { font-size: .9rem; }
  .section { padding-block: 30px; }
  .spot { grid-template-columns: 96px minmax(0, 1fr); padding: 26px 14px 18px; }
  .shelf-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 16px; }
  .shelf-item { width: 150px; }
  .game-grid, .topic-grid, .medal-grid, .plans { grid-template-columns: 1fr; }
  .game-emoji { width: 78px; height: 78px; font-size: 2.6rem; }
  .page-head-row { padding: 16px; gap: 12px; }
  .head-orb { width: 62px; height: 62px; font-size: 2rem; }
  .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .t-row { flex-wrap: wrap; }
  .t-actions { width: 100%; }
  .t-actions > * { flex: 1; }
  .reader-nav .nav-btn { min-width: 0; padding-inline: 14px; font-size: 1.05rem; }
  .choices.pics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .choices.pics .choice { min-height: 118px; }
  .slot, .tile { width: 54px; height: 62px; font-size: 1.9rem; }
  .bins.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .bin { min-height: 92px; padding: 10px 6px; border-radius: 18px; }
  .bin-name { font-size: 1rem; }
  .bin-items { font-size: 1.2rem; }
  .classify-item { padding: 12px 22px; }
  .classify-item .emo.xl { font-size: 4.4rem; }
  .play-area, .quiz-area { min-height: 0; gap: 16px; }
  .act-intro { flex-direction: column; text-align: center; }
  .riddle { padding: 60px 20px 22px; }
  .riddle-mark { left: 50%; top: 10px; transform: translateX(-50%); }
  .memory-grid.cols-4 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .footer-arch { border-radius: 200px 200px 0 0; }
  .toast { font-size: 1.05rem; padding: 10px 20px; }
}
