/* 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; } }

/* ==== Painted rooms (29 Nov 2026). Every page is a corner of the same garden. ====
   --ground: the patterned floor pages sit on. --veil: the colour of the light over the painting. */
:root { --ground: #0f1a4a; --ground-ink: #f4f1e8; --ground-muted: #c3cbec; --veil: 9 14 58; --gold-deep: #9a6a0c;
  --tiles: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Cg fill='none' stroke='%23f6b93b' stroke-opacity='.13' stroke-width='1.2'%3E%3Cpath d='M40 18 62 40 40 62 18 40Z M24.4 24.4h31.2v31.2H24.4Z M0 0l24.4 24.4M80 0 55.6 24.4M0 80l24.4-24.4M80 80 55.6 55.6M40 0v18M40 62v18M0 40h18M62 40h18'/%3E%3C/g%3E%3C/svg%3E"); }
[data-mode='kids'] { --ground: #fff1c2; --ground-ink: #14316e; --ground-muted: #4d5f8e; --veil: 255 226 160; --dark-alpha: .3;
  --tiles: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Cg fill='none' stroke='%23d08a12' stroke-opacity='.2' stroke-width='1.4'%3E%3Cpath d='M40 18 62 40 40 62 18 40Z M24.4 24.4h31.2v31.2H24.4Z M0 0l24.4 24.4M80 0 55.6 24.4M0 80l24.4-24.4M80 80 55.6 55.6M40 0v18M40 62v18M0 40h18M62 40h18'/%3E%3C/g%3E%3C/svg%3E"); }
[data-mode='teens'] { --ground: #080f33; --ground-ink: #f2f4ff; --ground-muted: #aab5e6; --veil: 4 8 36; }
body:not([data-view='world']):not([data-view='lesson']) { background: var(--ground) var(--tiles); }
.foot { color: var(--ground-muted); } .foot a { color: var(--ground-ink); }

/* Brand: the eight-point star holding a lit arch */
.brand { gap: 10px; color: #fff; } .brand .mark { width: 38px; height: 38px; filter: drop-shadow(0 0 8px rgb(246 185 59 / .45)); }
.brand-word { font: 600 1.55rem/1 var(--display); letter-spacing: .01em; } .brand-ar { font: 1.25rem/1 'Amiri', serif; color: var(--lamp); margin-top: 4px; }

/* Painted backdrop */
.backdrop { position: absolute; inset: 0; overflow: hidden; background: var(--lapis); z-index: 0; }
.backdrop img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: var(--bx) var(--by); transform: scale(var(--bz)); transform-origin: var(--bx) var(--by); filter: blur(1.2px) saturate(1.12); will-change: transform; animation: breathe 38s ease-in-out infinite alternate; }
.backdrop::after { content: ''; position: absolute; inset: 0; z-index: 1; background: radial-gradient(ellipse 80% 70% at 50% 42%, transparent 35%, rgb(var(--veil) / .55) 100%), linear-gradient(rgb(var(--veil) / calc(var(--dark-alpha) * .55)), rgb(var(--veil) / var(--dark-alpha)) 85%); }
.backdrop-light { position: absolute; inset: 0; z-index: 2; background: radial-gradient(circle at 50% 92%, rgb(246 185 59 / .28), transparent 50%); }
.mote { position: absolute; z-index: 3; bottom: -10px; width: 5px; height: 5px; border-radius: 50%; background: #ffe4a0; box-shadow: 0 0 10px 3px rgb(246 185 59 / .7); opacity: 0; animation: rise-mote 12s linear infinite; }
.mote:nth-of-type(1) { left: 12%; } .mote:nth-of-type(2) { left: 27%; animation-delay: 3s; animation-duration: 15s; } .mote:nth-of-type(3) { left: 41%; animation-delay: 7s; } .mote:nth-of-type(4) { left: 58%; animation-delay: 1.5s; animation-duration: 14s; } .mote:nth-of-type(5) { left: 71%; animation-delay: 5s; } .mote:nth-of-type(6) { left: 84%; animation-delay: 9s; animation-duration: 16s; } .mote:nth-of-type(7) { left: 93%; animation-delay: 4s; }
[data-mode='kids'] .mote { display: none; }
@keyframes breathe { to { transform: scale(calc(var(--bz) * 1.05)) translate(-.8%, -.6%); } }
@keyframes rise-mote { 10% { opacity: .9; } 80% { opacity: .6; } to { opacity: 0; transform: translate(26px, -70vh); } }
.backdrop-fixed { position: fixed; }

/* Room hero: the painted header every page shares */
.room-hero { position: relative; min-height: clamp(320px, 48vh, 480px); display: flex; align-items: flex-end; padding: 96px clamp(16px, 5vw, 64px) 34px; color: #fff; }
.room-hero-copy, .place-title { position: relative; z-index: 4; max-width: 700px; padding: 22px 28px; border-radius: var(--radius-big); background: rgb(10 16 60 / .74); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); box-shadow: 0 20px 50px rgb(3 6 30 / .45); border: 1px solid rgb(246 185 59 / .28); }
.room-hero h1 { margin: 0 0 .2em; color: #fff; } .room-hero .page-lede { color: #dbe2ff; margin: 0; }
.hero-ar { font: 1.7rem/1.3 'Amiri', serif; color: var(--lamp); margin: 0 0 .1em; text-align: left; }
.search-hero { margin-top: 16px; background: #fff; color: #121c4e; border-color: transparent; } .search-hero .ic { color: var(--cobalt); }
.ground { position: relative; color: var(--ground-ink); padding: 26px clamp(16px, 4vw, 48px) 56px; } .ground > * { max-width: 1120px; margin-inline: auto; }
.panel { background: var(--surface); color: var(--ink); border-radius: var(--radius-big); padding: 22px clamp(18px, 3vw, 32px); margin-top: 30px; box-shadow: 0 16px 40px rgb(3 6 30 / .28); }
.panel h2 { font-size: 1.5rem; } .panel .rules { background: var(--tint); }
.room-page .page-lede { font-size: 1.12em; }
.lib-count { color: var(--ground-muted); }

/* Library: shelves of arch tiles, one shelf per place */
.lib-filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.shelf { margin-top: 30px; } .shelf-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid rgb(246 185 59 / .35); }
.shelf-head h2 { margin: 0; font-size: 1.55rem; } .shelf-head small { color: var(--ground-muted); }
.shelf-lamp { display: grid; place-items: center; width: 50px; height: 50px; border-radius: 50%; background: var(--lapis); color: var(--lamp); border: 2px solid var(--lamp); box-shadow: 0 0 20px 4px rgb(246 185 59 / .35); font-size: 1.2rem; }
.shelf-ar { font: 1.5rem 'Amiri', serif; color: var(--lamp); margin-left: auto; } [data-mode='kids'] .shelf-ar { color: var(--gold-deep); }
.shelf-count { color: var(--lamp); font-weight: 700; font-size: .9em; } [data-mode='kids'] .shelf-count { color: var(--gold-deep); }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.tile a { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; padding: 26px 14px 16px; text-align: center; text-decoration: none; background: var(--surface); color: var(--ink); border: 2px solid transparent; border-radius: 90px 90px 14px 14px / 64px 64px 14px 14px; box-shadow: 0 10px 26px rgb(3 6 30 / .25); transition: transform .18s, box-shadow .18s, border-color .18s; }
.tile a:hover, .tile a:focus-visible { transform: translateY(-4px); border-color: var(--lamp); box-shadow: 0 14px 34px rgb(3 6 30 / .3), 0 0 24px rgb(246 185 59 / .35); }
.tile b { font: 600 1.15rem/1.2 var(--display); } .tile small { color: var(--muted); font-size: .85em; }
.tile-lamp { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: var(--lapis); color: var(--lamp); font-size: 1.2rem; margin-bottom: 4px; }
.tile.lit a { border-color: var(--lamp); } .tile.lit .tile-lamp { background: var(--lamp); color: var(--lapis); box-shadow: 0 0 22px 6px rgb(246 185 59 / .5); }
.lib-planned { columns: 2; list-style: disc; padding-left: 1.2em; color: var(--muted); }

/* Words: cards with the Arabic word first */
.word-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.word-card { display: flex; flex-direction: column; gap: 4px; padding: 18px 20px; background: var(--surface); color: var(--ink); border-radius: var(--radius-big); border-top: 4px solid var(--lamp); box-shadow: 0 10px 26px rgb(3 6 30 / .22); }
.wc-ar { font: 2.1rem/1.4 'Amiri', serif; color: var(--gold-deep); text-align: right; } [data-mode='teens'] .wc-ar { color: var(--lamp); }
.word-card b { font: 600 1.3rem var(--display); } .word-card p { margin: 0; color: var(--muted); }

/* My lamps: lanterns hanging from a beam, one arcade per place */
.arcades { display: grid; gap: 26px; }
.arcade h2 { font-size: 1.45rem; margin-bottom: 4px; } .arcade h2 a { text-decoration: none; } .arcade h2 small { font: 700 .95rem var(--text); color: var(--lamp); margin-left: 8px; } [data-mode='kids'] .arcade h2 small { color: var(--gold-deep); }
.lantern-row { display: flex; flex-wrap: wrap; gap: 4px 10px; padding: 0 14px; border-top: 6px solid #8a5a1c; border-radius: 4px; box-shadow: inset 0 2px 0 #c98a1a; }
.lantern-row a { display: block; border-radius: 10px; } .lantern-row a:hover .lantern { transform: rotate(3deg); }
.lantern { display: block; width: 42px; height: 96px; overflow: visible; transform-origin: 50% 0; transition: transform .3s; }
.lantern .chain { stroke: #c98a1a; stroke-width: 1.5; } .lantern .cap { fill: #c98a1a; } .lantern .body { fill: #4a3412; } .lantern .glass { fill: #1b2456; } .lantern .flame { fill: #6a77ab; opacity: .45; }
[data-mode='kids'] .lantern .glass { fill: #e9dcb2; } [data-mode='kids'] .lantern .flame { fill: #b9a777; }
.lantern.lit .glass { fill: #ffd56b; } .lantern.lit .flame { fill: #fffaf0; opacity: 1; animation: flick 2.4s ease-in-out infinite; transform-box: fill-box; transform-origin: 50% 100%; }
.lantern.lit { filter: drop-shadow(0 0 10px rgb(246 185 59 / .75)) drop-shadow(0 12px 24px rgb(246 185 59 / .35)); }
@keyframes flick { 50% { transform: scale(.92, 1.06); } }

/* Place: the trail runs across the patterned ground */
.place-hero { min-height: clamp(360px, 60vh, 560px); } .place-title h1 { color: #fff; } .place-title .ar-name { margin: 0; }
.trail-path::before { border-left: 3px dashed rgb(246 185 59 / .65); } [data-mode='kids'] .trail-path::before { border-left-color: var(--gold-deep); }
.stop-text { background: var(--surface); color: var(--ink); padding: 14px 18px; border-radius: var(--radius-big); box-shadow: 0 10px 26px rgb(3 6 30 / .25); }
.stop-lamp { background: var(--lapis); color: var(--lamp); border-color: var(--lamp); box-shadow: 0 0 16px 2px rgb(246 185 59 / .35); }
.planned { background: var(--surface); color: var(--ink); border-color: var(--lamp); }
.back-garden .btn-quiet { background: var(--surface); }

/* Qur'an room: a mushaf page in the fountain court */
.quran-hall { position: relative; min-height: 100dvh; } .quran-hall .room { position: relative; z-index: 1; padding-top: 90px; padding-bottom: 40px; }
.room-side { align-self: start; position: sticky; top: 84px; padding: 20px; border-radius: var(--radius-big); background: rgb(10 16 60 / .78); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); color: #fff; border: 1px solid rgb(246 185 59 / .28); }
.room-side h1 { font-size: clamp(1.9rem, 3vw, 2.6rem); color: #fff; } .room-side .fine { color: #c3cbec; }
.quran-hall .surah { background: rgb(255 255 255 / .06); border-color: rgb(255 255 255 / .14); color: #fff; } .quran-hall .surah .ar { color: var(--lamp); font-size: 1.15rem; }
.quran-hall .surah-n { font: 1.1rem 'Amiri', serif; color: var(--lamp); } .quran-hall .surah[aria-pressed='true'] { border-color: var(--lamp); background: rgb(246 185 59 / .16); box-shadow: 0 0 18px rgb(246 185 59 / .3); }
.mushaf { --ink: #221d10; --muted: #5d5440; --line: #e5d5aa; --tint: #f4e8c6; --surface: #fcf7e8; --accent: #1f3fa8; --on-accent: #fff; color: var(--ink); background: var(--surface); border-radius: 10px; padding: clamp(16px, 3vw, 34px); border: 3px double #c99a3a; outline: 1px solid #c99a3a; outline-offset: -12px; box-shadow: 0 24px 60px rgb(3 6 30 / .5); }
.cartouche { display: flex; justify-content: center; margin: 4px 0 14px; } .cartouche span { padding: 6px 46px; font: 1.8rem/1.4 'Amiri', serif; color: var(--lamp); background: var(--lapis); border: 2px solid #c99a3a; clip-path: polygon(0 50%, 16px 0, calc(100% - 16px) 0, 100% 50%, calc(100% - 16px) 100%, 16px 100%); }
.room-head { text-align: center; } .room-head h2 { margin-bottom: .15em; } .room-head .room-tools { justify-content: center; }
.basmalah { color: #2a2414; }
.ayah-mark { display: inline-grid; place-items: center; min-width: 1.55em; height: 1.55em; padding: 0 .2em; font: .62em/1 'Amiri', serif; color: #7a5410; border: 2px solid #c99a3a; border-radius: 50%; box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px #e2c27a; vertical-align: middle; margin-inline: .15em; }
.mushaf .ayah-row { border-bottom-color: var(--line); } .mushaf .ayah-row.playing { background: #fff1c7; box-shadow: inset -4px 0 0 #c99a3a, 0 0 0 1px #e2c27a; }
.mushaf .ayah-row .icon-btn { background: var(--tint); color: var(--ink); }

/* Lessons stand in their place's corner of the garden */
.stage .backdrop img { filter: blur(2px) saturate(1.1); }
.gate { overflow: hidden; } .gate-card { z-index: 4; box-shadow: 0 20px 50px rgb(3 6 30 / .45); }

@media (max-width: 860px) {
  .brand-ar { display: none; } .room-hero { min-height: 300px; padding: 76px 12px 16px; } .room-hero-copy { padding: 16px 18px; }
  .room-side { position: static; } .quran-hall .room { padding-top: 76px; } .shelf-ar { margin-left: 0; } .tiles { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
  .lib-planned { columns: 1; }
}
@media (max-width: 560px) { .tile a { padding: 20px 10px 12px; } .tile b { font-size: 1.02rem; } .cartouche span { font-size: 1.4rem; padding: 4px 34px; } .wc-ar { font-size: 1.8rem; } }
.chip { color: var(--ink); } .chip[aria-pressed='true'] { color: var(--on-accent); }

/* ==== Journey: light, levels, goal, streak, badges (29 Nov 2026) ==== */
.toast { position: fixed; z-index: 70; left: 50%; bottom: 96px; transform: translate(-50%, 20px); padding: 10px 18px; border-radius: 999px; background: var(--lapis); color: #fff; font-weight: 700; border: 1px solid var(--lamp); box-shadow: 0 10px 30px rgb(3 6 30 / .4), 0 0 18px rgb(246 185 59 / .4); opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; white-space: nowrap; max-width: calc(100% - 24px); overflow: hidden; text-overflow: ellipsis; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.lamp-n { display: inline-flex; align-items: center; gap: 2px; } .lamp-n .ic { width: 1em; height: 1em; }
.bar { display: block; height: 10px; border-radius: 999px; background: rgb(127 140 190 / .25); overflow: hidden; } .bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #f6b93b, #ffe08a); box-shadow: 0 0 12px rgb(246 185 59 / .6); transition: width .8s ease-out; }

/* End-of-lesson celebration */
.reward { margin: 14px auto 6px; max-width: 520px; display: grid; gap: 12px; }
.gain { margin: 0; font: 600 1.3rem var(--display); color: var(--gold-deep); } [data-mode='teens'] .gain { color: var(--lamp); }
.gain-n { display: inline-block; font-size: 1.6em; animation: pop .6s cubic-bezier(.2, 1.6, .4, 1) both .3s; }
.level-up { margin: 0; padding: 8px 14px; border-radius: 999px; background: var(--lapis); color: #fff; justify-self: center; animation: pop .6s cubic-bezier(.2, 1.6, .4, 1) both .6s; } .level-up .ic { color: var(--lamp); } .level-up span { color: var(--lamp); font-family: 'Amiri', serif; }
.reward-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; text-align: left; }
.level-card, .goal-card { padding: 12px 14px; border-radius: var(--radius); background: var(--tint); display: grid; gap: 4px; } .level-card small, .goal-card small { color: var(--muted); } .level-card b, .goal-card b { font: 600 1.15rem var(--display); }
.goal-card { grid-template-columns: auto 1fr; align-items: center; gap: 10px; } .goal-card > div { display: grid; }
.goal-ring { width: 52px; height: 52px; transform: rotate(-90deg); } .goal-ring circle { fill: none; stroke: rgb(127 140 190 / .3); stroke-width: 5; } .goal-ring .goal-fill { stroke: var(--lamp); stroke-linecap: round; stroke-dasharray: 113; transition: stroke-dashoffset .9s ease-out; filter: drop-shadow(0 0 4px rgb(246 185 59 / .7)); }
.new-badges { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; } .new-badges .badge { animation: pop .6s cubic-bezier(.2, 1.6, .4, 1) both .8s; }
@keyframes pop { from { transform: scale(.4); opacity: 0; } }

/* Badges */
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.badge { display: grid; justify-items: center; text-align: center; gap: 4px; padding: 14px 10px; border-radius: var(--radius-big); background: var(--surface); color: var(--ink); opacity: .62; border: 2px dashed var(--line); }
.badge .ic { width: 40px; height: 40px; padding: 8px; box-sizing: content-box; border-radius: 50%; background: var(--tint); color: var(--muted); }
.badge b { font: 600 1.02rem var(--display); } .badge small { color: var(--muted); font-size: .8em; line-height: 1.3; }
.badge.on { opacity: 1; border: 2px solid var(--lamp); box-shadow: 0 0 20px rgb(246 185 59 / .35); } .badge.on .ic { background: var(--lamp); color: var(--lapis); box-shadow: 0 0 18px 4px rgb(246 185 59 / .5); }

/* My journey page */
.journey-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 14px; }
.j-card { padding: 18px 20px; border-radius: var(--radius-big); background: var(--surface); color: var(--ink); box-shadow: 0 12px 30px rgb(3 6 30 / .25); display: grid; gap: 8px; align-content: start; }
.j-card > small { color: var(--muted); font-weight: 700; } .j-card p { margin: 0; } .j-big { font: 600 1.6rem/1.2 var(--display); } .j-big span { font-family: 'Amiri', serif; color: var(--gold-deep); } [data-mode='teens'] .j-big span { color: var(--lamp); }
.j-level .bar { height: 14px; }
.levels { display: flex; gap: 4px; flex-wrap: wrap; } .levels li { font-size: .72em; padding: 2px 8px; border-radius: 999px; background: var(--tint); color: var(--muted); } .levels li.on { background: var(--lamp); color: var(--lapis); font-weight: 700; }
.goal-big { position: relative; width: 96px; height: 96px; } .goal-big .goal-ring { width: 96px; height: 96px; } .goal-big b { position: absolute; inset: 0; display: grid; place-items: center; font: 600 1.4rem var(--display); }
.goal-pick { display: flex; gap: 6px; flex-wrap: wrap; } .goal-pick .chip { min-height: 38px; }
.j-streak .ic { color: #e8742a; }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; } .week i { display: block; height: 26px; border-radius: 8px; background: var(--tint); } .week li.on i { background: linear-gradient(#ffd56b, #f6b93b); box-shadow: 0 0 10px rgb(246 185 59 / .5); } .week li.today i { outline: 2px solid var(--accent); outline-offset: 1px; } .week small { color: var(--muted); font-size: .75em; }
.row-title { display: flex; align-items: center; gap: 10px; margin: 34px 0 14px; font-size: 1.55rem; } .row-title .ic { color: var(--lamp); } .row-title small { font: 700 .9rem var(--text); color: var(--ground-muted); }
.journey-note { color: var(--ground-muted); margin-top: 12px; }

/* Library: stats, feature, painted cards, shelf banners */
.lib-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 18px; }
.stat { display: grid; grid-template-columns: auto 1fr; column-gap: 10px; align-items: center; padding: 12px 14px; border-radius: var(--radius-big); background: rgb(255 255 255 / .07); border: 1px solid rgb(246 185 59 / .3); text-decoration: none; color: var(--ground-ink); }
[data-mode='kids'] .stat { background: rgb(255 255 255 / .7); }
.stat .ic { grid-row: span 2; width: 34px; height: 34px; color: var(--lamp); } [data-mode='kids'] .stat .ic { color: var(--gold-deep); } .stat b { font: 600 1.4rem/1.1 var(--display); } .stat small { color: var(--ground-muted); }
.feature { position: relative; display: block; min-height: 260px; border-radius: 22px; overflow: hidden; text-decoration: none; color: #fff; box-shadow: 0 20px 50px rgb(3 6 30 / .45); border: 1px solid rgb(246 185 59 / .35); }
.feature .backdrop::after { background: linear-gradient(90deg, rgb(9 14 58 / .92) 0%, rgb(9 14 58 / .55) 55%, rgb(9 14 58 / .1) 100%); }
.feature-copy { position: relative; z-index: 4; display: grid; gap: 8px; max-width: 560px; padding: clamp(20px, 4vw, 36px); } .feature-copy small { color: var(--lamp); font-weight: 700; } .feature-copy b { font: 600 clamp(1.7rem, 3.4vw, 2.5rem)/1.1 var(--display); } .feature-copy > span:not(.btn) { color: #dbe2ff; }
.feature-copy .btn { justify-self: start; background: var(--lamp); border-color: var(--lamp); color: var(--lapis); }
.feature:hover .backdrop img, .card a:hover .backdrop img { transform: scale(calc(var(--bz) * 1.08)); transition: transform .8s; }
.feature-done { color: var(--ink); min-height: 0; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.cards-scroll { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; } .cards-scroll .card { flex: 0 0 240px; scroll-snap-align: start; }
.card a { position: relative; display: flex; flex-direction: column; height: 100%; min-height: 220px; border-radius: 18px; overflow: hidden; text-decoration: none; color: var(--ink); background: var(--surface); box-shadow: 0 12px 30px rgb(3 6 30 / .3); border: 2px solid transparent; transition: transform .18s, border-color .18s; }
.card a:hover, .card a:focus-visible { transform: translateY(-4px); border-color: var(--lamp); }
.card .card-art { position: relative; inset: auto; height: 110px; flex: none; } .card .card-art .mote { display: none; }
.card-lamp { position: absolute; z-index: 4; left: 14px; top: 84px; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: var(--lapis); color: var(--lamp); border: 2px solid var(--lamp); box-shadow: 0 0 16px rgb(246 185 59 / .45); }
.card.lit .card-lamp { background: var(--lamp); color: var(--lapis); } .card.lit a { border-color: var(--lamp); }
.card-body { display: grid; gap: 4px; padding: 30px 16px 16px; } .card-body small { color: var(--muted); font-size: .8em; font-weight: 700; } .card-body b { font: 600 1.18rem/1.2 var(--display); } .card-meta { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: .85em; margin-top: auto; }
.ribbon { position: absolute; z-index: 5; top: 12px; right: 12px; padding: 3px 10px; border-radius: 999px; background: var(--pomegranate); color: #fff; font-size: .75rem; font-weight: 700; box-shadow: 0 4px 12px rgb(0 0 0 / .3); }
.tile .ribbon { top: 8px; right: 50%; transform: translateX(50%); top: -10px; }
.shelf-banner { position: relative; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; min-height: 110px; padding: 18px 22px; margin-bottom: 16px; border-radius: 18px; overflow: hidden; color: #fff; border: 1px solid rgb(246 185 59 / .3); }
.shelf-banner .backdrop::after { background: linear-gradient(90deg, rgb(9 14 58 / .88), rgb(9 14 58 / .45)); } .shelf-banner .mote { display: none; }
.shelf-banner > :not(.backdrop) { position: relative; z-index: 4; } .shelf-banner h2 { margin: 0; color: #fff; } .shelf-banner small { color: #dbe2ff; } .shelf-banner .shelf-ar { color: var(--lamp); }
.shelf-progress { display: grid; gap: 4px; width: 160px; } .shelf-progress small { color: var(--lamp); font-weight: 700; }
.tile a { overflow: visible; }

@media (max-width: 860px) {
  .journey-grid { grid-template-columns: 1fr; } .lib-stats { grid-template-columns: 1fr 1fr; } .reward-row { grid-template-columns: 1fr; }
  .shelf-progress { width: 100%; } .feature { min-height: 230px; } .toast { bottom: 84px; }
}
.badge:not(.on) { background: rgb(255 255 255 / .06); color: var(--ground-ink); border-color: rgb(246 185 59 / .25); opacity: .85; } .badge:not(.on) small { color: var(--ground-muted); } .badge:not(.on) .ic { background: rgb(255 255 255 / .1); color: var(--ground-muted); }
[data-mode='kids'] .badge:not(.on) { background: rgb(255 255 255 / .6); }

/* ==== Tajweed room (29 Nov 2026) ==== */
.tj-layout { display: grid; grid-template-columns: 300px 1fr; gap: 20px; margin-top: 18px; align-items: start; } .tj-layout > * { min-width: 0; }
.tj-rules { position: sticky; top: 80px; display: grid; gap: 14px; max-height: calc(100dvh - 100px); overflow: auto; padding: 16px; border-radius: var(--radius-big); background: var(--surface); color: var(--ink); box-shadow: 0 12px 30px rgb(3 6 30 / .25); }
.tj-rules h2 { font-size: 1.15rem; margin: 0; } .tj-rules ul { display: grid; gap: 6px; margin-top: 6px; } .tj-rules .fine { margin: 2px 0 0; font-size: .82em; }
.tj-rule { width: 100%; display: grid; grid-template-columns: 14px 1fr auto; column-gap: 10px; align-items: center; text-align: left; padding: 8px 10px; border-radius: var(--radius); border: 2px solid var(--line); background: var(--surface); color: var(--ink); }
.tj-rule i { grid-row: span 2; width: 14px; height: 14px; border-radius: 50%; background: var(--c); } .tj-rule b { font-weight: 700; font-size: .95em; } .tj-rule span { font: 1.05rem 'Amiri', serif; color: var(--c); } .tj-rule small { grid-column: 2 / span 2; color: var(--muted); font-size: .78em; }
.tj-rule[aria-pressed='true'] { border-color: var(--c); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 25%, transparent); } .tj-rule:disabled { opacity: .45; cursor: default; }
.tj-surahs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; } .tj-surahs .chip { flex: none; }
.tj-card { margin: 12px 0; padding: 14px 18px; border-radius: var(--radius-big); background: var(--surface); color: var(--ink); box-shadow: 0 10px 26px rgb(3 6 30 / .22); } .tj-card p { margin: 6px 0 0; }
.tj-card-head { display: flex; align-items: center; gap: 10px; } .tj-card-head i { width: 16px; height: 16px; border-radius: 50%; background: var(--c); } .tj-card-head b { font: 600 1.3rem var(--display); } .tj-card-head span { font: 1.4rem 'Amiri', serif; color: var(--c); margin-left: auto; }
.tj-progress b { color: var(--gold-deep); } [data-mode='teens'] .tj-progress b { color: var(--lamp); }
.tj-ayat { display: grid; gap: 4px; } .tj-ayah { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: center; padding: 8px; border-radius: var(--radius); } .tj-ayah.playing { background: #fff1c7; box-shadow: inset -4px 0 0 #c99a3a; }
.tj-page .ayah { margin: 0; font-size: 2.15rem; line-height: 2.3; }
.tj { padding: 0; margin: 0; border: 0; background: none; font: inherit; color: var(--c); border-radius: 4px; cursor: pointer; }
.tj:hover, .tj:focus-visible { background: color-mix(in srgb, var(--c) 14%, transparent); }
.tj-page[data-rule]:not([data-rule='']) .tj { color: #b9ad8e; }
.tj-page[data-rule='q'] .tj-q, .tj-page[data-rule='g'] .tj-g, .tj-page[data-rule='f'] .tj-f, .tj-page[data-rule='a'] .tj-a, .tj-page[data-rule='u'] .tj-u, .tj-page[data-rule='i'] .tj-i, .tj-page[data-rule='c'] .tj-c, .tj-page[data-rule='w'] .tj-w, .tj-page[data-rule='n'] .tj-n, .tj-page[data-rule='o'] .tj-o, .tj-page[data-rule='p'] .tj-p, .tj-page[data-rule='m'] .tj-m, .tj-page[data-rule='l'] .tj-l, .tj-page[data-rule='h'] .tj-h, .tj-page[data-rule='s'] .tj-s, .tj-page[data-rule='d'] .tj-d, .tj-page[data-rule='b'] .tj-b { color: var(--c); outline: 2px dashed color-mix(in srgb, var(--c) 55%, transparent); outline-offset: 2px; }
.tj.found { color: #fff !important; background: var(--c) !important; outline: 0 !important; box-shadow: 0 0 12px var(--c); }
.tj-src { color: var(--ground-muted); margin-top: 12px; } .tj-src a { color: var(--ground-ink); }
.tj-link { margin: 4px 0 10px; background: var(--lamp); border-color: var(--lamp); color: var(--lapis); }
.promo { display: flex; align-items: center; gap: 14px; margin-top: 18px; padding: 14px 18px; border-radius: 18px; text-decoration: none; color: var(--ground-ink); background: linear-gradient(90deg, rgb(14 143 133 / .35), rgb(246 185 59 / .18)); border: 1px solid rgb(246 185 59 / .45); }
.promo > .ic:first-child { width: 40px; height: 40px; color: var(--lamp); } .promo span { display: grid; flex: 1; } .promo b { font: 600 1.2rem var(--display); } .promo small { color: var(--ground-muted); }
[data-mode='kids'] .promo > .ic:first-child { color: var(--gold-deep); }
@media (max-width: 860px) { .tj-layout { grid-template-columns: 1fr; } .tj-rules { position: static; max-height: none; } .tj-page .ayah { font-size: 1.75rem; } }
@media (max-width: 860px) { .tj-main { order: -1; } .promo > .ic:last-child { display: none; } .promo > .ic:first-child { width: 30px; height: 30px; } }

/* ==== Wow pass (29 Nov 2026): one entrance per room, a real celebration, daily cards ==== */
/* Entrance: the painted hero settles in, then the room's content rises after it. */
.room-hero .backdrop img, .place-hero .backdrop img { animation: settle 1.4s cubic-bezier(.2, .7, .2, 1) both, breathe 38s ease-in-out 1.4s infinite alternate; }
.room-hero-copy, .place-title, .room-side { animation: rise-in .8s cubic-bezier(.2, .8, .2, 1) both .15s; }
.ground > *:nth-child(1) { animation: rise-in .7s cubic-bezier(.2, .8, .2, 1) both .35s; }
.ground > *:nth-child(2) { animation: rise-in .7s cubic-bezier(.2, .8, .2, 1) both .45s; }
.ground > *:nth-child(3) { animation: rise-in .7s cubic-bezier(.2, .8, .2, 1) both .55s; }
.ground > *:nth-child(4) { animation: rise-in .7s cubic-bezier(.2, .8, .2, 1) both .65s; }
.niche-wrap { animation: rise-in .7s cubic-bezier(.2, .8, .2, 1) both .1s; }
@keyframes settle { from { transform: scale(calc(var(--bz) * 1.12)); filter: blur(6px) saturate(.8) brightness(.6); } }
@keyframes rise-in { from { opacity: 0; transform: translateY(22px); } }

/* Celebration: a burst of light behind the lamp, and small lanterns drifting up */
.burst { position: relative; width: 220px; height: 170px; margin: 0 auto 4px; display: grid; place-items: end center; }
.burst .lamp-lit { position: relative; z-index: 2; margin: 0 auto; }
.rays { position: absolute; left: 50%; top: 50%; width: 260px; height: 260px; translate: -50% -48%; border-radius: 50%; background: repeating-conic-gradient(from 0deg, rgb(246 185 59 / .38) 0 6deg, transparent 6deg 22deg); -webkit-mask: radial-gradient(circle, #000 18%, transparent 68%); mask: radial-gradient(circle, #000 18%, transparent 68%); opacity: 0; }
.fresh .rays { animation: rays-in 1.2s ease-out .2s both, spin 24s linear 1.4s infinite; }
@keyframes rays-in { from { opacity: 0; transform: scale(.3) rotate(-30deg); } to { opacity: 1; transform: scale(1) rotate(0); } }
@keyframes spin { to { transform: rotate(360deg); } }
.rise { position: absolute; z-index: 3; bottom: 20px; width: 10px; height: 14px; border-radius: 4px 4px 6px 6px; background: linear-gradient(#fff4cf, #f6b93b); box-shadow: 0 0 12px 3px rgb(246 185 59 / .7); opacity: 0; }
.fresh .rise { animation: drift-up 2.8s ease-out both; }
.rise:nth-of-type(1) { left: 12%; animation-delay: .5s; } .rise:nth-of-type(2) { left: 25%; animation-delay: .9s; scale: .8; } .rise:nth-of-type(3) { left: 38%; animation-delay: .6s; } .rise:nth-of-type(4) { left: 62%; animation-delay: 1.1s; scale: .7; } .rise:nth-of-type(5) { left: 75%; animation-delay: .7s; } .rise:nth-of-type(6) { left: 86%; animation-delay: 1.3s; scale: .8; } .rise:nth-of-type(7) { left: 50%; animation-delay: 1.5s; scale: .6; } .rise:nth-of-type(8) { left: 18%; animation-delay: 1.7s; scale: .6; } .rise:nth-of-type(9) { left: 80%; animation-delay: 1.9s; scale: .7; }
@keyframes drift-up { 0% { opacity: 0; transform: translateY(0); } 15% { opacity: 1; } 100% { opacity: 0; transform: translate(10px, -150px); } }
.done-step h2 { animation: rise-in .7s cubic-bezier(.2, .8, .2, 1) both .5s; }

/* Ayah and Word for today */
.today-row { display: grid; grid-template-columns: 1.7fr 1fr; gap: 14px; margin-top: 18px; } .today-single { grid-template-columns: minmax(0, 520px); margin: 0 auto 18px; }
.today { position: relative; display: grid; gap: 6px; align-content: start; padding: 18px 22px; border-radius: 20px; overflow: hidden; color: var(--ink); background: var(--surface); box-shadow: 0 14px 34px rgb(3 6 30 / .3); border: 1px solid rgb(246 185 59 / .5); }
.today::before { content: ''; position: absolute; inset: 0; background: var(--tiles); opacity: .5; pointer-events: none; }
.today > * { position: relative; } .today > small { display: inline-flex; gap: 6px; align-items: center; font-weight: 700; color: var(--gold-deep); } [data-mode='teens'] .today > small { color: var(--lamp); }
.today-ayah { background: linear-gradient(160deg, #fcf7e8, #f4e6bd); color: #221d10; } .today-ayah .ayah { font-size: 1.9rem; line-height: 2.1; margin: 0; } .today-en { margin: 0; color: #4d4430; font-style: italic; }
.today-foot { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin: 4px 0 0; font-size: .85em; color: #6b5f43; } .today-ayah .btn { --accent: #1f3fa8; }
.today-word .wc-ar { font-size: 2.6rem; } .today-word b { font: 600 1.4rem var(--display); } .today-word p { margin: 0; color: var(--muted); }

/* Levels as a chain of lamps */
.levels { position: relative; display: grid; grid-template-columns: repeat(7, 1fr); gap: 0; margin-top: 6px; }
.levels::before { content: ''; position: absolute; left: 7%; right: 7%; top: 13px; height: 3px; background: rgb(127 140 190 / .3); border-radius: 2px; }
.levels li { position: relative; display: grid; justify-items: center; gap: 4px; padding: 0; background: none; font-size: .68em; text-align: center; color: var(--muted); }
.levels li::before { content: ''; width: 26px; height: 26px; border-radius: 50%; background: var(--tint); border: 2px solid rgb(127 140 190 / .45); }
.levels li.on { background: none; color: var(--ink); font-weight: 700; } .levels li.on::before { background: radial-gradient(circle at 50% 60%, #fff4cf, #f6b93b 60%, #d9861a); border-color: #f6b93b; box-shadow: 0 0 14px 4px rgb(246 185 59 / .55); }

/* Tajweed: a small spark when you find a letter */
.tj.found { animation: found-pop .5s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes found-pop { 0% { transform: scale(1); } 40% { transform: scale(1.35); } 100% { transform: scale(1); } }

@media (max-width: 860px) { .today-row { grid-template-columns: 1fr; } .today-ayah .ayah { font-size: 1.6rem; } .levels li { font-size: .6em; } }
