@import url('/fonts/fonts.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 {
  --bg: #fbf7ef;
  --surface: #ffffff;
  --mine: #fff4d6;
  --line: #e6dcc6;
  --ink: #1f1b14;
  --muted: #6b6457;
  --accent: #f5b82e;
  --on-accent: #1f1b14;
  --letter: #a8650a;
  --ok: #15803d;
  --on-ok: #ffffff;
  --bad: #b91c1c;
  --on-bad: #ffffff;
  --scrim: rgba(31, 27, 20, 0.25);
  --menu: #ffffff;
  --shadow: 0 12px 32px rgba(31, 27, 20, 0.18);
  --silver: #c9ced9;
  --bronze: #d08a5c;
  --band: #f6efe0;
  --soft: #fdf0cf;
  --font: 'Tajawal', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: light;
}
:root[data-theme="night"] {
  --bg: #12141c;
  --surface: #1e2130;
  --mine: #2a2414;
  --line: #33384d;
  --ink: #f4efe4;
  --muted: #9aa0b4;
  --letter: #f5b82e;
  --on-accent: #12141c;
  --ok: #4ade80;
  --on-ok: #0b1f12;
  --bad: #ff8a80;
  --on-bad: #2a0d0a;
  --scrim: rgba(5, 6, 10, 0.55);
  --menu: #232737;
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
  --band: #171a24;
  --soft: #2d2716;
  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 ----------------------------------------------------------------------- */
.top { position: relative; 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 .wrap::before { content: "…"; text-align: center; color: var(--muted); }
.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; }
.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.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 0 0 0 rgba(245, 184, 46, 0.55); } 50% { box-shadow: 0 0 0 10px rgba(245, 184, 46, 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; }
.progress { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; padding-block: 8px 12px; }
.progress span { height: 6px; border-radius: 3px; background: var(--line); }
.progress span.done, .progress span.now { background: var(--accent); }
.progress span.done { opacity: 0.5; }
.review { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.review-row { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; background: var(--surface); border: 2px solid var(--line); border-radius: 22px; }
.review-row.ok { border-color: var(--ok); }
.review-row.bad { border-color: var(--bad); }
.review-row.pending { border-style: dashed; border-color: var(--accent); }
.review-row .line { display: flex; align-items: center; gap: 8px; }
.review-row .answer { flex: 1; font-size: 22px; font-weight: 800; }
.review-row .names { flex: 1; font-size: 14px; color: var(--muted); }
.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; }
.mine-card { display: flex; align-items: center; gap: 12px; padding: 16px 20px; margin-block-end: 12px; background: var(--mine); border: 2px solid var(--accent); border-radius: 22px; }
.mine-card > div { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.mine-card .label { font-size: 13px; color: var(--muted); }
.mine-card .value { font-size: 22px; font-weight: 800; }
.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); }
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.stats > div { padding: 12px 14px; border-radius: 18px; border: 2px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
.stats .k { font-size: 12px; color: var(--muted); }
.stats .v { font-size: 16px; font-weight: 700; }

/* ---- 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; }
.share-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; }
.share-actions > * { min-height: 48px; font-size: 15px; padding: 0 12px; white-space: nowrap; }
.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, body.wide .top { max-width: 1320px; padding-inline: 32px; }
  .coord-lobby { display: grid; grid-template-columns: minmax(360px, 440px) minmax(0, 1fr); gap: 28px; align-items: start; }
  .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 .share-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .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; }
.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; }
.reveal svg { width: 22px; height: 22px; }
.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); }
.round-bar .letter-badge { width: 60px; height: 60px; border-radius: 30px; background: var(--accent); color: var(--on-accent); font-size: 34px; line-height: 1; box-shadow: 0 6px 18px rgba(245, 184, 46, 0.35); }
.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; }
