@import url('/fonts/game.css');

/*
 * «سهرة» (Nasser's choice, 2026-10-20): one design, night and day. The phone's setting decides first, then the
 * player's choice in the menu (data-theme on <html>, kept on the device).
 * Layout: one centred column, phone first; tablet and desktop keep the same column with room around it.
 */
:root {
  /* «برنامج المسابقات» (Nasser 2026-10-22, nhmsv docs/BUS_COMPLETE.md §2أ): stage navy, spotlight gold, buzzer red. */
  --navy: #0b1d51;
  --navy-2: #13286b;
  --on-navy: #ffffff;
  --gold: #ffb800;
  --gold-2: #ffd24d;
  --buzzer: #ff3b30;
  --buzzer-shadow: #b3241c;
  --on-buzzer: #ffffff;
  --rays: rgba(255, 210, 77, 0.07);
  --bg: #eef2ff;
  --surface: #ffffff;
  --mine: #fff4cc;
  --line: #d6ddf5;
  --ink: #0b1d51;
  --muted: #4b5a86;
  --accent: #ffb800;
  --on-accent: #0b1d51;
  --letter: #13286b;
  --ok: #16a34a;
  --on-ok: #ffffff;
  --bad: #e5281d;
  --on-bad: #ffffff;
  --scrim: rgba(11, 29, 81, 0.35);
  --menu: #ffffff;
  --shadow: 0 12px 32px rgba(11, 29, 81, 0.18);
  --silver: #c9d1ea;
  --bronze: #d08a5c;
  --band: #e3e9fb;
  --soft: #fff1c2;
  --font: 'Cairo', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --display: 'Lalezar', 'Cairo', system-ui, sans-serif;
  color-scheme: light;
}
:root[data-theme="night"] {
  --bg: #08153d;
  --surface: #13286b;
  --mine: #2b3060;
  --line: #24397f;
  --ink: #eef2ff;
  --muted: #a9b6dd;
  --letter: #ffd24d;
  --on-accent: #0b1d51;
  --ok: #4ade80;
  --on-ok: #0b1f12;
  --bad: #ff6b61;
  --on-bad: #2a0d0a;
  --scrim: rgba(3, 8, 24, 0.6);
  --menu: #13286b;
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  --band: #0e1d4f;
  --soft: #2e2a4a;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { min-height: 100dvh; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 17px; line-height: 1.55; -webkit-tap-highlight-color: transparent; }
a { color: var(--letter); }
p, h1, h2 { margin: 0; }
h1 { font-size: 32px; font-weight: 800; line-height: 1.3; text-wrap: balance; }
h2 { font-size: 19px; font-weight: 700; }
.hidden { display: none !important; }
.center { text-align: center; }
.muted { color: var(--muted); }
.stack { display: flex; flex-direction: column; gap: 14px; }

/* ---- Shell: top bar with the menu ----------------------------------------------------------------------- */
/* The bar stays at the top while the page scrolls (Nasser 2026-10-23). */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px; padding-block: max(14px, env(safe-area-inset-top)) 10px; padding-inline: max(20px, env(safe-area-inset-left)) max(16px, env(safe-area-inset-right)); max-width: 560px; margin-inline: auto; }
.brand { display: flex; align-items: center; gap: 10px; flex: 1; color: var(--ink); text-decoration: none; font-weight: 700; font-size: 18px; }
.icon-button { width: 44px; height: 44px; flex: none; display: inline-flex; align-items: center; justify-content: center; border: 2px solid transparent; border-radius: 22px; background: var(--surface); color: var(--ink); padding: 0; cursor: pointer; }
.icon-button[aria-expanded="true"] { border-color: var(--accent); }
.icon-button svg { width: 22px; height: 22px; }
.menu-scrim { position: fixed; inset: 0; background: var(--scrim); z-index: 20; }
.menu { position: fixed; inset-block-start: calc(max(14px, env(safe-area-inset-top)) + 54px); inset-inline-end: max(16px, calc((100vw - 560px) / 2 + 16px)); z-index: 21; width: min(270px, calc(100vw - 32px)); display: flex; flex-direction: column; padding: 8px; background: var(--menu); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); }
.menu-item { display: flex; align-items: center; gap: 12px; min-height: 52px; padding-inline: 12px; border: 0; border-radius: 14px; background: transparent; color: var(--ink); font: inherit; font-size: 16px; text-align: start; text-decoration: none; cursor: pointer; }
.menu-item:hover, .menu-item:focus-visible { background: var(--bg); }
.menu-item svg { width: 20px; height: 20px; flex: none; }
.menu-item span { flex: 1; }
.menu-item.danger { color: var(--bad); font-weight: 700; }
.menu-sep { height: 1px; margin: 4px 8px; background: var(--line); }
.menu-note { padding: 0 12px 6px; font-size: 13px; color: var(--muted); }
.switch { width: 44px; height: 26px; flex: none; border-radius: 13px; background: var(--line); display: flex; align-items: center; justify-content: flex-end; padding: 0 3px; }
.switch::after { content: ""; width: 20px; height: 20px; border-radius: 10px; background: var(--surface); }
[aria-checked="true"] > .switch { background: var(--accent); justify-content: flex-start; }
[aria-checked="true"] > .switch::after { background: var(--on-accent); }

/* ---- Page column ------------------------------------------------------------------------------------------ */
.wrap { max-width: 560px; margin-inline: auto; padding-block: 8px max(24px, env(safe-area-inset-bottom)); padding-inline: max(20px, env(safe-area-inset-left)) max(20px, env(safe-area-inset-right)); display: flex; flex-direction: column; gap: 16px; }
/* Offline: a banner at the top (shell.js / app.js), the page stays as it was. */
.offline-banner { position: sticky; top: 0; z-index: 25; margin: 0; padding: 10px 16px; text-align: center; background: var(--bad); color: var(--on-bad); font-size: 15px; font-weight: 700; }
.card { background: var(--surface); border-radius: 26px; padding: 20px; }
.alert { background: var(--bad); color: var(--on-bad); border-radius: 18px; padding: 12px 16px; font-weight: 700; }
.note { background: var(--mine); border-radius: 18px; padding: 12px 16px; }

/* ---- Controls --------------------------------------------------------------------------------------------- */
label { font-size: 14px; font-weight: 500; color: var(--muted); }
input, select { font: inherit; color: var(--ink); background: var(--surface); border: 2px solid var(--line); border-radius: 29px; height: 58px; padding: 0 22px; width: 100%; font-size: 19px; }
input:focus, select:focus { outline: none; border-color: var(--accent); }
button:focus-visible, a:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.code-input { height: 74px; border-color: var(--accent); border-radius: 37px; text-align: center; font-size: 34px; font-weight: 800; letter-spacing: 0.25em; direction: ltr; }
button { font: inherit; cursor: pointer; }
button:disabled { cursor: not-allowed; }
.primary, .ghost, a.button, .danger-outline { display: flex; align-items: center; justify-content: center; min-height: 60px; padding: 0 22px; border-radius: 32px; font-size: 19px; font-weight: 800; text-decoration: none; border: 0; }
.primary { background: var(--accent); color: var(--on-accent); }
.primary:disabled { opacity: 0.45; }
.ghost, a.button.ghost { background: transparent; color: var(--ink); border: 2px solid var(--line); font-weight: 700; font-size: 16px; min-height: 52px; }
.danger-outline { background: transparent; color: var(--bad); border: 2px solid var(--bad); font-weight: 700; font-size: 16px; min-height: 52px; }
.row-buttons { display: flex; gap: 10px; }
.row-buttons > * { flex: 1; }
.link-button { background: none; border: 0; padding: 6px; color: var(--muted); font-size: 14px; text-decoration: underline; }

/* ---- Join ------------------------------------------------------------------------------------------------- */
.join { min-height: calc(100dvh - 110px); display: flex; flex-direction: column; justify-content: space-between; gap: 24px; }
.join-form { display: flex; flex-direction: column; gap: 22px; margin-block: auto; }
.field-group { display: flex; flex-direction: column; gap: 8px; }

/* ---- Lobby ------------------------------------------------------------------------------------------------ */
.code-card { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.code { font-size: 44px; font-weight: 800; letter-spacing: 0.2em; direction: ltr; color: var(--letter); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 7px 14px; border-radius: 18px; background: var(--surface); font-size: 15px; border: 0; color: var(--ink); }
.chip.me { font-weight: 800; }
.chip.lead { background: var(--accent); color: var(--on-accent); font-weight: 700; }
.chip.count { background: transparent; border: 2px dashed var(--line); color: var(--muted); }
.chip .x { margin-inline-start: 6px; color: var(--muted); }
.player-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.player-list li { display: flex; align-items: center; justify-content: space-between; min-height: 54px; padding: 0 20px; background: var(--surface); border-radius: 27px; }
.tag { font-size: 13px; color: var(--on-accent); background: var(--accent); border-radius: 999px; padding: 2px 10px; font-weight: 700; }
.settings { display: flex; flex-direction: column; padding: 6px 18px; background: var(--surface); border-radius: 26px; }
.setting { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 66px; border-bottom: 1px solid var(--line); }
.setting:last-child { border-bottom: 0; }
.setting > span { font-size: 16px; font-weight: 700; }
.setting.block-setting { flex-direction: column; align-items: stretch; padding-block: 14px; }
.segmented { display: flex; padding: 4px; background: var(--bg); border-radius: 20px; flex: none; }
.segmented button { min-height: 36px; padding: 0 14px; border: 0; border-radius: 16px; background: transparent; color: var(--muted); font-size: 15px; }
.segmented button[aria-checked="true"] { background: var(--accent); color: var(--on-accent); font-weight: 700; }
.stepper { display: flex; align-items: center; gap: 10px; }
.stepper button { width: 40px; height: 40px; border: 2px solid var(--line); border-radius: 20px; background: transparent; color: var(--ink); font-size: 20px; }
.stepper output { min-width: 28px; text-align: center; font-size: 22px; font-weight: 800; }
.stepper .stepper-value { width: auto; min-width: 52px; padding: 0 12px; border-color: var(--accent); background: var(--soft); font-size: 22px; font-weight: 800; }
.rounds-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 8px; }
.rounds-grid button { height: 48px; min-height: 0; padding: 0; border: 2px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--ink); font-size: 18px; font-weight: 700; }
.rounds-grid button:disabled { opacity: 0.35; }
.rounds-grid button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.toggle { border: 0; background: transparent; padding: 0; }
.toggle .switch { width: 50px; height: 30px; border-radius: 15px; }
.toggle .switch::after { width: 24px; height: 24px; border-radius: 12px; }
.points-edit { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding-block: 12px 4px; }
.points-edit label { display: flex; flex-direction: column; gap: 6px; }
.points-edit input { height: 48px; border-radius: 24px; text-align: center; }
.points-edit .wide { grid-column: 1 / -1; }
.letters-off { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; padding-block: 10px 4px; }
.letters-off button { height: 40px; border: 0; border-radius: 12px; background: var(--bg); color: var(--ink); font-size: 18px; font-weight: 700; }
.letters-off.en button { text-transform: uppercase; }
.letters-off button[aria-pressed="false"] { background: transparent; border: 2px dashed var(--line); color: var(--muted); text-decoration: line-through; }
.hint { font-size: 13px; color: var(--muted); }

/* ---- Screens with a fixed head and foot (letter picker, correction) ---------------------------------------- */
.screen { height: var(--vh, 100dvh); display: flex; flex-direction: column; width: 100%; max-width: 560px; margin-inline: auto; }
.screen-head { flex: none; display: flex; align-items: center; gap: 12px; padding-block: max(14px, env(safe-area-inset-top)) 6px; padding-inline: max(20px, env(safe-area-inset-left)) max(16px, env(safe-area-inset-right)); }
.screen-head .titles { flex: 1; display: flex; flex-direction: column; }
.screen-head .kicker { font-size: 13px; color: var(--muted); }
.screen-head .title { font-size: 24px; font-weight: 800; line-height: 1.3; }
.screen-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding-inline: max(20px, env(safe-area-inset-left)) max(20px, env(safe-area-inset-right)); padding-block-end: 8px; }
.screen-foot { flex: none; display: flex; flex-direction: column; gap: 10px; padding-block: 12px max(22px, env(safe-area-inset-bottom)); padding-inline: max(20px, env(safe-area-inset-left)) max(20px, env(safe-area-inset-right)); background: var(--bg); }
body.full .top { display: none; }
body.full .wrap { max-width: none; padding: 0; }
.legend { display: flex; gap: 14px; padding: 6px 0 12px; font-size: 13px; color: var(--muted); }
.legend span { display: flex; align-items: center; gap: 6px; }
.dot { width: 12px; height: 12px; border-radius: 6px; background: var(--accent); }
.dot.played { background: var(--line); }
.dot.today { background: transparent; box-shadow: 0 0 0 2px var(--gold, #ffb800) inset; }
.dot.off { background: transparent; border: 2px dashed var(--line); }
.letter-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.letter-grid button { height: 56px; border: 0; border-radius: 18px; background: var(--surface); color: var(--ink); font-size: 26px; font-weight: 800; transition: transform 0.15s; }
.letter-grid.en button { text-transform: uppercase; }
.letter-grid button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); transform: scale(1.06); }
.letter-grid button.played { background: var(--line); color: var(--muted); text-decoration: line-through; }
.letter-grid button.off { background: transparent; border: 2px dashed var(--line); color: var(--muted); }
.letter-grid button:disabled { cursor: default; }

/* ---- Round (one screen, no scroll) ------------------------------------------------------------------------ */
.round-screen { position: relative; min-height: var(--vh, 100dvh); max-width: 560px; margin-inline: auto; display: flex; flex-direction: column; padding-inline: max(20px, env(safe-area-inset-left)) max(20px, env(safe-area-inset-right)); padding-block-start: max(8px, env(safe-area-inset-top)); }
.round-menu { position: absolute; inset-block-start: max(10px, env(safe-area-inset-top)); inset-inline-end: 12px; z-index: 5; }
.round-menu .icon-button { background: transparent; color: var(--muted); }
.round-letter { flex: none; text-align: center; }
.letter { font-size: clamp(64px, 15vh, 132px); line-height: 1.35; font-weight: 800; color: var(--letter); min-height: 1em; }
.letter.en { text-transform: uppercase; }
.countdown { font-size: clamp(48px, 12vh, 104px); line-height: 1.2; font-weight: 800; color: var(--muted); }
.round-fields { flex: none; display: flex; flex-direction: column; gap: clamp(6px, 1.2vh, 10px); padding-block: 4px; }
.round-field { display: flex; align-items: center; gap: 12px; flex: none; height: clamp(52px, 7vh, 60px); padding-inline: 20px; background: var(--surface); border: 2px solid var(--line); border-radius: 30px; }
.round-field:focus-within { border-color: var(--accent); }
.round-field span { width: 52px; flex: none; font-size: 15px; font-weight: 500; color: var(--muted); }
.round-field:focus-within span { color: var(--letter); font-weight: 700; }
.round-field input { flex: 1; min-width: 0; height: 100%; border: 0; border-radius: 0; background: transparent; padding: 0; font-size: 21px; font-weight: 500; }
.round-action { flex: none; padding-block: 16px max(18px, env(safe-area-inset-bottom)); scroll-margin-bottom: 16px; }
/* Until all six fields are filled: dots and how many are left. Then «بس!» arrives, large and glowing. */
.bus-hint { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 56px; padding: 0 18px; border: 2px dashed var(--line); border-radius: 28px; color: var(--muted); font-size: 15px; }
.bus-dots { display: flex; gap: 5px; flex: none; }
.bus-dots i { width: 9px; height: 9px; border-radius: 5px; background: var(--line); }
.bus-dots i.on { background: var(--accent); }
.bus.pop { animation: pop 0.5s cubic-bezier(.2, .8, .2, 1) both, glow 1.6s 0.5s ease-in-out infinite; }
@keyframes glow { 0%, 100% { box-shadow: 0 6px 0 var(--buzzer-shadow), 0 0 0 0 rgba(255, 59, 48, 0.55); } 50% { box-shadow: 0 6px 0 var(--buzzer-shadow), 0 0 0 12px rgba(255, 59, 48, 0); } }
.bus { width: 100%; height: 68px; border: 0; border-radius: 34px; background: var(--accent); color: var(--on-accent); font-size: 30px; font-weight: 800; line-height: 1; display: flex; align-items: center; justify-content: center; padding: 0; }
.bus:disabled { opacity: 0.45; }
.round-wait { text-align: center; margin-block-start: 24px; }
.locked-screen { min-height: 70dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; }
.big { font-size: 24px; font-weight: 800; }
@media (max-height: 560px) {
  .letter { font-size: 48px; }
}

