:root {
  --ink: #2c2a26;
  --muted: #7b7468;
  --paper: #f6f1e7;
  --glass: rgba(250, 246, 238, 0.82);
  --line: rgba(60, 50, 40, 0.12);
  --green: #2f5a47;
  --green-2: #3f7560;
  --gold: #c9a046;
  --shadow: 0 6px 24px rgba(40, 30, 20, 0.16);
  --r: 18px;
  --font: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --urdu: 'Noto Nastaliq Urdu', 'Nunito', serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #e9dfcd; color: var(--ink); font-family: var(--font); }
html[lang="ur"] body, .ur { font-family: var(--urdu); }
html[lang="ur"] body { line-height: 1.9; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
#c { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; outline: none; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.row { display: flex; gap: 8px; align-items: center; }
.row.between { justify-content: space-between; }
.row.center { justify-content: center; }
.row.wrap { flex-wrap: wrap; }

.glass { background: var(--glass); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,0.6); box-shadow: var(--shadow); border-radius: var(--r); }

.primary { background: var(--green); color: #fff; padding: 10px 18px; border-radius: 999px; font-weight: 700; box-shadow: 0 3px 10px rgba(47,90,71,0.3); transition: transform .15s, background .2s; }
.primary:hover { background: var(--green-2); }
.primary:active { transform: scale(0.97); }
.primary.big { width: 100%; padding: 14px 20px; font-size: 1.05rem; }
.primary.small, .ghost.small { padding: 6px 12px; font-size: 0.85rem; }
.ghost { padding: 9px 16px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255,255,255,0.55); font-weight: 600; }
.ghost:hover { background: #fff; }

/* overlays */
.overlay { position: fixed; inset: 0; display: grid; place-items: center; z-index: 30; padding: 16px; background: radial-gradient(ellipse at 50% 30%, rgba(246,236,214,0.85), rgba(214,190,150,0.92)); }
.overlay.soft { background: rgba(240, 232, 216, 0.88); gap: 12px; align-content: center; text-align: center; }
.card { background: var(--paper); border-radius: 24px; box-shadow: 0 20px 60px rgba(60,40,20,0.25); padding: 26px; width: min(420px, 100%); max-height: calc(100vh - 32px); overflow: auto; }
.intro-card { text-align: center; position: relative; }
.logo { width: 76px; height: 76px; margin: 6px auto 0; display: block; }
h1 { margin: 6px 0 2px; font-size: 1.7rem; letter-spacing: 0.2px; color: var(--green); }
h2 { margin: 0; font-size: 1.25rem; color: var(--green); }
h3 { margin: 16px 0 6px; font-size: 0.95rem; color: var(--muted); font-weight: 700; }
.tagline { margin: 0 0 18px; color: var(--muted); }
.note { font-size: 0.8rem; color: var(--muted); margin: 14px 0 0; line-height: 1.5; }
.field { display: grid; gap: 6px; text-align: start; margin-bottom: 12px; }
.field > span { font-size: 0.8rem; font-weight: 700; color: var(--muted); }
.field input, .field select { width: 100%; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--line); background: #fff; }
.field .row select { flex: 1; min-width: 0; }
.seg { display: flex; background: rgba(0,0,0,0.05); border-radius: 999px; padding: 4px; }
.seg button { flex: 1; padding: 8px 10px; border-radius: 999px; font-weight: 700; color: var(--muted); }
.seg button.on { background: #fff; color: var(--green); box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.lang-switch { position: absolute; top: 14px; inset-inline-end: 14px; display: flex; gap: 2px; background: rgba(0,0,0,0.05); border-radius: 999px; padding: 3px; font-size: 0.8rem; }
.lang-switch button { padding: 3px 10px; border-radius: 999px; color: var(--muted); }
.lang-switch button.on { background: #fff; color: var(--green); }
.check { display: flex; gap: 8px; align-items: center; margin-top: 12px; font-size: 0.9rem; }

.spinner { width: 46px; height: 46px; border-radius: 50%; border: 4px solid rgba(47,90,71,0.2); border-top-color: var(--green); animation: spin 1s linear infinite; margin: 0 auto 10px; }
#loading { align-content: center; text-align: center; color: var(--green); font-weight: 700; }
@keyframes spin { to { transform: rotate(360deg); } }

/* HUD */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; }
#hud > * { pointer-events: auto; }
.top-left { position: absolute; top: max(12px, env(safe-area-inset-top)); inset-inline-start: 12px; padding: 8px 14px; display: flex; gap: 8px; align-items: center; font-weight: 700; font-size: 0.9rem; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #c9a046; }
.dot.on { background: #4caf7a; }
.top-right { position: absolute; top: max(12px, env(safe-area-inset-top)); inset-inline-end: 12px; display: flex; gap: 8px; }
.icon { width: 42px; height: 42px; display: grid; place-items: center; }
.icon svg, .pill svg { width: 22px; height: 22px; }
.pill { display: flex; align-items: center; gap: 6px; padding: 0 14px; height: 42px; font-weight: 700; font-size: 0.88rem; }
.pill.on { background: var(--green); color: #fff; }
.now-playing { position: absolute; top: calc(max(12px, env(safe-area-inset-top)) + 50px); inset-inline-end: 12px; padding: 7px 12px; font-size: 0.8rem; max-width: 260px; }
.now-playing b { color: var(--green); }

.top-center { position: absolute; top: max(12px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); padding: 8px 16px; text-align: center; min-width: 200px; }
.pc-main { display: flex; gap: 8px; align-items: baseline; justify-content: center; white-space: nowrap; }
.pc-label { font-size: 0.75rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px; }
.pc-name { font-weight: 800; color: var(--green); font-size: 1.05rem; }
.pc-time { font-weight: 700; }
.pc-sub { font-size: 0.82rem; color: var(--muted); font-variant-numeric: tabular-nums; }
#saffBtn { margin-top: 6px; }

.bottom-bar { position: absolute; bottom: max(16px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); display: flex; gap: 4px; padding: 6px; border-radius: 22px; }
.bottom-bar button { display: grid; justify-items: center; gap: 2px; padding: 7px 14px; border-radius: 16px; font-size: 0.75rem; font-weight: 700; color: #4a453d; min-width: 64px; }
.bottom-bar button svg { width: 24px; height: 24px; }
.bottom-bar button:hover { background: rgba(255,255,255,0.7); }
.bottom-bar button.on { background: var(--green); color: #fff; }

#tasbeehPanel { position: absolute; bottom: calc(max(16px, env(safe-area-inset-bottom)) + 84px); left: 50%; transform: translateX(-50%); padding: 12px 18px; text-align: center; min-width: 210px; }
.tb-phrase { font-family: 'Amiri', serif; font-size: 1.4rem; color: var(--green); }
.tb-phrase small { display: block; font-family: var(--font); font-size: 0.78rem; color: var(--muted); }
.tb-count { width: 86px; height: 86px; border-radius: 50%; margin: 8px auto; display: grid; place-items: center; font-size: 1.9rem; font-weight: 800; color: #fff; background: radial-gradient(circle at 35% 30%, #4c8a70, #2f5a47); box-shadow: 0 6px 16px rgba(47,90,71,0.35); user-select: none; transition: transform .08s; }
.tb-count:active { transform: scale(0.94); }
.tb-total { font-size: 0.78rem; color: var(--muted); }

.hint { position: absolute; bottom: calc(max(16px, env(safe-area-inset-bottom)) + 84px); left: 50%; transform: translateX(-50%); padding: 8px 14px; font-size: 0.8rem; color: var(--muted); white-space: nowrap; transition: opacity 1s; }
.toast { position: absolute; top: 120px; left: 50%; transform: translateX(-50%); padding: 10px 16px; font-weight: 700; font-size: 0.9rem; }

.adhan { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -60%); padding: 22px 26px; text-align: center; width: min(380px, calc(100% - 32px)); }
.adhan-ar { font-family: 'Amiri', serif; font-size: 2.2rem; color: var(--gold); line-height: 1.4; }
.adhan-title { font-weight: 800; font-size: 1.3rem; color: var(--green); }
.adhan-sub { color: var(--muted); margin: 6px 0 14px; font-size: 0.9rem; }
.cue { position: absolute; bottom: calc(max(16px, env(safe-area-inset-bottom)) + 84px); left: 50%; transform: translateX(-50%); padding: 10px 18px; text-align: center; font-weight: 800; color: var(--green); }
.cue small { display: block; font-weight: 600; color: var(--muted); font-size: 0.78rem; }

.timetable { list-style: none; padding: 0; margin: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.timetable li { display: flex; justify-content: space-between; padding: 8px 14px; font-size: 0.92rem; }
.timetable li:nth-child(odd) { background: rgba(0,0,0,0.03); }
.timetable li.now { color: var(--green); font-weight: 800; }
.settings-card .row.wrap { margin-top: 12px; }

/* name tags */
#labels { position: fixed; inset: 0; pointer-events: none; z-index: 5; overflow: hidden; }
.tag { position: absolute; left: 0; top: 0; transform: translate(-50%, -100%); white-space: nowrap; font-size: 0.74rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: rgba(255,255,255,0.86); color: #3a352e; box-shadow: 0 2px 8px rgba(0,0,0,0.12); will-change: transform; }
.tag.me::before { content: attr(data-me); display: inline-grid; place-items: center; min-width: 16px; height: 16px; padding: 0 5px; margin-inline-end: 5px; border-radius: 8px; background: var(--green); color: #fff; font-size: 0.62rem; vertical-align: 1px; }
.tag.imam { background: rgba(47,90,71,0.9); color: #fff; }
.bubble { position: absolute; left: 50%; bottom: calc(100% + 6px); transform: translateX(-50%); background: #fff; color: var(--green); padding: 5px 10px; border-radius: 12px; font-size: 0.82rem; white-space: nowrap; box-shadow: 0 3px 10px rgba(0,0,0,0.15); animation: pop .25s ease-out; }
@keyframes pop { from { transform: translateX(-50%) scale(0.6); opacity: 0; } }

@media (max-width: 860px) {
  .pill span { display: none; }
  .pill { padding: 0; width: 42px; justify-content: center; }
  .top-center { top: calc(max(12px, env(safe-area-inset-top)) + 52px); min-width: 0; width: calc(100% - 24px); }
  .top-left { font-size: 0.8rem; padding: 8px 12px; max-width: calc(100% - 180px); overflow: hidden; }
  #roomName { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .bottom-bar button { min-width: 56px; padding: 7px 8px; }
  .hint { white-space: normal; width: calc(100% - 32px); text-align: center; }
  .now-playing { top: auto; bottom: calc(max(16px, env(safe-area-inset-bottom)) + 84px); inset-inline-end: 16px; }
}

.tb-select { width: 100%; padding: 7px 10px; border-radius: 10px; border: 1px solid var(--line); background: #fff; font-size: 0.82rem; margin-bottom: 6px; }
.tb-custom { display: flex; gap: 6px; margin-bottom: 6px; }
.tb-custom input { flex: 1; min-width: 0; padding: 7px 10px; border-radius: 10px; border: 1px solid var(--line); background: #fff; font-size: 0.85rem; }
.tb-custom input[type=number] { flex: 0 0 72px; }
.tb-row { display: flex; align-items: center; justify-content: space-between; }
.tb-reset { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: rgba(0,0,0,0.05); color: var(--muted); }
.tb-reset:hover { background: rgba(0,0,0,0.1); color: var(--green); }
.tb-reset svg { width: 20px; height: 20px; }
.tb-spacer { width: 40px; }
#tasbeehPanel { min-width: 250px; }
.timetable li small { display: block; font-size: 0.72rem; color: var(--muted); font-weight: 600; }

/* loading screen (calm, like a quiet morning) */
#loader { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: #f2ede3; transition: opacity .8s ease; }
#loader.done { opacity: 0; pointer-events: none; }
.loader-inner { display: grid; justify-items: center; gap: 14px; }
.loader-logo { width: 54px; height: 54px; opacity: .9; animation: breathe 3s ease-in-out infinite; }
.loader-title { font-family: 'Noto Nastaliq Urdu', serif; color: var(--green); font-size: 1.3rem; line-height: 2; }
.load-line { width: min(240px, 60vw); height: 2px; background: rgba(47,90,71,0.15); border-radius: 2px; overflow: hidden; }
#loadBar { height: 100%; width: 100%; background: var(--green); transform: scaleX(0); transform-origin: left; transition: transform .35s ease-out; }
html[dir="rtl"] #loadBar { transform-origin: right; }
.loader-text { margin: 0; font-size: .8rem; color: var(--muted); }
@keyframes breathe { 0%, 100% { transform: scale(1); opacity: .75 } 50% { transform: scale(1.06); opacity: 1 } }

/* prayer guidance */
.cue { max-width: min(560px, calc(100% - 24px)); width: max-content; }
.cue-ar { font-family: 'Amiri', serif; font-size: 1.45rem; color: var(--green); line-height: 1.7; font-weight: 700; }
.cue-tr { font-weight: 800; color: #3b4a42; font-size: .92rem; }
.cue-hint { font-weight: 600; color: #4f4a42; font-size: .82rem; margin-top: 3px; line-height: 1.45; }
html[lang="ur"] .cue-hint { font-size: .9rem; line-height: 2; }
.cue small { margin-top: 4px; }

/* radio */
.now-playing { line-height: 1.45; }
.now-playing .live { color: #c0392b; font-size: .7rem; animation: breathe 2s infinite; display: inline-block; }
.np-sub { color: var(--muted); font-size: .76rem; }
.np-next { color: var(--muted); font-size: .72rem; border-top: 1px solid var(--line); margin-top: 4px; padding-top: 3px; }

/* proximity chat */
.talk-prompt { position: absolute; left: 50%; bottom: calc(max(16px, env(safe-area-inset-bottom)) + 150px); transform: translateX(-50%); display: flex; align-items: center; gap: 8px; padding: 8px 14px 8px 8px; font-weight: 800; color: var(--green); border-radius: 999px; animation: pop .25s ease-out; }
.talk-prompt kbd { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: var(--green); color: #fff; font: 800 .8rem var(--font); box-shadow: 0 2px 0 #1d3b2e; }
.dialog { position: absolute; left: 50%; bottom: calc(max(16px, env(safe-area-inset-bottom)) + 84px); transform: translateX(-50%); width: min(430px, calc(100% - 24px)); padding: 12px 14px; z-index: 12; }
.dlg-head { display: flex; align-items: center; gap: 8px; color: var(--green); font-size: 1rem; }
.dlg-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); }
.dlg-x { margin-inline-start: auto; width: 28px; height: 28px; border-radius: 50%; font-size: 1.2rem; color: var(--muted); }
.dlg-x:hover { background: rgba(0,0,0,0.06); }
.dlg-log { max-height: 96px; overflow: auto; margin: 6px 0; font-size: .86rem; display: grid; gap: 3px; }
.dlg-log:empty { display: none; }
.dlg-line b { color: var(--muted); font-weight: 700; }
.dlg-line.mine b { color: var(--green); }
.dlg-opts { list-style: none; margin: 6px 0 8px; padding: 0; display: grid; gap: 4px; }
.dlg-opts button { width: 100%; display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 10px; text-align: start; font-weight: 700; font-size: .9rem; color: #3b3630; background: rgba(255,255,255,0.55); border: 1px solid transparent; }
.dlg-opts button:hover, .dlg-opts button:focus-visible { border-color: var(--gold); background: #fff; outline: none; }
.dlg-num { display: inline-grid; place-items: center; min-width: 22px; height: 22px; border-radius: 6px; background: rgba(47,90,71,0.12); color: var(--green); font-size: .78rem; font-weight: 800; }
.dlg-form { display: flex; gap: 6px; align-items: center; }
.dlg-form input { flex: 1; min-width: 0; padding: 9px 12px; border-radius: 999px; border: 1px solid var(--line); background: #fff; }
.dlg-count { font-size: .72rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.tag.npc { background: rgba(255,255,255,0.7); color: #5a544b; font-weight: 600; font-size: .68rem; }
.bubble { max-width: 220px; white-space: normal; text-align: center; line-height: 1.35; }

/* ---- In-world HUD: dark smoky glass with white text (matches the sample) ---- */
#hud .glass, #hud .talk-btn {
  background: rgba(28, 26, 22, 0.38);
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2);
  color: #fff;
}
#hud .muted, #hud .pc-label, #hud .pc-sub, #hud .np-sub, #hud .np-next, #hud .tb-total,
#hud .dlg-count, #hud .cue small, #hud .adhan-sub, #hud .hint { color: rgba(255, 255, 255, 0.72); }
#hud .pc-name, #hud .now-playing b, #hud .dlg-head, #hud .adhan-title { color: #f3dfa6; }
#hud .pc-time { color: #fff; }
#hud .bottom-bar { border-radius: 26px; padding: 8px 10px; gap: 6px; }
#hud .bottom-bar button { color: #fff; font-weight: 600; min-width: 74px; }
#hud .bottom-bar button:hover { background: rgba(255, 255, 255, 0.12); }
#hud .bottom-bar button.on { background: rgba(255, 255, 255, 0.24); color: #fff; }
#hud .icon, #hud .pill { color: #fff; }
#hud .pill.on { background: rgba(47, 90, 71, 0.75); }
#hud .dot { background: #f3dfa6; } #hud .dot.on { background: #7be0a6; }
#hud .tb-phrase { color: #f3dfa6; }
#hud .tb-phrase small { color: rgba(255,255,255,0.7); }
#hud .tb-reset { background: rgba(255,255,255,0.12); color: #fff; }
#hud .cue-ar { color: #f3dfa6; } #hud .cue-tr { color: #fff; } #hud .cue-hint { color: rgba(255,255,255,0.86); }
#hud .dlg-opts button { background: rgba(255, 255, 255, 0.08); color: #fff; }
#hud .dlg-opts button:hover, #hud .dlg-opts button:focus-visible { background: rgba(255, 255, 255, 0.18); border-color: rgba(243, 223, 166, 0.7); }
#hud .dlg-num { background: rgba(255, 255, 255, 0.16); color: #f3dfa6; }
#hud .dlg-line b { color: rgba(255,255,255,0.65); } #hud .dlg-line.mine b { color: #f3dfa6; }
#hud .dlg-x { color: rgba(255,255,255,0.8); } #hud .dlg-x:hover { background: rgba(255,255,255,0.12); }
#hud .adhan-ar { color: #f3dfa6; }

/* language links above the action bar */
.lang-bar { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(max(16px, env(safe-area-inset-bottom)) + 76px); display: flex; gap: 14px; align-items: baseline; }
.lang-bar button { color: rgba(255, 255, 255, 0.72); font-size: .82rem; font-weight: 600; padding: 2px 0; text-shadow: 0 1px 6px rgba(0,0,0,0.45); border-bottom: 1px solid transparent; }
.lang-bar button.ur { font-size: .9rem; }
.lang-bar button.on { color: #fff; border-bottom-color: #fff; }
.lang-bar button:hover { color: #fff; }
#hud #tasbeehPanel, #hud .cue, #hud .hint, #hud #dialog { bottom: calc(max(16px, env(safe-area-inset-bottom)) + 108px); }

/* "Talk" button floating above a nearby person's head */
.talk-btn { position: absolute; left: 50%; bottom: calc(100% + 6px); transform: translateX(-50%); display: none; align-items: center; gap: 6px; padding: 4px 10px 4px 4px; border-radius: 999px; font-size: .78rem; font-weight: 700; white-space: nowrap; pointer-events: auto; cursor: pointer; animation: pop .2s ease-out; }
.talk-btn.show { display: flex; }
.talk-btn kbd { display: none; place-items: center; min-width: 20px; height: 20px; border-radius: 6px; background: #fff; color: #2c2a26; font: 800 .7rem var(--font); }
.talk-btn.nearest kbd { display: inline-grid; }
.talk-btn:not(.nearest) { padding-left: 10px; }
.talk-btn:hover { background: rgba(47, 90, 71, 0.8); }
.talk-btn { background: rgba(28, 26, 22, 0.55); color: #fff; border: 1px solid rgba(255,255,255,0.25); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }

/* ---- Arabic ---- */
html[lang="ar"] body, .arb { font-family: 'Noto Naskh Arabic', 'Nunito', serif; }
html[lang="ar"] .cue-hint, html[lang="ar"] .tagline { line-height: 1.8; }

/* ---- Prayer chip (side) + pop-up card ---- */
#hud .top-center { display: none; }
.prayer-chip { position: absolute; top: calc(max(12px, env(safe-area-inset-top)) + 50px); inset-inline-start: 12px; display: flex; align-items: center; gap: 7px; padding: 7px 12px 7px 10px; border-radius: 999px; font-weight: 700; font-size: .84rem; max-width: calc(100% - 24px); white-space: nowrap; }
.prayer-chip svg { width: 18px; height: 18px; flex: none; color: #f3dfa6; }
.prayer-chip .chip-time { font-weight: 600; opacity: .8; font-variant-numeric: tabular-nums; }
.prayer-chip.alert { animation: chipPulse 1.6s ease-in-out infinite; }
.prayer-chip.alert svg { color: #7be0a6; }
@keyframes chipPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(123,224,166,0.55); } 50% { box-shadow: 0 0 0 8px rgba(123,224,166,0); } }
.prayer-pop { position: absolute; top: calc(max(12px, env(safe-area-inset-top)) + 96px); inset-inline-start: 12px; width: min(300px, calc(100% - 24px)); padding: 12px 14px; text-align: start; animation: pop .2s ease-out; }
.prayer-pop .pc-main { justify-content: flex-start; flex-wrap: wrap; white-space: normal; padding-inline-end: 24px; }
.prayer-pop .pc-sub { margin-top: 2px; }
.prayer-pop #saffBtn { margin-top: 8px; }
.pop-x { position: absolute; top: 6px; inset-inline-end: 6px; width: 28px; height: 28px; border-radius: 50%; color: rgba(255,255,255,0.85); font-size: 1.2rem; line-height: 1; }
.pop-x:hover { background: rgba(255,255,255,0.12); }
#hud .adhan { top: calc(max(12px, env(safe-area-inset-top)) + 96px); left: 12px; inset-inline-start: 12px; transform: none; width: min(320px, calc(100% - 24px)); padding: 14px 16px; text-align: start; }
html[dir="rtl"] #hud .adhan { left: auto; }
#hud .adhan .adhan-ar { font-size: 1.5rem; }
#hud .adhan .row.center { justify-content: flex-start; }

/* ---- Qur'an radio bar ---- */
.radio-bar { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(max(16px, env(safe-area-inset-bottom)) + 104px); display: flex; align-items: center; gap: 10px; padding: 6px 14px 6px 6px; border-radius: 999px; width: min(420px, calc(100% - 24px)); }
html[dir="rtl"] .radio-bar { padding: 6px 6px 6px 14px; }
.rb-play { flex: none; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: #fff; color: #2c2a26; box-shadow: 0 2px 10px rgba(0,0,0,0.25); }
.rb-play svg { width: 18px; height: 18px; }
.rb-icon-pause { display: none; }
.rb-play.on { background: #f3dfa6; }
.rb-play.on .rb-icon-play { display: none; } .rb-play.on .rb-icon-pause { display: block; }
.rb-text { flex: 1; min-width: 0; }
.rb-title { font-weight: 800; font-size: .86rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; gap: 6px; align-items: center; }
.rb-live { color: #ff6b5b; font-size: .6rem; display: none; animation: breathe 2s infinite; }
.radio-bar.on .rb-live { display: inline; }
.rb-sub { font-size: .74rem; opacity: .75; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rb-eq { display: none; gap: 2px; align-items: flex-end; height: 16px; flex: none; }
.radio-bar.on .rb-eq { display: flex; }
.rb-eq i { width: 3px; background: #f3dfa6; border-radius: 2px; animation: eq 1s ease-in-out infinite; }
.rb-eq i:nth-child(2) { animation-delay: -.3s; } .rb-eq i:nth-child(3) { animation-delay: -.6s; } .rb-eq i:nth-child(4) { animation-delay: -.15s; }
@keyframes eq { 0%, 100% { height: 4px; } 50% { height: 16px; } }
#hud .now-playing { display: none !important; }
#hud #tasbeehPanel, #hud .cue, #hud .hint, #hud #dialog { bottom: calc(max(16px, env(safe-area-inset-bottom)) + 160px); }
@media (max-width: 860px) {
  .prayer-chip { font-size: .8rem; }
  .radio-bar { width: calc(100% - 24px); }
}

/* inputs on the dark HUD keep a white box, so their text must be dark to be readable */
#hud input, #hud select, #hud textarea { color: #2c2a26; caret-color: #2f5a47; }
#hud input::placeholder { color: #8a8378; opacity: 1; }

/* ---- Big prayer alert (centre of the screen) ---- */
#hud .big-alert { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -58%); width: min(380px, calc(100% - 28px)); padding: 22px 20px 18px; text-align: center; border-radius: 26px; animation: alertIn .35s ease-out; z-index: 20; }
@keyframes alertIn { from { opacity: 0; transform: translate(-50%, -52%) scale(.94); } }
#hud .big-alert .adhan-ar { font-size: 2rem; color: #f3dfa6; line-height: 1.5; }
.ba-label { font-weight: 800; font-size: 1.35rem; color: #fff; margin-top: 2px; }
.ba-count { font-size: 3.2rem; font-weight: 800; color: #fff; font-variant-numeric: tabular-nums; letter-spacing: 1px; line-height: 1.15; margin: 6px 0 4px; }
.big-alert.urgent .ba-count { color: #ffd27a; animation: breathe 1.2s ease-in-out infinite; }
.big-alert.urgent { border-color: rgba(255, 210, 122, 0.6); box-shadow: 0 0 0 4px rgba(255, 210, 122, 0.15), 0 10px 40px rgba(0,0,0,.35); }
#hud .big-alert .adhan-sub { margin: 4px 0 14px; font-size: .9rem; }
.ba-actions { display: grid; gap: 8px; }
.ba-actions .ghost { background: rgba(255,255,255,0.12); color: #fff; border-color: rgba(255,255,255,0.25); }
#hud .big-alert .pop-x { font-size: 1.4rem; }

/* ---- Listen to Qur'an: mode switch ---- */
.rb-mode { flex: none; padding: 5px 10px; border-radius: 999px; font-size: .72rem; font-weight: 800; color: #2c2a26; background: rgba(255,255,255,0.9); white-space: nowrap; }
.rb-mode:hover { background: #fff; }

/* ---- Masjid list ---- */
#roomPill { cursor: pointer; }
#roomPill:hover { background: rgba(28, 26, 22, 0.5); }
.pill-caret { width: 16px; height: 16px; opacity: .8; margin-inline-start: -2px; }
.rooms-overlay { position: absolute; inset: 0; display: grid; place-items: center; padding: 16px; background: rgba(0,0,0,0.25); z-index: 30; }
#hud .rooms-card { width: min(460px, 100%); max-height: min(720px, calc(100vh - 32px)); display: flex; flex-direction: column; padding: 20px 18px 16px; border-radius: 28px; animation: pop .2s ease-out; }
.rooms-head { display: flex; align-items: center; justify-content: space-between; }
.rooms-head h2 { margin: 0; color: #fff; font-size: 1.25rem; }
.rooms-head .pop-x { position: static; width: 36px; height: 36px; border-radius: 50%; background: rgba(255,255,255,0.1); }
.rooms-sub { margin: 10px 0 14px; color: rgba(255,255,255,0.85); font-size: .9rem; }
.rooms-row { display: flex; justify-content: space-between; align-items: center; font-size: .85rem; color: rgba(255,255,255,0.8); }
.rooms-refresh { color: rgba(255,255,255,0.85); font-size: .82rem; text-decoration: underline; text-underline-offset: 3px; }
.rooms-note { margin: 8px 0 12px; font-size: .78rem; color: rgba(255,255,255,0.6); }
.rooms-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; overflow-y: auto; padding-inline-end: 4px; }
.room-card { position: relative; overflow: hidden; display: grid; gap: 4px; text-align: start; padding: 12px 14px 14px; border-radius: 16px; background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.18); color: #fff; }
.room-card b { font-size: .95rem; }
.room-card span { font-size: .8rem; color: rgba(255,255,255,0.75); font-variant-numeric: tabular-nums; }
.room-card i { position: absolute; left: 0; bottom: 0; height: 3px; width: var(--fill); background: #f3dfa6; opacity: .8; }
html[dir="rtl"] .room-card i { left: auto; right: 0; }
.room-card:hover:not(:disabled) { background: rgba(255,255,255,0.16); }
.room-card.here { border-color: #7be0a6; background: rgba(123, 224, 166, 0.12); }
.room-card.full { opacity: .45; cursor: not-allowed; }
.rooms-grid { flex: 1; min-height: 0; grid-auto-rows: max-content; }
.room-card { min-height: 66px; align-content: start; }

/* ---- Achievements ---- */
.ach-btn { position: relative; }
.ach-badge { position: absolute; top: -4px; inset-inline-end: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #f2c94c; color: #2c2a26; font-size: .66rem; font-weight: 800; display: grid; place-items: center; }
.trophy-toast { position: absolute; top: calc(max(12px, env(safe-area-inset-top)) + 8px); left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 12px; padding: 10px 18px 10px 10px; border-radius: 18px; min-width: min(320px, calc(100% - 24px)); z-index: 40; border-color: var(--tier) !important; box-shadow: 0 0 0 1px var(--tier), 0 10px 36px rgba(0,0,0,0.35) !important; animation: trophyIn .45s cubic-bezier(.2,1.2,.4,1); }
.trophy-toast.out { animation: trophyOut .45s ease-in forwards; }
@keyframes trophyIn { from { transform: translate(-50%, -140%); opacity: 0; } }
@keyframes trophyOut { to { transform: translate(-50%, -140%); opacity: 0; } }
.tt-icon { width: 46px; height: 46px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: 1.5rem; background: radial-gradient(circle at 35% 30%, rgba(255,255,255,0.35), rgba(255,255,255,0.05)); box-shadow: inset 0 0 0 2px var(--tier); }
.tt-text { display: grid; }
.tt-text small { color: var(--tier); font-weight: 800; font-size: .72rem; text-transform: uppercase; letter-spacing: .6px; }
.tt-text b { color: #fff; font-size: 1rem; }
.ach-card { width: min(520px, 100%) !important; }
.ach-summary { display: flex; justify-content: space-between; align-items: center; color: #fff; margin: 10px 0 6px; }
.ach-tiers { display: flex; gap: 12px; font-size: .82rem; color: rgba(255,255,255,0.85); }
.ach-tiers span { display: flex; align-items: center; gap: 5px; }
.ach-tiers i { width: 11px; height: 11px; border-radius: 50%; }
.ach-bar { height: 6px; border-radius: 3px; background: rgba(255,255,255,0.12); overflow: hidden; }
.ach-bar i { display: block; height: 100%; width: var(--fill); background: linear-gradient(90deg, #f2c94c, #a9d8ff); }
.ach-tabs { display: flex; gap: 6px; margin: 12px 0 10px; }
.ach-tabs button { padding: 6px 12px; border-radius: 999px; font-size: .8rem; font-weight: 700; color: rgba(255,255,255,0.75); background: rgba(255,255,255,0.08); }
.ach-tabs button.on { background: #fff; color: #2c2a26; }
.ach-list { flex: 1; min-height: 0; overflow-y: auto; display: grid; gap: 8px; grid-auto-rows: max-content; padding-inline-end: 4px; }
.ach-row { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 14px; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1); }
.ach-row.done { background: rgba(255,255,255,0.12); border-color: color-mix(in srgb, var(--tier) 60%, transparent); }
.ach-icon { width: 40px; height: 40px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: 1.25rem; box-shadow: inset 0 0 0 2px var(--tier); background: rgba(0,0,0,0.15); }
.ach-row:not(.done) .ach-icon { box-shadow: inset 0 0 0 2px rgba(255,255,255,0.2); font-size: 1rem; opacity: .8; }
.ach-text { flex: 1; min-width: 0; display: grid; gap: 2px; }
.ach-text b { color: #fff; font-size: .9rem; }
.ach-text span { color: rgba(255,255,255,0.7); font-size: .78rem; }
.ach-text small { color: rgba(255,255,255,0.6); font-size: .7rem; font-variant-numeric: tabular-nums; }
.ach-prog { height: 4px; border-radius: 2px; background: rgba(255,255,255,0.12); overflow: hidden; margin-top: 3px; }
.ach-prog i { display: block; height: 100%; background: var(--tier); }
.ach-tier { flex: none; font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; color: var(--tier); }

/* ---- Wudu ---- */
.wudu-btn { background: rgba(32, 96, 110, 0.75) !important; }
.wudu-btn:hover { background: rgba(32, 120, 140, 0.9) !important; }
.tag.me.has-wudu::after { content: '💧'; margin-inline-start: 4px; }
.wudu-card { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(max(16px, env(safe-area-inset-bottom)) + 160px); width: min(340px, calc(100% - 24px)); padding: 14px 16px; border-radius: 20px; text-align: center; animation: pop .2s ease-out; }
.wudu-head { display: flex; align-items: center; justify-content: center; gap: 8px; color: #fff; font-size: 1.05rem; }
.wudu-drop { font-size: 1.3rem; animation: breathe 1.2s infinite; }
.wudu-pct { color: #9fe3ef; font-weight: 800; font-variant-numeric: tabular-nums; }
.wudu-step { color: rgba(255,255,255,0.9); font-weight: 700; margin: 6px 0 10px; min-height: 1.3em; }
.wudu-bar { height: 8px; border-radius: 4px; background: rgba(255,255,255,0.15); overflow: hidden; }
.wudu-bar i { display: block; height: 100%; background: linear-gradient(90deg, #6fd3e6, #bff3fb); transform: scaleX(0); transform-origin: left; }
html[dir="rtl"] .wudu-bar i { transform-origin: right; }
.wudu-dots { display: flex; justify-content: center; gap: 6px; margin-top: 10px; }
.wudu-dots i { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,0.2); transition: background .2s; }
.wudu-dots i.on { background: #9fe3ef; }

.loader-note { margin: 18px 0 0; max-width: min(320px, 80vw); text-align: center; font-size: .8rem; line-height: 1.55; color: var(--muted); }
html[lang="ur"] .loader-note, html[lang="ar"] .loader-note { line-height: 2; }

/* exit to the welcome screen (top left, beside the masjid name) */
.exit-btn { position: absolute; top: max(12px, env(safe-area-inset-top)); inset-inline-start: 12px; color: #fff; }
html[dir="rtl"] .exit-btn svg { transform: scaleX(-1); }
#hud #roomPill { inset-inline-start: 62px; max-width: calc(100% - 200px); }

/* ---- Sign in (welcome card) ---- */
.guest-sub { margin: 6px 0 0; font-size: .8rem; color: var(--muted); }
.signed-row { margin-top: 8px; font-size: .85rem; color: var(--muted); }
.signed-row b { color: var(--green); }
.linkish { color: var(--green); text-decoration: underline; text-underline-offset: 3px; font-weight: 700; font-size: .85rem; }
.or-line { display: flex; align-items: center; gap: 10px; margin: 18px 0 10px; color: var(--muted); font-size: .78rem; font-weight: 700; }
.or-line::before, .or-line::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.google-btn { display: flex; justify-content: center; min-height: 0; margin-bottom: 8px; }
.google-btn:empty { display: none; }
.ghost.wide { width: 100%; padding: 10px 16px; }
.contact-form { display: flex; gap: 6px; margin-top: 8px; }
.contact-form input { flex: 1; min-width: 0; padding: 10px 14px; border-radius: 999px; border: 1px solid var(--line); background: #fff; }
.small-note { margin-top: 8px !important; font-size: .72rem !important; }
.wa-link { display: inline-flex; align-items: center; gap: 6px; margin-top: 14px; color: #128c4b; font-weight: 800; font-size: .85rem; text-decoration: none; }
.wa-link svg, .wa-btn svg { width: 18px; height: 18px; }
.wa-btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px; border-radius: 999px; background: #25d366; color: #fff !important; font-weight: 800; text-decoration: none; }
.acct-line { margin: 0; font-size: .88rem; color: var(--muted); }
/* WhatsApp prompt in the masjid */
.wa-prompt { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -55%); width: min(340px, calc(100% - 28px)); padding: 20px 18px 16px; text-align: center; border-radius: 24px; z-index: 21; animation: pop .25s ease-out; }
.wa-prompt b { display: block; color: #fff; font-size: 1.1rem; margin-top: 6px; }
.wa-prompt p { color: rgba(255,255,255,0.8); font-size: .88rem; margin: 6px 0 14px; }
.wa-icon { width: 54px; height: 54px; margin: 0 auto; border-radius: 50%; display: grid; place-items: center; background: #25d366; color: #fff; }
.wa-icon svg { width: 30px; height: 30px; }
.wa-actions { display: grid; gap: 8px; }
.wa-actions .wa-btn { justify-content: center; padding: 12px; }
.wa-actions .ghost { background: rgba(255,255,255,0.12); color: #fff; border-color: rgba(255,255,255,0.25); }

/* ---- Library: juz picker ---- */
.juz-card { width: min(560px, 100%) !important; }
.juz-lang { margin: 12px 0 4px; background: rgba(255,255,255,0.1); }
.juz-lang button { color: rgba(255,255,255,0.8); }
.juz-lang button.on { background: #fff; color: #2c2a26; }
.juz-grid { flex: 1; min-height: 0; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; grid-auto-rows: max-content; }
.juz-btn { display: grid; gap: 2px; text-align: start; padding: 10px 12px; border-radius: 14px; background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.16); color: #fff; }
.juz-btn:hover { background: rgba(255,255,255,0.16); }
.juz-btn .jn { font-size: .72rem; color: rgba(255,255,255,0.65); font-weight: 700; }
.juz-btn .ja { font-family: 'Amiri', serif; font-size: 1.15rem; color: #f3dfa6; line-height: 1.5; }
.juz-btn .je { font-size: .74rem; color: rgba(255,255,255,0.7); }
.juz-btn.done { border-color: rgba(123, 224, 166, 0.7); }
.juz-btn.done .jn::after { content: ' ✓'; color: #7be0a6; }

/* ---- Reader: the book ---- */
.reader { position: fixed; inset: 0; z-index: 45; display: grid; grid-template-rows: auto 1fr auto; background: radial-gradient(ellipse at 50% 40%, rgba(40,30,20,0.55), rgba(10,8,6,0.88)); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); padding: max(10px, env(safe-area-inset-top)) 12px max(10px, env(safe-area-inset-bottom)); animation: readerIn .45s ease-out; }
@keyframes readerIn { from { opacity: 0; transform: scale(1.04); } }
.r-top { display: flex; align-items: center; gap: 10px; color: #fff; }
.r-close { width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,0.12); color: #fff; font-size: 1.4rem; }
.r-title { flex: 1; text-align: center; font-weight: 800; font-size: .95rem; color: #f3dfa6; }
.r-lang { display: flex; gap: 4px; background: rgba(255,255,255,0.1); border-radius: 999px; padding: 3px; }
.r-lang button { color: rgba(255,255,255,0.8); padding: 4px 10px; border-radius: 999px; font-size: .8rem; font-weight: 700; }
.r-lang button.on { background: #fff; color: #2c2a26; }
.book-wrap { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 0; perspective: 2400px; }
.r-nav { flex: none; width: 44px; height: 64px; border-radius: 14px; color: #fff; background: rgba(255,255,255,0.1); font-size: 2rem; }
.r-nav:hover { background: rgba(255,255,255,0.2); }
.book { position: relative; display: grid; grid-template-columns: 1fr 1fr; width: min(1180px, 100%); height: min(88vh, calc(100vh - 120px)); max-height: 900px; padding: 14px; border-radius: 10px; background: linear-gradient(90deg, #3a2414, #5a3a22 48%, #2c1a0e 50%, #5a3a22 52%, #3a2414); box-shadow: 0 30px 80px rgba(0,0,0,0.6), inset 0 0 0 2px rgba(201,160,70,0.5); transform: rotateX(4deg); transform-style: preserve-3d; cursor: pointer; }
.book.single { grid-template-columns: 1fr; width: min(640px, 100%); background: linear-gradient(90deg, #2c1a0e, #5a3a22 4%, #3a2414); }
.book.single .pg-b, .book.single .spine { display: none; }
.page { position: relative; overflow: hidden; background: #f6ecd2; background-image: radial-gradient(ellipse at 50% 50%, rgba(255,250,235,0.9), rgba(236,220,182,0.95) 80%), repeating-linear-gradient(0deg, rgba(120,90,40,0.025) 0 2px, transparent 2px 4px); padding: 26px 30px 34px; }
.pg-a { border-radius: 4px 0 0 4px; box-shadow: inset -24px 0 30px -18px rgba(90,60,20,0.45); }
.pg-b { border-radius: 0 4px 4px 0; box-shadow: inset 24px 0 30px -18px rgba(90,60,20,0.45); }
.book.single .pg-a { border-radius: 4px; box-shadow: inset 14px 0 24px -16px rgba(90,60,20,0.4); }
.page::before { content: ''; position: absolute; inset: 10px; border: 2px solid rgba(160,120,40,0.55); outline: 1px solid rgba(160,120,40,0.35); outline-offset: 3px; border-radius: 3px; pointer-events: none; }
.spine { position: absolute; left: 50%; top: 14px; bottom: 14px; width: 2px; transform: translateX(-1px); background: rgba(60,40,20,0.35); }
.page-inner { height: 100%; overflow: hidden; color: #2b2116; text-align: justify; }
.page.measure { position: absolute; visibility: hidden; left: 0; top: 0; pointer-events: none; }
.pg-num { position: absolute; bottom: 14px; left: 0; right: 0; text-align: center; font-size: .8rem; color: #8a6a35; font-weight: 700; }
.pg-status { height: 100%; display: grid; place-items: center; color: #8a6a35; font-weight: 700; }
.reader[data-lang="ar"] .page-inner { direction: rtl; font-family: 'Amiri', serif; font-size: clamp(1.25rem, 2.1vw, 1.65rem); line-height: 2.15; text-align: justify; text-align-last: center; }
.reader[data-lang="ur"] .page-inner { direction: rtl; font-family: 'Noto Nastaliq Urdu', serif; font-size: clamp(0.95rem, 1.5vw, 1.15rem); line-height: 2.35; }
.reader[data-lang="en"] .page-inner { font-family: Georgia, 'Times New Roman', serif; font-size: clamp(0.95rem, 1.45vw, 1.1rem); line-height: 1.75; }
.ayah .am { color: #8a5a10; font-weight: 700; white-space: nowrap; }
.reader[data-lang="en"] .ayah .am { display: inline-grid; place-items: center; min-width: 1.5em; height: 1.5em; border-radius: 50%; border: 1.5px solid #b58a3a; font-size: .7em; font-family: 'Nunito', sans-serif; vertical-align: 2px; margin: 0 2px; }
.surah-head { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 6px 0 10px; padding: 6px 10px; border: 2px solid #b58a3a; border-radius: 8px; background: linear-gradient(180deg, rgba(47,90,71,0.12), rgba(47,90,71,0.05)); text-align: center; }
.surah-head b { display: block; color: #2f5a47; font-size: 1.15em; }
.surah-head small { display: block; color: #8a6a35; font-size: .7em; }
.sh-orn { color: #b58a3a; font-size: 1.2em; }
.basmala { text-align: center; font-family: 'Amiri', serif; font-size: 1.35em; color: #2f5a47; margin: 2px 0 8px; direction: rtl; }
.r-bottom { display: flex; align-items: center; gap: 12px; color: rgba(255,255,255,0.8); font-size: .82rem; font-weight: 700; padding-top: 8px; }
.r-progress { flex: 1; height: 4px; border-radius: 2px; background: rgba(255,255,255,0.15); overflow: hidden; }
.r-prog { display: block; height: 100%; background: #f3dfa6; transform-origin: left; }
.reader[data-lang="ar"] .r-prog, .reader[data-lang="ur"] .r-prog { transform-origin: right; }
/* the turning sheet */
.sheet { position: absolute; top: 14px; bottom: 14px; width: calc(50% - 14px); transform-style: preserve-3d; transition: transform .7s cubic-bezier(.4,.1,.25,1); z-index: 3; pointer-events: none; }
.sheet.on-right { left: 50%; transform-origin: left center; }
.sheet.on-left { left: 14px; transform-origin: right center; }
.sheet.full { left: 14px; width: calc(100% - 28px); }
.sheet.full.on-right { transform-origin: left center; }
.sheet.full.on-left { transform-origin: right center; }
.sheet.on-right.turn { transform: rotateY(-180deg); }
.sheet.on-left.turn { transform: rotateY(180deg); }
.sheet .face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.sheet .back { transform: rotateY(180deg); }
.sheet .face::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(90deg, rgba(0,0,0,0.18), transparent 30%, transparent 70%, rgba(0,0,0,0.12)); }
.sheet.turn .front::after { animation: shade .7s ease-in-out; }
@keyframes shade { 50% { background: rgba(0,0,0,0.25); } }
@media (max-width: 899px) { .r-nav { display: none; } .book { height: calc(100vh - 110px); padding: 8px; } .page { padding: 20px 20px 30px; } .sheet { top: 8px; bottom: 8px; } .sheet.full { left: 8px; width: calc(100% - 16px); } }
/* read button above your head */
.read-btn { background: rgba(110, 72, 30, 0.8) !important; }

.linkish.light { color: #f3dfa6; }

.page-inner { height: calc(100% - 16px); }

/* ---- Welcome screen in 3 steps ---- */
.steps-dots { display: flex; justify-content: center; gap: 6px; margin: 4px 0 14px; }
.steps-dots i { width: 8px; height: 8px; border-radius: 4px; background: var(--line); transition: width .25s, background .25s; }
.steps-dots i.on { width: 22px; background: var(--green); }
.steps-dots i.done { background: rgba(47,90,71,0.45); }
.step { display: grid; gap: 12px; animation: stepIn .3s ease-out; }
@keyframes stepIn { from { opacity: 0; transform: translateX(14px); } }
html[dir="rtl"] .step { animation-name: stepInRtl; }
@keyframes stepInRtl { from { opacity: 0; transform: translateX(-14px); } }
.step .field { margin-bottom: 0; }
.step .seg { margin-bottom: 4px; }
.step-back { justify-self: center; font-size: .82rem; color: var(--muted); }
.hello { margin: 0; color: var(--green); font-weight: 800; font-size: 1.05rem; }
.hello button { margin-inline-start: 6px; font-size: .78rem; }
#signinBox .or-line { margin-top: 6px; }
.intro-card .wa-link { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); width: 100%; justify-content: center; }

/* an ayah shared when you pet one of the masjid cats */
.ayah-card { position: absolute; left: 50%; top: calc(max(12px, env(safe-area-inset-top)) + 64px); transform: translateX(-50%); background: rgba(18, 26, 22, 0.86) !important; max-height: 46vh; overflow-y: auto; width: min(460px, calc(100% - 24px)); padding: 14px 18px 12px; border-radius: 20px; text-align: center; z-index: 30; animation: pop .3s ease-out; pointer-events: auto; }
.ayah-close { position: absolute; top: 6px; right: 8px; width: 28px; height: 28px; border: 0; border-radius: 50%; background: rgba(255,255,255,0.12); color: inherit; font-size: 1.1rem; cursor: pointer; }
.ayah-mood { font-size: .8rem; font-weight: 700; opacity: .85; margin: 0 24px 6px; }
.ayah-ar { font-family: 'Amiri', serif; font-size: 1.35rem; line-height: 1.9; margin: 0 0 6px; color: var(--gold); }
.ayah-tr { font-size: .9rem; line-height: 1.45; margin: 0 0 8px; }
.ayah-tr:lang(ur) { font-family: 'Noto Nastaliq Urdu', serif; line-height: 2.1; direction: rtl; }
.ayah-ref { font-size: .75rem; font-weight: 800; letter-spacing: .02em; opacity: .75; }
@media (max-width: 640px) { .ayah-card { top: calc(max(10px, env(safe-area-inset-top)) + 96px); } .ayah-ar { font-size: 1.2rem; } .ayah-tr { font-size: .84rem; } }

/* location row in the masjid picker */
.rooms-loc { display: flex; gap: 8px; align-items: flex-end; margin-top: 12px; }
.rooms-loc-field { flex: 1; display: flex; flex-direction: column; gap: 4px; font-size: .78rem; font-weight: 700; color: rgba(255,255,255,0.75); }
#hud .rooms-loc-field select { width: 100%; padding: 9px 10px; border-radius: 12px; border: 1px solid rgba(255,255,255,0.22); background: rgba(0,0,0,0.28); color: #fff; -webkit-text-fill-color: #fff; opacity: 1; font: 700 .9rem var(--font); }
.rooms-loc-field select option { color: #222; }
.rooms-locate { flex: none; padding: 9px 12px; border-radius: 12px; border: 1px solid rgba(255,255,255,0.18); background: rgba(255,255,255,0.12); color: #fff; font: 700 .8rem var(--font); cursor: pointer; white-space: nowrap; }
.rooms-locate:disabled { opacity: .6; cursor: default; }

/* page slider beside the book */
.r-scrub { flex: none; align-self: stretch; width: 52px; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 18px 0; touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; }
.r-scrub.dragging { cursor: grabbing; }
.r-scrub-end { font: 800 .72rem var(--font); color: rgba(255,255,255,0.6); }
.r-scrub-track { position: relative; flex: 1; width: 12px; border-radius: 8px; background: rgba(255,255,255,0.16); }
.r-scrub-fill { position: absolute; left: 0; right: 0; top: 0; height: var(--p, 0%); border-radius: 8px; background: rgba(243,210,122,0.55); }
.r-scrub-thumb { position: absolute; left: 50%; top: var(--p, 0%); width: 34px; height: 34px; margin: -17px 0 0 -17px; border-radius: 50%; background: #f3d27a; border: 3px solid #fff7e0; box-shadow: 0 2px 12px rgba(0,0,0,0.45); }
.r-scrub-thumb span { position: absolute; right: 44px; top: 50%; transform: translateY(-50%); background: rgba(18,24,21,0.92); color: #fff; padding: 5px 11px; border-radius: 10px; font: 800 .9rem var(--font); white-space: nowrap; opacity: 0; transition: opacity .15s; pointer-events: none; }
.r-scrub.dragging .r-scrub-thumb span, .r-scrub:hover .r-scrub-thumb span { opacity: 1; }
@media (max-width: 899px) { .r-scrub { width: 40px; padding: 10px 0; } .r-scrub-thumb { width: 30px; height: 30px; margin: -15px 0 0 -15px; } }

/* ---- Phones ---- */
/* touch screens: no keyboard keys on the buttons */
.touch .talk-btn kbd, .touch .talk-prompt kbd, .touch .talk-btn.nearest kbd { display: none !important; }
.touch .talk-btn { padding: 6px 12px; }
@media (max-width: 640px) {
  /* top bar: the masjid pill never runs into the buttons on the right */
  #hud #roomPill { max-width: calc(100% - 214px); }
  .top-right { gap: 6px; }
  /* bottom: languages live in Settings and on the welcome card, so the scene gets more room */
  .lang-bar { display: none; }
  .radio-bar { bottom: calc(max(14px, env(safe-area-inset-bottom)) + 80px); }
  #hud #tasbeehPanel, #hud .cue, #hud .hint, #hud #dialog { bottom: calc(max(14px, env(safe-area-inset-bottom)) + 136px); }
  .hint { font-size: .76rem; padding: 7px 12px; }
  /* welcome card: language switch sits above the logo instead of over it */
  .lang-switch { position: static; width: fit-content; margin: 0 auto 10px; }
}
