/* Darul Ihsan TV mode: a full-screen prayer display for a screen in the masjid.
   Everything is sized from the viewport so it fills any TV without scrolling. */
:root {
  --sky-1: #03130d; --sky-2: #082419; --sky-3: #103626; --sun: #e9c46a;
  --ink: #11261c;
  --display: 'Bricolage Grotesque', system-ui, sans-serif;
  --text: 'Hanken Grotesk', system-ui, sans-serif;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --u: min(1vw, 1.78vh); /* one unit = 1% of a 16:9 frame */
}
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; overflow: hidden; background: var(--sky-1); color: #fff; font: 400 calc(var(--u) * 1.5)/1.4 var(--text); -webkit-font-smoothing: antialiased; }
body.idle, body.idle * { cursor: none !important; }
h1, p, figure { margin: 0; }
.tnum { font-variant-numeric: tabular-nums; }

.sky { position: fixed; inset: 0; z-index: -1; background: linear-gradient(180deg, var(--sky-1) 0%, var(--sky-2) 48%, var(--sky-3) 100%); }
.sky-stars { position: absolute; inset: 0 0 30%; opacity: var(--stars, 0); transition: opacity 3s ease;
  background-image: radial-gradient(1px 1px at 12% 18%, #fff, transparent), radial-gradient(1px 1px at 28% 42%, #fffc, transparent), radial-gradient(1.5px 1.5px at 44% 12%, #fff, transparent), radial-gradient(1px 1px at 63% 30%, #fffb, transparent), radial-gradient(1px 1px at 78% 8%, #fff, transparent), radial-gradient(1.5px 1.5px at 88% 36%, #fffd, transparent), radial-gradient(1px 1px at 6% 52%, #fff9, transparent), radial-gradient(1px 1px at 52% 55%, #fff8, transparent);
  background-size: 640px 520px; }
.sky-glow { position: absolute; width: 90vmax; height: 90vmax; left: var(--gx, 70%); top: var(--gy, 40%); transform: translate(-50%, -50%); background: radial-gradient(closest-side, color-mix(in srgb, var(--sun) 32%, transparent), transparent 70%); opacity: var(--glow, 0.4); transition: opacity 3s ease, left 2s var(--ease-out), top 2s var(--ease-out); }

.tv { height: 100vh; height: 100dvh; display: grid; grid-template-rows: auto 1fr; padding: calc(var(--u) * 2.6) calc(var(--u) * 3.4) calc(var(--u) * 2); gap: calc(var(--u) * 1.2); }

/* Top: name, bismillah, clock */
.tv-top { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: calc(var(--u) * 2); }
.tv-brand { display: flex; align-items: center; gap: calc(var(--u) * 1.1); }
/* Official logo, never recoloured, directly on the sky with no plate */
.tv-logo { flex-shrink: 0; width: calc(var(--u) * 5.6); height: calc(var(--u) * 5.6); }
.tv-logo img { width: 100%; height: 100%; object-fit: contain; display: block; }
.tv-brand b { display: block; font: 600 calc(var(--u) * 1.9)/1.1 var(--display); letter-spacing: -0.02em; }
.tv-brand span { font-size: calc(var(--u) * 1.25); color: #ffffffd9; }
.tv-bismillah { font-family: 'Amiri', serif; font-size: calc(var(--u) * 2.6); color: var(--sun); white-space: nowrap; }
.tv-clock { justify-self: end; text-align: right; }
.tv-clock b { display: block; font: 500 calc(var(--u) * 4.2)/1 var(--display); letter-spacing: -0.02em; }
.tv-clock > span { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 0 calc(var(--u) * 1); font-size: calc(var(--u) * 1.35); margin-top: calc(var(--u) * 0.5); }
.tv-hijri { color: var(--sun); }

/* Middle: the next prayer and the sun's path */
.tv-main { display: grid; grid-template-columns: 1fr 1.05fr; align-items: center; gap: calc(var(--u) * 3); min-height: 0; overflow: hidden; padding-bottom: calc(var(--u) * 1); }
.tv-pre { font-size: calc(var(--u) * 2.1); }
.tv-pre.now { color: var(--sun); font-weight: 600; }
.tv-name { font: 600 calc(var(--u) * 13)/0.86 var(--display); font-variation-settings: 'wdth' 80, 'opsz' 96; letter-spacing: -0.04em; margin: calc(var(--u) * 0.4) 0 calc(var(--u) * 1); }
.tv-name.swap { animation: swap 900ms var(--ease-out); }
@keyframes swap { from { opacity: 0; transform: translateY(calc(var(--u) * 2)); filter: blur(10px); } }
.tv-at { display: flex; align-items: baseline; gap: calc(var(--u) * 2); font: 500 calc(var(--u) * 3.8)/1 var(--display); letter-spacing: -0.02em; }
.tv-ar { font-family: 'Amiri', serif; color: var(--sun); font-size: 0.9em; }
.tv-count { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 calc(var(--u) * 1.2); margin-top: calc(var(--u) * 1.6); }
.tv-in { font-size: calc(var(--u) * 2.1); }
.clock { display: inline-flex; align-items: baseline; font: 500 calc(var(--u) * 5)/1 var(--display); letter-spacing: -0.02em; }
.clock .unit { font-family: var(--text); font-size: 0.38em; margin: 0 calc(var(--u) * 1) 0 calc(var(--u) * 0.4); letter-spacing: 0; }
.clock .unit:last-child { margin-right: 0; }
.digit { display: inline-block; overflow: hidden; height: 1.08em; }
.digit > span { display: block; }

.dial { min-height: 0; height: 100%; display: flex; align-items: center; }
.dial-svg { width: 100%; max-height: 100%; overflow: visible; }
.dial-day { fill: none; stroke: #ffffff40; stroke-width: 1.5; stroke-dasharray: 2 7; stroke-linecap: round; }
.dial-night { fill: none; stroke: #ffffff22; stroke-width: 1.5; stroke-dasharray: 2 7; stroke-linecap: round; }
.dial-trail { fill: none; stroke: var(--sun); stroke-width: 2.5; stroke-linecap: round; transition: stroke-dashoffset 2s var(--ease-out); }
.dial-horizon { stroke: #ffffff4d; stroke-width: 1; }
.dial-disc { fill: #fff3d0; }
.dial-body { transition: transform 2s var(--ease-out); }
.dial-body.moon .dial-disc { fill: #f3ecd2; }
.mark circle { fill: var(--sky-2); stroke: #ffffffb3; stroke-width: 1.5; }
.mark text { fill: #fff; font: 600 19px var(--text); }
.mark text.t { font-weight: 500; font-size: 16px; fill: #ffffffd9; }
.mark.next circle { fill: var(--sun); stroke: #fff; r: 8; }
.mark.past circle { fill: #ffffff99; stroke: none; }

/* Bottom: the day's times */
.slots { list-style: none; margin: 0; padding: calc(var(--u) * 1.6) 0 0; display: grid; grid-template-columns: repeat(6, 1fr); gap: calc(var(--u) * 0.8); }
.slot { position: relative; padding: calc(var(--u) * 1.3) calc(var(--u) * 1.5) calc(var(--u) * 1.5); border-radius: calc(var(--u) * 1.4); background: #04150e99; transition: transform 800ms var(--ease-out), background-color 800ms ease; }
.slot-name { display: flex; justify-content: space-between; align-items: baseline; font-size: calc(var(--u) * 1.7); font-weight: 600; }
.slot-name span { font-family: 'Amiri', serif; font-weight: 400; font-size: calc(var(--u) * 1.9); color: #ffffffd9; }
/* A time stays on one line. "12:00 PM" used to wrap, which made the whole row taller and pushed the countdown off the screen. */
.slot time { display: block; margin-top: calc(var(--u) * 0.4); font: 500 calc(var(--u) * 2.9)/1.1 var(--display); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.slot.marker { background: #04150e66; box-shadow: inset 0 0 0 1px #ffffff40; }
.slot.marker time { font-weight: 400; }
.slot.past:not(.current) time { font-weight: 300; }
.slot.current { background: #ffffff26; }
.slot.next { background: #fff; color: var(--ink); transform: translateY(calc(var(--u) * -1.2)); box-shadow: 0 calc(var(--u) * -0.6) calc(var(--u) * 3) calc(var(--u) * -0.6) color-mix(in srgb, var(--sun) 70%, transparent); }
.slot.next .slot-name span { color: #4a5d52; }
.slot-tag { position: absolute; top: calc(var(--u) * -1.1); right: calc(var(--u) * 1.2); font-size: calc(var(--u) * 1.15); font-weight: 700; padding: calc(var(--u) * 0.25) calc(var(--u) * 0.8); border-radius: 999px; background: var(--sun); color: var(--ink); }
.tv-foot { display: flex; justify-content: space-between; align-items: center; gap: calc(var(--u) * 2); padding-top: calc(var(--u) * 1.2); font-size: calc(var(--u) * 1.3); }
.tv-jumuah { padding: max(10px, calc(var(--u) * 0.8)) max(16px, calc(var(--u) * 1.6)); border-radius: 999px; background: #04150e99; }
.tv-jumuah b { margin-right: calc(var(--u) * 0.6); }

/* Notices: one strip under the top bar, on the prayer screen and the announcement screen alike, in type large
   enough to read from across the room. It is a row of its own, so it never sits over the prayer times: the big
   prayer name and the spacing around it give up a little height to make room (a little more for two lines).
   Info is a dark plate with a gold dot; an alert is filled gold with a ringed "!" (shape as well as colour). */
.tv-notices { min-width: 0; font-size: calc(var(--u) * 2.1); }
.tv-notices[hidden] { display: none; }
.tv-notice { display: flex; align-items: center; gap: calc(var(--u) * 1.1); padding: calc(var(--u) * 0.7) calc(var(--u) * 1.8); border-radius: calc(var(--u) * 1.4); background: #04150ecc; box-shadow: inset 0 0 0 1px #ffffff40; font-weight: 600; line-height: 1.2; }
.tv-notice::before { content: ''; flex: none; width: calc(var(--u) * 0.9); height: calc(var(--u) * 0.9); margin: 0 calc(var(--u) * 0.6); border-radius: 50%; background: var(--sun); }
.tv-notice span { flex: 1; min-width: 0; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; }
.tv-notice.is-alert { background: var(--sun); color: var(--ink); box-shadow: none; }
.tv-notice.is-alert::before { content: '!'; display: grid; place-items: center; width: calc(var(--u) * 2.1); height: calc(var(--u) * 2.1); margin: 0; background: none; border: calc(var(--u) * 0.18) solid currentColor; font: 700 calc(var(--u) * 1.4)/1 var(--text); }
.tv-notice-count { flex: none; font-size: calc(var(--u) * 1.5); font-weight: 600; opacity: 0.85; }
body.has-notice .tv { grid-template-rows: auto auto 1fr; padding-top: calc(var(--u) * 2); }
body.has-notice .tv-name { font-size: calc(var(--u) * 9); margin-bottom: calc(var(--u) * 0.6); }
body.has-notice .tv-count { margin-top: calc(var(--u) * 0.8); }
body.notice-tall .tv-name { font-size: calc(var(--u) * 6.6); }
body.notice-tall .tv-pre { font-size: calc(var(--u) * 1.8); }
body.notice-tall .tv-at { font-size: calc(var(--u) * 3.3); }

/* The prayer screen and the announcement screen share one stage */
.tv-stagebox { position: relative; display: grid; grid-template-rows: 1fr auto; min-height: 0; }
.screen-prayer { transition: opacity 900ms var(--ease-out), transform 1100ms var(--ease-out), filter 900ms ease; }
body.announcing .screen-prayer { opacity: 0; transform: scale(0.97); filter: blur(8px); pointer-events: none; }
.screen-announce { position: absolute; inset: 0; display: grid; grid-template-rows: 1fr auto; gap: calc(var(--u) * 1.6); opacity: 0; transform: scale(1.03); filter: blur(8px); transition: opacity 900ms var(--ease-out), transform 1100ms var(--ease-out), filter 900ms ease; pointer-events: none; }
body.announcing .screen-announce { opacity: 1; transform: none; filter: none; }
.ann-slide { position: relative; min-height: 0; }
.slide { position: absolute; inset: 0; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: calc(var(--u) * 4); transition: opacity 800ms var(--ease-out), transform 900ms var(--ease-out); }
.slide.enter { opacity: 0; transform: translateX(calc(var(--u) * 3)); }
.slide.leave { opacity: 0; transform: translateX(calc(var(--u) * -3)); }
.slide img { height: 100%; max-height: calc(100dvh - var(--u) * 22); width: auto; max-width: calc(var(--u) * 46); object-fit: contain; border-radius: calc(var(--u) * 1); box-shadow: 0 calc(var(--u) * 2) calc(var(--u) * 5) calc(var(--u) * -1.5) #000a; justify-self: center; }
.slide-title { margin: 0; font: 600 calc(var(--u) * 5.6)/1 var(--display); font-variation-settings: 'wdth' 92, 'opsz' 96; letter-spacing: -0.01em; word-spacing: 0.06em; text-wrap: balance; }
.slide-text { font-size: calc(var(--u) * 2.1); line-height: 1.35; margin-top: calc(var(--u) * 1.4); max-width: 40ch; }
.slide-register { display: inline-block; margin-top: calc(var(--u) * 1.4); padding: calc(var(--u) * 0.4) calc(var(--u) * 1.4); border-radius: 999px; background: #04150e99; color: var(--sun); font-size: calc(var(--u) * 1.7); font-weight: 600; }
.slide-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: calc(var(--u) * 1.1) calc(var(--u) * 3); margin: calc(var(--u) * 2) 0 0; max-width: calc(var(--u) * 60); }
.slide-facts dt { font-size: calc(var(--u) * 1.4); color: var(--sun); }
.slide-facts dd { margin: 0; font-size: calc(var(--u) * 1.75); line-height: 1.25; }
/* TV mode is text only: no poster on the screen, the words fill it, centred and large enough to read across the hall */
.slide-text-only { grid-template-columns: 1fr; justify-items: center; text-align: center; }
.slide-text-only .slide-body { display: flex; flex-direction: column; align-items: center; width: 100%; max-width: calc(var(--u) * 88); }
.slide-rule { display: block; width: calc(var(--u) * 6); height: calc(var(--u) * 0.4); border-radius: 999px; background: var(--sun); margin-bottom: calc(var(--u) * 1.8); }
.slide-text-only .slide-title { font-size: calc(var(--u) * 6); margin: 0; }
.slide-text-only .slide-text { font-size: calc(var(--u) * 2.4); max-width: 48ch; margin-top: calc(var(--u) * 2); color: #ffffffe6; }
.slide-text-only .slide-facts { grid-template-columns: repeat(auto-fit, minmax(calc(var(--u) * 24), 1fr)); width: 100%; max-width: none; margin-top: calc(var(--u) * 2.6); padding-top: calc(var(--u) * 2); border-top: 1px solid #ffffff2e; gap: calc(var(--u) * 1.4) calc(var(--u) * 3); }
.slide-text-only .slide-facts dt { font-size: calc(var(--u) * 1.45); letter-spacing: 0.04em; }
.slide-text-only .slide-facts dd { font-size: calc(var(--u) * 1.95); font-weight: 500; }
.ann-foot { display: flex; align-items: center; gap: calc(var(--u) * 2); font-size: calc(var(--u) * 1.8); }
.ann-next { padding: calc(var(--u) * 0.7) calc(var(--u) * 1.6); border-radius: 999px; background: #04150e99; white-space: nowrap; }
.ann-progress { flex: 1; height: calc(var(--u) * 0.35); border-radius: 999px; background: #ffffff2e; overflow: hidden; }
.ann-progress span { display: block; height: 100%; background: var(--sun); transform-origin: left; transform: scaleX(0); }

/* Iqamah countdown: the final minute takes over the prayer screen */
.slot-iq { display: block; margin-top: calc(var(--u) * 0.3); font-size: calc(var(--u) * 1.3); font-variant-numeric: tabular-nums; opacity: 0.9; }
body.iqamah-soon .tv-pre { color: var(--sun); font-weight: 600; }
body.iqamah-soon .clock { color: var(--sun); }

/* Iqamah takeover (tv.js): the last minute before each iqamah is a full-screen countdown, then "Please silence your
   phones" for five minutes while the congregation prays. Above everything, including notices; the rotation resumes after.
   Motion is calm and slow (this is seen a handful of times a day, from across the hall): only transform and opacity
   move, plus SVG stroke drawing on small shapes. Entrances and the ring are driven by the Web Animations API in tv.js;
   ambient loops (lantern sway, glow, particles, border shimmer) are CSS keyframes. Reduced motion stops all of it. */
.iq { --gold: #e9c46a; --gold-hi: #f6dc94; --ease-out: cubic-bezier(0.23, 1, 0.32, 1); --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; overflow: hidden; color: #fff;
  background: radial-gradient(120% 90% at 50% 40%, #0f3a29 0%, #082419 55%, #03130d 100%); }
.iq[hidden] { display: none; }
/* Once the takeover covers the screen, the prayer screen under it stops drawing */
body.iq-covered > :not(.iq):not(.tv-controls) { visibility: hidden; } /* the grid above would otherwise override [hidden] */
.iq::before { content: ''; position: absolute; left: 50%; top: 44%; width: 84vmin; height: 84vmin; margin: -42vmin 0 0 -42vmin; border-radius: 50%;
  background: radial-gradient(closest-side, #e9c46a26, transparent 70%); pointer-events: none; animation: iq-breathe 7s ease-in-out infinite; }
@keyframes iq-breathe { 0%, 100% { opacity: 0.7; transform: scale(0.96); } 50% { opacity: 1; transform: scale(1.04); } }

/* Geometric border: a band of eight-point stars around the screen, with a slow light passing along it */
.iq-frame { position: absolute; inset: calc(var(--u) * 1.4); border-radius: calc(var(--u) * 2.2); padding: calc(var(--u) * 3.6); overflow: hidden;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); }
.iq-frame::before { content: ''; position: absolute; inset: 0; opacity: 0.34;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='56'%3E%3Cg fill='none' stroke='%23e9c46a' stroke-width='1.3'%3E%3Crect x='16' y='16' width='24' height='24'/%3E%3Crect x='16' y='16' width='24' height='24' transform='rotate(45 28 28)'/%3E%3Ccircle cx='28' cy='28' r='4'/%3E%3Cpath d='M0 28h8M48 28h8M28 0v8M28 48v8'/%3E%3C/g%3E%3C/svg%3E") 0 0 / calc(var(--u) * 3.6) calc(var(--u) * 3.6); }
.iq-frame::after { content: ''; position: absolute; top: 0; bottom: 0; left: 0; width: 30%;
  background: linear-gradient(90deg, transparent, #f6dc9433 50%, transparent); transform: translateX(-110%); animation: iq-sweep 11s var(--ease-in-out) infinite; }
@keyframes iq-sweep { 0% { transform: translateX(-110%); } 55%, 100% { transform: translateX(440%); } }

/* Slow light motes rising, like dust in lantern light */
.iq-particles { position: absolute; inset: 0; pointer-events: none; }
.iq-particles i { position: absolute; bottom: -2vh; width: var(--s); height: var(--s); border-radius: 50%; background: var(--gold-hi); box-shadow: 0 0 8px #f6dc94aa;
  opacity: 0; animation: iq-rise var(--d) linear var(--delay) infinite; }
@keyframes iq-rise { 0% { transform: translate3d(0, 0, 0); opacity: 0; } 12% { opacity: var(--o); } 80% { opacity: var(--o); } 100% { transform: translate3d(var(--x), -96vh, 0); opacity: 0; } }

/* Hanging lanterns (fanous) on both sides: a slow sway from the chain, and a flickering flame */
.iq-lantern { position: absolute; top: calc(var(--u) * 1.4); width: calc(var(--u) * 7.5); transform-origin: 50% 0; animation: ln-sway 7s ease-in-out infinite alternate; }
.iq-lantern.l { left: 13%; animation-duration: 7.6s; animation-delay: -2s; }
.iq-lantern.r { right: 13%; width: calc(var(--u) * 6.2); animation-duration: 6.4s; }
.iq-lantern svg { display: block; width: 100%; overflow: visible; }
@keyframes ln-sway { from { transform: rotate(-1.6deg); } to { transform: rotate(1.6deg); } }
.ln-chain { stroke: #e9c46a99; stroke-width: 1.2; stroke-dasharray: 3 2; fill: none; }
.ln-metal { fill: var(--gold); }
.ln-body { fill: #0b2e21cc; stroke: var(--gold); stroke-width: 1.6; }
.ln-win { fill: none; stroke: var(--gold); stroke-width: 1.3; }
.ln-flame { animation: ln-flicker 3.4s ease-in-out infinite; }
@keyframes ln-flicker { 0%, 100% { opacity: 1; } 22% { opacity: 0.86; } 41% { opacity: 0.97; } 63% { opacity: 0.85; } 82% { opacity: 0.95; } }
.ln-halo { position: absolute; left: 50%; top: 60%; width: 260%; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%;
  background: radial-gradient(closest-side, #f2c76640, transparent 70%); animation: ln-glow 4.5s ease-in-out infinite alternate; }
@keyframes ln-glow { from { opacity: 0.6; } to { opacity: 1; } }

.iq-screen { position: relative; grid-area: 1 / 1; display: flex; flex-direction: column; align-items: center; text-align: center; }
.iq:not([data-mode="count"]) .iq-count, .iq:not([data-mode="silence"]) .iq-silence { visibility: hidden; }

/* Countdown */
.iq-pre { font: 600 calc(var(--u) * 2.2)/1 var(--text); letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold); }
:root[lang="bn"] .iq-pre { letter-spacing: 0; text-transform: none; font-size: calc(var(--u) * 2.8); }
.iq-ring { position: relative; width: calc(var(--u) * 24); aspect-ratio: 1; margin: calc(var(--u) * 5) 0 calc(var(--u) * 4.4); }
.iq-rosette { position: absolute; inset: -24%; width: 148%; height: 148%; overflow: visible; animation: iq-turn 240s linear infinite; } /* the whole <svg> turns, so it stays on the GPU */
.iq-rosette g { fill: none; stroke: var(--gold); stroke-width: 0.7; opacity: 0.55; }
.iq-rosette .fine { stroke-width: 0.45; opacity: 0.6; }
@keyframes iq-turn { to { transform: rotate(360deg); } }
.iq-dial { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.iq-ticks line { stroke: #ffffff59; stroke-width: 1.4; stroke-linecap: round; transition: opacity 600ms ease, stroke 600ms ease; }
.iq-ticks line.gone { opacity: 0.15; }
.iq-track { fill: #04150ecc; stroke: #ffffff1a; stroke-width: 5; }
.iq-arc { fill: none; stroke: var(--gold); stroke-width: 6; stroke-linecap: round; stroke-dasharray: 552.92; transform: rotate(-90deg); transform-origin: 100px 100px; }
/* A soft wide stroke under the arc stands in for a glow filter, which would cost a blur pass every frame */
.iq-arc-glow { fill: none; stroke: #e9c46a33; stroke-width: 14; stroke-linecap: round; stroke-dasharray: 552.92; transform: rotate(-90deg); transform-origin: 100px 100px; }
.iq-tip { transform-origin: 100px 100px; }
.iq-tip-halo { fill: #f6dc9455; }
.iq-tip-dot { fill: #fff8e1; }
.iq-ring-in { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.iq-time { display: flex; font: 600 calc(var(--u) * 10)/1 var(--display); font-variation-settings: 'wdth' 85, 'opsz' 96; letter-spacing: 0; justify-content: center; transition: color 600ms ease; }
/* Each digit rolls inside its own window. The window is padded a little each side so no glyph's edge is clipped
   (the display face's digits reach past their advance width), and the padding is taken back with a negative margin. */
.iq-time .ch { display: inline-block; overflow: hidden; height: 1.12em; padding: 0.05em 0.08em; margin: -0.05em -0.05em; }
.iq-time .ch > span { display: block; }
.iq-sec { margin-top: calc(var(--u) * 0.6); font-size: calc(var(--u) * 1.6); color: #ffffffcc; letter-spacing: 0.08em; }
.iq-ripple { position: absolute; inset: 3%; border-radius: 50%; box-shadow: 0 0 0 2px var(--gold); opacity: 0; pointer-events: none; }
.iq-name { display: flex; align-items: baseline; gap: calc(var(--u) * 2.4); font: 600 calc(var(--u) * 5.6)/1.15 var(--display); letter-spacing: -0.03em; }
.iq-ar { font: 700 0.82em/1.15 'Amiri', serif; color: var(--gold); letter-spacing: 0; }
.iq-hint { margin-top: calc(var(--u) * 1.1); font-size: calc(var(--u) * 2); color: #ffffffd9; }
:root[lang="bn"] .iq-time { font-size: calc(var(--u) * 9.2); }
.iq.last .iq-time { color: var(--gold-hi); }

/* Silence your phones: the phone sits in nested pointed arches, like a mihrab */
.iq-phone { position: relative; width: calc(var(--u) * 21); aspect-ratio: 1; margin: calc(var(--u) * 3) 0 calc(var(--u) * 2.2); }
.iq-arches { position: absolute; left: -45%; right: -45%; bottom: -6%; width: 190%; overflow: visible; }
.iq-arches path { fill: none; stroke: var(--gold); stroke-width: 1.4; }
.iq-arches path:nth-child(1) { opacity: 0.25; } .iq-arches path:nth-child(2) { opacity: 0.4; } .iq-arches path:nth-child(3) { opacity: 0.6; }
.iq-phone-svg { position: relative; width: 100%; height: 100%; overflow: visible; }
.iq-float { position: relative; width: 100%; height: 100%; animation: ph-float 6s ease-in-out infinite; }
@keyframes ph-float { 0%, 100% { transform: translateY(-1.5%); } 50% { transform: translateY(1.5%); } }
.iq-glow { position: absolute; inset: -14%; border-radius: 50%; background: radial-gradient(closest-side, #e9c46a50, #e9c46a00 72%); animation: iq-glow 4.5s ease-in-out infinite; }
@keyframes iq-glow { 0%, 100% { opacity: 0.55; transform: scale(0.94); } 50% { opacity: 1; transform: scale(1.06); } }
.ph-body { fill: #0b2e21; stroke: #fff; stroke-width: 4; }
.ph-screen { fill: #12402e; }
.ph-detail { fill: #ffffff99; }
.ph-speaker { fill: #fff; }
.ph-waves path { fill: none; stroke: #fff; stroke-width: 4; stroke-linecap: round; opacity: 0; }
.ph-ring { fill: none; stroke: var(--gold); stroke-width: 9; stroke-dasharray: 1; transform: rotate(-135deg); transform-origin: 100px 100px; }
.ph-slash { stroke: var(--gold); stroke-width: 10; stroke-linecap: round; stroke-dasharray: 1; }
.iq-title { font: 600 calc(var(--u) * 5.8)/1.05 var(--display); font-variation-settings: 'wdth' 88, 'opsz' 96; letter-spacing: -0.03em; text-wrap: balance; max-width: 18ch; }
:root[lang="bn"] .iq-title { font-size: calc(var(--u) * 4.8); line-height: 1.3; max-width: 22ch; }
.iq-line { margin-top: calc(var(--u) * 1.6); font-size: calc(var(--u) * 2.5); color: var(--gold); font-weight: 500; }
body .tv-controls { z-index: 60; } /* the Exit button stays reachable over the takeover */
.iq-tag { margin-top: calc(var(--u) * 2.2); padding: calc(var(--u) * 0.6) calc(var(--u) * 1.8); border-radius: 999px; background: #04150e99; box-shadow: inset 0 0 0 1px #ffffff26; font-size: calc(var(--u) * 1.8); color: #ffffffd9; }

/* The moment of iqamah: a ring of gold light spreads out from the countdown */
.iq-burst { position: absolute; left: 50%; top: 50%; width: 40vmin; height: 40vmin; margin: -20vmin 0 0 -20vmin; border-radius: 50%; pointer-events: none; opacity: 0;
  box-shadow: 0 0 0 3px var(--gold), 0 0 60px 10px #e9c46a55, inset 0 0 60px 10px #e9c46a33; }

/* Controls appear when the mouse or remote moves, then fade away */
.tv-controls { position: fixed; left: 50%; bottom: calc(var(--u) * 2); transform: translate(-50%, 0); display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 999px; background: #04150eeb; box-shadow: 0 16px 40px -12px #0009; font: 500 15px var(--text); transition: opacity 300ms ease, transform 400ms var(--ease-out); }
body.idle .tv-controls { opacity: 0; transform: translate(-50%, 16px); pointer-events: none; }
.tv-btn { display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border-radius: 999px; background: #fff; color: var(--ink); font: 600 15px var(--text); border: 0; text-decoration: none; cursor: pointer; transition: transform 160ms var(--ease-out); }
.tv-btn:active { transform: scale(0.97); }
.tv-keys { color: #ffffffd9; padding-right: 8px; white-space: nowrap; }
.switch { position: relative; display: grid; grid-template-columns: 1fr 1fr; padding: 4px; border-radius: 999px; box-shadow: inset 0 0 0 1px #ffffff40; }
.switch button { position: relative; z-index: 1; min-height: 32px; padding: 0 14px; border: 0; background: none; font: 600 14px var(--text); color: #fff; cursor: pointer; transition: color 220ms ease; }
.switch button[aria-checked="true"] { color: var(--ink); }
.switch-thumb { position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px); border-radius: 999px; background: #fff; transition: transform 300ms var(--ease-out); }
.switch[data-value="hanafi"] .switch-thumb { transform: translateX(100%); }
:focus-visible { outline: 3px solid var(--sun); outline-offset: 3px; }

/* Portrait screens stack the dial under the next prayer */
@media (max-aspect-ratio: 1/1) {
  .slide { grid-template-columns: 1fr; grid-template-rows: 1fr auto; text-align: center; gap: calc(var(--u) * 2); }
  .slide img { max-width: 100%; max-height: calc(100dvh - var(--u) * 60); }
  .slide-text { margin-inline: auto; }
  :root { --u: min(1.6vw, 1vh); }
  .tv-top { grid-template-columns: 1fr auto; }
  .tv-bismillah { display: none; }
  .tv-main { grid-template-columns: 1fr; align-content: center; }
  .dial { height: auto; }
  .slots { grid-template-columns: repeat(3, 1fr); row-gap: calc(var(--u) * 2.2); }
  .tv-keys { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: 0.01ms !important; }
}