/* ---- Correction ------------------------------------------------------------------------------------------- */
.letter-badge { width: 52px; height: 52px; flex: none; border-radius: 26px; background: var(--surface); display: flex; align-items: center; justify-content: center; font-size: 30px; font-weight: 800; color: var(--letter); }
.letter-badge.en { text-transform: uppercase; }
.wiki-link { margin-inline-start: 8px; font-size: 12px; font-weight: 600; color: var(--muted); text-decoration: none; border: 1px solid var(--line); border-radius: 999px; padding: 2px 8px; vertical-align: middle; white-space: nowrap; }
.wiki-link::before { content: '🔎 '; }
.pts { font-size: 14px; font-weight: 700; }
.pts.ok { color: var(--ok); }
.pts.bad { color: var(--bad); }
.pts.wait { color: var(--letter); }
.verdict-btn { width: 52px; height: 44px; flex: none; border: 2px solid var(--line); border-radius: 22px; background: transparent; color: var(--muted); font-size: 20px; }
.verdict-btn.ok[aria-pressed="true"] { background: var(--ok); color: var(--on-ok); border-color: var(--ok); }
.verdict-btn.bad[aria-pressed="true"] { background: var(--bad); color: var(--on-bad); border-color: var(--bad); }
.merge { height: 36px; width: auto; max-width: 50%; padding: 0 12px; border: 1px solid var(--line); border-radius: 18px; background: transparent; font-size: 14px; }
.tally { display: flex; flex-direction: column; gap: 6px; }
.tally-chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.tally-chips span { flex: none; padding: 6px 12px; border-radius: 16px; background: var(--surface); font-size: 14px; }
.tally-chips b { margin-inline-start: 4px; direction: ltr; unicode-bidi: isolate; }
.tally-chips b.neg { color: var(--bad); }
.my-points { display: flex; align-items: baseline; justify-content: space-between; padding: 16px 22px; background: var(--surface); border-radius: 26px; }
.my-points b { font-size: 34px; font-weight: 800; color: var(--letter); direction: ltr; unicode-bidi: isolate; }
.nav-buttons { display: flex; gap: 10px; }
.nav-buttons .ghost { flex: none; width: 108px; min-height: 60px; }
.nav-buttons .primary { flex: 1; }

