/* ===== الإضافات الجديدة: السلايد، نمط الأهل، التقييم، الرسام الذكي، البوصلة، شريط الحروف ===== */

/* ---------- السلايد المستمر (الوضوء، الصلاة، العمرة، الحج) ---------- */
.sw-host { display: grid; grid-template-rows: auto 1fr; gap: 10px; padding-inline: 0 !important; overflow: hidden !important; min-height: 0; position: relative; }
.sw-dots { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; padding: 0 16px; }
.sw-dot { width: 10px; height: 10px; padding: 0; border: 0; border-radius: 99px; background: rgba(255,255,255,.28); transition: width .25s, background .25s; cursor: pointer; }
.sw-dot.ok { background: rgba(255,255,255,.65); }
.sw-dot.on { width: 26px; background: #FFC83D; }
.sw-track { display: flex; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scroll-behavior: smooth; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; scrollbar-width: none; min-height: 0; outline: none; touch-action: pan-x pan-y; }
.sw-track::-webkit-scrollbar { display: none; }
.sw-track.dragging { scroll-snap-type: none; scroll-behavior: auto; cursor: grabbing; user-select: none; }
.sw-slide { flex: 0 0 100%; scroll-snap-align: center; scroll-snap-stop: always; overflow-y: auto; padding: 4px 16px calc(18px + env(safe-area-inset-bottom, 0px)); display: grid; align-content: start; gap: 12px; }
.sw-slide > .hj-card { position: relative; transform: scale(.94); opacity: .55; transition: transform .35s cubic-bezier(.2,.8,.2,1), opacity .35s; }
.sw-slide.on > .hj-card { transform: none; opacity: 1; }
.sw-say { position: absolute; top: 10px; inset-inline-end: 10px; width: 44px; height: 44px; border-radius: 50%; border: 0; background: #2E2640; color: #fff; display: grid; place-items: center; box-shadow: 0 4px 10px rgba(0,0,0,.2); }
.sw-say .ic { width: 22px; height: 22px; }
.sw-say:active { transform: scale(.92); }
.sw-done { justify-self: center; min-width: 60%; font-size: 1.15rem; animation: bob 2.4s ease-in-out infinite; }
.sw-hint { position: absolute; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); inset-inline: 0; margin: auto; width: max-content; max-width: 90%; display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-radius: 99px; background: rgba(15,23,38,.82); color: #fff; font-weight: 700; pointer-events: none; z-index: 3; animation: fade .3s; }
.sw-hand { display: inline-block; font-size: 1.5rem; animation: sw-hand 1.4s ease-in-out infinite; }
[dir="rtl"] .sw-hand { animation-name: sw-hand-rtl; }
@keyframes sw-hand { 0% { transform: translateX(24px); opacity: 0; } 20% { opacity: 1; } 80% { opacity: 1; } 100% { transform: translateX(-24px); opacity: 0; } }
@keyframes sw-hand-rtl { 0% { transform: translateX(-24px); opacity: 0; } 20% { opacity: 1; } 80% { opacity: 1; } 100% { transform: translateX(24px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .sw-track { scroll-behavior: auto; } .sw-slide > .hj-card { transition: none; } .sw-hand, .sw-done { animation: none; } }

/* ---------- شريط الحروف في «اكتب الحرف» ---------- */
.tr-rail-wrap { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; }
.tr-rail { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding: 6px 40%; -webkit-mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent); mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent); }
.tr-rail::-webkit-scrollbar { display: none; }
.tr-chip { flex: none; scroll-snap-align: center; width: 54px; height: 54px; border-radius: 18px; border: 0; background: var(--paper); color: var(--ink); font: 800 1.6rem/1 "Baloo Bhaijaan 2", "Readex Pro", sans-serif; box-shadow: inset 0 -4px 0 var(--line), var(--shadow); transition: transform .2s; }
.tr-chip.on { background: var(--ink-c, #2E2640); color: #fff; transform: scale(1.14); box-shadow: inset 0 -4px 0 rgba(0,0,0,.2), 0 6px 16px rgba(0,0,0,.18); }
.tr-chip.on { --ink-c: var(--ink, #2E2640); }
[data-theme="dark"] .tr-chip.on { --ink-c: #5B4B8A; }
.tr-clear { width: 54px; height: 54px; }

/* ---------- بوابة الأهل بالنمط ---------- */
.pl-gate { z-index: 90; }
.pl-card { text-align: center; }
.pl-msg { margin: 0; font-weight: 600; color: var(--muted); min-height: 1.6em; }
.pl-pad { --pl-ink: #3FA6A0; --pl-dot: rgba(120,110,140,.16); --pl-dot-c: #8E84A3; width: min(280px, 78vw); aspect-ratio: 1; margin: 4px auto; border-radius: 28px; background: var(--soft); box-shadow: inset 0 0 0 2px var(--line); touch-action: none; }
.pl-pad canvas { display: block; border-radius: 28px; cursor: pointer; }
.pl-pad.off { opacity: .45; pointer-events: none; }
[data-theme="dark"] .pl-pad { --pl-dot: rgba(255,255,255,.12); --pl-dot-c: #9AA8BC; }
.pl-forgot { justify-self: center; }

/* ---------- التقييم ---------- */
.rt-modal { z-index: 90; }
.rt-card { text-align: center; }
.rt-stars { display: flex; justify-content: center; gap: 6px; direction: ltr; }
.rt-star { width: 52px; height: 52px; padding: 4px; border: 0; background: none; cursor: pointer; }
.rt-star svg { width: 100%; height: 100%; fill: var(--line); stroke: #E0B44A; stroke-width: 1; transition: fill .15s, transform .15s; }
.rt-star.on svg { fill: #FFC83D; }
.rt-star.pop svg { animation: rt-pop .35s; }
@keyframes rt-pop { 50% { transform: scale(1.3) rotate(-8deg); } }
.rt-word { margin: 0; font-weight: 700; color: var(--muted); min-height: 1.6em; }
.rt-q { margin: 4px 0 0; font-weight: 700; text-align: start; }
.rt-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.rt-tags .chip-btn.on { background: var(--leaf); color: #fff; border-color: var(--leaf); }
.rt-note { width: 100%; border-radius: 14px; border: 1.5px solid var(--line); background: var(--soft); color: var(--ink); padding: 10px 12px; font: inherit; resize: vertical; }
.rt-thanks { display: grid; gap: 10px; justify-items: center; padding: 8px 0; }
.rt-big { font-size: 3.2rem; animation: bob 2.4s ease-in-out infinite; }

/* ---------- الرسام الذكي ---------- */
.painter { grid-template-rows: auto minmax(0, 1fr) auto; grid-template-columns: minmax(0, 1fr); background: linear-gradient(180deg, #FFF4E2, #FFE9C7); color: #2E2640; }
[data-theme="dark"] .painter { background: linear-gradient(180deg, #121A28, #1B2537); color: #EDF2F8; }
.painter .pl-btn { color: inherit; }
.pt-top { display: flex; align-items: center; gap: 8px; padding: 8px 12px; }
.pt-title { font-family: var(--f-display); font-size: 1.2rem; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pt-acts { display: flex; gap: 4px; }
.pt-ib { width: 40px; height: 40px; border-radius: 14px; border: 0; background: var(--paper); color: var(--ink); font-size: 1.15rem; display: grid; place-items: center; box-shadow: inset 0 -3px 0 var(--line); cursor: pointer; }
.pt-ib.sm { width: 34px; height: 34px; font-size: .95rem; border-radius: 12px; }
.pt-ib:active { transform: scale(.92); }
.pt-stage { position: relative; min-height: 0; min-width: 0; padding: 0 10px; }
.pt-bar, .pt-row, .pt-tools, .pt-colors { min-width: 0; }
.pt-paper { position: relative; width: 100%; height: 100%; background: #fff; border-radius: 22px; box-shadow: 0 10px 30px rgba(46,38,64,.18), inset 0 0 0 2px rgba(46,38,64,.06); overflow: hidden;
  background-image: radial-gradient(rgba(46,38,64,.06) 1px, transparent 1px); background-size: 22px 22px; }
.pt-paper canvas { position: absolute; inset: 0; }
.pt-guide { pointer-events: none; }
.pt-live { cursor: crosshair; touch-action: none; }
.pt-paper[data-tool="fill"] .pt-live { cursor: cell; }
.pt-fab { position: absolute; bottom: 12px; inset-inline-end: 22px; display: flex; align-items: center; gap: 6px; padding: 8px 14px 8px 10px; border: 0; border-radius: 99px; background: linear-gradient(135deg, #7B2FF7, #F72585); color: #fff; font-weight: 800; box-shadow: 0 8px 20px rgba(123,47,247,.4); cursor: pointer; animation: pt-float 3s ease-in-out infinite; z-index: 2; }
.pt-fab span { font-size: 1.4rem; }
@keyframes pt-float { 50% { transform: translateY(-4px); } }
.pt-stepbar { position: absolute; top: 10px; inset-inline: 20px; z-index: 3; background: rgba(255,255,255,.96); color: #2E2640; border-radius: 20px; padding: 10px 12px; box-shadow: 0 10px 26px rgba(46,38,64,.22); display: grid; gap: 6px; animation: fade .25s; }
.pt-sb-top { display: flex; align-items: center; gap: 6px; }
.pt-sb-n { flex: 1; font-weight: 800; color: #7B2FF7; font-size: .9rem; }
.pt-sb-t { margin: 0; font-weight: 700; font-size: 1.05rem; line-height: 1.4; }
.pt-sb-win { text-align: center; }
.pt-sb-dots { display: flex; gap: 5px; }
.pt-sb-dots i { flex: 1; height: 5px; border-radius: 9px; background: #E9E3F3; }
.pt-sb-dots i.ok { background: #B79BF2; }
.pt-sb-dots i.on { background: #7B2FF7; }
.pt-sb-acts { display: flex; gap: 8px; justify-content: flex-end; }
.pt-bar { padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px)); display: grid; gap: 8px; }
.pt-tools { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px; }
.pt-tools::-webkit-scrollbar { display: none; }
.pt-tool { flex: none; display: grid; justify-items: center; gap: 0; width: 58px; padding: 6px 2px 4px; border: 0; border-radius: 16px; background: var(--paper); color: var(--ink); box-shadow: inset 0 -3px 0 var(--line); cursor: pointer; }
.pt-tool span { font-size: 1.35rem; line-height: 1.2; }
.pt-tool small { font-size: .68rem; font-weight: 600; white-space: nowrap; }
.pt-tool.on { background: #2E2640; color: #fff; box-shadow: 0 4px 10px rgba(46,38,64,.3); transform: translateY(-2px); }
.pt-row { display: flex; align-items: center; gap: 10px; }
.pt-colors { flex: 1; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 4px 2px; }
.pt-colors::-webkit-scrollbar { display: none; }
.pt-col { flex: none; position: relative; width: 34px; height: 34px; border-radius: 50%; border: 3px solid #fff; background: var(--c); box-shadow: 0 0 0 1.5px rgba(46,38,64,.18); cursor: pointer; display: grid; place-items: center; font-size: 1rem; overflow: hidden; }
.pt-col.on { transform: scale(1.18); box-shadow: 0 0 0 3px #2E2640; }
.pt-more { background: conic-gradient(#E63946, #FFC83D, #52B788, #4895EF, #7B2FF7, #F72585, #E63946); }
.pt-more input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.pt-sizes { display: flex; align-items: center; gap: 4px; }
.pt-size { width: 36px; height: 36px; border-radius: 12px; border: 0; background: var(--paper); display: grid; place-items: center; box-shadow: inset 0 -3px 0 var(--line); cursor: pointer; }
.pt-size i { width: var(--z); height: var(--z); border-radius: 50%; background: var(--ink); }
.pt-size.on { background: #2E2640; } .pt-size.on i { background: #fff; }
.pt-fillmode { height: 36px; padding: 0 10px; border-radius: 12px; border: 0; background: var(--paper); color: var(--ink); font: 700 .78rem var(--f-body); box-shadow: inset 0 -3px 0 var(--line); cursor: pointer; }
.pt-fillmode.on { background: #2E2640; color: #fff; }
.pt-sheet { position: fixed; inset-inline: 0; bottom: 0; z-index: 45; max-height: 72vh; display: grid; grid-template-rows: auto 1fr auto auto; gap: 8px; background: var(--paper); color: var(--ink); border-radius: 26px 26px 0 0; padding: 12px 14px calc(12px + env(safe-area-inset-bottom, 0px)); box-shadow: 0 -10px 40px rgba(0,0,0,.25); animation: pt-up .28s cubic-bezier(.2,.8,.2,1); }
@keyframes pt-up { from { transform: translateY(100%); } }
.pt-sh-head { display: flex; align-items: center; justify-content: space-between; }
.pt-log { overflow-y: auto; display: grid; gap: 8px; align-content: start; min-height: 80px; max-height: 32vh; }
.pt-msg { display: flex; gap: 6px; align-items: flex-end; }
.pt-msg p { margin: 0; padding: 8px 12px; border-radius: 16px; max-width: 82%; line-height: 1.45; }
.pt-msg.bot p { background: #F1EAFE; color: #2E2640; border-end-start-radius: 4px; }
.pt-msg.me { justify-content: flex-end; }
.pt-msg.me p { background: #2E2640; color: #fff; border-end-end-radius: 4px; }
.pt-av { font-size: 1.3rem; }
.pt-chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.pt-chips::-webkit-scrollbar { display: none; }
.pt-chips .chip-btn { flex: none; white-space: nowrap; }
.pt-ask { display: flex; gap: 6px; align-items: center; }
.pt-in { flex: 1; min-width: 0; height: 44px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--soft); color: var(--ink); padding: 0 12px; font: inherit; }
.pt-mic { width: 44px; height: 44px; border-radius: 50%; border: 0; background: #F1EAFE; font-size: 1.25rem; cursor: pointer; flex: none; }
.pt-mic.on { background: #F72585; animation: pt-pulse 1s infinite; }
@keyframes pt-pulse { 0% { box-shadow: 0 0 0 0 rgba(247,37,133,.5); } 100% { box-shadow: 0 0 0 16px rgba(247,37,133,0); } }
.pt-album { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; overflow-y: auto; }
.pt-thumb { padding: 0; border: 0; border-radius: 14px; overflow: hidden; background: #fff; box-shadow: var(--shadow); aspect-ratio: 3 / 4; cursor: pointer; }
.pt-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pt-empty { text-align: center; }
.pt-confirm { display: grid; gap: 12px; text-align: center; padding: 10px 0; font-weight: 700; }
/* بطاقة الدخول في صفحة الألعاب */
.pt-entry-wrap { margin: 18px 0; }
.pt-entry { width: 100%; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; padding: 14px; border: 0; border-radius: 24px; text-align: start; color: #fff; background: linear-gradient(120deg, #7B2FF7, #F72585 70%, #FF9F1C); box-shadow: 0 12px 28px rgba(123,47,247,.35); cursor: pointer; }
.pt-entry-art { position: relative; width: 76px; height: 76px; }
.pt-entry-art svg { width: 100%; height: 100%; }
.pt-entry-art i { position: absolute; bottom: -4px; inset-inline-end: -6px; font-style: normal; font-size: 1.6rem; animation: bob 2.4s ease-in-out infinite; }
.pt-entry-txt { display: grid; gap: 2px; }
.pt-entry-txt b { font-family: var(--f-display); font-size: 1.35rem; }
.pt-entry-txt span { opacity: .92; }
.pt-entry-go { font-size: 1.4rem; }
.pt-entry:active { transform: scale(.98); }
@media (max-width: 380px) { .pt-tool { width: 52px; } .pt-col { width: 30px; height: 30px; } .pt-entry { grid-template-columns: auto 1fr; } .pt-entry-go { display: none; } }

/* ---------- البوصلة الجديدة ---------- */
.qibla { background: radial-gradient(120% 90% at 50% 10%, #2E2654, #0F0C1E); }
.qb-compass { position: relative; width: min(84vw, 46vh, 340px); aspect-ratio: 1; contain: layout paint; }
.qb-dial { position: absolute; inset: 0; transition: none !important; will-change: transform; transform: translateZ(0); backface-visibility: hidden; }
.qb-glow { position: absolute; inset: -6%; border-radius: 50%; background: radial-gradient(circle, rgba(47,179,110,0) 55%, rgba(47,179,110,.0) 70%); transition: background .4s; pointer-events: none; }
.qibla.aligned .qb-glow { background: radial-gradient(circle, rgba(47,179,110,0) 55%, rgba(47,179,110,.55) 70%, rgba(47,179,110,0) 76%); animation: qb-pulse 1.6s ease-in-out infinite; }
@keyframes qb-pulse { 50% { transform: scale(1.04); opacity: .7; } }
.qb-lubber { position: absolute; top: -12px; left: 50%; width: 26px; transform: translateX(-50%); pointer-events: none; filter: drop-shadow(0 2px 3px rgba(0,0,0,.4)); }
.qb-lubber path { fill: #FFC83D; transition: fill .3s; }
.qibla.aligned .qb-lubber path { fill: #2FB36E; }
.qb-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; pointer-events: none; }
.qb-deg { direction: ltr; unicode-bidi: isolate; font: 800 clamp(1.8rem, 9vw, 2.6rem)/1 var(--f-display); letter-spacing: .5px; text-shadow: 0 2px 8px rgba(0,0,0,.45); font-variant-numeric: tabular-nums; }
.qb-center small { opacity: .75; font-weight: 600; margin-top: 4px; }
.qb-needle { display: none; }
.qb-msg { transition: background .3s; }
.qb-cal { background: rgba(255,200,61,.16); border: 1px solid rgba(255,200,61,.45); border-radius: 14px; padding: 8px 12px; font-size: .9rem; max-width: 340px; }
.qibla.aligned .qb-compass { filter: none; }

/* ---------- حكايات عالمية ---------- */
#secTales { margin-top: 22px; }
.tl-sub { margin: -6px 0 10px; }
.tl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.tl-card { position: relative; display: grid; justify-items: center; gap: 4px; padding: 16px 10px 14px; border: 0; border-radius: 22px; background: var(--paper); color: var(--ink); box-shadow: inset 0 -5px 0 var(--g), var(--shadow); cursor: pointer; text-align: center; }
.tl-card b { font-family: var(--f-display); font-size: 1.05rem; line-height: 1.3; }
.tl-card small { color: var(--muted); font-size: .8rem; }
.tl-e { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; font-size: 2rem; background: color-mix(in srgb, var(--g) 18%, var(--paper)); }
.tl-card.locked { opacity: .7; }
.tl-card .lk { position: absolute; top: 8px; inset-inline-end: 8px; color: var(--muted); }
.tl-card .lk .ic { width: 20px; height: 20px; }
.tl-card:active { transform: scale(.96); }

/* زرار اللغة والوضع في شاشة الدخول كان مغطّى بعنوان التطبيق (مكانش بيستجيب للمس) */
.auth-brand { pointer-events: none; }
.auth-prefs { z-index: 5 !important; }
/* شريط التبويبات: 6 أزرار (ضفنا «تعلّم») */
.tabbar { grid-template-columns: repeat(6, minmax(0, 1fr)) !important; }
.tabbar button { font-size: .68rem; min-width: 0; }
.tabbar button span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
/* زرار المساعد العائم: فوق شريط التبويبات عشان مايغطّيش «للأهل» */
body:has(.tabbar) .hb-fab:not([style*="top"]) { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }

/* ---------- منهج رياض الأطفال (kg-curriculum.js) ---------- */
.kgc-glyph { --c: var(--leaf); display: grid; place-items: center; align-content: center; gap: 6px; min-height: 200px; border-radius: 24px; background: color-mix(in srgb, var(--c) 14%, var(--paper, #fff)); border: 3px solid color-mix(in srgb, var(--c) 35%, transparent); }
.kgc-glyph b { font-size: 96px; line-height: 1.25; color: var(--c); font-weight: 800; }
.kgc-glyph i { font-style: normal; font-size: 44px; line-height: 1; }
.kgc-word { font-size: 1.5em; color: var(--ink); }
.kgc-ask { text-align: center; margin: 8px 0 12px; }
.kgc-pick .an-p { min-height: 96px; }
.kgc-l { font-size: 52px; line-height: 1.2; font-weight: 800; }
.kgc-sum { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; font-size: 34px; line-height: 1.2; padding: 12px; }
.kgc-sum b { font-size: 40px; color: var(--leaf); }
.kgc-glyph { min-width: 180px; padding: 0 24px; }
.aq-art .kgc-glyph { min-height: 120px; }
.aq-art .kgc-glyph b { font-size: 64px; }
