/*
 * The prayer screen. Everything is laid out on a 1080x1920 stage in px and
 * scaled to the screen as a whole (screen.js sets --scale), so sizes here are
 * sizes on a 1080p portrait screen.
 *
 * <html> carries the state: data-time (day | night), data-skin (ramadan | eid
 * | hajj | white | muharram | friday), data-mode (normal | silence | final | empty |
 * loading) and data-phase (iqama, from an adhan to its iqama).
 *
 * The sections have fixed heights and the space left over is shared out
 * between them (justify-content: space-between), down to a 14px gap. The
 * busiest screen (an occasion, three Jumuaa sessions, two notices) still fits.
 */

@font-face { font-family: 'Source Sans Pro'; font-weight: 400; font-display: block; src: url(fonts/source-sans-pro-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'Source Sans Pro'; font-weight: 600; font-display: block; src: url(fonts/source-sans-pro-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: 'Source Sans Pro'; font-weight: 700; font-display: block; src: url(fonts/source-sans-pro-latin-700-normal.woff2) format('woff2'); }
@font-face { font-family: 'Lora'; font-weight: 500; font-display: block; src: url(fonts/lora-latin-500-normal.woff2) format('woff2'); }
@font-face { font-family: 'Lora'; font-weight: 600; font-display: block; src: url(fonts/lora-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: 'Lora'; font-weight: 700; font-display: block; src: url(fonts/lora-latin-700-normal.woff2) format('woff2'); }

/* Day: the website's greens on parchment */
:root {
  --bg: #f4f1e8;
  --ink: #10291a;
  --muted: #56665a;
  --faint: #8a968c;
  --line: rgba(16, 41, 26, 0.12);
  --accent: #0a7a2b;
  --card: #ffffff;
  --card-line: rgba(16, 41, 26, 0.14);
  /* White cards on parchment need lifting off it; dark themes do not */
  --card-shadow: 0 1px 2px rgba(16, 41, 26, 0.06), 0 8px 24px rgba(16, 41, 26, 0.08);
  --hero-bg: linear-gradient(135deg, #0f4523 0%, #0a3219 100%);
  --hero-ink: #ffffff;
  --hero-muted: rgba(255, 255, 255, 0.72);
  --hero-accent: #9be3a9;
  --pattern: rgba(10, 122, 43, 0.11);
  --final-bg: #0a3219;
  --final-ink: #ffffff;
  --final-accent: #9be3a9;
  --logo-colour: block;
  --logo-white: none;
  /* The app's QR code: dark on light, so here on a white card */
  --qr-bg: var(--card);
  --qr-ink: var(--ink);
  --qr-eye: var(--accent);
  /* Its white margin (3 of its 31 modules) does not show on the white card */
  --qr-margin-hidden: 19px;
}

/* Night: from Maghrib to sunrise, so the screen is not a lamp in the hall.
   The day's green and parchment the other way round: a green screen, and the
   next prayer in parchment. */
[data-time='night'] {
  --bg: #0c341c;
  --ink: #f4f1e8;
  --muted: #b3c2b5;
  --faint: #7d9a84;
  --line: rgba(244, 241, 232, 0.12);
  --accent: #9be3a9;
  --card: rgba(244, 241, 232, 0.06);
  --card-line: rgba(244, 241, 232, 0.14);
  --hero-bg: linear-gradient(135deg, #f4f1e8 0%, #e6e0cc 100%);
  --hero-ink: #10291a;
  --hero-muted: rgba(16, 41, 26, 0.62);
  --hero-accent: #0a7a2b;
  --pattern: rgba(244, 241, 232, 0.10);
  --final-bg: #0c341c;
  --logo-colour: none;
  --logo-white: block;
}

/* Ramadan: a night sky in indigo and lantern gold, day and night */
[data-skin='ramadan'] {
  --bg: #0b1030;
  --ink: #f6efdc;
  --muted: #b3b0cf;
  --faint: #7a78a0;
  --line: rgba(255, 255, 255, 0.1);
  --accent: #e8bd58;
  --card: rgba(255, 255, 255, 0.05);
  --card-line: rgba(232, 189, 88, 0.18);
  --hero-bg: linear-gradient(135deg, #f0c766 0%, #ddb04a 100%);
  --hero-ink: #14183d;
  --hero-muted: rgba(20, 24, 61, 0.7);
  --hero-accent: #2a2f7a;
  --pattern: rgba(232, 189, 88, 0.13);
  --final-bg: #0b1030;
  --final-ink: #fff8e6;
  --final-accent: #f2cd72;
  --logo-colour: none;
  --logo-white: block;
}

/* Eid: deep green and gold */
[data-skin='eid'] {
  --bg: #08331f;
  --ink: #fbf5e2;
  --muted: #b9cdbd;
  --faint: #7f9a86;
  --line: rgba(255, 255, 255, 0.1);
  --accent: #f3c95c;
  --card: rgba(255, 255, 255, 0.06);
  --card-line: rgba(243, 201, 92, 0.22);
  --hero-bg: linear-gradient(135deg, #f6d173 0%, #e8bb48 100%);
  --hero-ink: #08331f;
  --hero-muted: rgba(8, 51, 31, 0.7);
  --hero-accent: #0f5a35;
  --pattern: rgba(243, 201, 92, 0.15);
  --final-bg: #08331f;
  --final-ink: #fffaf0;
  --final-accent: #f7d67e;
  --logo-colour: none;
  --logo-white: block;
}

/* The first ten days of Dhul Hijjah: the black and gold of the Kiswah */
[data-skin='hajj'] {
  --bg: #0f0e0c;
  --ink: #f4ecd8;
  --muted: #b5ab95;
  --faint: #7d7563;
  --line: rgba(201, 162, 74, 0.18);
  --accent: #d4ab55;
  --card: #1a1814;
  --card-line: rgba(212, 171, 85, 0.2);
  --hero-bg: linear-gradient(135deg, #ddb763 0%, #c99d45 100%);
  --hero-ink: #0f0e0c;
  --hero-muted: rgba(15, 14, 12, 0.68);
  --hero-accent: #4a3210;
  --pattern: rgba(212, 171, 85, 0.15);
  --final-bg: #0f0e0c;
  --final-ink: #f8f0dc;
  --final-accent: #e2bd68;
  --logo-colour: none;
  --logo-white: block;
}

/* The White Days: moonlight on a midnight sky, and the full moon by the clock */
[data-skin='white'] {
  --bg: #0b1322;
  --ink: #eef2f8;
  --muted: #a7b2c6;
  --faint: #6d7a92;
  --line: rgba(255, 255, 255, 0.09);
  --accent: #bcd2f7;
  --card: rgba(255, 255, 255, 0.05);
  --card-line: rgba(188, 210, 247, 0.16);
  --hero-bg: linear-gradient(135deg, #eef3fb 0%, #dbe4f4 100%);
  --hero-ink: #0b1322;
  --hero-muted: rgba(11, 19, 34, 0.66);
  --hero-accent: #2c4a85;
  --pattern: rgba(188, 210, 247, 0.11);
  --final-bg: #0b1322;
  --final-ink: #f6f8fc;
  --final-accent: #fff1c4;
  --logo-colour: none;
  --logo-white: block;
}

/* Muharram (the new year, Ashura): deep teal and copper, and a new crescent */
[data-skin='muharram'] {
  --bg: #0a2328;
  --ink: #f3efe6;
  --muted: #a9c0bf;
  --faint: #6f8b8b;
  --line: rgba(255, 255, 255, 0.09);
  --accent: #e6a87c;
  --card: rgba(255, 255, 255, 0.05);
  --card-line: rgba(230, 168, 124, 0.2);
  --hero-bg: linear-gradient(135deg, #eab088 0%, #db9a6b 100%);
  --hero-ink: #0a2328;
  --hero-muted: rgba(10, 35, 40, 0.7);
  --hero-accent: #0f4a52;
  --pattern: rgba(230, 168, 124, 0.13);
  --final-bg: #0a2328;
  --final-ink: #fbf7ef;
  --final-accent: #f3bf96;
  --logo-colour: none;
  --logo-white: block;
}

[data-time='night'], [data-skin='ramadan'], [data-skin='eid'], [data-skin='hajj'], [data-skin='white'], [data-skin='muharram'] {
  --card-shadow: none;
  --qr-bg: var(--ink);
  --qr-ink: var(--bg);
  --qr-eye: var(--hero-accent);
  --qr-margin-hidden: 0px;
}

/* Friday: the usual day and night, touched with gold */
[data-skin='friday'] {
  --bg: #f6f0e2;
  --accent: #8d6a17;
  --card-line: rgba(141, 106, 23, 0.26);
  --hero-accent: #f2d48a;
  --pattern: rgba(141, 106, 23, 0.13);
  --final-accent: #f2d48a;
}
[data-skin='friday'][data-time='night'] {
  --bg: #0c341c;
  --accent: #e2bf6b;
  --hero-accent: #8d6a17;
  --card-line: rgba(226, 191, 107, 0.12);
  --pattern: rgba(226, 191, 107, 0.10);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
/* Pinned to the window and clipping the stage: a phone otherwise widens the
   page to fit the stage's unscaled 1080px, and it lands off-centre */
body { position: fixed; inset: 0; }
/* The overlays cover the whole screen, not only the stage, when the screen
   is not exactly 9:16 */
html[data-mode='silence'], html[data-mode='silence'] body { background: #000; }
html[data-mode='final'], html[data-mode='final'] body { background: var(--final-bg); }
/* The stage too, or its scaled edge shows as a faint line */
[data-mode='silence'] .stage { background: #000; }
[data-mode='final'] .stage { background: var(--final-bg); }
[data-mode='silence'] .pattern, [data-mode='final'] .pattern { display: none; }

body {
  color: var(--ink);
  font-family: 'Source Sans Pro', 'Helvetica Neue', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* screen.js centres it, and makes it taller on a screen taller than 9:16 */
.stage {
  position: absolute;
  left: 0;
  top: 0;
  width: 1080px;
  height: var(--stage-height, 1920px);
  transform-origin: 0 0;
  transform: translate(var(--stage-x, 0), var(--stage-y, 0)) scale(var(--scale, 1));
  padding: 46px 60px 32px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  overflow: hidden;
  background: var(--bg);
}

/* An eight-pointed star lattice, strongest behind the clock and fading out
   by the timetable */
.pattern {
  position: absolute;
  inset: 0 0 auto 0;
  height: 1150px;
  background-color: var(--pattern);
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cg fill='none' stroke='%23000' stroke-width='2'%3E%3Cpath d='M60 18l12.7 17.3L94 30l-5.3 21.3L106 60l-17.3 8.7L94 90l-21.3-5.3L60 102l-12.7-17.3L26 90l5.3-21.3L14 60l17.3-8.7L26 30l21.3 5.3z'/%3E%3Cpath d='M0 0l26 30M120 0L94 30M0 120l26-30M120 120L94 90M60 0v18M60 120v-18M0 60h14M120 60h-14'/%3E%3C/g%3E%3C/svg%3E"), linear-gradient(#000 0%, rgba(0, 0, 0, 0.6) 40%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cg fill='none' stroke='%23000' stroke-width='2'%3E%3Cpath d='M60 18l12.7 17.3L94 30l-5.3 21.3L106 60l-17.3 8.7L94 90l-21.3-5.3L60 102l-12.7-17.3L26 90l5.3-21.3L14 60l17.3-8.7L26 30l21.3 5.3z'/%3E%3Cpath d='M0 0l26 30M120 0L94 30M0 120l26-30M120 120L94 90M60 0v18M60 120v-18M0 60h14M120 60h-14'/%3E%3C/g%3E%3C/svg%3E"), linear-gradient(#000 0%, rgba(0, 0, 0, 0.6) 40%, transparent 100%);
  mask-composite: intersect;
  -webkit-mask-size: 120px 120px, 100% 100%;
  mask-size: 120px 120px, 100% 100%;
  -webkit-mask-repeat: repeat, no-repeat;
  mask-repeat: repeat, no-repeat;
  pointer-events: none;
}

.decor { position: absolute; left: 0; top: 0; width: 1080px; height: 1920px; pointer-events: none; display: none; color: var(--accent); }
[data-skin='eid'] .decor-eid { display: block; }

/* Drawn either side of the clock: the stage's width, from just above the clock */
.clock-decor { position: absolute; left: -60px; top: -24px; width: 1080px; height: 260px; pointer-events: none; display: none; color: var(--accent); }
[data-skin='ramadan'] .decor-ramadan,
[data-skin='white'] .decor-white,
[data-skin='muharram'] .decor-muharram { display: block; }
.moon-halo { animation: glow 8s ease-in-out infinite alternate; }
.lantern-glow { animation: glow 6s ease-in-out infinite alternate; }
.twinkle { animation: twinkle 5s ease-in-out infinite; opacity: 0.25; }
.t2 { animation-delay: -1.7s; }
.t3 { animation-delay: -3.3s; }
@keyframes glow { from { opacity: 0.55; } to { opacity: 1; } }
@keyframes twinkle { 0%, 100% { opacity: 0.2; } 50% { opacity: 0.85; } }

.top, .clock, .occasion, .hero, .timetable, .night, .cards, .bottom { position: relative; flex-shrink: 0; }

/* Figures that change keep their width, so nothing shuffles each second */
.clock, .hero-left, .row-time, .night-time, .session-time, .extra-time, .final-left, .empty-clock {
  font-variant-numeric: tabular-nums;
}

/* -------------------------------------------------------------------------- */

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}
.home { flex: none; line-height: 0; -webkit-tap-highlight-color: transparent; }
.logo { height: 76px; width: auto; }
.top .logo-colour, .overlay-empty .logo-colour { display: var(--logo-colour); }
.top .logo-white, .overlay-empty .logo-white { display: var(--logo-white); }
/* A button for trying the screen out (the end of this file), looking like
   nothing more than the dates */
.dates { text-align: right; font: inherit; color: inherit; background: none; border: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.gregorian, .hijri { display: block; }
.gregorian { font-size: 34px; font-weight: 600; line-height: 1.15; }
.hijri { font-family: 'Lora', serif; font-size: 31px; font-weight: 600; color: var(--accent); line-height: 1.25; margin-top: 2px; }

.clock {
  text-align: center;
  line-height: 0.9;
  margin: 34px 0 -4px;
  white-space: nowrap;
}
.clock-hm, .clock-s { position: relative; }
.clock-hm { font-size: 220px; font-weight: 600; letter-spacing: -0.02em; }
.clock-s { font-size: 84px; font-weight: 600; color: var(--faint); margin-left: 14px; display: inline-block; width: 2.2ch; text-align: left; }

/* The occasion: Ramadan, Eid, the White Days... Its space is kept when there
   is none, so nothing below it moves from day to day. */
.occasion {
  display: flex;
  align-items: center;
  gap: 28px;
  height: 118px;
  padding: 0 32px;
  border-radius: 24px;
  background: linear-gradient(100deg, color-mix(in srgb, var(--accent) 24%, transparent), color-mix(in srgb, var(--accent) 6%, transparent));
  border: 2px solid color-mix(in srgb, var(--accent) 45%, transparent);
}
.occasion.is-empty { visibility: hidden; }
.occasion-mark { width: 76px; height: 76px; flex: none; color: var(--accent); }
.mark { width: 76px; height: 76px; display: none; }
[data-skin='ramadan'] .mark-ramadan,
[data-skin='eid'] .mark-eid,
[data-skin='hajj'] .mark-hajj,
[data-skin='white'] .mark-white,
[data-skin='muharram'] .mark-muharram { display: block; }
html:not([data-skin]) .mark-plain, [data-skin='friday'] .mark-plain { display: block; }
[data-skin='white'] .occasion-mark { color: #fff1c4; filter: drop-shadow(0 0 12px rgba(255, 236, 160, 0.8)); }
.occasion-text { flex: 1; min-width: 0; }
.occasion-headline, .occasion-detail { overflow: hidden; text-overflow: ellipsis; }
.occasion.has-extra .occasion-headline { font-size: 44px; }
.occasion-headline { font-family: 'Lora', serif; font-size: 50px; font-weight: 700; line-height: 1.12; white-space: nowrap; }
.occasion-detail { font-size: 32px; color: var(--muted); line-height: 1.3; margin-top: 4px; white-space: nowrap; }
.occasion-extra { display: flex; gap: 34px; text-align: right; }
.occasion-extra:empty { display: none; }
.extra-label { font-size: 22px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.extra-time { font-size: 50px; font-weight: 700; color: var(--accent); line-height: 1.05; }

/* The next prayer */
.hero {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 24px;
  padding: 26px 44px 34px;
  border-radius: 30px;
  background: var(--hero-bg);
  color: var(--hero-ink);
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.14);
}
.hero-label, .hero-step {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--hero-muted);
}
.hero-name { font-family: 'Lora', serif; font-size: 104px; font-weight: 700; line-height: 1.05; margin-top: 8px; white-space: nowrap; }
/* Both sides the same height: the labels level along the top, the name and
   the countdown along the bottom */
.hero-main, .hero-countdown { display: flex; flex-direction: column; justify-content: space-between; }
.hero-main { flex: 1; min-width: 0; }
.hero-countdown { flex: none; align-items: flex-end; }
/* "Maghrib & Isha" beside an hours-long countdown: on two lines */
.hero-name.is-long { font-size: 72px; line-height: 1; margin-top: 12px; white-space: normal; max-width: 420px; }
.hero-countdown { text-align: right; }
.hero-left { font-size: 132px; font-weight: 700; line-height: 1; color: var(--hero-accent); margin-top: 10px; letter-spacing: -0.01em; }
/* From the adhan to the iqama the card changes colour, and the prayer's row
   with it, so the countdown reads as the iqama's from across the hall. Navy
   by day, amber by night; each dark skin has its own, away from its usual
   card colour. */
:root { --iqama-bg: linear-gradient(135deg, #1f4f86 0%, #163a66 100%); --iqama-accent: #bfe0ff; }
[data-time='night'] { --iqama-bg: linear-gradient(135deg, #8a5a10 0%, #5f3d08 100%); --iqama-accent: #ffd98c; }
[data-skin='ramadan'] { --iqama-bg: linear-gradient(135deg, #6a2c78 0%, #451b55 100%); --iqama-accent: #f2cd72; }
[data-skin='eid'] { --iqama-bg: linear-gradient(135deg, #8a6514 0%, #5e430b 100%); --iqama-accent: #fff0c2; }
[data-skin='hajj'] { --iqama-bg: linear-gradient(135deg, #7d1f2c 0%, #53131d 100%); --iqama-accent: #f5d891; }
[data-skin='white'] { --iqama-bg: linear-gradient(135deg, #4b3f7a 0%, #2f2856 100%); --iqama-accent: #fff1c4; }
[data-skin='muharram'] { --iqama-bg: linear-gradient(135deg, #7a3e22 0%, #552915 100%); --iqama-accent: #ffd2ae; }
[data-phase='iqama'] .hero, [data-phase='iqama'] .row.is-next {
  background: var(--iqama-bg);
  --hero-ink: #ffffff;
  --hero-muted: rgba(255, 255, 255, 0.72);
  --hero-accent: var(--iqama-accent);
}

.hero-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 12px; background: color-mix(in srgb, var(--hero-ink) 14%, transparent); display: none; }
.hero-progress.is-on { display: block; }
.hero-bar { height: 100%; width: 0; background: var(--hero-accent); transition: width 1s linear; }

/* The day's times */
.timetable { display: flex; flex-direction: column; }
.timetable-head, .row {
  display: grid;
  grid-template-columns: 1fr 220px 220px;
  align-items: center;
  column-gap: 12px;
}
.timetable-head {
  padding: 0 32px 10px;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.timetable-head span:not(:first-child) { text-align: right; }
.rows { display: flex; flex-direction: column; gap: 4px; }
.row {
  height: 84px;
  padding: 0 32px;
  border-radius: 20px;
  border-bottom: 2px solid var(--line);
}
.row:last-child { border-bottom-color: transparent; }
.row-name { font-family: 'Lora', serif; font-size: 58px; font-weight: 600; white-space: nowrap; }
.row-time { font-size: 64px; font-weight: 600; text-align: right; white-space: nowrap; }
.row-iqama { color: var(--accent); font-weight: 700; }
.row-note { font-size: 30px; font-weight: 600; color: var(--muted); text-align: right; line-height: 1.1; }
.row.is-long .row-name { font-size: 48px; }
.row.is-minor .row-name { font-size: 48px; color: var(--muted); }
.row.is-minor .row-time { font-size: 54px; color: var(--muted); }
.row.is-past { opacity: 0.42; }
.row.is-combined .row-name, .row.is-combined .row-time { color: var(--muted); }
/* The next prayer's row and the card above it are one colour: the skin's
   brightest, so the next prayer stands out, and the iqama's from the adhan */
.row.is-next {
  background: var(--hero-bg);
  color: var(--hero-ink);
  border-bottom-color: transparent;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.16);
}
.row.is-next .row-name, .row.is-next .row-time { color: var(--hero-ink); }
.row.is-next .row-iqama { color: var(--hero-accent); }
.row.is-next .row-note { color: var(--hero-muted); }

/* The last third of the night: a strip under the table */
.night {
  display: flex;
  align-items: center;
  gap: 22px;
  height: 84px;
  padding: 0 32px;
  border-radius: 22px;
  background: var(--card);
  border: 2px solid var(--card-line);
  box-shadow: var(--card-shadow);
}
.night-mark { width: 40px; height: 40px; flex: none; color: var(--accent); }
.night-label { flex: 1; font-size: 34px; font-weight: 600; white-space: nowrap; }
.night-time { font-size: 56px; font-weight: 700; color: var(--accent); }

/* Jumuaa: the sessions side by side, however many there are */
.card {
  background: var(--card);
  border: 2px solid var(--card-line);
  box-shadow: var(--card-shadow);
  border-radius: 24px;
  padding: 20px 32px 22px;
}
.card-title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
  white-space: nowrap;
}
.card-when { color: var(--accent); margin-left: 8px; }
.sessions { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; }
.session { padding: 0 28px; border-left: 2px solid var(--line); min-width: 0; }
.session:first-child { padding-left: 0; border-left: 0; }
.session.is-past { opacity: 0.42; }
.session-time { font-size: 64px; font-weight: 700; color: var(--accent); line-height: 1.05; }
.session-name { font-size: 36px; font-weight: 600; line-height: 1.2; margin-top: 4px; white-space: nowrap; }
.session-comment { font-size: 30px; color: var(--muted); line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* One session: the name beside the time rather than under it */
.sessions.is-single .session { display: flex; align-items: center; gap: 36px; }
.sessions.is-single .session-name { margin-top: 0; }
.jumuaa.is-today { border-color: var(--accent); }

/* The app's card beside Jumuaa's, the same height: a QR code for
   https://mai.ie/#app. Dark on light whatever the theme, as not every phone
   reads a code the other way round: on the white card by day, and on a dark
   screen on the screen's colours swapped (--qr-bg and the rest, with the
   themes). The corner eyes in the theme's accent. */
.cards { display: flex; justify-content: flex-end; gap: 20px; }
/* One session is shorter than the code: centred in the card, which is as tall */
.jumuaa { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sessions { flex: 1; align-content: center; }
.app {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 18px 0;
  color: inherit;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
/* As big as the card's height allows, so the card is square */
.app-qr {
  display: block;
  width: 196px;
  height: 196px;
  border-radius: 14px;
  background: var(--qr-bg);
  color: var(--qr-ink);
}
.qr-eyes { color: var(--qr-eye); }
/* The name, centred between the code's visible edge and the card's. At a
   line height of 1 the capitals sit in the middle of the line. */
.app-label {
  flex: 1;
  display: flex;
  align-items: center;
  margin-top: calc(-1 * var(--qr-margin-hidden));
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  line-height: 1;
  color: var(--muted);
}
/* Three sessions beside it: a little smaller and closer, to fit */
.jumuaa:has(.session:nth-child(3)) { padding-left: 24px; padding-right: 24px; }
.sessions:has(> :nth-child(3)) > .session { padding-right: 16px; }
.sessions:has(> :nth-child(3)) > .session + .session { padding-left: 16px; }
.sessions:has(> :nth-child(3)) .session-name { font-size: 32px; }
.sessions:has(> :nth-child(3)) .session-comment { font-size: 26px; }

/* Notices and the data's health */
.bottom { min-height: 80px; display: flex; flex-direction: column; justify-content: flex-end; gap: 12px; }
.notices { display: flex; flex-direction: column; gap: 10px; }
.notice {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 32px;
  font-weight: 600;
  line-height: 1.25;
}
.notice::before {
  content: '';
  flex: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
}
.status { display: flex; align-items: center; justify-content: flex-end; gap: 10px; font-size: 22px; color: var(--faint); }
.status::before { content: ''; width: 12px; height: 12px; border-radius: 50%; background: currentColor; }
.status.is-ok::before { background: var(--accent); }
.status.is-stale { color: #d98b1c; font-size: 26px; font-weight: 600; }

/* -------------------------------------------------------------------------- */
/* The overlays */

.dimmer { position: fixed; inset: 0; background: #000; opacity: 0; pointer-events: none; z-index: 20; transition: opacity 1s linear; }

/* Small and faint, on the dark overlays and the light screen fading out alike.
   In the window's px, so 44 of them to tap, with the x in their corner: in the
   stage's margin on a phone, clear of the date while the screen fades out. */
.dismiss {
  position: fixed;
  top: 0;
  right: 0;
  display: grid;
  place-items: start end;
  width: 44px;
  height: 44px;
  padding: 6px;
  border: 0;
  background: none;
  color: #8c8c8c;
  opacity: 0.6;
  cursor: pointer;
  z-index: 30;
}
.dismiss[hidden] { display: none; }
.dismiss:hover { opacity: 1; }
.dismiss svg { width: 16px; height: 16px; }
/* The screen in the mosque has nothing to press it with */
@media (any-pointer: none) {
  .dismiss { display: none; }
}

.overlay {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  z-index: 10;
}
[data-mode='silence'] .overlay-silence,
[data-mode='final'] .overlay-final,
[data-mode='empty'] .overlay-empty { display: flex; }
[data-mode='loading'] .stage > * { visibility: hidden; }

/* Dim enough not to light the hall, legible enough to read from the back */
.overlay-silence { background: #000; color: #8c8c8c; }
.silence-icon { width: 220px; height: 220px; color: #6e6e6e; margin-bottom: 60px; }
.silence-title { font-family: 'Lora', serif; font-size: 92px; font-weight: 600; color: #a8a8a8; }
.silence-text { font-size: 54px; margin-top: 24px; }
.silence-foot { position: absolute; bottom: 90px; font-size: 40px; color: #555; }

.overlay-final { background: var(--final-bg); color: var(--final-ink); }
.final-step { font-family: 'Lora', serif; font-size: 96px; font-weight: 600; }
.final-left { font-size: 400px; font-weight: 700; line-height: 1; margin: 30px 0 60px; color: var(--final-accent); }
.final-text { font-size: 56px; line-height: 1.35; opacity: 0.85; }

.overlay-empty { background: var(--bg); gap: 50px; }
.overlay-empty .logo { height: 160px; }
.empty-clock { font-size: 220px; font-weight: 600; }
.empty-text { font-size: 48px; color: var(--muted); }

/* -------------------------------------------------------------------------- */
/* Trying it out: the day before and after, the calendar and the time. The
   pickers are not on the stage, so in the window's own px, in the colours of
   the theme. */

/* Clicked, right-clicked and long-pressed, so not selected */
.dates, .clock, .overlay-silence, .overlay-final { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }

/* The day before and after, either side of the date without moving it: the
   one after in the stage's margin. On the stage, so in its px. */
.date-nav { position: relative; }
.step {
  position: absolute;
  top: 50%;
  translate: 0 -50%;
  display: grid;
  place-items: center;
  width: 44px;
  height: 64px;
  border: 0;
  border-radius: 12px;
  background: none;
  color: var(--muted);
  cursor: pointer;
}
.step[hidden] { display: none; }
.step:hover { color: var(--ink); }
.step:active { scale: 0.9; }
.step svg { width: 36px; height: 36px; }
#step-prev { right: calc(100% + 6px); }
#step-next { left: calc(100% + 6px); }
/* Scaled down on a phone they are small, so they take taps from further out,
   away from the date: the one after as far as the edge */
.step::after { content: ''; position: absolute; inset: -28px 0; }
#step-prev::after { left: -40px; }
#step-next::after { right: -40px; }

.picker {
  position: fixed;
  inset: auto;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--card-line);
  border-radius: 20px;
  background: var(--bg);
  color: var(--ink);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28), 0 2px 8px rgba(0, 0, 0, 0.12);
  font-size: 15px;
  opacity: 0;
  transform: translateY(-6px) scale(0.98);
  transition: opacity 0.15s ease, transform 0.15s ease, overlay 0.15s allow-discrete, display 0.15s allow-discrete;
}
.picker:popover-open { opacity: 1; transform: none; }
@starting-style { .picker:popover-open { opacity: 0; transform: translateY(-6px) scale(0.98); } }

.picker button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
.picker-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; color: var(--muted); }
.picker-icon:hover { background: var(--line); color: var(--ink); }
.picker-icon svg { width: 20px; height: 20px; }
.picker .picker-live { display: block; width: 100%; margin-top: 10px; padding: 9px; border-radius: 12px; font-weight: 600; color: var(--accent); }
.picker .picker-live:hover { background: var(--line); }
.picker-live[hidden] { display: none; }

.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.cal-title { text-align: center; }
.cal-month { font-family: 'Lora', serif; font-size: 18px; font-weight: 700; }
.cal-hijri { font-size: 13px; color: var(--accent); font-weight: 600; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 40px); gap: 2px; }
.cal-weekday { padding: 4px 0; text-align: center; font-size: 11px; font-weight: 700; letter-spacing: 0.08em; color: var(--faint); }
.cal-day { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 44px; border-radius: 12px; line-height: 1.1; }
.cal-day:hover { background: var(--line); }
.cal-day b { font-size: 15px; font-weight: 600; }
.cal-day small { font-size: 10px; color: var(--faint); }
.cal-day.is-other { opacity: 0.35; }
.cal-day.is-friday b { color: var(--accent); }
.cal-day.is-today { box-shadow: inset 0 0 0 1.5px var(--accent); }
.cal-day.is-shown, .cal-day.is-shown:hover { background: var(--hero-bg); color: var(--hero-ink); }
.cal-day.is-shown b, .cal-day.is-shown small { color: inherit; }
.cal-day.is-shown small { opacity: 0.7; }

.time-fields { display: flex; align-items: center; justify-content: center; gap: 6px; }
.time-field { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.time-field input {
  width: 84px;
  padding: 4px 0;
  border: 0;
  border-radius: 14px;
  background: var(--line);
  color: var(--ink);
  font: 600 48px/1.1 'Source Sans Pro', sans-serif;
  font-variant-numeric: tabular-nums;
  text-align: center;
  caret-color: var(--accent);
}
.time-field input:focus { outline: 2px solid var(--accent); }
.time-colon { font-size: 44px; font-weight: 600; color: var(--faint); padding-bottom: 6px; }
/* The seconds smaller and fainter, and level with the bottom of the minutes,
   as on the clock */
.time-field.is-seconds { margin: 24px 0 0 2px; }
.time-field.is-seconds input { width: 50px; font-size: 26px; color: var(--faint); border-radius: 10px; }

/* Fingers on a phone: the calendar as wide as the phone, and everything
   bigger to tap. The screen in the mosque has no touch. */
@media (pointer: coarse) {
  .picker { padding: 16px; font-size: 17px; }
  .picker-icon { width: 46px; height: 46px; }
  .picker-icon svg { width: 26px; height: 26px; }
  .picker .picker-live { margin-top: 12px; padding: 12px; }
  #date-picker { width: min(420px, calc(100vw - 24px)); }
  .cal-month { font-size: 21px; }
  .cal-hijri { font-size: 15px; }
  .cal-grid { grid-template-columns: repeat(7, 1fr); }
  .cal-weekday { font-size: 12px; }
  .cal-day { height: 54px; }
  .cal-day b { font-size: 19px; }
  .cal-day small { font-size: 12px; }
  .time-field input { width: 104px; font-size: 64px; }
  .time-colon { font-size: 58px; }
  .time-field.is-seconds { margin-top: 33px; }
  .time-field.is-seconds input { width: 64px; font-size: 34px; }
}
