/* Noor. Sections: fonts, tokens, base, nav, world, place, stage, beats, activities, pages, responsive, motion. */

/* ---- Fonts: self-hosted, OFL ---- */
@font-face { font-family: 'Reem Kufi'; src: url(../assets/fonts/reem-kufi-latin-wght-normal.woff2) format('woff2'); font-weight: 400 700; font-display: swap; unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: 'Reem Kufi'; src: url(../assets/fonts/reem-kufi-latin-ext-wght-normal.woff2) format('woff2'); font-weight: 400 700; font-display: swap; unicode-range: U+0100-02FF, U+1E00-1EFF; }
@font-face { font-family: 'Alegreya Sans'; src: url(../assets/fonts/alegreya-sans-latin-400-normal.woff2) format('woff2'); font-weight: 400; font-display: swap; unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: 'Alegreya Sans'; src: url(../assets/fonts/alegreya-sans-latin-ext-400-normal.woff2) format('woff2'); font-weight: 400; font-display: swap; unicode-range: U+0100-02FF, U+1E00-1EFF; }
@font-face { font-family: 'Alegreya Sans'; src: url(../assets/fonts/alegreya-sans-latin-500-normal.woff2) format('woff2'); font-weight: 500; font-display: swap; unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: 'Alegreya Sans'; src: url(../assets/fonts/alegreya-sans-latin-700-normal.woff2) format('woff2'); font-weight: 700; font-display: swap; unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: 'Alegreya Sans'; src: url(../assets/fonts/alegreya-sans-latin-ext-700-normal.woff2) format('woff2'); font-weight: 700; font-display: swap; unicode-range: U+0100-02FF, U+1E00-1EFF; }
@font-face { font-family: 'Amiri'; src: url(../assets/fonts/amiri-arabic-400-normal.woff2) format('woff2'); font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: 'Amiri Quran'; src: url(../assets/fonts/amiri-quran-arabic-400-normal.woff2) format('woff2'); font-display: swap; }

