/* القارئ الصغير — v2 */
:root {
  --bg1: #e8f4ff; --bg2: #fff6e5;
  --ink: #2d3448; --muted: #7a8299; --card: #fff; --line: #e8ecf3;
  --blue: #2e86de; --green: #10ac84; --orange: #ff9f43; --purple: #8854d0; --red: #ee5253; --gray: #a4b0be; --gold: #feca57;
  --ui: 'Baloo Bhaijaan 2', 'Segoe UI', Tahoma, sans-serif;
  --read: 'Noto Naskh Arabic', 'Traditional Arabic', 'Amiri', serif;
  --r: 24px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { min-height: 100%; }
body {
  font-family: var(--ui); color: var(--ink); font-size: 17px; line-height: 1.6;
  background: linear-gradient(170deg, var(--bg1) 0%, #f3ecff 45%, var(--bg2) 100%) fixed;
  -webkit-user-select: none; user-select: none; overscroll-behavior-y: contain;
}
input, textarea { -webkit-user-select: text; user-select: text; font-family: var(--ui); }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; font-size: inherit; }
button:disabled { cursor: default; }
.ar { font-family: var(--read); }
.hidden { display: none !important; }
.muted { color: var(--muted); font-size: .92em; }
.center { text-align: center; }
a { color: inherit; }

.app { max-width: 1180px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; position: relative; }
.screen { padding: 12px 14px calc(100px + var(--safe-b)); animation: fadeIn .25s ease; max-width: 640px; margin: 0 auto; }
.screen.home, .screen.profiles, .screen.rewards, .screen.stories, .screen.fluency { max-width: 1180px; }
.screen.parent { max-width: 920px; }
.boot { min-height: 100vh; display: grid; place-content: center; text-align: center; font-size: 1.4em; font-weight: 800; color: #5a67d8; }

/* ---------- الأزرار ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 12px 22px; border-radius: 18px; font-weight: 800; font-size: 1.05em; color: #fff; background: var(--blue); box-shadow: 0 5px 0 rgba(0,0,0,.18); transition: transform .08s, box-shadow .08s; margin: 4px; }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 rgba(0,0,0,.18); }
.btn.big { padding: 15px 28px; font-size: 1.2em; }
.btn.huge { padding: 20px 40px; font-size: 1.45em; border-radius: 24px; }
.btn.sm { padding: 7px 14px; font-size: .9em; border-radius: 12px; box-shadow: 0 3px 0 rgba(0,0,0,.18); }
.btn.wide { width: calc(100% - 8px); }
.btn-blue { background: var(--blue); } .btn-green { background: var(--green); } .btn-orange { background: var(--orange); }
.btn-purple { background: var(--purple); } .btn-red { background: var(--red); } .btn-gray { background: var(--gray); }
.btn:disabled { opacity: .6; }
.link { color: var(--blue); text-decoration: underline; margin-top: 10px; font-size: .95em; }
.file-btn { cursor: pointer; }

/* ---------- الشريط العلوي ---------- */
.topbar { display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,.9); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); border-radius: 22px; padding: 7px 10px; box-shadow: 0 4px 14px rgba(60,70,120,.1); position: sticky; top: 8px; z-index: 20; margin-bottom: 12px; }
.tb-profile { display: flex; align-items: center; gap: 6px; font-weight: 800; min-width: 0; }
.tb-profile .av { font-size: 1.8em; line-height: 1; }
.tb-profile .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 90px; }
.tb-stats { display: flex; align-items: center; gap: 6px; margin-inline-start: auto; }
.chip { background: #f4f6fb; border-radius: 14px; padding: 3px 10px; font-size: .95em; white-space: nowrap; }
.chip.hot { background: #fff1e0; color: #e67e22; }
.goal { position: relative; width: 40px; height: 40px; }
.goal span { position: absolute; top: 0; right: 0; bottom: 0; left: 0; display: grid; place-content: center; font-size: .95em; }
.tb-gear { font-size: 1.25em; opacity: .55; padding: 4px; }

/* ---------- الشريط السفلي ---------- */
.bottomnav { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 560px; display: flex; background: #fff; border-top: 2px solid var(--line); padding: 6px 6px calc(6px + var(--safe-b)); z-index: 30; border-radius: 22px 22px 0 0; box-shadow: 0 -4px 18px rgba(60,70,120,.08); }
.bottomnav button { flex: 1; display: flex; flex-direction: column; align-items: center; font-size: .82em; font-weight: 700; color: var(--muted); padding: 4px 0; border-radius: 14px; }
.bottomnav button span { font-size: 1.7em; line-height: 1.2; filter: grayscale(.6); transition: transform .15s; }
.bottomnav button.on { color: var(--blue); background: #eef5ff; }
.bottomnav button.on span { filter: none; transform: scale(1.12); }

/* ---------- الملفات الشخصية ---------- */
.profiles .hero { text-align: center; padding: 26px 10px 8px; }
.logo-bubble { width: 110px; height: 110px; margin: 0 auto 10px; border-radius: 50%; background: linear-gradient(135deg, #ffd86b, #ff9f43); display: grid; place-content: center; font-size: 58px; box-shadow: 0 10px 0 #e58a2e, 0 18px 30px rgba(255,159,67,.35); animation: float 3s ease-in-out infinite; }
.profiles h1 { font-size: 2.3em; color: #5a67d8; line-height: 1.3; }
.profiles .hero p { color: var(--muted); }
.sec-title { text-align: center; margin: 18px 0 10px; font-size: 1.35em; }
.sec-title small { color: var(--muted); font-size: .7em; }
.profile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.profile-card { background: #fff; border-radius: var(--r); padding: 16px 8px; display: flex; flex-direction: column; align-items: center; box-shadow: 0 6px 0 #e3e8f2; transition: transform .1s; }
.profile-card:active { transform: translateY(4px); box-shadow: 0 2px 0 #e3e8f2; }
.profile-card .av { font-size: 3.2em; line-height: 1.2; }
.profile-card b { font-size: 1.15em; }
.profile-card small { color: var(--muted); }
.profile-card.add { border: 3px dashed #c9d3e6; background: transparent; box-shadow: none; }
.av-pick { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin: 8px 0; }
.av-pick button { font-size: 1.9em; border-radius: 14px; padding: 4px; border: 3px solid transparent; }
.av-pick button.on { border-color: var(--green); background: #e8faf3; }

/* ---------- عدّاد الزوار ---------- */
.visitors-btn { display: inline-flex; align-items: center; gap: 6px; background: #fff; border: 2px solid #dfe6f5; border-radius: 30px; padding: 6px 16px; font-weight: 700; color: #5a67d8; margin-top: 10px; box-shadow: 0 3px 0 #dfe6f5; }
.visitors-btn b { font-size: 1.1em; }
.visitors-row { text-align: center; margin: -4px 0 6px; }
.visitors-big { font-size: 3em; font-weight: 800; color: #5a67d8; line-height: 1.2; margin: 6px 0; }

/* ---------- التذييل ---------- */
.site-footer { text-align: center; margin: 34px 0 10px; padding: 18px 12px; background: rgba(255,255,255,.75); border-radius: var(--r); }
.free-note { font-weight: 800; font-size: 1.1em; color: #2d6a4f; }
.free-tags { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 10px 0; }
.free-tags span { background: #e8faf3; color: #10885f; border-radius: 12px; padding: 2px 10px; font-size: .85em; font-weight: 700; }
.yt-btn { display: inline-flex; align-items: center; gap: 8px; background: #ff0000; color: #fff; text-decoration: none; font-weight: 800; padding: 10px 18px; border-radius: 16px; box-shadow: 0 4px 0 #b80000; margin: 6px 0; }
.yt-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #b80000; }
.yt-ico { background: #fff; color: #ff0000; border-radius: 8px; width: 28px; height: 20px; display: grid; place-content: center; font-size: .75em; }
.brand { margin-top: 12px; font-weight: 800; color: #5a67d8; font-size: 1.15em; letter-spacing: .3px; }

/* ---------- الرئيسية: الرفيق ---------- */
.welcome-row { display: flex; flex-direction: column; align-items: center; margin: 4px 0 6px; }
.companion { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.comp-e { font-size: 3.6em; line-height: 1; animation: float 3s ease-in-out infinite; filter: drop-shadow(0 6px 6px rgba(0,0,0,.12)); }
.bubble { background: #fff; border-radius: 18px; padding: 8px 14px; font-weight: 700; box-shadow: 0 4px 12px rgba(60,70,120,.1); position: relative; max-width: 260px; font-size: .95em; }
.bubble::after { content: ''; position: absolute; right: -8px; top: 50%; transform: translateY(-50%); border: 8px solid transparent; border-left-color: #fff; border-right: 0; }
.evolve-bar { width: 220px; text-align: center; margin-top: 6px; }
.evolve-bar small { color: var(--muted); }
.bar { height: 10px; background: #e8ecf3; border-radius: 10px; overflow: hidden; }
.bar.big { height: 14px; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, #feca57, #ff9f43); border-radius: 10px; transition: width .6s; }

/* ---------- الرئيسية: الخريطة ---------- */
.unit { margin: 16px 0 6px; }
.unit-banner { display: flex; align-items: center; gap: 10px; background: var(--uc); color: #fff; border-radius: var(--r); padding: 12px 16px; box-shadow: 0 6px 0 rgba(0,0,0,.14); position: relative; flex-wrap: wrap; }
.unit-banner .ue { font-size: 2.1em; }
.unit-banner h3 { font-size: 1.3em; line-height: 1.2; }
.unit-banner small { opacity: .9; }
.unit-bar { flex-basis: 100%; height: 8px; background: rgba(255,255,255,.35); border-radius: 8px; overflow: hidden; }
.unit-bar i { display: block; height: 100%; background: #fff; border-radius: 8px; }
.path { display: flex; flex-direction: column; align-items: center; padding: 14px 0 4px; }
.node-wrap { display: flex; flex-direction: column; align-items: center; margin: 6px 0; position: relative; }
.node { width: 78px; height: 72px; border-radius: 50%; background: var(--uc); color: #fff; box-shadow: 0 7px 0 rgba(0,0,0,.2), inset 0 -4px 0 rgba(0,0,0,.08); display: grid; place-content: center; transition: transform .1s; position: relative; }
.node:active { transform: translateY(5px); box-shadow: 0 2px 0 rgba(0,0,0,.2); }
.node-label { font-family: var(--read); font-size: 1.55em; font-weight: 700; line-height: 1; }
.node.locked { background: #dfe4ec; color: #9aa4b5; box-shadow: 0 7px 0 #c7cfdb; }
.node.done::after { content: '✓'; position: absolute; top: -6px; left: -6px; width: 26px; height: 26px; border-radius: 50%; background: var(--gold); color: #fff; font-weight: 800; display: grid; place-content: center; font-size: .85em; box-shadow: 0 2px 0 #e0a800; }
.node.current { animation: pulse 1.6s infinite; outline: 5px solid rgba(255,255,255,.9); }
.node-start { position: absolute; top: -34px; background: #fff; color: var(--uc); font-weight: 800; padding: 2px 12px; border-radius: 12px; box-shadow: 0 3px 0 #e3e8f2; animation: bob 1.2s ease-in-out infinite; white-space: nowrap; z-index: 2; }
.node-stars { font-size: .85em; margin-top: 8px; min-height: 22px; }
.node-stars .nt { color: var(--muted); font-size: .9em; font-family: var(--read); }

/* ---------- الدرس ---------- */
.lesson { padding-bottom: 180px; }
.lesson-top { display: flex; align-items: center; gap: 10px; padding: 4px 0 12px; position: sticky; top: 0; z-index: 10; background: linear-gradient(var(--bg1) 70%, transparent); }
.x { font-size: 1.4em; color: var(--muted); width: 40px; height: 40px; border-radius: 50%; background: #fff; box-shadow: 0 3px 0 #e3e8f2; flex-shrink: 0; }
.lbar { flex: 1; height: 16px; background: #e3e8f2; border-radius: 10px; overflow: hidden; }
.lbar i { display: block; height: 100%; background: var(--uc, var(--green)); border-radius: 10px; transition: width .4s; box-shadow: inset 0 -4px 0 rgba(0,0,0,.1); }
.lbar.timer i { background: var(--green); transition: width .2s linear; }
.lbar.timer.hurry i { background: var(--red); }
.lcount { font-weight: 800; color: var(--muted); min-width: 40px; text-align: center; }
.step { text-align: center; }
.prompt { font-size: 1.35em; margin: 6px 0 12px; }
.hear-btn { width: 74px; height: 74px; border-radius: 50%; background: var(--blue); color: #fff; font-size: 2em; box-shadow: 0 6px 0 #1b6cbf; margin: 4px auto 12px; display: grid; place-content: center; }
.hear-btn:active { transform: translateY(4px); box-shadow: 0 2px 0 #1b6cbf; }
.hear-btn.sm { width: 52px; height: 52px; font-size: 1.4em; }
.q-show { margin: 4px 0 14px; }
.q-pic { margin: 4px 0 10px; }
.pic-emoji { font-size: 4.6em; line-height: 1.15; display: inline-block; }
.pic-img { width: 120px; height: 120px; object-fit: contain; border-radius: 18px; background: #fff; }
.pic-img.sm { width: 50px; height: 50px; }
.q-big { font-size: 5em; font-weight: 700; line-height: 1.3; color: var(--uc); }
.q-word { font-size: 3.4em; font-weight: 700; line-height: 1.5; background: #fff; border-radius: var(--r); padding: 6px 18px; display: inline-block; box-shadow: 0 6px 0 #e3e8f2; }
.q-sentence { font-size: 2em; font-weight: 700; line-height: 1.9; background: #fff; border-radius: var(--r); padding: 12px 18px; box-shadow: 0 6px 0 #e3e8f2; }
.options { display: grid; gap: 12px; margin: 10px auto; max-width: 440px; }
.options.style-big { grid-template-columns: 1fr 1fr; }
.options.style-emoji { grid-template-columns: repeat(3, 1fr); }
.options.style-word { grid-template-columns: 1fr; }
.opt { background: #fff; border-radius: 22px; box-shadow: 0 6px 0 #dfe5ef; border: 3px solid #e8ecf3; padding: 10px; min-height: 76px; display: grid; place-content: center; transition: transform .08s; }
.opt:active { transform: translateY(4px); box-shadow: 0 2px 0 #dfe5ef; }
.style-big .opt { font-size: 3.2em; font-weight: 700; min-height: 110px; line-height: 1.2; }
.style-word .opt { font-size: 2em; font-weight: 700; }
.style-emoji .opt .pic-emoji { font-size: 3em; }
.style-emoji .opt .pic-img { width: 80px; height: 80px; }
.opt.right { background: #dcfce7; border-color: var(--green); box-shadow: 0 6px 0 #9be3bf; animation: popIn .35s; }
.opt.wrong { background: #ffe4e6; border-color: var(--red); box-shadow: 0 6px 0 #f5b5bd; animation: shake .4s; opacity: .7; }
.opt.hint { animation: glow 1s infinite; border-color: var(--gold); }

/* بطاقات التعلّم */
.learn-grid { display: grid; gap: 12px; }
.learn-grid.cols-2 { grid-template-columns: 1fr 1fr; }
.learn-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.learn-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.learn-card { background: #fff; border-radius: 22px; box-shadow: 0 6px 0 #dfe5ef; padding: 12px 6px; position: relative; border: 3px solid transparent; transition: transform .1s; }
.learn-card:active { transform: translateY(4px); box-shadow: 0 2px 0 #dfe5ef; }
.learn-card.playing { border-color: var(--uc); transform: scale(1.04); }
.learn-card.seen { border-color: #b8ebd3; }
.lc-check { position: absolute; top: 6px; left: 8px; width: 24px; height: 24px; border-radius: 50%; background: var(--green); color: #fff; font-size: .8em; display: none; place-content: center; }
.learn-card.seen .lc-check { display: grid; }
.lc-pic .pic-emoji { font-size: 2.6em; }
.lc-pic .pic-img { width: 70px; height: 70px; }
.lc-big { font-size: 2.6em; font-weight: 700; line-height: 1.35; color: var(--uc); }
.cols-4 .lc-big { font-size: 2.2em; }
.learn-card.wordmode .lc-big { font-size: 2em; color: var(--ink); }
.lc-sub { color: #4b5470; font-size: 1.75em; font-weight: 700; line-height: 1.5; word-spacing: 6px; }
.syl { display: inline-block; padding: 0 3px; border-radius: 10px; transition: background .15s, color .15s; }
.syl.hl { background: var(--gold); color: #fff; }

/* المقدمة */
.intro-card { background: #fff; border-radius: var(--r); padding: 22px; box-shadow: 0 8px 0 #e3e8f2; }
.intro-sym { font-family: var(--read); font-size: 5em; color: var(--uc); line-height: 1.2; }
.intro-card h2 { font-size: 1.8em; }
.intro-1 { font-size: 1.2em; font-weight: 700; }
.intro-2 { font-size: 1.4em; margin: 8px 0 14px; color: #4b5470; }

/* بناء الكلمة */
.build-slots { display: flex; justify-content: center; gap: 8px; margin: 10px 0 18px; flex-wrap: wrap; }
.slot { min-width: 74px; height: 74px; border-radius: 18px; border: 3px dashed #c3cde0; display: grid; place-content: center; font-size: 2.2em; font-weight: 700; background: rgba(255,255,255,.5); padding: 0 8px; }
.slot.filled { border-style: solid; border-color: var(--green); background: #e8faf3; animation: popIn .3s; }
.tiles { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.tile { min-width: 74px; padding: 8px 14px; border-radius: 18px; background: #fff; box-shadow: 0 6px 0 #dfe5ef; font-size: 2.1em; font-weight: 700; border: 3px solid #e8ecf3; }
.tile.word { font-size: 1.6em; }
.tile.used { visibility: hidden; }
.tile:active { transform: translateY(4px); box-shadow: 0 2px 0 #dfe5ef; }
.order-line { min-height: 80px; background: #fff; border-radius: 20px; padding: 10px; margin: 6px 0 16px; font-size: 1.8em; font-weight: 700; border: 3px dashed #c3cde0; line-height: 1.8; }
.ow { display: inline-block; animation: popIn .3s; color: var(--green); }

/* القراءة */
.read-target { margin: 6px 0 16px; }
.read-actions { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.read-done { margin-top: 10px; }
.listening { animation: pulse 1s infinite; }
.ra-w { display: inline-block; padding: 0 4px; border-radius: 10px; cursor: pointer; transition: background .15s, transform .15s; }
.ra-w.hl { background: var(--gold); color: #fff; transform: scale(1.06); }

/* لوحة الملاحظات */
.feedback { position: fixed; bottom: 0; left: 50%; transform: translate(-50%, 110%); width: 100%; max-width: 560px; padding: 16px 18px calc(18px + var(--safe-b)); border-radius: 26px 26px 0 0; transition: transform .25s ease; z-index: 40; text-align: center; }
.feedback.show { transform: translate(-50%, 0); }
.feedback.ok { background: #d7f8e6; color: #0b7a55; }
.feedback.no { background: #ffe4e6; color: #c0392b; }
.feedback.neutral { background: #e8f1ff; color: #1b5fae; }
.fb-msg { font-size: 1.35em; font-weight: 800; margin-bottom: 6px; }

/* نهاية الدرس */
.lesson-end { text-align: center; padding-top: 40px; }
.end-comp { font-size: 6em; line-height: 1.1; }
.lesson-end h1 { font-size: 1.9em; margin: 6px 0; }
.end-stars { font-size: 3.4em; margin: 8px 0; }
.end-stars.sm { font-size: 2.4em; }
.es { display: inline-block; filter: grayscale(1); opacity: .3; }
.es.on { filter: none; opacity: 1; animation: starIn .5s both; }
.end-gain { font-size: 1.5em; font-weight: 800; color: #e0a800; }
.end-gain small { display: block; font-size: .55em; color: var(--muted); }
.end-daily { display: inline-flex; align-items: center; gap: 12px; background: #fff; border-radius: 20px; padding: 8px 18px; margin: 14px 0; box-shadow: 0 5px 0 #e3e8f2; }
.end-btns { display: flex; flex-direction: column; align-items: center; gap: 4px; }

/* القصص */
.story-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 10px; }
.story-card { background: #fff; border-radius: var(--r); padding: 14px 8px; box-shadow: 0 6px 0 #e3e8f2; display: flex; flex-direction: column; align-items: center; }
.story-card:active { transform: translateY(4px); box-shadow: 0 2px 0 #e3e8f2; }
.sc-cover .pic-emoji { font-size: 3.4em; }
.sc-cover .pic-img { width: 90px; height: 90px; }
.story-card b { font-size: 1.15em; line-height: 1.6; }
.story-card small { color: var(--muted); }
.story-title { font-size: 1.4em; flex: 1; text-align: center; }
.story-cover { text-align: center; }
.story-text { background: #fffdf5; border-radius: var(--r); padding: 18px; font-size: 1.75em; line-height: 2.1; box-shadow: 0 6px 0 #efe6c9; margin: 8px 0 14px; border: 2px solid #f5ecd0; }
.story-text p { margin-bottom: 6px; }
.story-actions { display: flex; flex-wrap: wrap; justify-content: center; }

/* الطلاقة */
.fl-sets { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 14px 0; }
.fl-set { background: #fff; border-radius: var(--r); padding: 14px 8px; box-shadow: 0 6px 0 #e3e8f2; display: flex; flex-direction: column; align-items: center; }
.fl-set:active { transform: translateY(4px); box-shadow: 0 2px 0 #e3e8f2; }
.fe { font-size: 2.6em; line-height: 1.2; }
.fl-set b { font-size: 1.2em; }
.fl-set small { color: var(--muted); }
.spark { display: flex; align-items: flex-end; gap: 3px; height: 34px; margin-top: 6px; }
.spark i { width: 9px; background: linear-gradient(var(--green), #6ee7b7); border-radius: 4px 4px 0 0; }
.toggle { display: flex; align-items: center; gap: 8px; justify-content: center; margin: 10px 0; font-weight: 700; }
.toggle input { width: 22px; height: 22px; accent-color: var(--green); }
.fl-run { text-align: center; }
.countdown { font-size: 6em; font-weight: 800; color: #5a67d8; min-height: 80vh; display: grid; place-content: center; }
.fl-score { font-size: 2em; font-weight: 800; color: var(--green); }
.fl-item { font-size: 4.6em; font-weight: 700; background: #fff; border-radius: 28px; padding: 30px 12px; margin: 14px 0 20px; box-shadow: 0 8px 0 #e3e8f2; line-height: 1.4; min-height: 200px; display: grid; place-content: center; }
.fl-item.long { font-size: 2.2em; }
.fl-mic { color: var(--purple); font-weight: 800; animation: pulse 1.5s infinite; border-radius: 20px; display: inline-block; padding: 2px 14px; margin-bottom: 8px; }
.fl-btns { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; }

/* الجوائز */
.comp-card { background: linear-gradient(160deg, #fff, #fff8e6); border-radius: var(--r); padding: 18px; text-align: center; box-shadow: 0 7px 0 #efe3c0; }
.comp-big { font-size: 6em; line-height: 1.1; }
.comp-card .bar { margin: 8px auto; max-width: 300px; }
.stages { display: flex; justify-content: center; gap: 8px; margin-top: 10px; font-size: 1.7em; }
.stages span { opacity: .35; } .stages span.on { opacity: 1; }
.stat-row, .pub-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 14px 0; }
.pub-stats { grid-template-columns: repeat(3, 1fr); }
.stat { background: #fff; border-radius: 18px; padding: 10px 4px; text-align: center; box-shadow: 0 4px 0 #e3e8f2; display: flex; flex-direction: column; }
.stat span { font-size: 1.5em; } .stat b { font-size: 1.35em; line-height: 1.2; } .stat small { color: var(--muted); font-size: .78em; }
.sticker-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.sticker { aspect-ratio: 1; min-height: 46px; background: #eef1f7; border-radius: 16px; display: grid; place-content: center; font-size: 1.9em; color: #c3cad8; }
.sticker.on { background: #fff; box-shadow: 0 4px 0 #e3e8f2; animation: popIn .4s; }
.badge-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.badge { background: #eef1f7; border-radius: 18px; padding: 10px 4px; text-align: center; display: flex; flex-direction: column; filter: grayscale(1); opacity: .5; }
.badge.on { background: #fff; filter: none; opacity: 1; box-shadow: 0 4px 0 #e3e8f2; }
.badge span { font-size: 2em; } .badge b { font-size: .9em; line-height: 1.3; } .badge small { font-size: .72em; color: var(--muted); }

/* البوابة */
.gate-card { background: #fff; border-radius: var(--r); padding: 20px; text-align: center; box-shadow: 0 7px 0 #e3e8f2; margin-top: 10px; }
.pin-dots { display: flex; justify-content: center; gap: 14px; margin: 16px 0; }
.pin-dots i { width: 20px; height: 20px; border-radius: 50%; border: 3px solid #c3cde0; }
.pin-dots i.on { background: #5a67d8; border-color: #5a67d8; }
.keypad { display: grid; grid-template-columns: repeat(3, 76px); gap: 12px; justify-content: center; direction: ltr; }
.keypad button { height: 64px; border-radius: 20px; background: #f4f6fb; font-size: 1.6em; font-weight: 800; box-shadow: 0 4px 0 #dfe5ef; }
.keypad button:active { transform: translateY(3px); box-shadow: 0 1px 0 #dfe5ef; }
.keypad .ghost { visibility: hidden; }

/* لوحة المعلم */
.parent { padding-bottom: 40px; -webkit-user-select: text; user-select: text; }
.parent-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.parent-head h2 { font-size: 1.3em; }
.ptabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; position: sticky; top: 0; z-index: 5; background: linear-gradient(var(--bg1) 80%, transparent); }
.ptabs button { white-space: nowrap; background: #fff; border-radius: 14px; padding: 6px 12px; font-weight: 700; box-shadow: 0 3px 0 #e3e8f2; }
.ptabs button.on { background: #5a67d8; color: #fff; box-shadow: 0 3px 0 #3f4bb3; }
.pbody { margin-top: 8px; }
.info-box { background: #eef5ff; border: 2px solid #cfe2ff; border-radius: 18px; padding: 12px 14px; margin-bottom: 12px; font-size: .95em; }
.info-box ol { padding-inline-start: 22px; margin: 6px 0; }
.info-box code { background: #fff; padding: 0 6px; border-radius: 6px; direction: ltr; display: inline-block; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 10px; }
.chips button { background: #fff; border: 2px solid #e3e8f2; border-radius: 14px; padding: 4px 12px; font-weight: 700; font-size: .92em; }
.chips button.on { background: var(--green); border-color: var(--green); color: #fff; }
.rec-progress { margin: 4px 0 8px; }
.rec-list { display: flex; flex-direction: column; gap: 6px; }
.rec-row { display: flex; align-items: center; gap: 6px; background: #fff; border-radius: 14px; padding: 6px 10px; border-inline-start: 5px solid #e3e8f2; }
.rec-row.has { border-color: var(--green); }
.rec-row.srv { border-color: var(--blue); }
.rt { flex: 1; font-size: 1.35em; font-weight: 700; line-height: 1.6; }
.rbtn { width: 40px; height: 40px; border-radius: 50%; background: #f4f6fb; font-size: 1.05em; flex-shrink: 0; }
.rbtn.rec { background: #ffe4e6; }
.rbtn.rec.recording { background: var(--red); animation: pulse 1s infinite; }
.rec-row.has .rbtn.rec { background: #dcfce7; }
.rec-ind { position: fixed; top: 10px; left: 50%; transform: translate(-50%, -150%); background: var(--red); color: #fff; font-weight: 800; padding: 8px 18px; border-radius: 30px; z-index: 90; transition: transform .2s; }
.rec-ind.show { transform: translate(-50%, 0); }
.form-card, .list-card, .rep-card { background: #fff; border-radius: 20px; padding: 14px; margin-bottom: 12px; box-shadow: 0 4px 0 #e3e8f2; }
.form-card h3, .list-card h3 { margin-bottom: 6px; }
.form-card label { display: block; font-weight: 700; margin: 10px 0 4px; }
.inp { width: 100%; padding: 10px 14px; border-radius: 14px; border: 2px solid #dfe5ef; font-size: 1.1em; background: #fbfcfe; outline: none; }
.inp:focus { border-color: var(--blue); }
.inp.ar { font-size: 1.4em; }
textarea.inp { resize: vertical; line-height: 1.9; }
.emoji-inp { width: 90px; text-align: center; font-size: 1.6em; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row3 { display: grid; gap: 6px; }
.syl-preview { margin-top: 6px; }
.syl-preview .syl { background: #fff3d6; margin: 0 2px; font-size: 1.3em; }
.li { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.li b { font-size: 1.3em; } .li small { color: var(--muted); flex: 1; } .li .rbtn { margin-inline-start: auto; }
.li-pic .pic-emoji { font-size: 1.8em; } .li-pic .pic-img { width: 40px; height: 40px; }
input[type=range] { width: 100%; accent-color: var(--blue); }
.rep-head { display: flex; align-items: center; gap: 10px; }
.rep-head .av { font-size: 2.4em; } .rep-head h3 { line-height: 1.2; } .rep-head small { color: var(--muted); }
.comp-sm { margin-inline-start: auto; font-size: 2em; }
.rep-progress { margin: 10px 0; } .rep-progress small { color: var(--muted); }
.rep-stats { display: flex; flex-wrap: wrap; gap: 6px; }
.rep-stats span, .rep-units span { background: #f4f6fb; border-radius: 12px; padding: 2px 10px; font-size: .9em; }
.rep-units { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.rep-units span { border-inline-start: 4px solid var(--uc); }
.rep-sec { margin-top: 8px; font-size: .95em; }
.weak { display: inline-block; background: #fff1f2; color: #be123c; border-radius: 10px; padding: 0 8px; margin: 2px; font-size: 1.2em; }
.weak small { font-family: var(--ui); font-size: .7em; }
.rep-actions { margin-top: 8px; }

/* المودال والتنبيهات */
.modal { position: fixed; top: 0; right: 0; bottom: 0; left: 0; background: rgba(30,35,60,.55); display: none; align-items: center; justify-content: center; z-index: 100; padding: 16px; }
.modal.show { display: flex; animation: fadeIn .2s; }
.modal-card { background: #fff; border-radius: 28px; padding: 22px 18px 14px; width: 100%; max-width: 400px; text-align: center; animation: popIn .3s; max-height: 90vh; overflow-y: auto; }
.modal-card h2 { font-size: 1.45em; line-height: 1.4; margin-bottom: 4px; }
.modal-card .inp { margin: 8px 0; }
.modal-card .options { margin-top: 12px; }
.modal-btns { display: flex; flex-wrap: wrap; justify-content: center; margin-top: 12px; }
.rw-big { font-size: 5em; line-height: 1.2; }
.toast { position: fixed; bottom: calc(96px + var(--safe-b)); left: 50%; transform: translate(-50%, 30px); background: #2d3448; color: #fff; padding: 10px 18px; border-radius: 16px; font-weight: 700; opacity: 0; pointer-events: none; transition: all .25s; z-index: 120; max-width: 90vw; text-align: center; font-size: .95em; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
#confetti { position: fixed; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 110; display: none; }

/* الحركة */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { 0% { transform: scale(.6); opacity: 0; } 70% { transform: scale(1.08); } 100% { transform: scale(1); opacity: 1; } }
.pop { animation: popIn .4s; }
@keyframes shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
.shake { animation: shake .4s; }
@keyframes pulse { 0%,100% { box-shadow: 0 7px 0 rgba(0,0,0,.2), 0 0 0 0 rgba(254,202,87,.7); } 50% { box-shadow: 0 7px 0 rgba(0,0,0,.2), 0 0 0 14px rgba(254,202,87,0); } }
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes glow { 0%,100% { box-shadow: 0 6px 0 #f5d77a, 0 0 0 0 rgba(254,202,87,.8); } 50% { box-shadow: 0 6px 0 #f5d77a, 0 0 0 10px rgba(254,202,87,0); } }
@keyframes starIn { 0% { transform: scale(0) rotate(-90deg); } 70% { transform: scale(1.3) rotate(10deg); } 100% { transform: scale(1) rotate(0); } }
.bounce { animation: float 1.6s ease-in-out infinite; }

@media (max-width: 380px) {
  body { font-size: 15px; }
  .learn-grid.cols-4 { grid-template-columns: repeat(3, 1fr); }
  .sticker-grid { grid-template-columns: repeat(5, 1fr); }
  .keypad { grid-template-columns: repeat(3, 68px); }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- رحلة الكنز ---------- */
.chip.gold { background: #fff6d6; color: #a46b00; }
.home-grid { display: grid; gap: 14px; }
.home-side { display: flex; flex-direction: column; gap: 10px; }
.treasure-card { background: linear-gradient(160deg, #fff9e8 0%, #ffe9b8 100%); border: 3px solid #f3d27a; border-radius: var(--r); padding: 14px 16px; box-shadow: 0 6px 0 #e7c25e; cursor: pointer; position: relative; overflow: hidden; }
.treasure-card::before { content: ''; position: absolute; top: 0; right: 0; bottom: 0; left: 0; background: repeating-linear-gradient(45deg, transparent 0 18px, rgba(196,140,40,.05) 18px 20px); pointer-events: none; }
.tc-head { font-weight: 800; color: #8a5a00; font-size: 1.05em; }
.tc-stage { display: flex; align-items: center; gap: 12px; margin: 6px 0 8px; }
.tc-stage .comp-e { font-size: 3.4em; }
.tc-stage b { display: block; font-size: 1.3em; color: #6b4500; line-height: 1.3; }
.tc-stage small { color: #9a7a3a; }
.treasure-card .bar { background: rgba(255,255,255,.7); }
.tc-left { display: block; text-align: left; color: #9a7a3a; font-weight: 700; margin-top: 2px; }
.tc-trail { display: flex; align-items: center; justify-content: space-between; margin: 10px 0 4px; font-size: 1.45em; }
.tc-trail span { filter: grayscale(1); opacity: .35; transition: all .3s; }
.tc-trail span.on { filter: none; opacity: 1; }
.tc-trail i { flex: 1; border-top: 3px dashed #d9b356; margin: 0 3px; }
.guide { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.guide > span { font-size: 2.2em; animation: float 3s ease-in-out infinite; }
.guide .bubble { font-size: .92em; }
.guide .bubble::after { display: none; }
.side-goal { display: flex; align-items: center; gap: 12px; background: #fff; border-radius: 20px; padding: 10px 14px; box-shadow: 0 4px 0 #e3e8f2; }
.side-goal b { display: block; } .side-goal small { color: var(--muted); }
.home-side .visitors-row { margin: 0; }
.home-side .visitors-btn { margin: 0; }
.comp-card .tc-head { text-align: center; }

/* ---------- دخول المعلم ---------- */
.pass-inp { text-align: center; font-size: 1.6em; letter-spacing: 6px; direction: ltr; max-width: 320px; margin: 10px auto 0; display: block; }
.gate-err { color: var(--red); font-weight: 700; min-height: 1.6em; margin: 6px 0; }
.gate-card { max-width: 420px; margin-inline: auto; }

/* ---------- الكمبيوتر والشاشات الكبيرة ---------- */
@media (min-width: 760px) {
  .story-grid { grid-template-columns: repeat(3, 1fr); }
  .fl-sets { grid-template-columns: repeat(4, 1fr); }
  .badge-grid { grid-template-columns: repeat(4, 1fr); }
  .sticker-grid { grid-template-columns: repeat(10, 1fr); }
  .profile-grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); max-width: 900px; margin: 0 auto; }
  .options { max-width: 560px; }
  .lesson .step { max-width: 640px; margin: 0 auto; }
  .feedback { max-width: 640px; }
  .bottomnav { max-width: 520px; bottom: 14px; border-radius: 24px; border: 2px solid var(--line); }
  .toast { bottom: 110px; }
  .comp-card { max-width: 720px; margin: 0 auto; }
  .stat-row { max-width: 720px; margin-inline: auto; }
  .site-footer { max-width: 720px; margin-inline: auto; }
  .rewards .sec-title, .rewards .muted { max-width: 900px; margin-inline: auto; }
}
@media (min-width: 960px) {
  body { font-size: 18px; }
  .home-grid { grid-template-columns: 340px 1fr; align-items: start; }
  .home-side { position: sticky; top: 84px; }
  .home-main { min-width: 0; }
  .story-grid { grid-template-columns: repeat(4, 1fr); }
  .badge-grid { grid-template-columns: repeat(6, 1fr); }
  .topbar { padding: 8px 16px; }
  .tb-profile .nm { max-width: 200px; }
  .node { width: 88px; height: 82px; }
  .fl-item { font-size: 5.6em; }
  .fl-item.long { font-size: 2.8em; }
  .q-big { font-size: 6em; }
}
@media (hover: hover) {
  .opt:hover, .learn-card:hover, .tile:hover, .story-card:hover, .fl-set:hover, .profile-card:hover { border-color: #c9d8f5; transform: translateY(-2px); }
  .node:not(.locked):hover { filter: brightness(1.06); transform: translateY(-2px); }
}
@media (max-width: 959px) {
  .side-goal { display: none; }  /* هدف اليوم ظاهر في الشريط العلوي على الجوال */
  .treasure-card { padding: 12px 14px; }
  .tc-stage .comp-e { font-size: 2.8em; }
}

/* ---------- الحفظ على الخادم ---------- */
.cloud-banner { border-radius: 14px; padding: 8px 12px; margin-bottom: 10px; font-weight: 700; font-size: .95em; }
.cloud-banner.ok { background: #dcfce7; color: #0b7a55; }
.cloud-banner.off { background: #fff4e5; color: #a65b00; }
.cloud-banner.wait { background: #eef2f7; color: var(--muted); }
.cloud-banner .link { margin: 0 6px; }
.rec-row.pend { border-color: var(--orange); }
.rec-row .cl { font-size: 1em; }
/* أجهزة قديمة لا تدعم gap في flex */
@supports not (gap: 1px) { .tb-stats > * + *, .chips > * + *, .row > * + * { margin-right: 6px; } }

/* ---------- أغلفة القصص ---------- */
.story-card { padding: 0 0 12px; overflow: hidden; }
.story-card .sc-cover { padding-top: 12px; }
.sc-img { width: 100%; aspect-ratio: 16 / 9; overflow: hidden; background: #eaf3ff; margin-bottom: 8px; }
.sc-img img { width: 100%; height: 100%; object-fit: cover; object-position: center top; display: block; transition: transform .3s; }
@supports not (aspect-ratio: 1) { .sc-img { height: 0; padding-bottom: 56.25%; position: relative; } .sc-img img { position: absolute; top: 0; left: 0; } }
.story-card:hover .sc-img img { transform: scale(1.05); }
.story-card b { padding: 0 8px; }
.story-hero { border-radius: var(--r); overflow: hidden; box-shadow: 0 6px 0 #e3e8f2; margin: 4px 0 10px; background: #eaf3ff; }
.story-hero img { width: 100%; display: block; max-height: 360px; object-fit: cover; object-position: center top; }
.end-story-img { border-radius: 20px; overflow: hidden; margin: -6px -4px 10px; }
.end-story-img img { width: 100%; display: block; max-height: 200px; object-fit: cover; object-position: center top; }

/* ---------- مستويات القصص والأغلفة بالإيموجي ---------- */
.lib-progress { max-width: 420px; margin: 4px auto 6px; text-align: center; }
.lib-progress small { color: var(--muted); }
.level-title { margin: 20px 4px 8px; font-size: 1.2em; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.level-title span { font-size: 1.3em; }
.level-title small { color: var(--muted); font-size: .7em; font-weight: 500; }
.sc-emo { display: flex; align-items: center; justify-content: center; }
.sc-emo .emo { font-size: 3.6em; line-height: 1; filter: drop-shadow(0 4px 4px rgba(0,0,0,.12)); transition: transform .3s; }
.story-card:hover .sc-emo .emo { transform: scale(1.12) rotate(-4deg); }
.story-card.read { box-shadow: 0 6px 0 #f3d27a; }
.story-hero.sc-emo { aspect-ratio: 16 / 9; max-height: 260px; width: 100%; }
.story-hero.sc-emo .emo { font-size: 6em; }
@supports not (aspect-ratio: 1) { .story-hero.sc-emo { height: 200px; } }

/* ---------- إطار الأغلفة الموحّد (يتكيف مع أي أبعاد للصورة) ---------- */
.cover-frame { position: relative; overflow: hidden; width: 100%; aspect-ratio: 4 / 3; background: #eaf3ff; display: block; }
@supports not (aspect-ratio: 1) { .cover-frame { height: 0; padding-bottom: 75%; } .cover-frame > * { position: absolute; top: 0; left: 0; } .cover-frame.sc-emo .emo { top: 50%; left: 50%; transform: translate(-50%, -50%); } }
.cover-frame .cf-bg { position: absolute; top: -12%; left: -12%; width: 124%; height: 124%; object-fit: cover; filter: blur(16px) saturate(1.15); opacity: .75; transform: none; }
.cover-frame .cf-img { position: relative; width: 100%; height: 100%; object-fit: contain; object-position: center; display: block; transition: transform .3s; }
.story-card:hover .cover-frame .cf-bg { transform: none; }
.story-card:hover .cover-frame .cf-img { transform: scale(1.04); }
.sc-img.cover-frame { margin-bottom: 8px; }
.story-hero.cover-frame { aspect-ratio: 4 / 3; max-height: 420px; border-radius: var(--r); }
.end-story-img.cover-frame { max-height: 230px; border-radius: 20px; margin: -6px 0 10px; }
.end-story-img.cover-frame.sc-emo .emo, .story-hero.cover-frame.sc-emo .emo { font-size: 5em; }
.cover-frame.sc-emo { display: flex; align-items: center; justify-content: center; }

/* ---------- كل الأغلفة 4:3 — تملأ الإطار تماماً على كل الشاشات ---------- */
.cover-frame .cf-img { object-fit: cover; }
/* غلاف صفحة القصة: عرض كامل على الجوال، ولا يتجاوز نصف ارتفاع الشاشة على الشاشات الأفقية */
.story-hero.cover-frame { max-height: none; width: 100%; max-width: 560px; margin: 4px auto 12px; }
@supports (width: min(1px, 2px)) { .story-hero.cover-frame { width: min(100%, 560px, 72vh); } }
.end-story-img.cover-frame { max-height: none; width: 100%; max-width: 300px; margin: -6px auto 10px; }
@supports (width: min(1px, 2px)) { .end-story-img.cover-frame { width: min(100%, 300px, 40vh); } }

/* ---------- ما يُنطق الآن يتلوّن بالأحمر ---------- */
.speaking, .syl.speaking, .ra-w.hl, .tk.speaking { color: #e53935 !important; }
.tk, .syl, .ra-w { transition: color .12s, background .12s, transform .12s; display: inline-block; border-radius: 10px; }
.tk.speaking, .syl.speaking, .ra-w.hl, .ra-w.speaking { background: #ffe8e8; transform: scale(1.1); text-shadow: 0 0 1px rgba(229,57,53,.25); }
.lc-big.speaking, .q-big.speaking, .intro-sym.speaking { transform: scale(1.08); transition: transform .15s, color .12s; }
.opt.speaking, .slot.speaking, .tile.speaking { border-color: #e53935 !important; background: #fff0f0 !important; }
.q-word.speaking, .q-sentence.speaking, .rt.speaking { color: #e53935 !important; }
.learn-card.playing { border-color: #e53935; }

/* ---------- واتساب ---------- */
.btn-wa { background: #25d366; box-shadow: 0 5px 0 #1a9e4b; }
.wa-ico { display: inline-grid; place-content: center; width: 24px; height: 24px; border-radius: 50%; background: #fff; color: #25d366; font-size: 15px; font-weight: 800; line-height: 1; }
.wa-inp { direction: ltr; text-align: center; font-size: 1.3em; letter-spacing: 1px; max-width: 260px; }
.modal-card .wa-inp { margin: 6px auto; display: block; }
.modal-card .lbl { display: block; font-weight: 700; margin-top: 8px; }
.muted.small { font-size: .85em; }

.share-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 12px 0 2px; }
.share-opt { display: flex; flex-direction: column; align-items: center; gap: 4px; font-weight: 700; font-size: .85em; padding: 6px 2px; border-radius: 14px; }
.share-opt:active { background: #f1f4fa; }
.share-opt span { width: 52px; height: 52px; border-radius: 50%; color: #fff; display: grid; place-content: center; font-size: 1.5em; box-shadow: 0 4px 0 rgba(0,0,0,.15); }
#stShare { background: var(--green); box-shadow: 0 5px 0 #0b8a69; }

/* ===== خلفية الكود الأصلي: تدرّج بنفسجي ===== */
body { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) fixed; background-color: #6b5fc7; }
.boot, .countdown { color: #fff; }
.sec-title, .level-title, .profiles h1, .profiles .hero p, .lesson .prompt, .lesson-end h1, .story-title, .parent-head h2,
.lcount, .fl-score, .rec-progress, .toggle, .fl-mic, .node-stars, .node-stars .nt { color: #fff; }
.sec-title small, .level-title small, .lib-progress small { color: rgba(255,255,255,.8); }
.profiles h1 { text-shadow: 0 4px 0 rgba(40,20,90,.35); }
.screen > .muted, .step > .muted, .screen > p.muted, .fl-run .muted, .rewards > .muted { color: rgba(255,255,255,.88); }
.lesson-end .end-gain { color: #ffe066; text-shadow: 0 3px 0 rgba(40,20,90,.3); }
.lesson-end .end-gain small { color: rgba(255,255,255,.8); }
.lesson-top { background: linear-gradient(rgba(108,98,210,.96) 70%, transparent); }
.ptabs { background: linear-gradient(rgba(108,98,210,.96) 80%, transparent); }
.feedback.neutral { background: #eef0ff; }
.lbar { background: rgba(255,255,255,.35); }
.unit-banner { box-shadow: 0 6px 0 rgba(30,15,70,.3); }
.node-start { color: #5a3fc0; }
.visitors-row .visitors-btn, .hero .visitors-btn { border-color: transparent; }
.profile-card.add { border-color: rgba(255,255,255,.7); color: #fff; }
.profile-card.add small { color: rgba(255,255,255,.8); }
.privacy-link { display: inline-block; margin-top: 8px; color: #5a67d8; font-size: .9em; }

/* ---------- ال القمرية والشمسية ---------- */
.lam.said { color: #10ac84; }
.lam.silent { color: #b4bccb; }
.al-word { color: #2d3448 !important; }
.lc-sub.al-tag { font-size: 1em; color: var(--muted); font-family: var(--ui); }
.intro-2 small { display: block; font-size: .8em; color: #8854d0; margin-top: 4px; }
.al-letters { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 4px 0 14px; direction: rtl; }
.al-letters span { font-family: var(--read); font-size: 1.6em; width: 52px; height: 52px; display: grid; place-content: center; border-radius: 14px; font-weight: 700; }
.al-letters span.qamar { background: #e9f9f2; color: #0b8a69; }
.al-letters span.shams { background: #fff4e0; color: #e17055; }
.speaking .lam.said { color: #e53935; }

/* =========================================================
   خريطة البحر والجزر
   ========================================================= */
body.sea {
  background: linear-gradient(180deg, #8cddee 0%, #6ed2ea 50%, #51c8e6 100%) fixed;
  background-color: #6ed2ea;
}
body.sea::before {
  content: ''; position: fixed; top: 0; right: 0; bottom: 0; left: 0; pointer-events: none; z-index: 0; opacity: .35;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='60'%3E%3Cpath d='M0 30 q20 -10 40 0 t40 0' fill='none' stroke='white' stroke-width='3' stroke-linecap='round'/%3E%3Cpath d='M90 52 q14 -7 28 0 t28 0' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' opacity='.7'/%3E%3C/svg%3E");
  background-size: 160px 60px; animation: seaWaves 18s linear infinite;
}
body.sea .app { position: relative; z-index: 1; }
@keyframes seaWaves { from { background-position: 0 0; } to { background-position: -320px 60px; } }

/* السماء والجبال والغيوم أعلى الخريطة */
.sea-map { position: relative; }
.sea-sky { position: relative; height: 190px; margin: 0 -14px 6px; border-radius: 0 0 40px 40px; overflow: hidden;
  background: linear-gradient(180deg, #bfe8ff 0%, #d9f2ff 62%, #9fe3f2 63%, #49c6e5 100%); }
.sea-sky .mount { position: absolute; left: 0; right: 0; bottom: 60px; width: 100%; height: 70px; }
.sea-sky .cloud { position: absolute; background: #fff; border-radius: 40px; height: 26px; box-shadow: 20px -12px 0 6px #fff, 44px 0 0 0 #fff; opacity: .95; animation: cloudDrift 40s linear infinite; }
.sea-sky .c1 { width: 70px; top: 26px; left: 10%; }
.sea-sky .c2 { width: 54px; top: 54px; left: 55%; animation-duration: 55s; transform: scale(.8); }
.sea-sky .c3 { width: 60px; top: 18px; left: 80%; animation-duration: 48s; }
@keyframes cloudDrift { from { margin-left: -40px; } to { margin-left: 40px; } }
.sea-sky .gulls { position: absolute; top: 40px; left: 22%; width: 200px; height: 60px; fill: none; stroke: #4a4878; stroke-width: 3; stroke-linecap: round; animation: bob 3s ease-in-out infinite; }
.sea-sky .sky-title { position: absolute; bottom: 14px; left: 0; right: 0; text-align: center; color: #fff; font-weight: 800; font-size: 1.25em; text-shadow: 0 3px 0 rgba(10,80,120,.35); }

/* مسار القارب */
.route { position: absolute; top: 0; left: 0; pointer-events: none; z-index: 0; }
.sea-map .unit { position: relative; z-index: 1; }
.sea-map .unit-banner { background: linear-gradient(180deg, color-mix(in srgb, var(--uc) 92%, #fff), var(--uc)); border: 4px solid rgba(255,255,255,.85); }
.ue.ue-ar { font-family: var(--read); font-size: 1.35em; font-weight: 700; background: rgba(255,255,255,.22); border-radius: 14px; padding: 0 10px; line-height: 1.6; white-space: nowrap; }

/* الجزر */
.isle-wrap { display: flex; flex-direction: column; align-items: center; margin: 4px 0; position: relative; }
.isle { position: relative; width: 168px; height: 116px; padding: 0; transition: transform .15s; }
.isle .isle-svg { width: 100%; height: 100%; display: block; filter: drop-shadow(0 6px 0 rgba(0,60,100,.18)); }
.isle:active { transform: scale(.96); }
.isle-label { position: absolute; left: 50%; top: 30px; transform: translateX(-50%); min-width: 54px; height: 54px; padding: 0 8px; border-radius: 28px;
  background: var(--uc); color: #fff; border: 4px solid #fff; display: grid; place-content: center; font-size: 1.3em; font-weight: 800; box-shadow: 0 5px 0 rgba(0,0,0,.18); white-space: nowrap; }
.isle-label.ar { font-family: var(--read); font-size: 1.5em; }
.isle.locked .isle-svg { filter: grayscale(.55) brightness(.92) drop-shadow(0 6px 0 rgba(0,60,100,.15)); }
.isle.locked .isle-label { background: #8a94a6; font-size: 1.2em; }
.isle-flag { position: absolute; top: -4px; right: 26px; font-size: 1.6em; animation: bob 2.4s ease-in-out infinite; }
.isle-chest { position: absolute; bottom: 10px; left: 22px; font-size: 1.5em; }
.isle-chest.closed { opacity: .9; }
.isle.current .shallow { animation: shallowPulse 1.6s ease-in-out infinite; transform-origin: 80px 80px; }
@keyframes shallowPulse { 0%,100% { opacity: .6; transform: scale(1); } 50% { opacity: .95; transform: scale(1.08); } }
.isle.current .isle-label { animation: pulse 1.6s infinite; }
.isle-name { margin-top: -4px; color: #0b4f6c; font-weight: 800; font-size: .95em; text-shadow: 0 1px 0 rgba(255,255,255,.7); min-height: 22px; font-family: var(--read); }
.isle-name .st { font-family: var(--ui); text-shadow: none; }
.sea-map .node-start { top: -26px; z-index: 3; }
.isle-wrap.final { margin: 30px 0 10px; }
.isle.big { width: 240px; height: 166px; }
.isle-label.big { top: 44px; min-width: 70px; height: 70px; font-size: 2em; background: #f5b70a; }
.isle.big.locked .isle-label.big { background: #8a94a6; }
.final .isle-name { font-size: 1.15em; }

/* القارب */
.boat { position: absolute; top: 0; left: 0; z-index: 2; pointer-events: none; display: flex; flex-direction: column; align-items: center; will-change: transform; }
.boat-e { font-size: 2.6em; line-height: 1; animation: boatRock 2.2s ease-in-out infinite; filter: drop-shadow(0 4px 0 rgba(0,60,100,.25)); }
.boat-av { font-size: 1.5em; line-height: 1; margin-bottom: -14px; z-index: 1; animation: boatRock 2.2s ease-in-out infinite; }
@keyframes boatRock { 0%,100% { transform: rotate(-6deg) translateY(0); } 50% { transform: rotate(6deg) translateY(-4px); } }

/* نهاية الدرس: فتح قفل الجزيرة وأخذ كنزها */
.unlock-scene { position: relative; width: 260px; height: 180px; margin: 0 auto; }
.unlock-scene .isle-svg { width: 100%; height: 100%; }
.unlock-scene > span { position: absolute; left: 50%; top: 52px; transform: translateX(-50%); font-size: 3.4em; line-height: 1; }
.ul-lock { animation: lockShake .8s ease-in-out, ulHide .15s .85s forwards; }
.ul-open { opacity: 0; animation: ulShow .2s .85s forwards, ulHide .25s 1.3s forwards; }
.ul-chest { opacity: 0; animation: chestPop .55s 1.3s cubic-bezier(.3,1.6,.6,1) forwards; }
.ul-coin { opacity: 0; font-size: 1.8em !important; top: 70px !important; animation: coinFly 1.1s calc(1.5s + var(--d)) ease-out forwards; }
@keyframes lockShake { 0%,100% { transform: translateX(-50%) rotate(0); } 20% { transform: translateX(-50%) rotate(-14deg); } 40% { transform: translateX(-50%) rotate(12deg); } 60% { transform: translateX(-50%) rotate(-10deg); } 80% { transform: translateX(-50%) rotate(8deg); } }
@keyframes ulHide { to { opacity: 0; transform: translateX(-50%) scale(1.4); } }
@keyframes ulShow { from { opacity: 0; transform: translateX(-50%) scale(.6); } to { opacity: 1; transform: translateX(-50%) scale(1.1); } }
@keyframes chestPop { from { opacity: 0; transform: translateX(-50%) scale(0); } to { opacity: 1; transform: translateX(-50%) scale(1); } }
@keyframes coinFly { 0% { opacity: 1; transform: translate(-50%, 0) scale(.6); } 100% { opacity: 0; transform: translate(calc(-50% + var(--dx)), var(--dy)) scale(1.1) rotate(360deg); } }
.ul-title { color: #ffe066; font-weight: 800; font-size: 1.5em; text-shadow: 0 3px 0 rgba(40,20,90,.35); margin-top: 4px; opacity: 0; animation: ulShowPlain .4s 1.2s forwards; }
@keyframes ulShowPlain { to { opacity: 1; } }
@supports not (color: color-mix(in srgb, red, blue)) { .sea-map .unit-banner { background: var(--uc); } }

/* صور الشخصيات */
.av-img { width: 1.25em; height: 1.25em; border-radius: 50%; object-fit: cover; display: inline-block; vertical-align: middle; background: #f6efdc; box-shadow: 0 0 0 2px #fff, 0 2px 6px rgba(0,0,0,.18); }
.tb-profile .av .av-img { width: 40px; height: 40px; }
.profile-card .av .av-img { width: 84px; height: 84px; box-shadow: 0 0 0 4px #fff, 0 4px 10px rgba(0,0,0,.18); }
.rep-head .av .av-img { width: 56px; height: 56px; }
.boat-av .av-img { width: 40px; height: 40px; }
.av-pick { grid-template-columns: repeat(auto-fill, minmax(58px, 1fr)); max-height: 46vh; overflow-y: auto; padding: 4px; }
.av-pick button { padding: 3px; border-radius: 50%; line-height: 0; }
.av-pick .av-img { width: 100%; height: auto; aspect-ratio: 1; box-shadow: none; }
.av-pick button.on { background: #e8faf3; border-color: var(--green); transform: scale(1.06); }
/* روابط التذييل */
.ft-links { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.store-btn { display: inline-flex; align-items: center; gap: 8px; background: #0f9d76; color: #fff; text-decoration: none; font-weight: 800; padding: 10px 18px; border-radius: 16px; box-shadow: 0 4px 0 #0a6e53; margin: 6px 0; direction: rtl; }
.store-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #0a6e53; }
.support-btn { display: inline-flex; align-items: center; gap: 8px; background: linear-gradient(135deg,#ffa53b,#f57c00); color: #fff; text-decoration: none; font-weight: 800; padding: 11px 22px; border-radius: 18px; box-shadow: 0 4px 0 #c25e00; margin: 8px 0 4px; font-size: 1.05em; animation: heartBeat 2.4s ease-in-out infinite; }
.support-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #c25e00; }
@keyframes heartBeat { 0%,100% { transform: scale(1); } 8% { transform: scale(1.06); } 16% { transform: scale(1); } }
.yt-sub { display: block; font-size: .78em; font-weight: 700; opacity: .9; }
.yt-btn > span:last-child { text-align: right; line-height: 1.35; }
.ft-visitors { margin: 6px 0 2px; }
.yt-top { display: block; font-size: 1.15em; }
/* ترتيب أزرار التذييل: اليوتيوب فوق، والزران تحته بنفس العرض */
.ft-links { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; max-width: 360px; margin: 8px auto; }
.ft-links .yt-btn { grid-column: 1 / -1; justify-content: center; }
.ft-links .yt-btn, .ft-links .store-btn, .ft-links .support-btn { margin: 0; justify-content: center; box-sizing: border-box; width: 100%; padding-left: 8px; padding-right: 8px; white-space: nowrap; }
.ft-links .support-btn { animation: none; font-size: 1em; }
.support-btn { border: 0; cursor: pointer; font-family: inherit; }
.sup-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 10px 0 4px; }
.sup-amt { display: flex; flex-direction: column; align-items: center; justify-content: center; background: linear-gradient(135deg,#ffa53b,#f57c00); color: #fff; text-decoration: none; border-radius: 18px; padding: 12px 6px; box-shadow: 0 4px 0 #c25e00; }
.sup-amt b { font-size: 2em; line-height: 1.1; } .sup-amt small { font-weight: 800; opacity: .95; }
.sup-amt:active { transform: translateY(3px); box-shadow: 0 1px 0 #c25e00; }
/* تحديد المستوى */
.lvl-list { display: grid; gap: 8px; margin: 10px 0; text-align: right; }
.lvl { display: grid; grid-template-columns: 44px 1fr; grid-template-rows: auto auto; column-gap: 8px; align-items: center; background: #f4f1ff; border: 2px solid transparent; border-radius: 16px; padding: 8px 12px; font-family: inherit; cursor: pointer; color: #2d2a4a; text-align: right; }
.lvl span { grid-row: 1 / 3; font-size: 1.7em; text-align: center; }
.lvl b { font-size: 1.05em; } .lvl small { color: #6b6890; font-weight: 700; }
.lvl.on, .lvl:hover { border-color: #8c6bff; background: #ece6ff; }
.pt-head { display: flex; justify-content: space-between; font-weight: 800; color: #6b4fd8; margin-bottom: 4px; }
.pt-word { font-size: 2.6em; margin: 14px 0; }
.pt-say { margin: 10px auto; display: block; }
.pt-opts { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 12px 0 4px; }
.pt-opt { min-width: 84px; min-height: 84px; border-radius: 20px; border: 3px solid #e3dcff; background: #fff; font-size: 2.3em; cursor: pointer; font-family: inherit; display: grid; place-items: center; padding: 6px; }
.pt-opt:active { transform: scale(.95); }
.pt-opt .pic-emoji { font-size: 1em; }
.pc-wrap { position: relative; }
.pc-wrap .profile-card { width: 100%; }
.pc-edit { position: absolute; top: 6px; left: 6px; width: 34px; height: 34px; border-radius: 50%; border: 0; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.18); cursor: pointer; font-size: 16px; }
.pe-lvl { margin-top: 12px; width: 100%; }
.lvl span { font-family: inherit; font-weight: 800; color: #ff9f43; } .rw-big:is(:empty){}
.isle.big { border: 0; background: none; cursor: pointer; font-family: inherit; }
.isle.big.done { animation: boatRock 3s ease-in-out infinite; }
.grand-hint { font-weight: 800; color: #0b4f6c; margin-top: 4px; animation: heartBeat 1.6s infinite; }
.unlock-scene.grand svg { width: 200px; height: auto; }
.grand-card .ul-chest { font-size: 64px; }
.rbtn.up { background: #e0f2fe; } .rbtn:disabled { opacity: .6; }