/* ---- Results and honour board ----------------------------------------------------------------------------- */
.headline { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding-block: 4px 18px; }
.lead-name { font-size: 46px; font-weight: 800; color: var(--letter); line-height: 1.2; }
.standings { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.standings li { display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 0 20px; background: var(--surface); border-radius: 29px; }
.standings li.first { min-height: 66px; background: var(--mine); border: 2px solid var(--accent); }
.standings .place { width: 22px; font-weight: 800; color: var(--muted); }
.standings li.first .place { color: var(--letter); }
.standings .who { flex: 1; font-size: 18px; }
.standings li.first .who, .standings li.me .who { font-weight: 700; }
.standings .gain { font-size: 14px; color: var(--muted); direction: ltr; unicode-bidi: isolate; }
.standings .neg { color: var(--bad); }
.standings .bonus { font-size: 13px; color: var(--on-accent); background: var(--accent); border-radius: 999px; padding: 3px 9px; font-weight: 800; }
.standings .total { min-width: 46px; text-align: end; font-size: 21px; font-weight: 800; direction: ltr; unicode-bidi: isolate; font-variant-numeric: tabular-nums; }
.podium { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; align-items: end; }
.podium > div { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.medal { width: 44px; height: 44px; border-radius: 22px; display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 800; color: #12141c; }
.medal.p1 { width: 56px; height: 56px; border-radius: 28px; font-size: 26px; background: var(--accent); color: var(--on-accent); }
.medal.p2 { background: var(--silver); }
.medal.p3 { background: var(--bronze); }
.podium .name { font-size: 17px; font-weight: 700; text-align: center; overflow-wrap: anywhere; }
.podium .p1-col .name { font-size: 20px; font-weight: 800; }
.block { width: 100%; border-radius: 20px 20px 8px 8px; background: var(--surface); display: flex; justify-content: center; padding-top: 14px; font-size: 24px; font-weight: 800; direction: ltr; }
.block.b1 { height: 170px; background: var(--mine); border: 2px solid var(--accent); color: var(--letter); font-size: 30px; }
.block.b2 { height: 120px; }
.block.b3 { height: 90px; }
.crown { width: 40px; height: 28px; fill: var(--accent); }

/* ---- Motion (off when the device asks for less motion) ---------------------------------------------------- */
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { transform: scale(0.4); opacity: 0; } 70% { transform: scale(1.12); opacity: 1; } 100% { transform: scale(1); } }
@keyframes grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes flash { from { box-shadow: 0 0 0 6px var(--accent); } to { box-shadow: 0 0 0 0 transparent; } }
.reveal > * { animation: rise 0.45s cubic-bezier(.2, .8, .2, 1) both; }
.pop { animation: pop 0.5s cubic-bezier(.2, .8, .2, 1) both; }
.podium .block { transform-origin: bottom; animation: grow 0.8s cubic-bezier(.2, .8, .2, 1) both; }
.podium .p3-col .block { animation-delay: 0.2s; }
.podium .p2-col .block { animation-delay: 0.5s; }
.podium .p1-col .block { animation-delay: 0.9s; }
.podium .p1-col .medal, .podium .p1-col .crown { animation: pop 0.6s 1.5s cubic-bezier(.2, .8, .2, 1) both; }
.changed { animation: flash 0.7s ease-out; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---- Tablet and desktop ----------------------------------------------------------------------------------- */
@media (min-width: 768px) {
  .wrap { padding-block-start: 24px; }
  .round-screen { padding-block-start: 24px; }
}

/* ---- Plans and invoices ----------------------------------------------------------------------------------- */
.small { font-size: 14px; }
.plan-now { display: flex; flex-direction: column; gap: 2px; }
.plan-now strong { font-size: 19px; }
.plan-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.plan { display: flex; flex-direction: column; gap: 12px; }
.plan-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.plan-price { font-size: 22px; font-weight: 800; color: var(--letter); white-space: nowrap; }
.order-row { display: flex; flex-direction: column; gap: 6px; padding-block: 16px; }
.order-badge { padding: 2px 10px; border-radius: 12px; background: var(--bg); color: var(--muted); white-space: nowrap; }
.order-badge.order-paid { background: var(--ok); color: var(--on-ok); }
.order-badge.order-refunded, .order-badge.order-rejected { background: var(--bad); color: var(--on-bad); }
.order-mark { width: 72px; height: 72px; margin-inline: auto; border-radius: 36px; display: flex; align-items: center; justify-content: center; font-size: 36px; font-weight: 800; background: var(--bg); color: var(--muted); }
.order-paid .order-mark { background: var(--ok); color: var(--on-ok); }
.order-expired .order-mark, .order-cancelled .order-mark, .order-rejected .order-mark, .order-refunded .order-mark { background: var(--bad); color: var(--on-bad); }

/* ---- Footer and privacy ----------------------------------------------------------------------------------- */
.foot { text-align: center; padding: 8px 20px max(20px, env(safe-area-inset-bottom)); font-size: 14px; }
.foot a { color: var(--muted); }
.privacy h2 { margin-top: 6px; }
.cookie-list { margin: 0; padding-inline-start: 20px; display: flex; flex-direction: column; gap: 6px; }
.cookie-list code { font-weight: 700; }

/* ---- Inviting players: code, QR and share options; dialogs ------------------------------------------------- */
.share-card { display: flex; flex-direction: column; gap: 14px; }
.share-top { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.share-code { display: flex; flex-direction: column; gap: 2px; }
.share-code .code { font-size: 44px; line-height: 1.1; }
.share-link { font-size: 14px; overflow-wrap: anywhere; }
.qr-button { border: 0; padding: 6px; background: #fff; border-radius: 16px; cursor: zoom-in; line-height: 0; flex: none; }
.qr { display: block; width: 120px; height: 120px; image-rendering: pixelated; }
.qr.big { width: min(70vw, 60vh, 420px); height: auto; aspect-ratio: 1; background: #fff; border-radius: 18px; padding: 10px; }
.overlay { position: fixed; inset: 0; z-index: 40; background: var(--scrim); display: flex; align-items: center; justify-content: center; padding: 20px; animation: fade-in 0.15s ease-out; }
.big-share { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 24px; border-radius: 28px; background: var(--surface); text-align: center; max-width: 520px; width: 100%; }
.big-share .code { font-size: clamp(44px, 9vw, 80px); letter-spacing: 0.2em; }
.dialog { width: min(420px, 100%); }
.dialog .row-buttons > * { font-size: 17px; padding: 0 14px; white-space: nowrap; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .overlay { animation: none; } }

/* ---- Wide screens: header links (desktop design approved by Nasser, 2026-10-20) ---------------------------- */
.top-nav, .top-links { display: none; }
.icon-button.outline { background: transparent; border: 1px solid var(--line); }
.pill { display: inline-flex; align-items: center; height: 44px; padding: 0 18px; border: 1px solid var(--line); border-radius: 22px; color: var(--ink); font-size: 15px; font-weight: 700; text-decoration: none; white-space: nowrap; }
@media (min-width: 900px) {
  .top { max-width: 1160px; gap: 22px; padding-inline: 24px; }
  .brand { flex: none; font-size: 20px; }
  .top-nav { display: flex; flex: 1; gap: 24px; font-size: 16px; }
  .top-nav a { color: var(--muted); text-decoration: none; }
  .top-nav a:hover { color: var(--ink); }
  .top-links { display: flex; align-items: center; gap: 10px; margin-inline-start: auto; }
  .top-nav + .top-links { margin-inline-start: 0; }
  .top-links > a:first-child { color: var(--muted); font-size: 15px; text-decoration: none; padding-inline: 6px; }
  .top-links .icon-button svg { width: 20px; height: 20px; }
}

/* ---- Home page --------------------------------------------------------------------------------------------- */
body.landing-page .wrap { max-width: none; padding: 0; gap: 0; }
body.landing-page .top { position: sticky; top: 0; z-index: 10; background: var(--bg); }
.landing h2 { font-size: 30px; font-weight: 800; line-height: 1.3; }
.landing h3 { margin: 0; font-size: 19px; font-weight: 800; }
.landing p { line-height: 1.75; }
.landing [id] { scroll-margin-top: 80px; }
.badge { align-self: flex-start; display: inline-block; padding: 6px 14px; border-radius: 16px; background: var(--soft); color: var(--letter); font-size: 14px; font-weight: 700; }
.section { max-width: 1160px; margin-inline: auto; padding: 56px 20px; display: flex; flex-direction: column; gap: 28px; }
.section.narrow { max-width: 860px; }
.section-head { display: flex; flex-direction: column; gap: 6px; text-align: center; }
.band { background: var(--band); }
.hero { max-width: 1160px; margin-inline: auto; padding: 24px 20px 48px; display: grid; gap: 40px; align-items: center; }
.hero-text { display: flex; flex-direction: column; gap: 20px; }
.hero-title { font-size: clamp(34px, 5vw, 54px); line-height: 1.25; }
.hero-title span { display: block; color: var(--letter); }
.lead { font-size: 18px; color: var(--muted); max-width: 40em; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-cta > * { flex: 1 1 200px; }
.join-card { display: flex; flex-direction: column; gap: 18px; border: 1px solid var(--line); }
.join-card h2 { font-size: 22px; }
.join-card .join-form { margin: 0; gap: 16px; }
.hero-art { display: none; }
.steps, .features, .price-cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.steps li, .features li { display: flex; flex-direction: column; gap: 10px; border: 1px solid var(--line); }
.step-no { width: 44px; height: 44px; border-radius: 22px; background: var(--accent); color: var(--on-accent); display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 800; }
.feature-icon { width: 48px; height: 48px; border-radius: 16px; background: var(--soft); color: var(--letter); display: flex; align-items: center; justify-content: center; }
.feature-icon svg { width: 24px; height: 24px; }
.price-card { display: flex; flex-direction: column; gap: 14px; border: 1px solid var(--line); }
.price-card.featured { border: 2px solid var(--accent); }
.price-card .price { font-size: 34px; font-weight: 800; color: var(--letter); }
.price-card .button { margin-top: auto; }
.ticks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; color: var(--muted); }
.ticks li::before { content: "✓"; color: var(--ok); font-weight: 800; margin-inline-end: 8px; }
.faq { display: flex; flex-direction: column; gap: 10px; }
.faq details { border: 1px solid var(--line); padding: 0; }
.faq summary { padding: 18px 22px; font-size: 18px; font-weight: 700; cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--letter); font-weight: 800; }
.faq details[open] summary::after { content: "−"; }
.faq details p { padding: 0 22px 18px; }
.cta-band { padding: 32px; border-radius: 32px; background: var(--surface); border: 1px solid var(--line); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; }
.cta-band > div { display: flex; flex-direction: column; gap: 6px; }
.cta-band strong { font-size: 28px; font-weight: 800; }
.cta-band span { color: var(--muted); font-size: 18px; }
body.landing-page .foot { max-width: 1160px; margin-inline: auto; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding: 24px 20px; border-top: 1px solid var(--line); color: var(--muted); }

@media (min-width: 640px) {
  .steps, .features { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .price-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 900px) {
  .hero { grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); padding: 56px 24px 80px; gap: 56px; }
  .section { padding: 80px 24px; gap: 36px; }
  .landing h2 { font-size: 38px; }
  .steps { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .features { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .price-cards { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .steps li, .features li, .price-card { padding: 26px; }
  .cta-band { padding: 44px; }
  .cta-band strong { font-size: 34px; }

  /* The phone in the hero shows a round in play; decoration only (aria-hidden). */
  .hero-art { display: block; position: relative; min-height: 620px; }
  .phone { position: absolute; inset-inline-start: 50%; transform: translateX(50%); top: 0; width: 290px; padding: 22px 18px; border: 10px solid var(--line); border-radius: 44px; background: var(--bg); box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 9px; }
  [dir="ltr"] .phone { transform: translateX(-50%); }
  .phone-letter { text-align: center; font-size: 84px; line-height: 1.3; font-weight: 800; color: var(--letter); }
  .phone-field { display: flex; align-items: center; gap: 10px; height: 46px; padding-inline: 16px; background: var(--surface); border: 2px solid var(--line); border-radius: 23px; }
  .phone-field span { width: 46px; font-size: 13px; color: var(--muted); }
  .phone-field b { font-size: 17px; font-weight: 700; }
  .phone-bus { margin-top: 6px; height: 54px; border-radius: 27px; background: var(--accent); color: var(--on-accent); display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: 800; }
  .float-card { position: absolute; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); }
  .results-card { inset-inline-end: 0; bottom: -24px; width: 220px; padding: 16px 18px; display: flex; flex-direction: column; gap: 8px; font-size: 15px; }
  .results-card span { display: flex; justify-content: space-between; }
  .results-card span.first { color: var(--letter); font-weight: 800; }
  .results-card i { font-style: normal; }
  .bus-chip { inset-inline-start: 0; top: 70px; padding: 10px 16px; font-weight: 700; color: var(--letter); }
}

/* ---- Coordinator lobby on a computer or TV: invitation on one side, players and settings on the other ------- */
@media (min-width: 900px) {
  body.wide .wrap { max-width: 1320px; padding-inline: 32px; }
  .coord-lobby { display: grid; grid-template-columns: minmax(360px, 440px) minmax(0, 1fr); gap: 28px; align-items: stretch; }
  .coord-lobby .lobby-share { position: sticky; top: 16px; }
  .coord-lobby .share-card { padding: 28px; align-items: stretch; border: 1px solid var(--line); }
  .coord-lobby .share-top { flex-direction: column-reverse; gap: 18px; }
  .coord-lobby .qr-button { align-self: center; padding: 14px; border-radius: 22px; }
  .coord-lobby .qr { width: 240px; height: 240px; }
  .coord-lobby .share-code { align-items: center; text-align: center; }
  .coord-lobby .share-code .code { font-size: 64px; }
  .coord-lobby .chips .chip { font-size: 17px; padding: 10px 18px; }
}

/* ---- Coordinator account pages: sign in, new account, reset, verify ---------------------------------------- */
.auth { width: 100%; max-width: 460px; margin-inline: auto; display: flex; flex-direction: column; gap: 18px; padding-block: 8px 12px; }
.auth-card { display: flex; flex-direction: column; gap: 20px; padding: 28px 24px; border: 1px solid var(--line); box-shadow: var(--shadow); }
.auth-head { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.auth-head img { width: 56px; height: 56px; border-radius: 16px; margin-bottom: 4px; }
.auth-head h1 { font-size: 28px; }
.auth-head p { font-size: 15px; max-width: 30em; }
.auth-form { display: flex; flex-direction: column; gap: 16px; }
.auth-form .primary { margin-top: 4px; }
.label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.label-row a { font-size: 14px; }
.password-field { position: relative; }
.password-field input { display: block; padding-inline-end: 56px; }
.pw-reveal { position: absolute; inset-block: 0; inset-inline-end: 6px; margin-block: auto; width: 46px; height: 46px; border: 0; border-radius: 23px; background: transparent; color: var(--muted); display: flex; align-items: center; justify-content: center; }
.pw-reveal svg { width: 22px; height: 22px; }
.pw-reveal[aria-pressed="true"] { color: var(--letter); }
.auth-sep { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 14px; }
.auth-sep::before, .auth-sep::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.auth .center a { color: var(--muted); font-size: 15px; }
@media (min-width: 900px) {
  .auth { padding-block: 40px; }
  .auth-card { padding: 36px 36px 32px; }
}

/* ---- Round: the letter large at first, then in the top bar (Nasser 2026-10-21) ------------------------------- */
.round-bar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; padding-block: 6px 12px; }
.round-logo { display: flex; justify-content: flex-start; }
.round-logo img { width: 36px; height: 36px; border-radius: 10px; }
.round-bar-end { display: flex; justify-content: flex-end; }
.round-bar-end .icon-button { background: transparent; color: var(--muted); }
.letter-title { font-size: 26px; font-weight: 800; line-height: 1.3; white-space: nowrap; text-align: center; }
.letter-title .word { color: var(--muted); font-weight: 700; }
.letter-title .name { color: var(--letter); }
body.kids .letter-title { font-size: 32px; }
.letter-overlay { position: fixed; inset: 0; z-index: 30; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; background: var(--bg); cursor: pointer; animation: fade-in 0.15s ease-out; }
.letter-overlay .letter { font-size: clamp(140px, 45vw, 280px); line-height: 1.2; }
.letter-overlay .countdown { font-size: clamp(96px, 30vw, 200px); }
.overlay-hint { color: var(--muted); font-size: 16px; }
.letter-overlay .letter:empty, .letter-overlay .countdown:empty { display: none; }

/* ---- Narrow phones (≤ 380px): settings labels stay on one line beside their controls ------------------------ */
.setting > span { flex: 1; min-width: 0; }
@media (max-width: 380px) {
  .settings { padding-inline: 14px; }
  .segmented button { padding: 0 10px; font-size: 14px; }
  .share-code .code { font-size: 36px; }
  .qr { width: 100px; height: 100px; }
}

/* ---- Account in the menu; plan limits in the lobby and on the coordinator page ------------------------------ */
.menu form .menu-item { width: 100%; }
.plan-left { font-weight: 700; color: var(--letter); }
.limit { display: flex; flex-direction: column; gap: 10px; }
.meters { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.meter { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border-radius: 18px; background: var(--surface); }
.meter .k { font-size: 13px; color: var(--muted); }
.meter .v { font-size: 18px; font-weight: 800; }
.meter .bar { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; display: flex; }
.meter .bar i { background: var(--accent); }
.meter.full .bar i { background: var(--bad); }
.meter.full .v { color: var(--bad); }
.limit .note { display: flex; flex-direction: column; gap: 10px; }

/* ---- Coordinator panel (Nasser 2026-10-21): tab bar at the bottom on phones, tabs under the header on a computer */
.stack-tight { display: flex; flex-direction: column; gap: 2px; }
.panel-nav { position: fixed; inset-inline: 0; bottom: 0; z-index: 15; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  padding: 6px max(8px, env(safe-area-inset-left)) max(8px, env(safe-area-inset-bottom)); background: var(--menu); border-top: 1px solid var(--line); }
.panel-nav a { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 2px; border-radius: 14px; color: var(--muted); font-size: 12px; text-decoration: none; }
.panel-nav svg { width: 24px; height: 24px; }
.panel-nav a[aria-current="page"] { color: var(--letter); font-weight: 800; }
.panel-nav a[aria-current="page"] svg { background: var(--soft); border-radius: 12px; padding: 2px 10px; width: 44px; box-sizing: content-box; height: 22px; }
body.has-panel .wrap { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
body.has-panel .foot { display: none; }
.panel-page h1 { font-size: 28px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.panel-head a { font-size: 15px; }
.small-button { min-height: 44px; font-size: 15px; padding: 0 18px; }
.plan-card { display: flex; flex-direction: column; gap: 14px; border: 1px solid var(--line); }
.resume { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--ink); text-decoration: none; border: 2px solid var(--accent); }
.resume b { color: var(--letter); white-space: nowrap; }
.session-list, .round-history { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.session-row { display: flex; flex-direction: column; gap: 6px; color: var(--ink); text-decoration: none; border: 1px solid var(--line); }
.session-row:hover { border-color: var(--accent); }
.session-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.session-leader { font-size: 15px; font-weight: 700; color: var(--letter); }
.state-badge { padding: 3px 10px; border-radius: 12px; font-size: 13px; font-weight: 700; background: var(--bg); color: var(--muted); white-space: nowrap; }
.state-lobby, .state-playing_round, .state-round_results { background: var(--accent); color: var(--on-accent); }
.back-link { color: var(--muted); font-size: 15px; text-decoration: none; }
.round-history .card { display: flex; flex-direction: column; gap: 12px; border: 1px solid var(--line); }
.round-history-head { display: flex; align-items: center; gap: 12px; }
.wrap-chips { flex-wrap: wrap; overflow: visible; }
.wrap-chips span { background: var(--bg); }
.wrap-chips b { margin-inline-start: 8px; }
.account-card { display: flex; align-items: center; gap: 14px; }
.avatar { width: 52px; height: 52px; flex: none; border-radius: 26px; background: var(--accent); color: var(--on-accent); display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: 800; }
.list-card { padding: 6px 18px; display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 58px; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--ink); font: inherit; font-size: 16px; text-decoration: none; text-align: start; cursor: pointer; padding: 0; }
.list-item:last-child { border-bottom: 0; }
.list-item b { color: var(--muted); font-weight: 500; }
@media (min-width: 900px) {
  .panel-nav { position: sticky; top: 0; bottom: auto; max-width: 560px; margin: 0 auto 8px; grid-template-columns: repeat(5, auto); justify-content: center; gap: 4px;
    padding: 6px; border: 1px solid var(--line); border-radius: 22px; }
  .panel-nav a { flex-direction: row; gap: 8px; padding: 8px 14px; font-size: 15px; }
  .panel-nav svg { width: 20px; height: 20px; }
  .panel-nav a[aria-current="page"] { background: var(--soft); }
  .panel-nav a[aria-current="page"] svg { background: none; padding: 0; width: 20px; height: 20px; }
  body.has-panel .wrap { padding-bottom: 32px; }
}

/* ---- The others' progress while the round is played: names and six dots, no answers (Nasser 2026-10-21) ------- */
.progress-strip { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-block: 0 10px; flex: none; }
.progress-strip:empty { display: none; }
.progress-chip { flex: none; display: flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 16px; background: var(--surface); font-size: 13px; }
.progress-chip b { font-weight: 700; }
.progress-chip.full { background: var(--mine); box-shadow: 0 0 0 2px var(--accent); }
.mini-dots { display: flex; gap: 3px; }
.mini-dots i { width: 6px; height: 6px; border-radius: 3px; background: var(--line); }
.mini-dots i.on { background: var(--accent); }
.progress-strip.big { flex-wrap: wrap; justify-content: center; padding-top: 24px; }
.progress-strip.big .progress-chip { font-size: 18px; padding: 10px 16px; }
.progress-strip.big .mini-dots i { width: 10px; height: 10px; border-radius: 5px; }
.list-note { margin: 0; padding: 12px 0; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.session-close { display: flex; justify-content: flex-end; margin-top: -4px; }
.session-close .link-button { color: var(--bad); }

/* ---- The coordinator's screen, /s/<key> (TV / projector, Nasser 2026-10-21): large, readable from the room ----- */
body.screen-page .wrap { max-width: none; min-height: 100dvh; padding: clamp(16px, 3vw, 48px); }
.screen-show { min-height: calc(100dvh - 2 * clamp(16px, 3vw, 48px)); display: flex; flex-direction: column; cursor: default; }
.screen-show > section { flex: 1; }
.show-center { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1vh; text-align: center; }
.show-logo { width: clamp(80px, 10vw, 160px); height: auto; border-radius: 24%; }
.show-title { font-size: clamp(28px, 4vw, 64px); font-weight: 800; }
.show-muted { color: var(--muted); font-size: clamp(16px, 1.8vw, 30px); }
.show-brand { display: flex; align-items: center; gap: 12px; font-size: clamp(18px, 1.8vw, 28px); font-weight: 800; }
.show-brand img { width: clamp(32px, 3vw, 48px); height: auto; border-radius: 22%; }
.show-lobby { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: clamp(24px, 4vw, 72px); align-items: center; }
.show-join { display: flex; flex-direction: column; align-items: center; gap: 1vh; padding: clamp(16px, 2.5vw, 40px); border-radius: 32px; background: var(--surface); border: 1px solid var(--line); text-align: center; }
.show-qr { width: min(34vw, 52vh); height: auto; aspect-ratio: 1; background: #fff; border-radius: 24px; padding: 14px; image-rendering: pixelated; }
.show-code { font-size: clamp(48px, 8vw, 140px); font-weight: 800; letter-spacing: 0.15em; color: var(--letter); direction: ltr; line-height: 1.1; }
.show-join-corner { position: fixed; inset-block-end: 2vh; inset-inline-end: 2vw; display: flex; flex-direction: column; align-items: center; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 10px; z-index: 5; }
.show-join-corner img { width: min(12vw, 18vh); height: auto; aspect-ratio: 1; background: #fff; border-radius: 8px; image-rendering: pixelated; }
.show-join-corner b { font-size: clamp(18px, 2vw, 32px); letter-spacing: 0.12em; color: var(--letter); direction: ltr; }
.show-link { font-size: clamp(16px, 1.8vw, 30px); color: var(--muted); }
.show-players { display: flex; flex-direction: column; gap: 2vh; }
.show-players h1 { font-size: clamp(36px, 5vw, 88px); }
.show-chips { display: flex; flex-wrap: wrap; gap: 12px; }
.show-chip { padding: 0.5em 1.1em; border-radius: 999px; background: var(--surface); font-size: clamp(18px, 2vw, 34px); font-weight: 700; animation: pop 0.4s both; }
.show-chip.lead { background: var(--accent); color: var(--on-accent); }
.show-countdown { font-size: clamp(120px, 30vh, 360px); font-weight: 800; color: var(--muted); line-height: 1; }
.show-letter { font-size: clamp(140px, 42vh, 480px); font-weight: 800; color: var(--letter); line-height: 1.35; }
.show-letter.small { font-size: clamp(100px, 28vh, 300px); }
.show-letter.en, .show-badge.en { text-transform: uppercase; }
.show-countdown:empty, .show-letter:empty { display: none; }
.show-review { display: flex; flex-direction: column; gap: 3vh; }
.show-review-head { display: flex; align-items: center; gap: 24px; }
.show-review-head h1 { font-size: clamp(32px, 4.5vw, 80px); }
.show-badge { width: clamp(72px, 8vw, 140px); height: clamp(72px, 8vw, 140px); border-radius: 50%; background: var(--accent); color: var(--on-accent); display: flex; align-items: center; justify-content: center; font-size: clamp(40px, 5vw, 90px); font-weight: 800; flex: none; }
.show-answers { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); gap: 16px; }
.show-answers li { display: flex; flex-direction: column; gap: 6px; padding: 18px 24px; border-radius: 24px; background: var(--surface); border: 3px dashed var(--accent); }
.show-answers li.ok { border: 3px solid var(--ok); }
.show-answers li.bad { border: 3px solid var(--bad); opacity: 0.75; }
.show-answers b { font-size: clamp(24px, 2.6vw, 48px); }
.show-answers i { font-style: normal; font-weight: 700; font-size: clamp(14px, 1.3vw, 22px); color: var(--muted); }
.show-answers li.ok i { color: var(--ok); }
.show-answers li.bad i { color: var(--bad); }
.show-results { display: flex; flex-direction: column; align-items: center; gap: 2.5vh; text-align: center; }
.show-results h1 { font-size: clamp(36px, 5vw, 90px); }
.show-standings { list-style: none; margin: 0; padding: 0; width: min(100%, 1100px); display: flex; flex-direction: column; gap: 12px; }
.show-standings li { display: flex; align-items: center; gap: 20px; padding: 14px 28px; border-radius: 999px; background: var(--surface); font-size: clamp(20px, 2.4vw, 42px); }
.show-standings li.first { background: var(--mine); border: 3px solid var(--accent); }
.show-standings .place { width: 1.6em; font-weight: 800; color: var(--muted); }
.show-standings .who { flex: 1; text-align: start; font-weight: 700; }
.show-standings .gain { color: var(--muted); font-size: 0.7em; }
.show-standings .total { font-weight: 800; min-width: 3ch; text-align: end; }
.show-podium { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; align-items: end; width: min(100%, 1100px); }
.show-podium .col { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.show-podium .name { font-size: clamp(22px, 2.6vw, 48px); font-weight: 800; }
.show-podium .block { width: 100%; display: flex; justify-content: center; padding-top: 18px; border-radius: 28px 28px 10px 10px; background: var(--surface); font-size: clamp(28px, 3vw, 56px); font-weight: 800; transform-origin: bottom; animation: grow 0.8s both; }
.show-podium .p1 .block { background: var(--mine); border: 3px solid var(--accent); color: var(--letter); }
/* The step's height follows its position, its colour the real place (ties share a colour, Nasser 2026-10-23). */
.show-podium .step1 .block { height: 34vh; }
.show-podium .step2 .block { height: 24vh; }
.show-podium .step3 .block { height: 17vh; }
/* With the awards under it, the podium is lower so the whole board fits one screen. */
.show-results.final .show-podium .step1 .block { height: 22vh; }
.show-results.final .show-podium .step2 .block { height: 15vh; }
.show-results.final .show-podium .step3 .block { height: 10vh; }
.show-results.final { gap: clamp(10px, 1.6vh, 22px); }
.show-results.final h1 { margin: 0; }
@media (max-width: 800px) {
  .show-lobby { grid-template-columns: 1fr; }
  .show-qr { width: min(70vw, 40vh); }
}
.screen-card { display: flex; flex-direction: column; gap: 12px; border: 1px solid var(--line); }
.screen-url { padding: 10px 14px; border-radius: 14px; background: var(--bg); font-size: 16px; font-weight: 700; overflow-wrap: anywhere; }

/* ---- Round time limit (Nasser 2026-10-21) ------------------------------------------------------------------- */
.round-bar-end { gap: 6px; align-items: center; }
.round-timer { min-width: 52px; padding: 4px 10px; border-radius: 14px; background: var(--surface); font-weight: 800; font-variant-numeric: tabular-nums; direction: ltr; text-align: center; }
.round-timer.urgent { background: var(--bad); color: var(--on-bad); animation: pop 0.4s; }

/* ---- The session's fields: presets and the coordinator's own (Nasser 2026-10-21) --------------------------- */
.preset-row { display: flex; flex-wrap: wrap; gap: 8px; padding-block: 10px 6px; }
.preset-row .chip, .field-chips .chip { background: var(--bg); border: 0; cursor: pointer; }
.preset-row .chip.lead { background: var(--accent); color: var(--on-accent); }
.field-chips { padding-block: 6px; }
.field-add { display: flex; gap: 8px; }
.field-add input { height: 44px; border-radius: 22px; font-size: 16px; }
.field-add .small-button { flex: none; width: 52px; padding: 0; }
.round-field span { width: auto; min-width: 52px; max-width: 34%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- Kids mode: bigger letters and text in the round (Nasser 2026-10-21) ------------------------------------ */
body.kids .round-field input { font-size: 25px; }
body.kids .round-field span { font-size: 17px; }
body.kids .letter-badge { width: 72px; height: 72px; font-size: 42px; }

/* ---- Appeals in correction: who objected, the votes, and the decision (Nasser 2026-10-21) ------------------- */
.appeal { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.appeal .link-button { padding: 0; }
.appeal.open { padding: 8px 10px; border-radius: 14px; background: var(--soft); color: var(--ink); }
.appeal-head { font-weight: 700; }
.appeal-votes { flex: 1; white-space: nowrap; text-align: end; }
.appeal-actions { display: flex; flex-wrap: wrap; gap: 8px; width: 100%; }
.appeal-actions:empty { display: none; }
.appeal .chip { padding: 6px 12px; border-radius: 14px; border: 2px solid var(--line); background: var(--surface); font-size: 14px; }
.appeal .chip[aria-pressed="true"] { border-color: var(--accent); background: var(--mine); }
.appeal .chip.accept { border-color: var(--ok); }
.appeal.accepted b { color: var(--ok); }
.appeal.rejected b { color: var(--bad); }

/* ---- Team mode: the teams in the lobby, and their standings (Nasser 2026-10-21) ---------------------------- */
.teams-panel { display: flex; flex-direction: column; gap: 10px; }
.teams-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.team-card { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 18px; background: var(--surface); border: 2px solid var(--line); border-top-width: 6px; }
.team-card.team-0 { border-top-color: #d97706; }
.team-card.team-1 { border-top-color: #2563eb; }
.team-card.team-2 { border-top-color: #16a34a; }
.team-card.team-3 { border-top-color: #db2777; }
.team-card.team-4 { border-top-color: #7c3aed; }
.team-card.team-5 { border-top-color: #0891b2; }
.team-head { display: flex; align-items: center; gap: 6px; }
.team-head b { flex: 1; }
.team-name { flex: 1; min-width: 0; padding: 6px 8px; border: 1px solid var(--line); border-radius: 10px; background: transparent; color: inherit; font: inherit; font-weight: 700; }
.team-members { display: flex; flex-wrap: wrap; gap: 6px; }
.team-members .chip { font-size: 14px; }
.team-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.team-actions button { flex: 1; }
.team-standings h2 { margin: 0 0 8px; font-size: 18px; }
.team-standings .who small { font-weight: 400; }
.team-winner { font-size: 20px; font-weight: 800; }


/* Offers and coupons on the plans (Nasser 2026-10-21): the old price struck through, the saving, the offer's badge. */
.was { font-size: 0.6em; font-weight: 600; color: var(--muted); margin-inline-end: 6px; }
.saving { margin: 0; font-weight: 700; color: var(--letter); }
.badge.offer { background: var(--accent); color: var(--on-accent); }
.coupon-form { display: flex; flex-direction: column; gap: 8px; }
.coupon-form .row { display: flex; gap: 8px; }
.coupon-form input { flex: 1; min-width: 0; text-transform: uppercase; }
.coupon-form p { margin: 0; }

/* The winner's coupon on the honour board (only on the winner's phone). */
.winner-coupon { display: flex; flex-direction: column; gap: 10px; border: 2px dashed var(--accent); text-align: center; }
.winner-coupon p { margin: 0; }
.winner-code { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; }
.winner-code code { font-size: 26px; font-weight: 800; letter-spacing: 3px; color: var(--letter); }
.winner-budget { margin: 0; }

/* «شاهد كيف تلعب» on the coordinator's page: the how-to video, folded until opened. */
.howto summary { cursor: pointer; font-weight: 700; }
.howto video { display: block; width: 100%; max-width: 280px; aspect-ratio: 9 / 16; margin: 12px auto 0; border-radius: 16px; background: #000; }

/* The screen's round board (Nasser 2026-10-21): who filled which box, never what. «race»: the three leaders large,
   then everyone else in lanes; «table»: one row per player. Boxes: empty, typing (dashed, three dots), done (lit). */
.show-play { display: flex; flex-direction: column; gap: 2.2vh; }
.show-round-head { display: flex; align-items: center; gap: 24px; }
.show-round-head .show-title { margin: 0; }
.show-round-head .show-muted { margin: 0; }
.show-spacer { flex: 1; }
.show-timer { font-size: clamp(28px, 4vw, 64px); font-weight: 800; font-variant-numeric: tabular-nums; }
.show-timer:empty { display: none; }
.show-board { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 1.4vh; }
.show-board[hidden] { display: none; }
.cell { display: flex; align-items: flex-end; justify-content: center; min-height: 0; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); position: relative; color: var(--muted); font-weight: 700; }
.cell.done { background: linear-gradient(180deg, #f8c64b, #e0a21c); border-color: #f8c64b; color: #3a2a06; box-shadow: 0 0 18px rgba(245, 184, 46, 0.35); }
.cell.typing { background: rgba(245, 184, 46, 0.1); border: 3px dashed var(--accent); color: var(--accent); }
.cell.typing::after { content: ''; position: absolute; inset: 0; margin: auto; width: 48px; height: 12px; background: radial-gradient(circle, var(--accent) 5px, transparent 6px) 0 0 / 16px 12px repeat-x; animation: typing 1s infinite alternate; }
@keyframes typing { from { opacity: 0.35; } to { opacity: 1; } }
.show-count { display: inline-flex; align-items: center; justify-content: center; min-width: 4.2em; padding: 0.3em 0.6em; border-radius: 999px; font-weight: 800; font-variant-numeric: tabular-nums; direction: ltr; }
.heat0 { background: var(--surface); color: var(--muted); } .heat1 { background: #3b3420; color: #f5d27a; } .heat2 { background: #5a4512; color: #fde68a; }
.heat3 { background: #8a5d0b; color: #fff; } .heat4 { background: #c2410c; color: #fff; } .heat5 { background: #dc2626; color: #fff; box-shadow: 0 0 24px rgba(220, 38, 38, 0.55); }
.show-rank { font-weight: 800; color: var(--muted); text-align: center; }
.show-who { font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.show-section { margin: 0; color: var(--muted); font-weight: 800; font-size: clamp(14px, 1.3vw, 24px); }
.show-cells { display: grid; grid-template-columns: repeat(var(--fields), minmax(0, 1fr)); gap: 8px; }
.show-leaders { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.show-leader { display: flex; flex-direction: column; gap: 14px; padding: 20px 24px; border-radius: 28px; background: var(--surface); border: 1px solid var(--line); }
.show-leader.first { border-color: var(--accent); box-shadow: 0 0 40px rgba(245, 184, 46, 0.25); }
.show-leader-head { display: flex; align-items: center; gap: 14px; font-size: clamp(22px, 2.4vw, 46px); }
.show-leader-head .show-rank { width: 1.3em; height: 1.3em; border-radius: 50%; background: var(--line); color: var(--ink); display: inline-flex; align-items: center; justify-content: center; font-size: 0.7em; }
.show-leader.first .show-rank { background: var(--accent); color: var(--on-accent); }
.show-leader-head .show-count { margin-inline-start: auto; font-size: 0.6em; }
.show-leader .cell { height: clamp(60px, 10vh, 110px); padding-bottom: 8px; font-size: clamp(12px, 1.1vw, 22px); }
.show-leader .cell.typing::after { inset: 18% 0 auto 0; }
.show-lanes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1vh 40px; }
.show-lane { display: grid; grid-template-columns: 2.2em 8em minmax(0, 1fr) 4.6em; align-items: center; gap: 14px; font-size: clamp(16px, 1.6vw, 30px); }
.show-lane .cell { height: clamp(28px, 4.4vh, 48px); font-size: 0; }
.show-lane .show-count, .show-row .show-count { font-size: 0.8em; }
.show-board.table { gap: 0.8vh; }
.show-row { display: grid; grid-template-columns: 2.2em 9em repeat(var(--fields), minmax(0, 1fr)) 5em; align-items: center; gap: 10px; font-size: clamp(16px, 1.8vw, 34px); }
.show-row .cell { height: clamp(28px, 6.8vh, 74px); }
.show-board.n10 .show-row .cell, .show-board.n11 .show-row .cell, .show-board.n12 .show-row .cell { height: 4.6vh; }
.show-board.n13 .show-row, .show-board.n14 .show-row, .show-board.n15 .show-row { font-size: clamp(14px, 1.3vw, 24px); }
.show-board.n13 .show-row .cell, .show-board.n14 .show-row .cell, .show-board.n15 .show-row .cell { height: 3.6vh; }
.show-row.head { font-size: clamp(14px, 1.4vw, 28px); color: var(--muted); font-weight: 800; }
.show-field { text-align: center; }
.show-row.is-bus .cell, .show-lane.is-bus .cell { outline: 3px solid var(--accent); outline-offset: 2px; }
.show-leader.is-bus { outline: 4px solid var(--accent); }
.show-banner { align-self: center; margin: 0; padding: 0.35em 1.2em; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-size: clamp(28px, 3.6vw, 64px); font-weight: 800; box-shadow: 0 0 80px rgba(245, 184, 46, 0.5); }
.show-legend { display: flex; flex-wrap: wrap; gap: 28px; color: var(--muted); font-size: clamp(13px, 1.2vw, 22px); align-items: center; }
.show-legend span { display: inline-flex; align-items: center; gap: 10px; }
.show-legend .cell { display: inline-block; width: 30px; height: 22px; }
.show-legend .cell.typing::after { display: none; }
.show-settings { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 1vh; }
.show-set { padding: 14px 18px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); }
.show-set small { display: block; color: var(--muted); font-size: clamp(12px, 1.1vw, 22px); }
.show-set b { font-size: clamp(16px, 1.6vw, 30px); }
.screen-layout { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.segmented button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); font-weight: 700; }

/* Teams on the screen (Nasser 2026-10-21): a colour per team, its name beside every member, its totals. */
.show-team { display: inline-block; margin-inline-start: 0.6em; padding: 0.1em 0.6em; border-radius: 999px; font-size: 0.55em; font-weight: 800; vertical-align: middle; color: #12141c; }
.t0 { --team: #f5b82e; } .t1 { --team: #60a5fa; } .t2 { --team: #4ade80; } .t3 { --team: #f472b6; } .t4 { --team: #a78bfa; } .t5 { --team: #fb923c; }
.show-team { background: var(--team, var(--line)); }
.show-teams { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.show-team-col { display: flex; flex-direction: column; gap: 10px; padding: 14px 18px; border-radius: 22px; background: var(--surface); border: 2px solid var(--team, var(--line)); }
.show-team-col > b { color: var(--team, var(--muted)); font-size: clamp(18px, 1.8vw, 32px); }
.show-team-col .show-chip { font-size: clamp(16px, 1.5vw, 28px); }
.show-team-sums { display: flex; flex-wrap: wrap; gap: 14px; }
.show-team-sums .show-team { margin: 0; font-size: clamp(16px, 1.5vw, 28px); padding: 0.25em 0.9em; }
.show-team-standings { display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; }
.show-team-card { display: flex; align-items: center; gap: 14px; padding: 12px 22px; border-radius: 22px; background: var(--surface); border: 2px solid var(--team, var(--line)); font-size: clamp(18px, 2vw, 36px); }
.show-team-card.first { box-shadow: 0 0 40px rgba(245, 184, 46, 0.3); }
.show-team-card .place { color: var(--muted); font-weight: 800; }
.show-team-card b { color: var(--team); }
.show-team-card .total { font-weight: 800; }
.show-team-winner { text-align: center; font-size: clamp(22px, 2.6vw, 48px); font-weight: 800; color: var(--letter); margin: 0; }

/* «اقتراح الحكم»: a quiet line under an answer awaiting the coordinator; the verdict buttons stay the decision. */
.ai-hint { margin: 4px 0 0; font-size: 13px; color: var(--muted); }
.ai-hint::before { content: '✦ '; }
.ai-hint.ok::before { color: var(--ok, #15803d); }
.ai-hint.bad::before { color: var(--bad, #b42318); }
/* The suggestion disagrees with the verdict the row has now (often the letter check's automatic «صحيحة»). */
.ai-hint.differs { color: var(--ink); font-weight: 600; }
/* «التصحيح الذكي» on its way: one quiet line above the answers, with a way to carry on without it. */
/* «التصحيح الذكي» on its way: the whole screen, a spinner and «تخطَّ» (Nasser 2026-10-22). */
.ai-overlay { position: fixed; inset: 0; z-index: 40; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 24px; text-align: center; background: var(--bg); animation: fade-in 0.15s ease-out; }
.ai-overlay-title { margin: 0; font-size: 20px; font-weight: 800; }
.ai-overlay-title::before { content: '✦ '; color: var(--letter); }
.ai-overlay .ghost { min-width: 160px; }
.spinner { width: 48px; height: 48px; border-radius: 50%; border: 4px solid var(--line); border-top-color: var(--accent); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2.4s; } }
/* The letter's name under the big letter: «حرف الراء». */
.letter-overlay .letter-name { margin: 0; font-size: clamp(22px, 6vw, 34px); font-weight: 700; }
.letter-overlay .letter-name:empty { display: none; }
.merged-line { margin: 4px 0 0; font-size: 13px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip-undo { border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 2px 10px; font: inherit; font-size: 13px; }
button.chip-undo { cursor: pointer; }
.share-icons { display: flex; align-items: center; justify-content: center; gap: 12px; }
.icon-round { width: 52px; height: 52px; min-height: 0; padding: 0; border-radius: 26px; border: 2px solid var(--line); background: var(--surface); color: var(--ink); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.icon-round svg { width: 24px; height: 24px; }
.text-link { color: var(--muted); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

/* The countdown in words (Nasser 2026-10-22): «خلك» slides in, «جاهز» drops and bounces, «بنبدأ!» bursts out with a
   shake; then the letter. Sized from the countdown's own font size so it fits a phone and a TV. */
.count-word { display: inline-block; font-size: 0.68em; line-height: 1.15; white-space: nowrap; color: var(--letter); }
.count-word.w3 { color: var(--gold); animation: word-slide 0.85s cubic-bezier(.2, .9, .25, 1) both; }
.count-word.w2 { color: var(--gold-2); animation: word-drop 0.85s cubic-bezier(.3, 1.4, .5, 1) both; }
.count-word.w1 { color: var(--buzzer); animation: word-burst 0.9s cubic-bezier(.2, .9, .25, 1) both; }
.count-word.w4 { color: var(--muted); font-size: 1em; animation: word-drop 0.7s ease-out both; }
@keyframes word-slide { 0% { transform: translateX(70%) skewX(-18deg); opacity: 0; filter: blur(8px); } 60% { transform: translateX(-6%) skewX(6deg); opacity: 1; filter: blur(0); } 100% { transform: none; opacity: 1; } }
@keyframes word-drop { 0% { transform: translateY(-90%) scale(1.25); opacity: 0; } 55% { transform: translateY(8%) scale(0.96); opacity: 1; } 75% { transform: translateY(-3%); } 100% { transform: none; opacity: 1; } }
@keyframes word-burst { 0% { transform: scale(0.2) rotate(-8deg); opacity: 0; } 45% { transform: scale(1.18) rotate(2deg); opacity: 1; } 60% { transform: scale(1) translateX(-4%); } 70% { transform: translateX(4%); } 80% { transform: translateX(-2%); } 100% { transform: none; opacity: 1; } }
/* «خمّن الحرف الجاي…»: «بنبدأ!» gives way, the line fades in and beats faster with the drums, glowing. */
.count-word.guess { white-space: normal; max-width: 90vw; font-size: 0.4em; line-height: 1.35; color: var(--letter); text-align: center;
  animation: guess-in 0.5s ease-out both, guess-beat 0.42s ease-in-out 0.5s infinite alternate, guess-glow 2s ease-in 0.2s both; }
@keyframes guess-in { 0% { opacity: 0; transform: scale(0.85); filter: blur(6px); } 100% { opacity: 1; transform: none; filter: blur(0); } }
@keyframes guess-beat { from { transform: scale(1); } to { transform: scale(1.06); } }
@keyframes guess-glow { from { text-shadow: 0 0 0 transparent; } to { text-shadow: 0 0 0.35em rgba(255, 184, 0, 0.6); } }
/* The letter's entrance after the drums: it lands from far with a flash. */
.letter-overlay .letter.pop { animation: letter-land 0.6s cubic-bezier(.2, .9, .25, 1.2) both; }
@keyframes letter-land { 0% { transform: scale(3); opacity: 0; filter: blur(10px); } 60% { transform: scale(0.94); opacity: 1; filter: blur(0); } 100% { transform: none; } }
@media (prefers-reduced-motion: reduce) { .count-word, .letter-overlay .letter.pop { animation: none !important; } }

/* ---- «برنامج المسابقات» (Nasser 2026-10-22): the stage ----------------------------------------------------------
   Navy bars and stages with faint gold rays, the big type in Lalezar, the main actions red buzzer buttons with a bottom
   shadow like a console key. Colours come from the tokens above only. */
.stage { background: repeating-conic-gradient(from 0deg at 50% 110%, var(--rays) 0deg 7deg, transparent 7deg 18deg), var(--navy); color: var(--on-navy); }
h1, h2, .code, .show-code, .show-title, .lead-name, .count-word, .letter-title, .pts, .total, .place, .medal, .block,
.letter-overlay .letter, .show-letter, .show-badge, .show-countdown, .bus, .screen-head .title { font-family: var(--display); font-weight: 400; letter-spacing: 0; }
h1 { font-size: 34px; }
.code, .show-code, .show-join-corner b { letter-spacing: 0.18em; }
/* The top bar: full-width navy, the menu button light on it. */
.top { max-width: none; padding-inline: max(20px, calc((100% - 560px) / 2 + 20px)); background: repeating-conic-gradient(from 0deg at 50% 160%, var(--rays) 0deg 7deg, transparent 7deg 18deg), var(--navy); }
.top .brand { color: var(--on-navy); font-family: var(--display); font-weight: 400; font-size: 21px; }
.top .icon-button { background: rgba(255, 255, 255, 0.1); color: var(--on-navy); }
/* Buzzer buttons. */
.primary, .bus { background: var(--buzzer); color: var(--on-buzzer); box-shadow: 0 6px 0 var(--buzzer-shadow); transition: transform 0.08s, box-shadow 0.08s; }
.primary:active:not(:disabled), .bus:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 2px 0 var(--buzzer-shadow); }
.primary:disabled, .bus:disabled { box-shadow: 0 6px 0 rgba(179, 36, 28, 0.35); }
.bus { font-size: 34px; }
.ghost, a.button.ghost { box-shadow: 0 4px 0 var(--line); }
/* The countdown and the letter fill the stage. */
.letter-overlay { background: repeating-conic-gradient(from 0deg at 50% 50%, var(--rays) 0deg 7deg, transparent 7deg 18deg), var(--navy); color: var(--on-navy); }
.letter-overlay .letter { color: var(--gold); }
.letter-overlay .letter-name, .letter-overlay .overlay-hint { color: var(--on-navy); }
.letter-overlay .count-word.guess { color: var(--gold-2); }
/* In the bar: «حرف» then the letter's name on a gold key. */
.letter-title .word { color: var(--muted); }
.letter-title .name { color: var(--navy); background: var(--gold); border-radius: 12px; padding: 0 0.35em; box-shadow: 0 3px 0 rgba(179, 127, 0, 0.6); }
.letter-badge { font-family: var(--display); font-weight: 400; background: var(--gold); color: var(--navy); }
/* The TV: always the stage. */
body.screen-page { background: repeating-conic-gradient(from 0deg at 50% 120%, var(--rays) 0deg 6deg, transparent 6deg 15deg), var(--navy); color: var(--on-navy); }
body.screen-page .show-muted, body.screen-page .show-link { color: #a9b6dd; }
body.screen-page .show-letter, body.screen-page .show-code, body.screen-page .show-join-corner b { color: var(--gold); }
body.screen-page .show-join, body.screen-page .show-chip, body.screen-page .show-answers li, body.screen-page .show-standings li,
body.screen-page .show-podium .block, body.screen-page .show-join-corner { background: var(--navy-2); border-color: rgba(255, 255, 255, 0.12); color: var(--on-navy); }
body.screen-page .show-chip.lead, body.screen-page .show-badge { background: var(--gold); color: var(--navy); }
body.screen-page .show-standings li.first, body.screen-page .show-podium .p1 .block { background: #1b3585; border-color: var(--gold); color: var(--gold); }
body.screen-page .show-standings .place, body.screen-page .show-standings .gain { color: #a9b6dd; }
/* The landing page: navy bar and a navy stage behind the hero (full width), the join card white on it. */
body.landing-page .top { background: repeating-conic-gradient(from 0deg at 50% 160%, var(--rays) 0deg 7deg, transparent 7deg 18deg), var(--navy); }
body.landing-page .hero { position: relative; color: var(--on-navy); box-shadow: 0 0 0 100vmax var(--navy); clip-path: inset(0 -100vmax); background: repeating-conic-gradient(from 0deg at 50% 120%, var(--rays) 0deg 7deg, transparent 7deg 18deg), var(--navy); }
body.landing-page .hero .hero-title span { color: var(--gold); }
body.landing-page .hero .lead { color: #c9d3f2; }
body.landing-page .hero .badge { background: var(--gold); color: var(--navy); }
body.landing-page .hero .ghost { color: var(--on-navy); border-color: rgba(255, 255, 255, 0.35); box-shadow: none; }
body.landing-page .hero .join-card { color: var(--ink); }
.step-no { font-family: var(--display); font-weight: 400; }
.price-card .price { font-family: var(--display); font-weight: 400; color: var(--ink); }
body.screen-page { --rays: rgba(255, 210, 77, 0.045); }

/* Inviting players (Nasser 2026-10-22): four round icons with a word under each; the QR opens large when tapped. */
.invite-icons { display: grid; grid-template-columns: repeat(auto-fit, minmax(64px, 1fr)); gap: 8px; }
.invite-icon { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 4px 0; border: 0; background: none; color: var(--ink); font: inherit; font-size: 13px; font-weight: 600; text-decoration: none; text-align: center; cursor: pointer; }
.invite-disc { width: 52px; height: 52px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--navy); color: var(--gold); box-shadow: 0 4px 0 var(--navy-2); transition: transform 0.08s, box-shadow 0.08s; }
.invite-icon:active .invite-disc { transform: translateY(3px); box-shadow: 0 1px 0 var(--navy-2); }
.invite-disc svg { width: 24px; height: 24px; }
.qr-button { display: flex; flex-direction: column; align-items: center; gap: 2px; }

/* The settings behind one button, in a sheet (Nasser 2026-10-22). */
.settings-open { display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px 18px; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); color: var(--ink); font: inherit; text-align: start; cursor: pointer; box-shadow: 0 4px 0 var(--line); }
.settings-open-text { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.settings-open-text b { font-size: 17px; }
.sheet-overlay { align-items: flex-end; padding: 0; }
.sheet { width: min(640px, 100%); max-height: 88dvh; display: flex; flex-direction: column; background: var(--bg); border-radius: 26px 26px 0 0; box-shadow: var(--shadow); animation: sheet-up 0.22s ease-out; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px 10px; }
.sheet-done { min-height: 44px; padding: 0 22px; font-size: 16px; }
.sheet-body { overflow-y: auto; padding: 0 16px max(20px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 10px; }
@keyframes sheet-up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (min-width: 900px) { .sheet-overlay { align-items: center; } .sheet { border-radius: 26px; } }

/* The coordinator's microphone before their name (Nasser 2026-10-22). */
.host-mark { width: 1em; height: 1em; vertical-align: -0.12em; margin-inline-end: 0.3em; flex: none; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

/* Many players (Nasser 2026-10-22, tried with 15): the lobby list in two columns, tighter result rows, and on the TV
   smaller chips, standings in two columns, a tighter table, and room kept for the join corner. */
.player-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.player-list li { min-height: 46px; padding: 0 16px; border-radius: 23px; font-size: 16px; }
.standings.many { gap: 6px; }
.standings.many li { min-height: 44px; padding: 0 16px; border-radius: 22px; }
.standings.many li.first { min-height: 52px; }
.standings.many .who { font-size: 16px; }
.standings.many .total { font-size: 18px; }
.show-chips.many { gap: 8px; }
.show-chips.many .show-chip { font-size: clamp(15px, 1.5vw, 26px); padding: 0.4em 0.9em; }
.show-standings.many { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-flow: column; grid-template-rows: repeat(10, auto); width: min(100%, 1500px); gap: 8px 20px; }
.show-standings.many li { padding: 6px 20px; font-size: clamp(16px, 1.7vw, 30px); }
.show-board.n13 .show-row .cell, .show-board.n14 .show-row .cell, .show-board.n15 .show-row .cell { height: 2.9vh; }
.show-board.n13.table, .show-board.n14.table, .show-board.n15.table { gap: 0.45vh; }
.screen-show:has(> .show-join-corner) > section { padding-inline-end: calc(min(12vw, 18vh) + 3vw); }

/* The code in the middle of its column, copied with a tap. */
.share-code { flex: 1; align-items: center; text-align: center; }
.code-copy { border: 0; background: none; padding: 0; cursor: copy; color: var(--letter); }

/* English letters (Nasser 2026-10-22): the display font draws «I» as a bare bar, read as «ا». A letter alone is drawn
   with serifs (the device's own serif, no font to fetch), on a key wide enough for a narrow letter. */
.letter.en, .letter-badge.en, .letter-title.en .name, .letter-grid.en button, .letters-off.en button,
.show-letter.en, .show-badge.en { font-family: Georgia, 'Times New Roman', serif; font-weight: 700; }
.letter-title.en .name { display: inline-block; min-width: 1.5em; text-align: center; }

/* The screen's colours for projectors (Nasser 2026-10-22), chosen by the coordinator: the navy stage above is «night».
   «day»: a light screen for a lit room, where a projector washes dark backgrounds out; dark ink, gold only as a fill.
   «contrast»: black and yellow with white outlines, for a weak projector or a sunny place. */
body.screen-page.show-day { --muted: #2c3a6e; --line: #b9c4ea; --surface: #eef2ff; --mine: #fff1c2; --letter: #0b1d51;
  background: #ffffff; color: var(--navy); }
body.screen-page.show-day .show-muted, body.screen-page.show-day .show-link,
body.screen-page.show-day .show-standings .place, body.screen-page.show-day .show-standings .gain { color: var(--muted); }
body.screen-page.show-day .show-letter, body.screen-page.show-day .show-code, body.screen-page.show-day .show-join-corner b { color: var(--navy); }
body.screen-page.show-day .show-join, body.screen-page.show-day .show-chip, body.screen-page.show-day .show-answers li,
body.screen-page.show-day .show-standings li, body.screen-page.show-day .show-podium .block,
body.screen-page.show-day .show-join-corner { background: var(--surface); border-color: var(--line); color: var(--navy); }
body.screen-page.show-day .show-chip.lead, body.screen-page.show-day .show-badge { background: var(--gold); color: var(--navy); }
body.screen-page.show-day .show-standings li.first, body.screen-page.show-day .show-podium .p1 .block { background: var(--mine); border-color: var(--gold); color: var(--navy); }
body.screen-page.show-contrast { --surface: #000000; --mine: #1c1a00; --line: #ffffff; --ink: #ffffff; --muted: #e6e6e6;
  --letter: #ffe600; --accent: #ffe600; --on-accent: #000000; --ok: #00e676; --bad: #ff5c5c; background: #000000; color: #ffffff; }
body.screen-page.show-contrast .show-muted, body.screen-page.show-contrast .show-link,
body.screen-page.show-contrast .show-standings .place, body.screen-page.show-contrast .show-standings .gain { color: var(--muted); }
body.screen-page.show-contrast .show-letter, body.screen-page.show-contrast .show-code, body.screen-page.show-contrast .show-join-corner b { color: var(--letter); }
body.screen-page.show-contrast .show-join, body.screen-page.show-contrast .show-chip, body.screen-page.show-contrast .show-answers li,
body.screen-page.show-contrast .show-standings li, body.screen-page.show-contrast .show-podium .block,
body.screen-page.show-contrast .show-join-corner, body.screen-page.show-contrast .show-leader { background: #000000; border: 3px solid #ffffff; color: #ffffff; }
body.screen-page.show-contrast .show-chip.lead, body.screen-page.show-contrast .show-badge { background: var(--accent); color: #000000; border-color: var(--accent); }
body.screen-page.show-contrast .show-standings li.first, body.screen-page.show-contrast .show-podium .p1 .block,
body.screen-page.show-contrast .show-leader.first { border-color: var(--accent); color: var(--accent); box-shadow: none; }
.screen-layout > .muted.small:last-child { flex-basis: 100%; }

/* Messages as a toast (Nasser 2026-10-22): over the page at the top, in and out by themselves, never pushing it down. */
.toast { position: fixed; z-index: 60; inset-inline: 0; top: max(14px, env(safe-area-inset-top)); width: max-content; max-width: min(92vw, 520px); margin-inline: auto;
  display: flex; align-items: center; gap: 12px; padding: 12px 20px 12px 14px; border-radius: 999px; background: var(--navy); color: var(--on-navy);
  font-weight: 700; font-size: 16px; line-height: 1.4; box-shadow: 0 14px 34px rgba(11, 29, 81, 0.35); cursor: pointer;
  opacity: 0; transform: translateY(-140%); pointer-events: none; transition: transform 0.28s cubic-bezier(0.2, 0.9, 0.3, 1.2), opacity 0.2s; }
.toast.show { opacity: 1; transform: none; pointer-events: auto; }
.toast.error { background: var(--buzzer); color: var(--on-buzzer); box-shadow: 0 6px 0 var(--buzzer-shadow), 0 14px 34px rgba(179, 36, 28, 0.35); }
.toast-icon { width: 28px; height: 28px; flex: none; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: rgba(255, 255, 255, 0.22); font-weight: 800; }
.toast.ok, .toast.info { background: #ffffff; color: var(--navy); border: 2px solid var(--gold); }
.toast.ok .toast-icon, .toast.info .toast-icon { background: var(--gold); color: var(--navy); }
@media (prefers-reduced-motion: reduce) { .toast { transition: opacity 0.2s; transform: none; } }

/* An open appeal holds the correction (Nasser 2026-10-22): the button waits, the appeal glows for the coordinator. */
.primary.waiting { background: var(--muted); box-shadow: 0 6px 0 rgba(11, 29, 81, 0.35); }
.appeal.open { animation: appeal-glow 1.6s ease-in-out infinite; }
@keyframes appeal-glow { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 184, 0, 0.55); } 50% { box-shadow: 0 0 0 6px rgba(255, 184, 0, 0); } }
@media (prefers-reduced-motion: reduce) { .appeal.open { animation: none; } }
/* «بس!» stamped on every phone and the screen (Nasser 2026-10-22): a red card, tilted, that lands hard and lifts away. */
.stamp-overlay { position: fixed; inset: 0; z-index: 70; display: flex; align-items: center; justify-content: center; background: rgba(11, 29, 81, 0.28); animation: fade-in 0.12s ease-out; cursor: pointer; }
.stamp-overlay.lift { opacity: 0; transition: opacity 0.4s; }
.stamp { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: min(72vw, 300px); padding: 16px 30px 18px; border-radius: 22px;
  background: var(--buzzer); color: var(--on-buzzer); border: 4px solid rgba(255, 255, 255, 0.9); box-shadow: 0 8px 0 var(--buzzer-shadow), 0 24px 60px rgba(11, 29, 81, 0.45);
  transform: rotate(-7deg); animation: stamp-in 0.38s cubic-bezier(0.2, 0.9, 0.3, 1) both; }
.stamp b { font-family: var(--display); font-weight: 400; font-size: clamp(64px, 20vw, 96px); line-height: 1.1; }
.stamp span { font-weight: 800; font-size: clamp(17px, 4.8vw, 22px); line-height: 1.4; max-width: 70vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.screen-page .stamp { min-width: 30vw; padding: 2vh 4vw 3vh; border-width: 6px; }
body.screen-page .stamp b { font-size: clamp(96px, 16vh, 220px); }
body.screen-page .stamp span { font-size: clamp(24px, 4vh, 56px); max-width: 60vw; }
@keyframes stamp-in { 0% { transform: rotate(-16deg) scale(2.6); opacity: 0; } 60% { transform: rotate(-6deg) scale(0.94); opacity: 1; } 80% { transform: rotate(-7.5deg) scale(1.03); } 100% { transform: rotate(-7deg) scale(1); } }
@media (prefers-reduced-motion: reduce) { .stamp { animation: none; } }

/* Until the first tap a phone plays no sound (Nasser 2026-10-22): a small button says so; any tap removes it. */
.sound-hint { position: fixed; z-index: 55; inset-inline: 0; width: max-content; margin-inline: auto; bottom: max(16px, env(safe-area-inset-bottom)); padding: 10px 18px; border: 2px solid var(--gold); border-radius: 999px; background: var(--navy); color: var(--on-navy); font: inherit; font-weight: 700; font-size: 15px; box-shadow: 0 10px 26px rgba(11, 29, 81, 0.35); cursor: pointer; animation: rise 0.3s both; }
body.full .sound-hint { bottom: auto; top: max(76px, env(safe-area-inset-top)); }

/* The player's own answer in the correction list (Nasser 2026-10-22): first, on a gold tint, with a «★ إجابتك» badge. */
.mine-badge { display: inline-flex; align-items: center; margin-inline-end: 8px; padding: 2px 10px; border-radius: 999px; background: var(--gold); color: var(--navy); font-family: var(--font); font-size: 13px; font-weight: 800; vertical-align: middle; white-space: nowrap; }

/* The coordinator's lobby on a computer (Nasser 2026-10-22): the right column matches the invitation's height, the
   players in a card that fills it, the limits and the settings side by side, then one large start button. */
.players-card, .lobby-facts { display: flex; flex-direction: column; gap: 14px; }
@media (min-width: 900px) {
  body.wide .top { padding-inline: max(32px, calc((100% - 1320px) / 2 + 32px)); }
  .coord-lobby .lobby-share .share-card { height: 100%; justify-content: center; }
  .lobby-main { gap: 20px; }
  .players-card { flex: 1; min-height: 240px; padding: 24px 28px; border-radius: 28px; background: var(--surface); border: 1px solid var(--line); }
  .players-card h2 { font-size: 24px; }
  .players-card .chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); align-content: start; gap: 10px; }
  .players-card .chips .chip { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; border-radius: 25px; }
  .players-card .chips .chip:not(.lead) { background: var(--bg); }
  .lobby-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
  .lobby-facts .meter { border: 1px solid var(--line); min-height: 88px; justify-content: center; }
  .lobby-facts .settings-open { min-height: 88px; }
  .lobby-start { min-height: 72px; font-size: 26px; }
}

/* The header on a computer (Nasser 2026-10-22): as wide as the page's content, its links light on the navy bar, nothing
   wrapping, and «دخول المنسق» a gold key. */
@media (min-width: 900px) {
  .top { padding-inline: max(24px, calc((100% - 1160px) / 2 + 24px)); }
  .top-nav { justify-content: center; gap: 28px; }
  .top-nav a, .top-links > a:first-child { color: #c9d3f2; white-space: nowrap; }
  .top-nav a:hover, .top-links > a:first-child:hover { color: var(--on-navy); }
  .top .icon-button.outline { border-color: rgba(255, 255, 255, 0.3); }
  .top .pill { background: var(--gold); color: var(--navy); border-color: var(--gold); box-shadow: 0 3px 0 rgba(179, 127, 0, 0.6); }
}
/* The demo phone's floating cards keep dark ink on the navy hero (their text inherited the hero's white). */
body.landing-page .hero .float-card { color: var(--ink); }

/* The coordinator's lobby on a phone (Nasser 2026-10-22): the limits, then the players in a card with room to fill,
   and the start button with a round settings button fixed at the bottom. On a computer: players first, one start
   button, the settings card beside the limits. */
.lobby-actions { display: flex; align-items: center; gap: 12px; }
.lobby-actions .lobby-start { flex: 1; }
.lobby-gear { width: 60px; height: 60px; flex: none; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 50%;
  background: var(--navy); color: var(--gold); box-shadow: 0 5px 0 var(--navy-2); cursor: pointer; }
.lobby-gear svg { width: 28px; height: 28px; }
.lobby-gear:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--navy-2); }
@media (max-width: 899px) {
  .coord-lobby { padding-bottom: 96px; }
  .lobby-facts .settings-open { display: none; }
  .players-card { min-height: 34vh; padding: 16px; border-radius: 22px; background: var(--surface); border: 1px solid var(--line); }
  .players-card .chips .chip:not(.lead) { background: var(--bg); }
  .lobby-actions { position: fixed; z-index: 12; inset-inline: 0; bottom: 0; max-width: 560px; margin-inline: auto;
    padding: 18px max(16px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
    background: linear-gradient(to bottom, transparent, var(--bg) 35%); }
  .lobby-actions .lobby-start { min-height: 60px; }
}
@media (min-width: 900px) {
  .players-card { order: -1; }
  .lobby-gear { display: none; }
}
@media (max-width: 899px) { body.wide .sound-hint { bottom: calc(100px + env(safe-area-inset-bottom)); } }
/* An animated parent holds a fixed child: the column with the fixed action bar does not take the entrance motion. */
.coord-lobby.reveal > .lobby-main { animation: none; }
/* The version at the bottom of the menu and in the footer, as on every NHMSV platform (Nasser 2026-10-22). */
.menu-version { margin: 6px 8px 2px; padding-top: 8px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; text-align: center; }
.menu-version code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 11px; background: none; }
.foot-version { color: var(--muted); font-size: 13px; }
.foot .foot-version::before { content: '·'; margin-inline: 8px; }
body.landing-page .foot .foot-version::before { content: none; }

/* On a computer the menu button stands at the other end from the name and logo (Nasser 2026-10-22), and the menu
   opens under it. */
@media (min-width: 900px) {
  .top [data-menu-button] { margin-inline-start: auto; }
  .menu { inset-inline-end: max(24px, calc((100vw - 1160px) / 2 + 24px)); }
  body.wide .menu { inset-inline-end: max(32px, calc((100vw - 1320px) / 2 + 32px)); }
}

/* A coordinator who only runs the game (Nasser 2026-10-22): one line under the players, not a player chip. */
.host-off { display: flex; align-items: center; gap: 6px; grid-column: 1 / -1; flex-basis: 100%; list-style: none; }
.player-list li.host-off { background: none; min-height: 0; padding: 0 4px; border: 0; box-shadow: none; }

/* The event plan (Nasser 2026-10-23): the event title above the lobby, results and honour board, and on the screen. */
.event-banner { margin: 0 0 12px; padding: 8px 14px; border-radius: 999px; background: var(--accent); color: var(--on-accent);
  font-weight: 800; text-align: center; overflow-wrap: anywhere; }
.event-setting input { width: 100%; }
.event-upsell { margin: 0 0 8px; }
.show-brand .show-event { display: flex; flex-direction: column; line-height: 1.15; }
.show-brand .show-event small { font-size: .55em; font-weight: 600; opacity: .7; }
/* Leagues (Nasser 2026-10-22, suggestion 5). */
.league-new label { font-weight: 700; }
.league-new input { flex: 1; min-width: 0; }
.league-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.league-row a { color: var(--ink); text-decoration: none; }
.league-row.archived { opacity: 0.6; }
.table-wrap { overflow-x: auto; padding: 0; }
.league-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.league-table th, .league-table td { padding: 10px 12px; text-align: start; border-bottom: 1px solid var(--line); }
.league-table th { color: var(--muted); font-size: 13px; font-weight: 700; }
.league-table tr.first td { background: var(--soft); }
.league-select { min-height: 40px; max-width: 60%; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--ink); font: inherit; padding: 0 10px; }
.league-board h2 { margin-bottom: 8px; }
.show-league { display: flex; flex-direction: column; align-items: center; gap: 0.5vh; }
.show-league-row { display: flex; flex-wrap: wrap; justify-content: center; gap: clamp(6px, 0.8vw, 14px); font-size: clamp(15px, 1.5vw, 26px); }
.chip.merge-hint { border: 2px dashed var(--gold); background: var(--soft); color: var(--ink); font-weight: 700; cursor: pointer; }
.notify-ask { width: 100%; }

/* The screen from the phone (Nasser 2026-10-22): the coordinator's choices in the menu, and the screen's overlays. */
.menu-label { margin: 8px 12px 2px; padding-top: 8px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; font-weight: 700; }
.menu-on { margin-inline-start: auto; color: var(--gold); }
.show-mode { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; padding: 4vh 4vw;
  background: repeating-conic-gradient(from 0deg at 50% 120%, var(--rays) 0deg 6deg, transparent 6deg 15deg), var(--navy); color: var(--on-navy); animation: fade-in 0.25s ease-out; }
body.show-day .show-mode { background: #ffffff; color: var(--navy); }
body.show-contrast .show-mode { background: #000000; color: #ffffff; }
.show-mode-body { width: min(100%, 1300px); display: flex; flex-direction: column; align-items: center; gap: 3vh; text-align: center; }
.show-mode.letter .show-letter { font-size: clamp(200px, 60vh, 700px); line-height: 1.2; }
.show-mode .show-title { font-size: clamp(40px, 6vw, 110px); }
body.hide-code .show-join-corner, body.hide-code .show-join { visibility: hidden; }
/* Ready-made sessions at the top of the settings sheet (Nasser 2026-10-22). */
.templates { display: flex; flex-direction: column; gap: 8px; padding: 4px 4px 10px; }
.template-chips { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.template-chip { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px 14px; border: 2px solid var(--line); border-radius: 18px; background: var(--surface); color: var(--ink); font: inherit; text-align: start; cursor: pointer; }
.template-chip b { font-size: 16px; }
.template-chip small { color: var(--muted); font-size: 12px; }
.template-chip[aria-pressed="true"] { border-color: var(--gold); background: var(--soft); }

/* Kids mode (Nasser 2026-10-22): a few right words under the box while a child types; a tap writes it. */
.kids-words { display: flex; flex-wrap: wrap; gap: 6px; }
.kids-words:empty { display: none; }
.kids-word { padding: 6px 14px; border: 2px solid var(--gold); border-radius: 999px; background: var(--soft); color: var(--ink); font: inherit; font-size: 16px; font-weight: 800; cursor: pointer; }
.kids-word:active { transform: scale(0.96); }

/* A join link (Nasser 2026-10-23, JOIN_CODE_LOCK): the code as read-only text, the name the only thing to type. */
.locked-code { align-items: center; text-align: center; }
.code-locked { display: block; font-size: 40px; font-weight: 800; letter-spacing: 0.12em; font-variant-numeric: tabular-nums; color: var(--ink); direction: ltr; }
.other-code { margin-top: 12px; }
.other-code a, .join-refused .button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; }
.join.join-refused { justify-content: center; text-align: center; }

/* The game's awards and the kings of the fields (Nasser 2026-10-23): on the phones and on the screen. */
.awards h2, .kings h2 { margin: 0 0 8px; font-size: 18px; }
.award-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.award { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 12px 14px; border-radius: 18px; background: var(--surface); border: 2px solid var(--line); }
.award.mine { border-color: var(--accent); background: var(--mine); }
.award-icon { font-size: 22px; line-height: 1; }
.award-title { font-size: 12px; color: var(--muted); }
.award-who { font-size: 18px; font-weight: 800; color: var(--ink); overflow-wrap: anywhere; }
.award-what { font-size: 13px; color: var(--muted); }
.king-list { list-style: none; margin: 0; padding: 0; border-radius: 18px; background: var(--surface); border: 2px solid var(--line); overflow: hidden; }
.king-list li { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) auto; align-items: center; gap: 10px; padding: 10px 14px; }
.king-list li + li { border-top: 1px solid var(--line); }
.king-list li.mine { background: var(--mine); }
.king-field { color: var(--muted); font-size: 14px; }
.king-who { font-weight: 800; overflow-wrap: anywhere; }
.king-count { font-size: 13px; color: var(--muted); white-space: nowrap; }
.show-awards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: clamp(10px, 1.4vw, 22px); width: min(100%, 1400px); }
.show-award { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: clamp(10px, 1.4vw, 22px); border-radius: 24px; background: var(--surface); text-align: center; }
.show-award .icon { font-size: clamp(24px, 2.6vw, 44px); line-height: 1; }
.show-award small { color: var(--muted); font-size: clamp(14px, 1.3vw, 22px); }
.show-award bdi { font-size: clamp(20px, 2.2vw, 40px); font-weight: 800; }
.show-award span:last-child { color: var(--muted); font-size: clamp(13px, 1.2vw, 20px); }
.show-kings { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: clamp(8px, 1vw, 16px); font-size: clamp(15px, 1.5vw, 26px); }
.show-king { display: inline-flex; align-items: baseline; gap: 8px; padding: 6px 16px; border-radius: 999px; background: var(--surface); }
.show-king small { color: var(--muted); }
.show-king bdi { font-weight: 800; }
body.screen-page .show-award, body.screen-page .show-king { background: var(--navy-2); color: var(--on-navy); }
body.screen-page.show-day .show-award, body.screen-page.show-day .show-king { background: var(--surface); color: var(--navy); }
/* Back to one's game and the internet's speed (Nasser 2026-10-23). */
.resume-card { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.reclaim { gap: 10px; text-align: center; }
.chip.away { opacity: .55; border-style: dashed; }
.away-mark { font-size: 13px; }
.net-slow { position: fixed; top: calc(env(safe-area-inset-top, 0px) + 16px); inset-inline-end: 72px; z-index: 40; display: inline-flex;
  align-items: center; gap: 6px; min-height: 36px; padding: 6px 12px; border: 0; border-radius: 999px; background: var(--accent);
  color: var(--on-accent); font: inherit; font-size: 13px; font-weight: 700; box-shadow: 0 4px 14px rgb(0 0 0 / .18); cursor: pointer; }

/* A round's points on the session page (Nasser 2026-10-23): each name against its points, highest first. */
.round-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.round-table th { padding: 0 12px 6px; color: var(--muted); font-size: 12px; font-weight: 700; text-align: start; }
.round-table th:last-child, .round-table td:last-child { text-align: end; width: 1%; white-space: nowrap; }
.round-table td { padding: 9px 12px; border-top: 1px solid var(--line); }
.round-table td:last-child { font-weight: 800; font-variant-numeric: tabular-nums; }
.round-table td.neg { color: var(--bad); }
.round-table tr.round-lead td { background: var(--soft); }
.round-table tr.round-lead td:first-child { border-start-start-radius: 12px; border-end-start-radius: 12px; }
.round-table tr.round-lead td:last-child { border-start-end-radius: 12px; border-end-end-radius: 12px; }

/* The player's waiting room (Nasser 2026-10-23): the code in the bar, the rules as icons with their values (a tap
   explains one), then the players; both sections fold away with a tap on their title. */
.code-pill { display: inline-flex; align-items: center; gap: 6px; flex: none; min-height: 40px; padding: 4px 12px; border: 0; border-radius: 999px;
  background: rgba(255, 255, 255, 0.12); color: var(--on-navy); font: inherit; font-size: 17px; font-weight: 800; letter-spacing: 0.08em; cursor: pointer; }
.code-pill svg { width: 18px; height: 18px; color: var(--gold); }
@media (min-width: 900px) {
  .top .code-pill { margin-inline-start: auto; }
  .top .code-pill:not(.hidden) ~ [data-menu-button] { margin-inline-start: 0; }
}
.fold { display: flex; flex-direction: column; gap: 10px; }
.fold-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; min-height: 44px; padding: 0 4px; border: 0;
  background: none; color: var(--ink); font: inherit; font-size: 17px; font-weight: 800; text-align: start; cursor: pointer; }
.fold-head small { margin-inline-start: auto; color: var(--muted); font-size: 12px; font-weight: 500; }
.fold-head svg { width: 20px; height: 20px; flex: none; transition: transform 0.2s; }
.fold-head[aria-expanded="false"] svg { transform: rotate(-90deg); }
[dir="rtl"] .fold-head[aria-expanded="false"] svg { transform: rotate(90deg); }
.rules-card { padding: 10px 14px 14px; }
.rule-chips { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.rule-chip { display: flex; align-items: center; gap: 5px; min-width: 0; min-height: 46px; padding: 5px; border: 2px solid transparent; border-radius: 16px;
  background: var(--bg); color: var(--ink); font: inherit; text-align: start; cursor: pointer; }
.rule-chip[aria-expanded="true"] { border-color: var(--gold); background: var(--mine); }
.rule-chip .ic { display: grid; place-items: center; width: 28px; height: 28px; flex: none; border-radius: 10px; background: var(--navy); color: var(--gold); font-size: 13px; font-weight: 800; }
.rule-chip .ic svg { width: 16px; height: 16px; }
.rule-chip b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 800; font-variant-numeric: tabular-nums; }
.rule-chip b.num { direction: ltr; unicode-bidi: isolate; }
.rule-chip.plus b { color: var(--ok); }
.rule-chip.minus b { color: var(--bad); }
.rule-tip { grid-column: 1 / -1; position: relative; margin: 0; padding: 12px 14px; border-radius: 16px; background: var(--navy); color: var(--on-navy); font-size: 14px; line-height: 1.6; }
.rule-tip strong { display: block; color: var(--gold); font-size: 15px; }
@media (max-width: 379px) {
  .rule-chip { gap: 4px; padding: 4px; }
  .rule-chip .ic { width: 24px; height: 24px; }
  .rule-chip b { font-size: 13px; }
}

/* What each player wrote in a round (Nasser 2026-10-23), opened from their name on the session page. */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.answers-toggle { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; width: 100%; min-height: 32px; padding: 0; border: 0; background: none;
  color: inherit; font: inherit; text-align: start; cursor: pointer; }
.answers-toggle svg { width: 16px; height: 16px; flex: none; color: var(--muted); transform: rotate(90deg); transition: transform 0.2s; }
[dir="ltr"] .answers-toggle svg { transform: rotate(-90deg); }
.answers-toggle[aria-expanded="true"] svg { transform: none; }
.answers-sum { display: inline-flex; gap: 6px; margin-inline-start: 4px; font-size: 12px; font-weight: 700; color: var(--muted); }
.answers-sum .ok { color: var(--ok); }
.answers-sum .no { color: var(--bad); }
.round-table tr.answers-row > td { padding: 0 4px 12px; border-top: 0; background: none; }
.answers { width: 100%; border-collapse: separate; border-spacing: 0 4px; font-size: 14px; }
.answers th, .answers td { padding: 7px 8px; background: var(--bg); border: 0; text-align: start; vertical-align: middle; }
.answers th { width: 22%; border-start-start-radius: 10px; border-end-start-radius: 10px; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.answers td:last-child { width: 1%; border-start-end-radius: 10px; border-end-end-radius: 10px; text-align: end; font-weight: 800; white-space: nowrap; font-variant-numeric: tabular-nums; }
.answers td.neg { color: var(--bad); }
.answers .ans { font-weight: 700; }
.answers .empty { color: var(--muted); font-weight: 400; }
.answers .mark { width: 1%; text-align: center; font-weight: 800; }
.answers .mark.ok { color: var(--ok); }
.answers .mark.no { color: var(--bad); }
.answers .appeal { display: flex; width: max-content; max-width: 100%; align-items: center; gap: 4px; margin-top: 4px; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 700; animation: none; }
.answers .appeal.won { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }
.answers .appeal.lost { background: color-mix(in srgb, var(--bad) 16%, transparent); color: var(--bad); }
.answers .appeal.open { background: var(--soft); color: var(--ink); }
.answers-legend { margin: 6px 4px 0; }

/* The compact correction screen (Nasser 2026-10-23): field tabs, one line per answer, the points on demand. */
.rv-screen .screen-head { padding-block-end: 4px; }
.rv-title { font-size: 20px; }
.rv-tabs { flex: none; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 4px max(16px, env(safe-area-inset-right)) 8px max(16px, env(safe-area-inset-left)); }
.rv-tab { flex: none; display: inline-flex; align-items: center; gap: 5px; padding: 6px 12px; border: 2px solid transparent; border-radius: 999px;
  background: var(--surface); color: var(--ink); font: inherit; font-size: 14px; font-weight: 700; }
button.rv-tab { cursor: pointer; }
.rv-tab.on { border-color: var(--navy); background: var(--navy); color: var(--on-navy); }
.rv-tab .done { color: var(--ok); }
.rv-tab .left { display: grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--gold); color: var(--navy); font-size: 11px; }
.rv-body { padding-inline: max(14px, env(safe-area-inset-left)) max(14px, env(safe-area-inset-right)); display: flex; flex-direction: column; gap: 8px; }
.rv-sec { display: flex; justify-content: space-between; margin: 4px 2px -2px; font-size: 12.5px; font-weight: 800; color: var(--muted); }
.rv-sec.wait { color: var(--letter); }
.rv-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border-radius: 18px; overflow: hidden; }
.rv-row { display: flex; flex-direction: column; gap: 4px; padding: 4px 6px 4px 8px; }
.rv-row + .rv-row { border-top: 1px solid var(--line); }
.rv-row.pending { background: var(--soft); }
.rv-row.mine { background: var(--mine); }
.rv-line { display: flex; align-items: center; gap: 6px; min-height: 42px; }
.rv-main { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 6px; padding: 4px 2px; border: 0; background: none; color: inherit; font: inherit;
  text-align: start; white-space: nowrap; overflow: hidden; cursor: pointer; }
.rv-answer { font-size: 17px; font-weight: 800; }
.rv-count { flex: none; display: inline-grid; place-items: center; min-width: 22px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--bg);
  color: var(--muted); font-size: 11.5px; font-weight: 800; }
.rv-tag { flex: none; font-size: 11px; font-weight: 700; color: var(--bad); }
.rv-spark { flex: none; font-size: 12px; color: var(--ok); }
.rv-spark.bad { color: var(--bad); }
.rv-names { flex: 1; min-width: 0; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; }
.rv-main .pts { flex: none; font-size: 12px; }
.rv-main .mine-badge { flex: none; font-size: 11px; padding: 1px 8px; margin: 0; }
.rv-acts { flex: none; display: flex; align-items: center; gap: 6px; }
.rv-src { display: grid; place-items: center; width: 30px; height: 34px; font-size: 15px; text-decoration: none; }
.rv-row .verdict-btn { width: 40px; height: 34px; border-radius: 12px; font-size: 18px; font-weight: 800; }
.rv-row .ai-hint, .rv-row .merged-line { margin: 0 4px 4px; }
.rv-row .merge-hint { align-self: flex-start; margin-inline-start: 4px; }
.rv-row .merge { max-width: 100%; align-self: flex-start; margin: 0 4px 6px; }
.rv-row .appeal { margin: 0 4px 6px; }
.rv-row:not(.open) .on-tap { display: none; }
.rv-empty { margin: 0; padding: 10px 12px; border-radius: 18px; background: var(--surface); color: var(--muted); font-size: 13px; }
.rv-foot { gap: 8px; padding-block-start: 8px; border-top: 1px solid var(--line); }
.rv-bar { display: flex; gap: 8px; align-items: center; }
.rv-bar .primary { flex: 1; }
.rv-pts { flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; width: 58px; height: 50px; border: 0; border-radius: 16px;
  background: var(--surface); color: var(--muted); font: inherit; font-size: 11px; font-weight: 700; cursor: pointer; }
.rv-pts b { font-size: 14px; color: var(--ink); transition: transform 0.2s; }
.rv-pts[aria-expanded="true"] b { transform: rotate(180deg); }
body.kids .rv-answer { font-size: 21px; }

/* The bell (nhmsv NOTIFICATIONS.md §4): beside the menu, the unread count in red, the last five under it. */
.bell { position: relative; margin-inline-start: auto; }
.top-links + .bell, .bell + [data-menu-button] { margin-inline-start: 0 !important; }
.bell > summary { list-style: none; position: relative; cursor: pointer; }
.bell > summary::-webkit-details-marker { display: none; }
.bell > summary svg { width: 20px; height: 20px; }
.bell-count { position: absolute; top: -4px; inset-inline-end: -4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--bad);
  color: #fff; font-size: 12px; font-weight: 800; line-height: 20px; text-align: center; }
.bell-panel { position: absolute; top: calc(100% + 8px); inset-inline-end: -48px; z-index: 40; width: min(340px, calc(100vw - 24px)); padding: 12px;
  border-radius: 18px; background: var(--surface); color: var(--ink); box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25); display: flex; flex-direction: column; gap: 8px; }
.bell-title { font-size: 15px; }
.bell-empty { margin: 0; color: var(--muted); font-size: 14px; }
.bell-list, .notify-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.bell-list li + li, .notify-list li + li { border-top: 1px solid var(--line); }
.bell-list a, .notify-list a { display: flex; flex-direction: column; gap: 2px; padding: 9px 4px; color: var(--ink); text-decoration: none; font-size: 14px; line-height: 1.5; }
.bell-list li.unread a, .notify-list li.unread a { font-weight: 700; }
.bell-list li.unread span::before, .notify-list li.unread span::before { content: '● '; color: var(--bad); font-size: 10px; vertical-align: 2px; }
.bell-list li.read a, .notify-list li.read a { color: var(--muted); }
.bell-all { align-self: center; color: var(--letter); font-weight: 700; font-size: 14px; text-decoration: none; }
.notify-list { padding: 4px 14px; }
label.check { display: flex; align-items: center; gap: 10px; min-height: 40px; font-size: 15px; }
label.check input { width: 20px; height: 20px; accent-color: var(--accent); }

/* The code screen (nhmsv USER_AUTH_FLOW.md §5–§6). */
.notice { background: var(--mine); border-radius: 18px; padding: 12px 16px; }
.verify-phone { font-size: 17px; }
.link-button:disabled { text-decoration: none; opacity: 0.7; }
.prefill { display: flex; align-items: center; gap: 10px; justify-content: space-between; background: var(--mine); border-radius: 18px; padding: 10px 14px; }
.prefill code { font-size: 18px; font-weight: 800; overflow-wrap: anywhere; }
.prefill .ghost { min-height: 40px; flex: none; }
.verify-qr { display: none; justify-content: center; }
.verify-qr svg { width: 200px; height: 200px; background: #fff; padding: 8px; border-radius: 12px; }
@media (min-width: 900px) { .verify-qr { display: flex; } }
.waiting::before { content: ""; display: inline-block; width: 10px; height: 10px; margin-inline-end: 8px; border-radius: 50%; background: var(--accent); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.25; } }

/* «نسخة تجريبية» while the platform is not live (nhmsv PLATFORM_MODES.md §2): thin, amber, no close button. */
.test-strip { margin: 0; padding: 4px 12px; background: #fef3c7; color: #78350f; font-size: 13px; font-weight: 700; text-align: center; }

/* The coordinator's entry (signed out): the card in the middle of the screen, on phones, tablets and computers. */
.auth-center { min-height: calc(100dvh - 190px); justify-content: center; }

/* ---- The coordinator's home as a dashboard (Nasser 2026-10-25): a layout for each screen ------------------------
   Phone: one column, the start first (new session), the plan in one line, the sessions, then the screen and settings.
   Tablet (700px+): two columns: the start beside the plan, then the sessions beside the screen and settings.
   Computer (1100px+): wide: the start across two thirds with the plan beside it, then the sessions two by two
   beside a column of settings. */
.dash { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); grid-template-areas: "welcome" "plan" "main" "side"; }
.dash-welcome { grid-area: welcome; display: flex; flex-direction: column; gap: 12px; }
.dash-greet { display: flex; flex-direction: column; gap: 4px; }
.dash-greet h1 { font-size: 26px; margin: 0; }
.dash-greet p { margin: 0; }
.dash-welcome .stack { margin: 0; }
.dash-plan { grid-area: plan; display: flex; flex-direction: column; gap: 10px; }
.dash-plan .note, .dash-plan p { margin: 0; }
.dash-main { grid-area: main; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.dash-main .panel-head h2 { margin: 0; }
.dash-side { grid-area: side; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.dash-side > * { margin: 0; }
.dash-empty { text-align: center; padding: 28px 18px; }
@media (max-width: 699px) {
  .dash .plan-card { flex-direction: row; align-items: center; justify-content: space-between; }
  .dash .plan-card .button { min-height: 44px; padding: 0 16px; font-size: 15px; flex: none; }
}
@media (min-width: 700px) {
  body.panel-wide .wrap, body.panel-wide .top { max-width: 980px; }
  .dash { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "welcome plan" "main side"; align-items: start; }
  .dash-welcome, .dash-plan .plan-card { min-height: 100%; }
  .dash-welcome { justify-content: space-between; }
  .dash-side .row-buttons { flex-direction: column; }
}
@media (min-width: 1100px) {
  body.panel-wide .wrap, body.panel-wide .top { max-width: 1240px; }
  .dash { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 380px); grid-template-areas: "welcome welcome plan" "main main side"; gap: 20px; }
  .dash-welcome { flex-direction: row; flex-wrap: wrap; align-items: center; padding: 28px; }
  .dash-greet { flex: 1 1 50%; }
  .dash-greet h1 { font-size: 32px; }
  .dash-welcome .stack { flex: 0 0 280px; }
  .dash-welcome .resume { flex: 1 1 100%; }
  .dash-main .session-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* «حرف اليوم» (Nasser 2026-10-25): the letter large, today's rare answers, and the day's letter in the picker. */
.today-hero { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 26px 18px; }
.today-letter { font-family: Lalezar, Cairo, sans-serif; font-size: 120px; line-height: 1.1; color: var(--letter); }
.today-rare { margin: 0; padding-inline-start: 22px; display: flex; flex-direction: column; gap: 8px; }
.today-rare li { display: flex; justify-content: space-between; gap: 12px; }
.letter-grid button.today { box-shadow: 0 0 0 3px var(--gold, #ffb800) inset; }
.today-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; text-decoration: none; color: var(--ink); border: 1px solid var(--line); }
.today-card b { font-family: Lalezar, Cairo, sans-serif; font-size: 34px; color: var(--letter); }
/* «إحصاءاتي» (Nasser 2026-10-25): sessions per month as bars in tenths, no inline style (CSP). */
.month-bars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.month-bars li { display: grid; grid-template-columns: 64px 1fr 28px; align-items: center; gap: 10px; }
.month-bars .bar { height: 12px; border-radius: 6px; background: var(--bg); overflow: hidden; }
.month-bars .bar i { display: block; height: 100%; border-radius: 6px; background: var(--accent); width: 0; }
.month-bars .bar i.w1 { width: 10%; } .month-bars .bar i.w2 { width: 20%; } .month-bars .bar i.w3 { width: 30%; } .month-bars .bar i.w4 { width: 40%; }
.month-bars .bar i.w5 { width: 50%; } .month-bars .bar i.w6 { width: 60%; } .month-bars .bar i.w7 { width: 70%; } .month-bars .bar i.w8 { width: 80%; }
.month-bars .bar i.w9 { width: 90%; } .month-bars .bar i.w10 { width: 100%; }
/* «صوت المذيع»: until the screen gets its first click, a small note at the bottom asks for one (browsers need it). */
.show-voice-hint { position: fixed; inset-inline: 0; bottom: 18px; margin: 0 auto; width: max-content; max-width: 90vw; padding: 8px 18px;
  border-radius: 20px; background: rgba(0, 0, 0, 0.55); color: #fff; font-size: clamp(14px, 1.4vw, 22px); z-index: 30; }
/* «ملخص الجلسة» on a past session (Nasser 2026-10-25): the share button beside its line. */
.summary-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid var(--line); }
.summary-card .primary { flex: none; min-height: 44px; }
/* History pages, one look for «فواتيري», «الباقات» and «الجلسات» (Nasser 2026-10-25): a navy card with the plan now, filter
   chips, rows grouped by month in one white card, and a receipt-like detail page. On wide screens the navy card sits
   beside the list. */
.hx-page { display: grid; gap: 14px; grid-template-areas: "title" "side" "main"; }
.hx-title { grid-area: title; font-family: var(--display); font-weight: 400; font-size: 34px; line-height: 1.2; }
.hx-side { grid-area: side; display: flex; flex-direction: column; gap: 12px; }
.hx-main { grid-area: main; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.hx-hero { border-radius: 22px; color: #fff; padding: 16px 18px; background-color: var(--navy);
  background-image: repeating-conic-gradient(from 0deg at 0% 100%, var(--rays) 0 6deg, transparent 6deg 14deg); display: flex; flex-direction: column; gap: 6px; }
.hx-k { font-size: 13px; color: var(--silver); font-weight: 600; }
.hx-plan { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.hx-name { font-family: var(--display); font-size: 26px; line-height: 1.2; color: var(--gold-2); }
.hx-left { background: var(--gold); color: var(--navy); font-weight: 800; border-radius: 999px; padding: 4px 12px; font-size: 13px; white-space: nowrap; }
.hx-left.hx-over { background: var(--buzzer); color: var(--on-buzzer); }
.hx-bar { height: 8px; border-radius: 8px; background: rgba(255, 255, 255, 0.18); overflow: hidden; margin-top: 4px; }
.hx-bar i { display: block; height: 100%; border-radius: 8px; background: var(--gold); width: 0; }
.hx-bar i.w1 { width: 10%; } .hx-bar i.w2 { width: 20%; } .hx-bar i.w3 { width: 30%; } .hx-bar i.w4 { width: 40%; } .hx-bar i.w5 { width: 50%; }
.hx-bar i.w6 { width: 60%; } .hx-bar i.w7 { width: 70%; } .hx-bar i.w8 { width: 80%; } .hx-bar i.w9 { width: 90%; } .hx-bar i.w10 { width: 100%; }
.hx-row { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 13px; color: var(--silver); }
.hx-stats { display: flex; gap: 8px; margin-top: 8px; }
.hx-stats div { flex: 1; min-width: 0; background: rgba(255, 255, 255, 0.08); border-radius: 14px; padding: 8px 10px; display: flex; flex-direction: column; }
.hx-stats b { font-family: var(--display); font-weight: 400; font-size: 21px; line-height: 1.3; color: #fff; white-space: nowrap; }
.hx-stats span { font-size: 12px; color: var(--silver); }
.hx-chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.hx-chips a { white-space: nowrap; padding: 6px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-weight: 700; font-size: 14px; color: var(--muted); text-decoration: none; }
.hx-chips a.on { background: var(--navy); color: var(--gold-2); border-color: var(--navy); }
.hx-month { font-weight: 800; color: var(--muted); font-size: 13px; margin: 6px 4px 0; display: flex; justify-content: space-between; }
.hx-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border-radius: 20px; overflow: hidden; border: 1px solid var(--line); }
.hx-list > li + li { border-top: 1px solid var(--band); }
.hx-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; color: var(--ink); text-decoration: none; }
.hx-item:hover { background: var(--bg); }
.hx-item::after { content: '‹'; color: var(--silver); font-size: 20px; line-height: 1; }
[dir="ltr"] .hx-item::after { content: '›'; }
.hx-tile { width: 46px; height: 46px; border-radius: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; flex: none;
  background: var(--band); color: var(--ink); line-height: 1.05; }
.hx-tile b { font-family: var(--display); font-weight: 400; font-size: 20px; }
.hx-tile small { font-size: 10px; font-weight: 700; }
.hx-tile.mid { background: var(--soft); color: var(--navy); }
.hx-tile.long, .hx-tile.live { background: var(--navy); color: var(--gold-2); }
.hx-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.hx-body strong { font-weight: 800; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hx-sub { font-size: 12.5px; color: var(--muted); }
.hx-end { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.hx-amt { font-weight: 800; font-size: 16px; white-space: nowrap; }
.hx-amt s { color: var(--muted); font-weight: 600; }
.hx-st { font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.hx-st::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.hx-st.ok { color: var(--ok); } .hx-st.bad { color: var(--bad); } .hx-st.wait { color: #b47d00; } .hx-st.off { color: var(--muted); }
.hx-st.live { color: var(--ok); }
.hx-item.dim strong, .hx-item.dim .hx-amt { color: var(--muted); }
/* The detail page: a receipt with a navy head and dashed sections. */
.hx-detail { display: flex; flex-direction: column; gap: 12px; max-width: 620px; width: 100%; margin-inline: auto; }
.hx-receipt { background: var(--surface); border-radius: 24px; overflow: hidden; border: 1px solid var(--line); }
.hx-rhead { color: #fff; text-align: center; padding: 18px 16px 20px; display: flex; flex-direction: column; align-items: center; gap: 4px; background-color: var(--navy);
  background-image: repeating-conic-gradient(from 0deg at 50% 130%, var(--rays) 0 6deg, transparent 6deg 14deg); }
.hx-badge { display: inline-block; padding: 4px 14px; border-radius: 999px; font-weight: 800; font-size: 13px; background: var(--silver); color: var(--navy); }
.hx-badge.ok { background: var(--ok); color: var(--on-ok); } .hx-badge.bad { background: var(--bad); color: var(--on-bad); } .hx-badge.wait, .hx-badge.live { background: var(--gold); color: var(--navy); }
.hx-big { font-family: var(--display); font-size: 44px; line-height: 1.15; color: var(--gold-2); }
.hx-for { font-weight: 700; color: var(--silver); }
.hx-sim { font-size: 12px; font-weight: 700; color: var(--navy); background: var(--soft); border-radius: 999px; padding: 2px 10px; }
.hx-sec { padding: 14px 18px; border-top: 1px dashed var(--line); }
.hx-rhead + .hx-sec { border-top: 0; }
.hx-sec h2 { font-size: 13px; color: var(--muted); font-weight: 800; margin: 0 0 8px; }
.hx-state h1 { font-size: 20px; margin: 0 0 4px; }
.hx-kv { margin: 0; display: flex; flex-direction: column; gap: 2px; }
.hx-kv > div { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; font-size: 14.5px; }
.hx-kv dt { color: var(--muted); }
.hx-kv dd { margin: 0; font-weight: 700; text-align: end; }
.hx-kv .total { border-top: 1px solid var(--band); margin-top: 4px; padding-top: 8px; font-size: 16px; }
.hx-kv .total dd { font-weight: 900; }
.hx-kv .ok { color: var(--ok); } .hx-kv .bad { color: var(--bad); }
.hx-mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; overflow-wrap: anywhere; }
.hx-tl { list-style: none; margin: 0; padding: 0 0 0 0; padding-inline-start: 22px; position: relative; display: flex; flex-direction: column; gap: 10px; }
.hx-tl::before { content: ''; position: absolute; inset-inline-start: 6px; top: 8px; bottom: 8px; width: 2px; background: var(--band); }
.hx-tl li { position: relative; display: flex; flex-direction: column; }
.hx-tl li::before { content: ''; position: absolute; inset-inline-start: -21px; top: 6px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--silver); border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--silver); }
.hx-tl li.ok::before { background: var(--ok); box-shadow: 0 0 0 1px var(--ok); }
.hx-tl li.bad::before { background: var(--bad); box-shadow: 0 0 0 1px var(--bad); }
.hx-tl li.wait::before { background: var(--gold); box-shadow: 0 0 0 1px var(--gold); }
.hx-tl b { font-size: 14.5px; }
.hx-tl small { font-size: 12px; color: var(--muted); }
.hx-limits { display: flex; gap: 8px; }
.hx-limits div { flex: 1; background: var(--bg); border-radius: 12px; padding: 8px; text-align: center; display: flex; flex-direction: column; }
.hx-limits b { font-family: var(--display); font-weight: 400; font-size: 22px; line-height: 1.3; }
.hx-limits span { font-size: 12px; color: var(--muted); }
.hx-actions { display: flex; flex-direction: column; gap: 10px; }
@media (min-width: 900px) {
  .hx-page { grid-template-columns: minmax(0, 1fr) 360px; grid-template-areas: "title title" "main side"; align-items: start; column-gap: 24px; }
  .hx-side { position: sticky; top: 90px; }
  .hx-actions { flex-direction: row; flex-wrap: wrap; }
  .hx-actions > * { flex: 1 1 200px; }
}
.hx-plans { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.hx-plan-card { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 14px; display: flex; flex-direction: column; gap: 12px; position: relative; }
.hx-plan-card.current { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold) inset; }
.hx-plan-card.discounted { border-color: var(--gold); }
.hx-plan-top { display: flex; align-items: center; gap: 12px; }
.hx-price { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.1; }
.hx-price b { font-family: var(--display); font-weight: 400; font-size: 28px; color: var(--letter); white-space: nowrap; }
.hx-price .was { color: var(--muted); font-size: 13px; }
.hx-plan-card .badge.offer { align-self: flex-start; }
.hx-plan-card form .primary { width: 100%; }
.hx-side .coupon-form { border: 1px solid var(--line); }
@media (min-width: 700px) { .hx-plans { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.hx-title-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.hx-title-row h1 { font-family: var(--display); font-weight: 400; font-size: 34px; line-height: 1.2; }
.hx-lead { font-size: 12.5px; font-weight: 700; color: var(--letter); }
.hx-list > li { display: flex; flex-direction: column; }
.hx-close { padding: 0 14px 10px; padding-inline-start: 72px; margin-top: -6px; }
.hx-close .link-button { font-size: 13px; }
.hx-session .hx-big { font-size: 34px; margin: 0; }
.hx-session .hx-limits b { font-size: 18px; }
.hx-session .hx-lead { margin: 10px 0 0; font-size: 14px; }
/* The panel bar's «+» (Nasser 2026-10-25): a round red buzzer raised over the bar on phones, a pill among the tabs on a
   computer. */
.panel-new { display: flex; justify-content: center; margin: 0; }
.panel-new button { display: flex; flex-direction: column; align-items: center; gap: 3px; background: none; border: 0; padding: 0; color: var(--buzzer); font: inherit; font-size: 12px; font-weight: 800; cursor: pointer; }
.panel-new-dot { width: 60px; height: 60px; margin-top: -30px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: var(--buzzer); color: var(--on-buzzer); box-shadow: 0 4px 0 var(--buzzer-shadow), 0 0 0 6px var(--menu); }
.panel-new-dot svg { width: 30px; height: 30px; }
.panel-new button:active .panel-new-dot { transform: translateY(3px); box-shadow: 0 1px 0 var(--buzzer-shadow), 0 0 0 6px var(--menu); }
@media (min-width: 900px) {
  .panel-new button { flex-direction: row; gap: 8px; padding: 6px 16px 6px 8px; border-radius: 16px; background: var(--buzzer); color: var(--on-buzzer); font-size: 15px; }
  .panel-new-dot { width: 26px; height: 26px; margin: 0; box-shadow: none; background: transparent; }
  .panel-new-dot svg { width: 20px; height: 20px; }
}
/* «المزيد» in groups (Nasser 2026-10-25): an icon on each row, rows that open in place, signing out on its own card. */
.mx-page { gap: 10px; }
.mx-account { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: 22px; color: #fff; background-color: var(--navy);
  background-image: repeating-conic-gradient(from 0deg at 0% 100%, var(--rays) 0 6deg, transparent 6deg 14deg); }
.mx-account strong { font-size: 18px; }
.mx-account .small { color: var(--silver); }
.mx-head { font-size: 13px; font-weight: 800; color: var(--muted); margin: 8px 6px 0; }
.mx-list { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; display: flex; flex-direction: column; margin: 0; }
.mx-list.mx-list > * + * { border-top: 1px solid var(--band); }
.mx-row { display: flex; align-items: center; gap: 14px; min-height: 60px; padding: 0 16px; width: 100%; background: transparent; border: 0; color: var(--ink);
  font: inherit; font-size: 16px; font-weight: 600; text-decoration: none; text-align: start; cursor: pointer; list-style: none; }
.mx-row::-webkit-details-marker { display: none; }
.mx-row:hover { background: var(--bg); }
.mx-row::after { content: '‹'; color: var(--silver); font-size: 22px; line-height: 1; margin-inline-start: auto; }
[dir="ltr"] .mx-row::after { content: '›'; }
.mx-fold > .mx-row::after { content: '⌄'; font-size: 18px; transition: transform 0.15s; }
.mx-fold[open] > .mx-row::after { transform: rotate(180deg); }
.mx-label { flex: 1; min-width: 0; }
.mx-val { color: var(--muted); font-size: 13px; font-weight: 500; max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mx-ic { width: 36px; height: 36px; flex: none; border-radius: 11px; display: flex; align-items: center; justify-content: center; background: var(--band); color: var(--letter); }
.mx-ic svg { width: 20px; height: 20px; }
.mx-ic-orders, .mx-ic-stats, .mx-ic-leagues, .mx-ic-today { background: var(--soft); color: #b47d00; }
.mx-body { padding: 4px 16px 16px; gap: 8px; }
.mx-body .screen-card { padding: 0; border: 0; background: transparent; box-shadow: none; }
.mx-out, .mx-out .mx-ic { color: var(--bad); }
.mx-out .mx-ic { background: rgba(229, 40, 29, 0.1); }
.mx-out::after { content: none; }
.list-note { margin: 0; padding: 10px 16px; font-size: 14px; color: var(--muted); }
/* The home in the history look (Nasser 2026-10-25): on phones the plan, then a new session and the latest sessions,
   then the screen and the settings; on a computer the list on one side and the cards on the other. */
.hx-home { grid-template-areas: "title" "side" "main" "extra"; }
.hx-extra { grid-area: extra; display: flex; flex-direction: column; gap: 12px; }
.hx-greet h1 { font-family: var(--display); font-weight: 400; font-size: 32px; line-height: 1.25; margin: 0; }
.hx-greet p { margin: 2px 0 0; font-family: var(--font); font-size: 15px; line-height: 1.5; }
.hx-side > .button { width: 100%; }
.hx-today { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-radius: 20px; text-decoration: none;
  background: var(--soft); color: var(--navy); border: 1px solid var(--gold); }
.hx-today .small { color: var(--muted); }
.hx-today b { font-family: var(--display); font-weight: 400; font-size: 40px; line-height: 1; color: var(--navy); }
.hx-extra .screen-card, .hx-extra .howto, .hx-extra #ai { border: 1px solid var(--line); }
.hx-resume { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 20px; background: var(--surface); border: 2px solid var(--ok);
  color: var(--ink); text-decoration: none; }
.hx-resume b { color: var(--ok); white-space: nowrap; }
.hx-resume-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 5px rgba(22, 163, 74, 0.18); flex: none; }
.hx-start { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 0; padding: 16px 18px; border-radius: 22px;
  background: var(--surface); border: 1px solid var(--line); }
.hx-start strong { font-family: var(--display); font-weight: 400; font-size: 24px; line-height: 1.2; }
.hx-buzz { width: 64px; height: 64px; flex: none; border-radius: 50%; border: 0; padding: 0; cursor: pointer; display: flex; align-items: center; justify-content: center;
  background: var(--buzzer); color: var(--on-buzzer); box-shadow: 0 5px 0 var(--buzzer-shadow); }
.hx-buzz svg { width: 32px; height: 32px; }
.hx-buzz:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--buzzer-shadow); }
.hx-month a { font-weight: 700; color: var(--letter); text-decoration: none; }
@media (min-width: 900px) {
  .hx-home { grid-template-areas: "title title" "main side" "main extra"; grid-template-rows: auto auto 1fr; }
  .hx-home .hx-side { position: static; }
}
/* «البريد» (USER_AUTH_FLOW.md §4ب): proven or not, next to the address. */
.mx-flag { font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.mx-flag.ok { background: rgba(22, 163, 74, 0.12); color: var(--ok); }
.mx-flag.wait { background: var(--soft); color: #b47d00; }

/* ---- Full width (nhmsv LAYOUT_WIDTH.md, Nasser 2026-10-26) ----------------------------------------------------
   Pages use the screen up to --content-max (1920px), then centre. The bar spans the same width. Forms and long text
   stay narrow and centred; card lists add columns as the screen grows; the type never grows. The game screens for
   players and the TV stay as designed: a round is played on a phone. */
:root { --content-max: 1920px; }
@media (min-width: 900px) {
  .top { padding-inline: max(24px, calc((100% - var(--content-max)) / 2 + 24px)); }
  body.landing-page .top { max-width: var(--content-max); padding-inline: 24px; }
  .section, .hero, body.landing-page .foot { max-width: var(--content-max); }
  body.wide .wrap, body.panel-wide .wrap { max-width: var(--content-max); padding-inline: 32px; }
}
@media (min-width: 900px) {
  body.panel-wide .top { max-width: none; }
  body.wide .top, body.panel-wide .top { padding-inline: max(32px, calc((100% - var(--content-max)) / 2 + 32px)); }
  /* Card lists and reports: columns grow with the screen; forms beside them stay narrow. */
  body.panel-wide .session-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(380px, 100%), 1fr)); }
  body.panel-wide .league-new { width: 100%; max-width: 720px; margin-inline: auto; }
  .hx-plans { grid-template-columns: repeat(auto-fill, minmax(min(380px, 100%), 1fr)); }
  .stats-page { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(380px, 100%), 1fr)); align-items: start; }
  .stats-page > :is(.back-link, h1, .meters, p) { grid-column: 1 / -1; }
}

/* «جلسة جديدة» with a session still open (Nasser 2026-10-27): go back to it, or end it and start a new one. */
.open-choice { display: flex; flex-direction: column; gap: 12px; border: 2px solid var(--accent); }
.open-choice-row { display: flex; flex-direction: column; gap: 10px; }
.open-choice-row form { margin: 0; display: flex; }
.open-choice-row form > button, .open-choice-row .button { width: 100%; min-height: 52px; }
@media (max-width: 560px) { .open-choice-row .row-buttons { flex-direction: column; } }