/* ---- Tokens. Lapis, faience turquoise, lamp gold. Each path re-tunes these. ---- */
:root {
  --lapis: #101b4d; --cobalt: #2546c7; --faience: #0e8f85; --lamp: #f6b93b; --pomegranate: #c93a4a; --porcelain: #eef3f6;
  --bg: var(--porcelain); --surface: #fbfdfe; --ink: #121c4e; --muted: #4a5478; --line: #c9d4e4; --accent: var(--cobalt); --on-accent: #fff; --tint: #dfe8f4; --good: #0b7a6e; --goodbg: #d5f0ea; --bad: #a42b3a; --badbg: #fbe3e2;
  --body-size: 1.1875rem; --radius: 10px; --radius-big: 18px; --dark-alpha: .78;
  --display: 'Reem Kufi', 'Amiri', Georgia, serif; --text: 'Alegreya Sans', 'Amiri', system-ui, sans-serif;
  color-scheme: light;
}
[data-mode='kids'] { --bg: #fff3c9; --surface: #fffbea; --ink: #14316e; --muted: #45598c; --line: #f0d98a; --accent: #0a8378; --tint: #ffeaa6; --body-size: 1.375rem; --radius: 20px; --radius-big: 30px; --dark-alpha: .34; }
[data-mode='teens'] { --bg: #0d1644; --surface: #16215f; --ink: #f2f4ff; --muted: #b6c0ea; --line: #34428f; --accent: var(--lamp); --on-accent: #17123f; --tint: #222f7a; --good: #6fe3cf; --goodbg: #114b58; --bad: #ffb3b3; --badbg: #5b2147; --radius: 6px; --radius-big: 10px; --dark-alpha: .88; color-scheme: dark; }

/* ---- Base ---- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 var(--body-size)/1.5 var(--text); }
h1, h2, h3, h4 { font-family: var(--display); font-weight: 600; line-height: 1.15; margin: 0 0 .5em; text-wrap: balance; }
h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); } h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); } h3 { font-size: clamp(1.4rem, 2.5vw, 1.8rem); } h4 { font-size: 1.25rem; }
p { margin: 0 0 .8em; } a { color: inherit; } button, input { font: inherit; color: inherit; }
button { cursor: pointer; } ul, ol { padding: 0; margin: 0; list-style: none; } h1:focus, h2:focus, h3:focus, #app:focus, .niche:focus { outline: none; }
:focus-visible { outline: 3px solid var(--lamp); outline-offset: 3px; border-radius: 4px; }
[data-mode='adults'] :focus-visible, [data-mode='kids'] :focus-visible { outline-color: var(--pomegranate); }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: fixed; top: -80px; left: 12px; z-index: 60; background: var(--surface); padding: 10px 16px; border-radius: 8px; } .skip:focus { top: 10px; }
.ic { display: inline-block; width: 1.25em; height: 1.25em; flex: none; background: currentColor; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; -webkit-mask-size: contain; mask-size: contain; -webkit-mask-position: center; mask-position: center; vertical-align: -.25em; }
.ar { font-family: 'Amiri', serif; }
.fine { font-size: .875em; color: var(--muted); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5em; min-height: 48px; padding: .55em 1.15em; border: 2px solid var(--accent); border-radius: var(--radius); background: var(--accent); color: var(--on-accent); font-weight: 700; text-decoration: none; transition: transform .12s; }
.btn:active { transform: scale(.97); } .btn[aria-disabled='true'] { opacity: .55; }
.btn-quiet { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost { background: rgb(10 16 60 / .55); border-color: rgb(255 255 255 / .35); color: #fff; }
.btn-small { min-height: 42px; padding: .3em .85em; font-size: .9em; } .btn-big { min-height: 58px; font-size: 1.1em; padding: .55em 1.4em; }
.icon-btn { display: inline-grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; border: 0; background: rgb(10 16 60 / .55); color: #fff; text-decoration: none; }
.chip { min-height: 44px; padding: .3em .9em; border: 2px solid var(--line); border-radius: 999px; background: var(--surface); text-align: left; }
.chip[aria-pressed='true'] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.scene-wrap { position: absolute; inset: 0; overflow: hidden; } .scene { width: 100%; height: 100%; display: block; }
.foot { display: flex; flex-wrap: wrap; gap: 8px 24px; padding: 20px 24px 90px; color: var(--muted); font-size: .9em; max-width: 1100px; margin: auto; }
body[data-view='world'] .foot, body[data-view='lesson'] .foot { display: none; }

/* ---- Navigation ---- */
#nav { position: fixed; z-index: 30; inset: 0 0 auto 0; display: flex; align-items: center; gap: 16px; padding: 10px 18px; background: var(--lapis); color: #fff; }
.brand { display: inline-flex; align-items: center; gap: 8px; font: 700 1.6rem/1 var(--display); text-decoration: none; color: var(--lamp); }
.nav-links { display: flex; gap: 4px; margin: 0 auto; } .nav-links a { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 8px; text-decoration: none; font-weight: 500; }
.nav-links a[aria-current] { background: rgb(255 255 255 / .16); } .lamp-n { font-style: normal; color: var(--lamp); font-weight: 700; }
.nav-path { position: relative; } .path-menu { position: absolute; right: 0; top: calc(100% + 8px); width: min(320px, 90vw); padding: 10px; background: var(--surface); color: var(--ink); border-radius: var(--radius-big); box-shadow: 0 16px 40px rgb(5 10 40 / .4); }
.paths { display: grid; gap: 8px; } .path { display: grid; grid-template-columns: auto 1fr; column-gap: 12px; align-items: center; text-align: left; padding: 12px; border: 2px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); }
.path .ic { grid-row: span 2; width: 34px; height: 34px; color: var(--accent); } .path small { color: var(--muted); } .path[aria-pressed='true'] { border-color: var(--accent); background: var(--tint); }
body:not([data-view='lesson']):not([data-view='world']) #app { padding-top: 70px; }

/* ---- World: the garden, darkened, with light growing from each finished lesson ---- */
.world { position: relative; height: 100dvh; overflow: hidden; background: var(--lapis); }
.world-pan { position: absolute; inset: 0; overflow: auto; scrollbar-width: none; } .world-pan::-webkit-scrollbar { display: none; }
.world-stage { position: relative; } .world-stage img { display: block; width: 100%; height: 100%; object-fit: cover; user-select: none; }
.world-dark { position: absolute; inset: 0; background: rgb(9 14 58 / var(--dark-alpha)); pointer-events: none; }
.pin { position: absolute; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 6px; text-decoration: none; color: #fff; text-align: center; width: 190px; }
.pin-lamp { display: grid; place-items: center; width: 58px; height: 58px; border-radius: 50%; background: var(--lapis); color: var(--lamp); border: 2px solid var(--lamp); box-shadow: 0 0 26px 6px rgb(246 185 59 / .45); transition: transform .15s; font-size: 1.3rem; }
.pin:hover .pin-lamp, .pin:focus-visible .pin-lamp { transform: scale(1.12); } .pin-lit .pin-lamp { background: var(--lamp); color: var(--lapis); box-shadow: 0 0 44px 14px rgb(246 185 59 / .7); }
.pin-label { background: rgb(10 16 60 / .82); padding: 6px 12px; border-radius: 10px; line-height: 1.2; } .pin-label b { display: block; font: 600 1.05rem var(--display); } .pin-label small { display: block; font-size: .78rem; color: #dbe2ff; } .pin-count { color: var(--lamp) !important; margin-top: 2px; }
.world-copy { position: absolute; left: clamp(16px, 4vw, 56px); bottom: clamp(20px, 5vh, 56px); max-width: 480px; color: #fff; padding: 22px 24px; background: rgb(10 16 60 / .84); border-radius: var(--radius-big); }
.world-copy h1 { font-size: clamp(1.8rem, 3.4vw, 2.8rem); } .world-copy .btn { background: var(--lamp); color: var(--lapis); border-color: var(--lamp); } .world-count { margin: .7em 0 0; color: var(--lamp); font-weight: 700; }
.first-run { position: absolute; z-index: 5; right: clamp(16px, 4vw, 56px); bottom: clamp(20px, 5vh, 56px); width: min(400px, calc(100% - 32px)); padding: 20px; background: var(--surface); color: var(--ink); border-radius: var(--radius-big); box-shadow: 0 16px 50px rgb(5 10 40 / .5); }
.first-run h2 { font-size: 1.6rem; } .first-run p { font-size: .95em; color: var(--muted); }
body[data-view='world'] #app { padding-top: 0; }

/* ---- Place ---- */
.place-hero { position: relative; min-height: 62vh; display: flex; align-items: flex-end; padding: 90px clamp(16px, 5vw, 64px) 36px; color: #fff; }
.place-title { position: relative; max-width: 640px; background: rgb(10 16 60 / .72); padding: 22px 26px; border-radius: var(--radius-big); }
.place-icon { width: 46px; height: 46px; color: var(--lamp); margin-bottom: 8px; } .ar-name { font: 1.7rem 'Amiri', serif; color: var(--lamp); margin: 0 0 .3em; text-align: left; } .fine-light { color: #dbe2ff; font-size: .9em; }
.place-title .term { color: #fff; } .place-title .btn { background: var(--lamp); border-color: var(--lamp); color: var(--lapis); }
.trail-path { position: relative; max-width: 920px; margin: 36px auto; padding: 0 16px; }
.trail-path::before { content: ''; position: absolute; left: 50%; top: 10px; bottom: 10px; border-left: 3px dashed var(--line); }
.trail-path li { position: relative; width: 50%; padding: 12px 40px; } .trail-path li.right { margin-left: 50%; }
.trail-path a { display: flex; gap: 14px; align-items: flex-start; text-decoration: none; }
.stop-lamp { flex: none; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: var(--surface); border: 2px solid var(--line); color: var(--accent); font-size: 1.15rem; position: relative; z-index: 1; }
.trail-path li.left a { flex-direction: row-reverse; text-align: right; } .trail-path li.left .stop-lamp { margin-right: -66px; } .trail-path li.right .stop-lamp { margin-left: -66px; }
.trail-path li.done .stop-lamp { background: var(--lamp); border-color: var(--lamp); color: var(--lapis); box-shadow: 0 0 22px 4px rgb(246 185 59 / .5); }
.stop-text b { display: block; font: 600 1.3rem/1.2 var(--display); } .stop-text span { display: block; color: var(--muted); } .stop-text small { color: var(--muted); }
.trail-path a:hover b { text-decoration: underline; text-underline-offset: 3px; }
.planned { max-width: 720px; margin: 28px auto; padding: 20px 24px; border: 2px dashed var(--line); border-radius: var(--radius-big); } .planned ul { list-style: disc; padding-left: 1.2em; }
.back-garden { text-align: center; padding: 10px 0 40px; }

/* ---- Stage: the lesson journey ---- */
.stage { position: relative; min-height: 100dvh; display: grid; grid-template-columns: 1fr minmax(0, 700px) 1fr; grid-template-rows: auto 1fr; color: var(--ink); overflow: hidden; }
.stage-bar { grid-column: 1 / -1; position: relative; z-index: 3; display: flex; align-items: center; gap: 14px; padding: 12px 16px; }
.beads { flex: 1; display: flex; gap: 5px; max-width: 520px; margin: auto; } .beads li { flex: 1; height: 7px; border-radius: 4px; background: rgb(255 255 255 / .3); } .beads li.on { background: var(--lamp); box-shadow: 0 0 8px rgb(246 185 59 / .8); }
.stage-title { display: none; }
.niche-wrap { grid-column: 2; position: relative; z-index: 2; display: flex; flex-direction: column; min-height: 0; height: calc(100dvh - 72px); padding: 0 12px; }
.arch-top { display: block; width: 100%; height: 44px; flex: none; margin-bottom: -1px; } .arch-top path { fill: var(--surface); }
.niche { flex: 1; min-height: 0; overflow-y: auto; background: var(--surface); padding: 6px clamp(18px, 4vw, 44px) 20px; }
.stage-nav { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--surface); padding: 12px clamp(14px, 3vw, 30px) 16px; border-top: 1px solid var(--line); }
.step-count { color: var(--muted); font-size: .9em; }
.open-step { text-align: center; padding: 6vh 0 0; } .open-icon { width: 70px; height: 70px; color: var(--accent); margin-bottom: 10px; } .lede { font-size: 1.2em; }
.gate { position: relative; min-height: 100dvh; display: grid; place-items: center; padding: 16px; } .gate-card { position: relative; max-width: 520px; background: var(--surface); border-radius: var(--radius-big); padding: 28px; }

/* ---- Beats: source, translation and editorial stay visibly distinct ---- */
.src-block { border-right: 5px solid var(--lamp); background: var(--tint); padding: 14px 18px; border-radius: var(--radius); margin: 0 0 12px; }
.src-en { border-right: 0; border-left: 5px solid var(--faience); background: transparent; }
.our-block { border-left: 5px dotted var(--accent); padding: 4px 0 4px 16px; margin: 0 0 12px; }
.src-tag, .our-tag { display: block; font-size: .85em; font-weight: 700; color: var(--muted); margin-bottom: 6px; }
.ayah { font: 2rem/2.2 'Amiri Quran', 'Amiri', serif; text-align: right; margin: 0 0 8px; } .ayah-n { font-size: .7em; color: var(--accent); }
.hadith-ar { font: 1.5rem/1.9 'Amiri', serif; text-align: right; margin: 0; }
.src-link { display: inline-flex; gap: 4px; align-items: center; font-size: .95em; color: var(--accent); text-underline-offset: 3px; }
[data-mode='adults'] .our-block { background: none; }
.beat-differ { border: 2px solid var(--accent); border-radius: var(--radius); padding: 14px 18px; } .beat-differ h3 { font-size: 1.3rem; } .beat-think { background: var(--tint); padding: 14px 18px; border-radius: var(--radius); }
.term { padding: 0; border: 0; background: none; color: inherit; font-weight: 500; text-decoration: underline dotted 2px; text-decoration-color: var(--accent); text-underline-offset: 3px; }
.term-card { position: fixed; z-index: 50; left: 50%; transform: translateX(-50%); bottom: 90px; width: min(460px, calc(100% - 24px)); padding: 14px 44px 8px 18px; background: var(--lapis); color: #fff; border-radius: var(--radius-big); box-shadow: 0 16px 40px rgb(5 10 40 / .45); }
.term-head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; } .term-head strong { font: 600 1.25rem var(--display); color: var(--lamp); } .term-head .ar { font-size: 1.4rem; }
.term-close { position: absolute; top: 6px; right: 6px; width: 40px; height: 40px; border: 0; background: none; color: #fff; }
.drawer { position: absolute; z-index: 6; top: 0; right: 0; bottom: 0; width: min(380px, 100%); background: var(--surface); color: var(--ink); padding: 18px 22px; overflow: auto; box-shadow: -10px 0 40px rgb(5 10 40 / .4); }
.drawer-head { display: flex; justify-content: space-between; align-items: center; } .drawer-head .icon-btn { background: var(--tint); color: var(--ink); } .drawer li { padding: 7px 0; border-bottom: 1px solid var(--line); }
.done-step { text-align: center; padding-top: 3vh; } .done-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 14px; }
.lamp-lit { position: relative; width: 96px; height: 120px; margin: 0 auto 10px; background: var(--lamp); clip-path: polygon(50% 0, 72% 16%, 86% 46%, 72% 82%, 58% 100%, 42% 100%, 28% 82%, 14% 46%, 28% 16%); } .flame { position: absolute; left: 33px; top: 38px; width: 30px; height: 44px; background: #fff; border-radius: 50% 50% 46% 46%; }
.fresh .lamp-lit { animation: ignite 1.2s ease-out both; }

/* ---- Activities ---- */
.act-status { min-height: 2.6em; margin: 12px 0 0; padding: 8px 12px; border-radius: var(--radius); background: var(--tint); font-size: .95em; }
.opt { display: block; width: 100%; min-height: 50px; text-align: left; margin-bottom: 8px; padding: .55em .9em; border: 2px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); }
.opt:hover { border-color: var(--accent); } .opt.best { background: var(--goodbg); border-color: var(--good); } .opt.rethink { background: var(--badbg); border-color: var(--bad); }
.nudge { animation: nudge .3s; } .nudge-svg { animation: nudgeY .3s; } .arrive { animation: arrive .25s; } .land { animation: land .3s; }
.sort-card { position: relative; padding: 22px 18px 16px; border-radius: var(--radius); background: var(--accent); color: var(--on-accent); text-align: center; font-size: 1.15em; font-weight: 500; margin-bottom: 12px; } .sort-card p { margin: 0; } .sort-left { position: absolute; top: 4px; right: 10px; font-size: .7em; opacity: .85; }
.sort-bins { display: grid; grid-template-columns: repeat(var(--n), 1fr); gap: 8px; } .sort-bin { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 6px; min-height: 96px; border: 2px dashed var(--line); border-radius: var(--radius); background: var(--tint); color: var(--ink); } .sort-bin .ic { width: 28px; height: 28px; color: var(--accent); } .sort-bin small { color: var(--muted); } .sort-count { position: absolute; top: 4px; right: 8px; font-weight: 700; color: var(--good); }
.sort-water .sort-card { background: var(--faience); color: #fff; }
.order-track { display: grid; gap: 6px; margin-bottom: 12px; counter-reset: s; } .order-track li { display: flex; gap: 10px; align-items: center; min-height: 40px; padding: 4px 10px; border: 2px dashed var(--line); border-radius: var(--radius); }
.order-track li.filled { border-style: solid; border-color: var(--good); background: var(--goodbg); animation: arrive .25s; } .order-num { flex: none; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: var(--tint); font-weight: 700; } .order-text small { display: block; color: var(--muted); }
.order-pool { display: flex; flex-wrap: wrap; gap: 8px; } .order-water .order-track { background: linear-gradient(to top, rgb(14 143 133 / .28) calc(var(--fill, 0) * 100%), transparent 0); border-radius: var(--radius); padding: 6px; transition: background .3s; }
.order-chain .order-track li + li { position: relative; } .order-chain .order-track li.filled + li.filled::before { content: ''; position: absolute; left: 22px; top: -9px; height: 10px; border-left: 3px solid var(--good); }
.pillars svg { width: 100%; max-height: 220px; display: block; } .roof, .beam, .base { fill: var(--accent); } .pillar rect { fill: var(--tint); stroke: var(--line); stroke-dasharray: 4 4; } .pillar text { font: 700 13px var(--text); fill: var(--on-accent); }
.pillar.up rect { fill: var(--accent); stroke: none; animation: rise .4s both; transform-box: fill-box; transform-origin: bottom; } .pillar-q { font-weight: 500; min-height: 3em; margin-top: 8px; } .pillar-opts { display: flex; flex-wrap: wrap; gap: 8px; }
.settle { text-align: center; } .settle-stage { position: relative; width: 170px; height: 170px; margin: 0 auto 6px; } .settle-ring { position: absolute; inset: 0; transform: rotate(-90deg); } .settle-ring circle { fill: none; stroke: var(--tint); stroke-width: 7; } .settle-ring .ring-fill { stroke: var(--lamp); stroke-dasharray: 100; stroke-dashoffset: 100; }
.filling .ring-fill { transition: stroke-dashoffset var(--ms, 2s) linear; stroke-dashoffset: 0; } .settle-figure { position: absolute; inset: 26px; } .figure { fill: var(--accent); stroke: var(--accent); stroke-width: 9; stroke-linecap: round; stroke-linejoin: round; } .figure path { fill: none; } .settle-dots { display: flex; justify-content: center; gap: 6px; margin-top: 10px; } .settle-dots i { width: 12px; height: 12px; border-radius: 50%; background: var(--tint); } .settle-dots i.on { background: var(--lamp); }
.dial-sky { position: relative; border-radius: var(--radius); overflow: hidden; background: #0b1547; transition: background .3s; } .dial-sky svg { display: block; width: 100%; } .dial-arc { fill: none; stroke: rgb(255 255 255 / .4); stroke-dasharray: 5 6; } .dial-land { fill: #0e1b4f; } .dial-sun { fill: #ffd95e; } .dial-time { position: absolute; left: 12px; top: 8px; color: #fff; font-weight: 700; text-shadow: 0 1px 4px #0008; }
.dial input { width: 100%; height: 44px; accent-color: var(--accent); } .dial-task { font-weight: 500; min-height: 2.6em; }
.jar-coin { display: flex; gap: 12px; align-items: center; padding: 10px; border-radius: var(--radius); background: var(--tint); margin-bottom: 10px; } .jar-coin p { margin: 0; font-weight: 500; } .coin { flex: none; width: 44px; height: 44px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #ffe59a, var(--lamp)); border: 3px solid #c98a1a; } .spin { animation: coinspin .4s; }
.jar-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; } .jar { position: relative; overflow: hidden; min-height: 92px; padding: 8px 4px; border: 2px solid var(--line); border-radius: 12px 12px 22px 22px; background: var(--surface); color: var(--ink); font-size: .85em; } .jar b { position: relative; font-weight: 500; } .jar-fill { position: absolute; left: 0; right: 0; bottom: 0; height: 0; background: var(--lamp); transition: height .35s; } .jar.full .jar-fill { height: 100%; } .jar.full { border-color: var(--lamp); color: #101b4d; opacity: 1; }
.route svg { display: block; width: 100%; border-radius: var(--radius); } .route-land { fill: #e8c98f; } [data-mode='teens'] .route-land { fill: #2a3580; } .route-line { fill: none; stroke: var(--pomegranate); stroke-width: 4; stroke-dasharray: 8 6; } [data-mode='teens'] .route-line { stroke: var(--lamp); }
.stop { cursor: pointer; outline: none; } .stop-hit { fill: transparent; } .stop-dot { fill: var(--surface); stroke: var(--accent); stroke-width: 3; } .stop text { font: 700 15px var(--text); fill: #101b4d; paint-order: stroke; stroke: #fff6; stroke-width: 3px; } [data-mode='teens'] .stop text { fill: #fff; stroke: #0006; } .stop:focus-visible .stop-dot { stroke: var(--pomegranate); stroke-width: 5; } .stop.done .stop-dot { fill: var(--lamp); }
.route-note { margin-top: 10px; min-height: 5em; } .route-note h4 { margin-bottom: .2em; }
.verdict-card { padding: 18px; border-radius: var(--radius); background: var(--tint); text-align: center; font-weight: 500; min-height: 92px; display: grid; place-items: center; margin-bottom: 10px; } .verdict-card p { margin: 0; } .verdict-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ark { display: block; width: min(300px, 100%); margin: 0 auto 8px; } .ark-hull { fill: #7a4a24; } .plank { fill: var(--tint); stroke: var(--line); stroke-dasharray: 3 3; } .plank.on { fill: #b77a3e; stroke: none; animation: arrive .3s; }
.scen-grow { display: flex; gap: 8px; justify-content: center; min-height: 40px; margin-bottom: 6px; } .sprout { font-size: 1.5rem; color: var(--line); } .sprout.on { color: var(--good); animation: land .35s; } .scen-q { font-weight: 500; font-size: 1.1em; }
.reveal-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; margin-bottom: 10px; } .reveal-item { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 8px; min-height: 92px; border: 2px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); } .reveal-item .ic { width: 30px; height: 30px; color: var(--muted); } .reveal-item b { font-weight: 500; } .reveal-item.lit { background: var(--tint); border-color: var(--lamp); } .reveal-item.lit .ic { color: var(--lamp); filter: drop-shadow(0 0 6px var(--lamp)); }
.reveal-note { min-height: 5em; padding: 12px 16px; border-radius: var(--radius); border-left: 5px dotted var(--accent); } .reveal-note p { margin: 0; } .reveal-dialogue .reveal-grid { grid-template-columns: 1fr; } .reveal-dialogue .reveal-item { flex-direction: row; min-height: 50px; text-align: left; }
.ns-stage { position: relative; height: 200px; overflow: hidden; border-radius: var(--radius); background: linear-gradient(#071238, #1b2a7a); transition: background .9s; } .nightsky[data-kind='sun'].risen .ns-stage { background: linear-gradient(#2a7fd0, #ffd9a0); } .ns-land { position: absolute; inset: auto 0 0; height: 36px; background: #0a1035; }
.ns-body { position: absolute; left: 50%; top: 210px; transform: translateX(-50%); width: 18px; height: 18px; border-radius: 50%; background: #fff6d8; box-shadow: 0 0 16px 5px #fff6d8aa; transition: top 1s ease-in-out; } .nightsky[data-kind='moon'] .ns-body { width: 56px; height: 56px; background: #ffefc0; } .nightsky[data-kind='sun'] .ns-body { width: 76px; height: 76px; background: #ffd95e; box-shadow: 0 0 50px 16px #ffd95eaa; } .nightsky.risen .ns-body { top: 44px; } .ns-note { min-height: 3em; margin-top: 10px; font-weight: 500; }
.wordx-line { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 10px; padding: 14px 8px; border-radius: var(--radius); background: var(--tint); } .word { font: 1.9rem/2 'Amiri Quran', 'Amiri', serif; border: 0; border-bottom: 3px solid transparent; background: none; color: var(--ink); padding: 0 4px; } .word.seen { border-color: var(--lamp); } .word.on { color: var(--accent); }
.wordx-dark .wordx-line { background: color-mix(in srgb, #071238 calc((1 - var(--lit)) * 100%), #ffe9a8); transition: background .4s; } .wordx-dark .word { color: color-mix(in srgb, #fff calc((1 - var(--lit)) * 100%), #101b4d); }
.wordx-mean { min-height: 2.8em; padding: 8px 2px 0; } .wordx-mean p { margin: 0; } .wordx-tools { margin: 6px 0; } .wordx-en { color: var(--muted); font-size: .92em; } .wordx-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; } .wordx-tabs .chip { min-height: 40px; }
.night-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; } .night { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px; border: 2px solid var(--line); border-radius: var(--radius); background: #101b4d; color: #fff; font-weight: 700; } .night-moon { width: 26px; height: 26px; border-radius: 50%; box-shadow: inset 7px -3px 0 0 #6a78b8; } .night.lit { border-color: var(--lamp); } .night.lit .night-moon { box-shadow: inset 7px -3px 0 0 var(--lamp), 0 0 12px var(--lamp); }

/* ---- Pages ---- */
.page { max-width: 900px; margin: auto; padding: 26px 18px; } .page-lede { font-size: 1.15em; color: var(--muted); } .prose { max-width: 680px; }
.search { display: flex; align-items: center; gap: 8px; padding: 0 12px; border: 2px solid var(--line); border-radius: var(--radius); background: var(--surface); } .search input { flex: 1; min-width: 0; min-height: 46px; border: 0; background: none; outline: none; }
.search:focus-within { border-color: var(--accent); } .lib-tools { display: grid; gap: 12px; } .lib-filters { display: flex; flex-wrap: wrap; gap: 6px; } .lib-count { color: var(--muted); margin: 12px 0 4px; }
.lib-list li { border-bottom: 1px solid var(--line); } .lib-list a { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 11px 4px; text-decoration: none; } .lib-list b { font: 600 1.2rem/1.2 var(--display); } .lib-list span:last-child { color: var(--muted); font-size: .9em; } .lib-list .ic { color: var(--accent); }
.lib-h2 { margin-top: 1.6em; } .lib-planned { columns: 2; list-style: disc; padding-left: 1.2em; color: var(--muted); }
.glossary > div { padding: 10px 0; border-bottom: 1px solid var(--line); } .glossary dt { font: 600 1.25rem var(--display); display: flex; justify-content: space-between; gap: 12px; } .glossary dd { margin: 0; color: var(--muted); }
.rules { padding: 16px 20px; background: var(--tint); border-radius: var(--radius-big); margin-bottom: 20px; } .rules dt { font-weight: 700; } .rules dd { margin: 0 0 8px; } .src-all li { display: grid; grid-template-columns: minmax(150px, 220px) 1fr; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); } .src-all span { color: var(--muted); font-size: .92em; }
.lamp-wall { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; } .lamp-wall h2 { font-size: 1.3rem; } .lamp-wall h2 a { text-decoration: none; } .lamp-wall ul { display: flex; flex-wrap: wrap; gap: 6px; } .lamp-wall li a { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--tint); color: var(--muted); } .lamp-wall li.on a { background: var(--lamp); color: var(--lapis); box-shadow: 0 0 14px 2px rgb(246 185 59 / .55); } .reset-row { margin-top: 20px; }
.room { display: grid; grid-template-columns: 320px 1fr; gap: 26px; max-width: 1180px; margin: auto; padding: 22px 18px; } .surah-list { display: grid; gap: 6px; margin-bottom: 12px; } .surah { display: grid; grid-template-columns: 34px 1fr auto; gap: 8px; align-items: center; padding: 8px 10px; border: 2px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); text-align: left; } .surah[aria-pressed='true'] { border-color: var(--accent); background: var(--tint); } .surah-n { color: var(--muted); }
.room-tools { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; } .check { display: inline-flex; gap: 6px; align-items: center; } .check input { width: 20px; height: 20px; accent-color: var(--accent); } .basmalah { font: 1.8rem/2 'Amiri Quran', 'Amiri', serif; text-align: center; margin: 12px 0 0; }
.ayah-row { display: grid; grid-template-columns: auto 1fr; gap: 12px; padding: 12px 8px; border-bottom: 1px solid var(--line); border-radius: var(--radius); } .ayah-row .icon-btn { background: var(--tint); color: var(--ink); } .ayah-row.playing { background: var(--tint); box-shadow: inset 4px 0 0 var(--lamp); } .ayah-en { color: var(--muted); } .no-en .ayah-en { display: none; }

/* ---- Responsive ---- */
@media (max-width: 860px) {
  #nav { padding: 8px 12px; justify-content: space-between; }
  .nav-links { position: fixed; inset: auto 0 0 0; margin: 0; padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); justify-content: space-around; background: var(--lapis); z-index: 31; }
  .nav-links a { flex-direction: column; gap: 0; padding: 5px 6px; font-size: .75rem; min-width: 58px; text-align: center; }
  .nav-links .ic { font-size: 1.3rem; } .lamp-n { display: none; }
  .world { height: calc(100dvh - 60px); }
  .world-copy { left: 10px; right: 10px; bottom: 10px; max-width: none; padding: 12px 16px; } .world-copy h1 { font-size: 1.45rem; } .world-copy p:not(.world-count) { display: none; } .world-count { font-size: .9em; }
  .first-run { left: 10px; right: 10px; bottom: 10px; width: auto; } .pin { width: 150px; } .pin-label small:not(.pin-count) { display: none; }
  .place-hero { min-height: 52vh; padding-top: 76px; } .trail-path::before { left: 42px; } .trail-path li, .trail-path li.right { width: 100%; margin: 0; padding: 10px 0 10px 0; } .trail-path li.left a { flex-direction: row; text-align: left; } .trail-path li.left .stop-lamp, .trail-path li.right .stop-lamp { margin: 0 0 0 0; }
  .room { grid-template-columns: 1fr; } .surah-list { grid-auto-flow: column; grid-auto-columns: 190px; overflow-x: auto; padding-bottom: 6px; } .lib-planned { columns: 1; } .foot { padding-bottom: 84px; }
}
@media (max-width: 560px) {
  :root { --body-size: 1.0625rem; } [data-mode='kids'] { --body-size: 1.25rem; }
  .niche-wrap { padding: 0; } .arch-top { height: 26px; } .btn-ghost { padding: .3em .6em; } .stage-bar { padding: 8px; gap: 8px; }
  .jar-row { grid-template-columns: repeat(2, 1fr); } .jar { min-height: 66px; } .sort-bins { grid-template-columns: 1fr; } .sort-bin { flex-direction: row; min-height: 54px; justify-content: flex-start; gap: 10px; padding: 8px 12px; text-align: left; } .sort-bin small { margin-left: auto; padding-right: 22px; }
  .verdict-btns { grid-template-columns: 1fr; } .ayah { font-size: 1.65rem; line-height: 2.1; } .word { font-size: 1.6rem; } .src-all li { grid-template-columns: 1fr; gap: 0; } .lib-list a { grid-template-columns: auto 1fr; } .lib-list span:last-child { grid-column: 2; }
  .step-count { display: none; } .stage-nav .btn { flex: 1; }
}

/* ---- Motion. Only responses to the learner, plus quiet scene life. ---- */
.twinkle { animation: twinkle 4s ease-in-out infinite; } .sway { animation: sway 7s ease-in-out infinite; } .drift { animation: drift 16s linear infinite; } .flicker { animation: flicker 1.6s ease-in-out infinite; transform-origin: 1120px 650px; }
@keyframes twinkle { 50% { opacity: .2; } } @keyframes sway { 50% { transform: rotate(1.2deg); } 0%, 100% { transform: rotate(-1.2deg); } } @keyframes drift { to { transform: translateX(-200px); } } @keyframes flicker { 50% { transform: scale(1.05, .94); } }
@keyframes nudge { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } } @keyframes nudgeY { 50% { opacity: .5; } } @keyframes arrive { from { opacity: 0; transform: translateY(6px); } } @keyframes land { 40% { transform: scale(1.06); } } @keyframes rise { from { transform: scaleY(0); } } @keyframes coinspin { from { transform: rotateY(180deg); } } @keyframes ignite { from { filter: brightness(.3) drop-shadow(0 0 0 var(--lamp)); } to { filter: brightness(1) drop-shadow(0 0 22px var(--lamp)); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* ---- Review fixes ---- */
.niche { display: flex; flex-direction: column; padding-top: 18px; }
.niche > * { margin-block: auto; flex: none; width: 100%; }
.world-copy { left: 0; right: 0; bottom: 0; max-width: none; border-radius: 0; display: grid; grid-template-columns: 1fr auto; gap: 2px 28px; align-items: center; padding: 14px clamp(16px, 4vw, 56px); }
.world-copy h1 { font-size: clamp(1.5rem, 2.6vw, 2.2rem); margin: 0; grid-column: 1; } .world-copy p { margin: 0; grid-column: 1; }
.world-copy .btn { grid-column: 2; grid-row: 1 / span 2; } .world-copy .world-count { grid-column: 2; grid-row: 3; text-align: center; margin: 2px 0 0; font-size: .9em; }
.first-run { bottom: 118px; }
@media (max-width: 860px) {
  .world-copy { grid-template-columns: 1fr; padding: 10px 14px; } .world-copy .btn, .world-copy .world-count { grid-column: 1; grid-row: auto; } .world-copy .btn { min-height: 48px; margin-top: 6px; }
  .first-run { bottom: 10px; }
}
h1, h2, h3, h4, b, strong { font-synthesis-weight: none; }
.route svg { max-height: 42vh; background: #e8c98f; } [data-mode='teens'] .route svg { background: #2a3580; }
.pillars svg { max-height: 26vh; }
.swipe-hint { display: none; }
@media (max-width: 860px) { .swipe-hint { display: inline-flex; gap: 6px; align-items: center; position: absolute; top: 72px; left: 50%; transform: translateX(-50%); padding: 4px 12px; border-radius: 999px; background: rgb(10 16 60 / .82); color: #fff; font-size: .85rem; white-space: nowrap; pointer-events: none; } }
.room > * { min-width: 0; } .act-status:empty { display: none; }
.ayah-long { font-size: 1.45rem; line-height: 2; }
@media (max-width: 560px) { .stop text { font-size: 24px; } .ayah-long { font-size: 1.25rem; line-height: 1.95; } .room-tools { gap: 8px 12px; } }
