:root {
  --navy: #0b2152;
  --navy-deep: #071634;
  --lime: #c8f23e;
  --blue: #1857d6;
  --blue-soft: #5b9cff;
  --paper: #f3f6fa;
  --surface: #ffffff;
  --ink: #13213d;
  --muted: #5b6884;
  --line: #dce3ec;
  --down: #bf3a30;
  --focus: #2f5fd0;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --display: "Saira Condensed", "Arial Narrow", sans-serif;
  font-family: "Be Vietnam Pro", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  -webkit-text-size-adjust: 100%;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--paper); }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
[hidden] { display: none !important; }

.brand { display: flex; align-items: center; gap: 10px; padding: calc(12px + var(--safe-top)) 16px 12px; background: var(--navy-deep); font-size: 20px; }
.brand img { width: 30px; height: 30px; }
.page { width: min(100%, 560px); margin: 0 auto; padding: 22px 16px calc(32px + var(--safe-bottom)); }
h1 { margin: 0 0 24px; font-size: 24px; font-weight: 500; line-height: 1.2; color: var(--navy); }
.lead { margin: 0 0 20px; color: var(--muted); }

.field { display: block; margin-bottom: 16px; font-weight: 500; font-size: 14px; }
.field input { display: block; width: 100%; margin-top: 6px; padding: 12px; font-size: 16px; font-weight: 400; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.choice { margin: 0 0 28px; padding: 0; border: 0; }
.choice legend { padding: 0; margin-bottom: 10px; font-size: 15px; color: var(--muted); }
.choice-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.choice label { display: block; }
.choice input { position: absolute; opacity: 0; }
.choice span { display: block; padding: 14px; text-align: center; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.choice input:checked + span { background: var(--navy); border-color: var(--navy); color: #fff; }
.choice input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.primary { display: block; width: 100%; padding: 15px; font-weight: 500; color: var(--navy-deep); background: var(--lime); border: 0; border-radius: 8px; }
.secondary { padding: 10px 14px; font-weight: 500; color: var(--navy); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; text-decoration: none; text-align: center; }
.error { min-height: 1.4em; margin: 10px 0 0; color: var(--down); }

.link-card { padding: 16px; margin-bottom: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.link-card h2 { margin: 0 0 10px; font-size: 16px; font-weight: 500; color: var(--navy); }
.link-card p { margin: 0 0 10px; font-size: 14px; color: var(--muted); }
.link-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.qr { width: 170px; margin: 2px auto 12px; }
.qr svg { display: block; width: 100%; height: auto; }
.note { margin: 12px 0 0; font-size: 14px; color: var(--muted); }

/* Camera: the whole phone screen, held sideways. */
.camera-page { position: fixed; inset: 0; background: #000; color: #fff; overflow: hidden; }
.camera-page video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.cam-top { position: absolute; top: calc(10px + var(--safe-top)); left: calc(12px + var(--safe-left)); right: calc(12px + var(--safe-right)); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cam-status { display: inline-flex; align-items: center; gap: 7px; padding: 6px 11px; font-weight: 500; background: rgba(0, 0, 0, 0.62); border-radius: 999px; }
.cam-status::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: #9aa4b5; }
.cam-status[data-state="live"]::before { background: #ff3b30; }
.cam-status[data-state="retrying"]::before, .cam-status[data-state="connecting"]::before { background: var(--lime); }
.cam-meta { padding: 6px 11px; font-size: 14px; background: rgba(0, 0, 0, 0.62); border-radius: 999px; font-variant-numeric: tabular-nums; }
#battery { font-weight: 500; }
#battery.is-critical, .cam-warning.is-critical { color: #fff; background: var(--down); }
.cam-locked { display: inline-flex; align-items: center; gap: 6px; }
.cam-lock-icon { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cam-warning { flex: 1 0 100%; margin: 0; padding: 10px 14px; font-weight: 500; color: #000; background: var(--lime); border-radius: 8px; }
.cam-dim { position: fixed; inset: 0; z-index: 10; display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start; padding: calc(14px + var(--safe-top)) calc(16px + var(--safe-right)) calc(14px + var(--safe-bottom)) calc(16px + var(--safe-left)); border: 0; border-radius: 0; color: #fff; background: #000; font-weight: 400; text-align: left; }
.cam-dim-top { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-variant-numeric: tabular-nums; opacity: 0.8; }
.cam-dim-dot { width: 8px; height: 8px; border-radius: 50%; background: #ff3b30; }
.cam-dim-hint { align-self: center; margin: auto; font-size: 16px; opacity: 0.85; }
.cam-bottom { position: absolute; left: calc(12px + var(--safe-left)); right: calc(12px + var(--safe-right)); bottom: calc(12px + var(--safe-bottom)); display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.cam-lens { display: block; font-size: 13px; }
.cam-lens select { display: block; max-width: 56vw; margin-top: 3px; padding: 9px; font-size: 16px; color: #fff; background: rgba(0, 0, 0, 0.72); border: 1px solid rgba(255, 255, 255, 0.4); border-radius: 8px; }
.cam-action { min-width: 150px; padding: 14px 20px; font-weight: 500; border: 0; border-radius: 8px; color: var(--navy-deep); background: var(--lime); }
.cam-action.is-stop { color: #fff; background: var(--down); }
.cam-notice { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(86%, 440px); padding: 14px 16px; text-align: center; background: rgba(0, 0, 0, 0.76); border-radius: 8px; }
.cam-notice button { margin-top: 10px; }
.cam-tip { font-size: 14px; }
.cam-rotate { margin: 0 0 6px; font-weight: 500; color: var(--lime); }

/* Watching. */
.watch-stage { position: relative; background: #000; aspect-ratio: 16 / 9; }
.watch-stage video { display: block; width: 100%; height: 100%; }
.watch-tag { position: absolute; top: 10px; left: 10px; padding: 4px 9px; font: 600 15px/1.2 var(--display); letter-spacing: 0.04em; color: #fff; background: #d92d20; border-radius: 4px; }
.watch-state { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 16px; text-align: center; color: #fff; }
.watch-tools { position: absolute; right: 10px; bottom: 10px; display: flex; align-items: center; gap: 6px; }
.watch-page { width: min(100%, 960px); margin: 0 auto; }
.watch-body { padding: 14px 16px calc(24px + var(--safe-bottom)); }
.watch-body h1 { font-size: 18px; margin-bottom: 10px; }
.watch-note { min-height: 1.4em; margin: 8px 0; font-size: 14px; color: var(--muted); }
.watch-body .secondary { display: block; width: 100%; }

/* Choosing players. */
.brand-link { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.team { margin: 0 0 28px; padding: 0; border: 0; }
.team legend { padding: 0; margin-bottom: 10px; font-size: 15px; color: var(--muted); }
.picker { position: relative; display: block; margin-bottom: 10px; }
.picker input { display: block; width: 100%; padding: 14px; font-size: 16px; font-weight: 400; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.picker-list { margin: 4px 0 0; padding: 4px; list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.picker-option { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 6px 8px; font-weight: 400; border-radius: 6px; cursor: pointer; }
.picker-option[aria-selected="true"], .picker-option:hover { background: var(--paper); }
.picker-option mark { background: none; color: inherit; font-weight: 500; }
.picker-photo { flex: none; display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; object-fit: cover; font-weight: 500; color: var(--navy); background: var(--line); border-radius: 50%; }
.picker-text { min-width: 0; }
.picker-name { display: block; font-size: 16px; overflow-wrap: anywhere; }
.picker-meta { display: block; font-size: 13px; color: var(--muted); }
.picker-chosen { display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 7px 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.picker-chosen .picker-text { flex: 1; }
.picker-clear { flex: none; width: 44px; height: 44px; font-size: 22px; line-height: 1; color: var(--muted); background: none; border: 0; }
.board-player { display: flex; align-items: center; gap: 8px; min-height: 32px; color: inherit; text-decoration: none; }
.board-player img { flex: none; width: 26px; height: 26px; object-fit: cover; border-radius: 50%; }
.board-player + .board-player { margin-top: 2px; }

/* Creating a match, one decision per screen. */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 24px; }
.steps i { height: 3px; background: var(--line); border-radius: 2px; }
.steps i.is-on { background: var(--navy); }
.format-list { display: grid; gap: 12px; }
.format-option { min-height: 84px; font-size: 18px; color: var(--navy); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.step-back { display: inline-flex; align-items: center; gap: 2px; min-height: 44px; margin: -10px 0 8px -6px; padding: 0 8px 0 0; color: var(--muted); background: none; border: 0; }
.step-back svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.cam-action:disabled { opacity: 0.45; }
.cam-zoom { display: flex; gap: 4px; padding: 4px; background: rgba(0, 0, 0, 0.62); border-radius: 999px; }
.cam-zoom button { min-width: 52px; min-height: 44px; padding: 0 10px; color: #fff; background: none; border: 0; border-radius: 999px; font-variant-numeric: tabular-nums; }
.cam-zoom button[aria-pressed="true"] { color: var(--navy-deep); background: var(--lime); font-weight: 500; }
.picker-option.is-new { margin-top: 4px; color: var(--navy); border-top: 1px solid var(--line); border-radius: 0 0 6px 6px; }
.picker-option.is-new .picker-photo { font-size: 24px; font-weight: 400; color: var(--navy-deep); background: var(--lime); }
.field-note { display: block; margin-top: 6px; font-size: 13px; font-weight: 400; color: var(--muted); }
.watch-description { margin: 10px 0 0; color: var(--navy); }

/* Viewing and creating matches: a dark room where pictures and scores stand out. The scoring and camera
   pages stay as they are, built for use on court in sunlight. */
.theme-dark {
  --dark-bg: #071634;
  --dark-card: #0f2758;
  --dark-field: rgba(255, 255, 255, 0.09);
  --dark-line: rgba(255, 255, 255, 0.12);
  --dark-soft: rgba(255, 255, 255, 0.68);
  min-height: 100dvh;
  color: #fff;
  background: var(--dark-bg);
}
.theme-dark .brand { position: relative; background: transparent; }
.theme-dark .page { position: relative; }
.page-court { position: fixed; left: 0; right: 0; bottom: 0; width: 100%; height: 56vh; fill: none; stroke: #fff; stroke-width: 2; opacity: 0.07; pointer-events: none; }
.theme-dark h1 { font-size: 27px; color: #fff; }
.theme-dark .error { color: #ffb4ae; }
.theme-dark .note { color: var(--dark-soft); text-align: center; }

.theme-dark .steps i { background: var(--dark-line); }
.theme-dark .steps i.is-on { background: var(--lime); }
.theme-dark .step-back { color: var(--dark-soft); }

/* Step 1: three courts to choose from. */
.format-option { display: flex; align-items: center; gap: 18px; min-height: 104px; padding: 14px 18px; font-size: 19px; text-align: left; color: #fff; background: var(--dark-card, var(--surface)); border: 1px solid var(--dark-line, var(--line)); border-radius: 16px; }
.format-court { flex: none; width: 116px; height: 60px; }
.format-court rect { fill: #1857d6; stroke: #fff; stroke-width: 1.4; }
.format-court path { fill: none; stroke: rgba(255, 255, 255, 0.72); stroke-width: 1; }
.format-court .dot-a { fill: var(--lime); }
.format-court .dot-b { fill: #fff; }

/* Step 2: two sides, with VS between them. */
.theme-dark .team { margin: 0; padding: 14px; background: var(--dark-card); border-radius: 16px; }
.theme-dark .team legend { float: left; width: 100%; margin-bottom: 10px; color: var(--dark-soft); }
.theme-dark .picker { clear: both; }
.team-versus { position: relative; z-index: 1; display: flex; width: 44px; height: 44px; margin: -10px auto; align-items: center; justify-content: center; font: 600 17px/1 var(--display); letter-spacing: 0.04em; color: var(--navy-deep); background: var(--lime); border-radius: 50%; }
#teams { margin-bottom: 24px; }
.theme-dark .picker input, .theme-dark .field input { color: #fff; background: var(--dark-field); border-color: transparent; }
.theme-dark .picker input::placeholder, .theme-dark .field input::placeholder { color: var(--dark-soft); }
.theme-dark .picker-list { background: #142e66; border-color: var(--dark-line); }
.theme-dark .picker-option[aria-selected="true"], .theme-dark .picker-option:hover { background: rgba(255, 255, 255, 0.08); }
.theme-dark .picker-meta { color: var(--dark-soft); }
.theme-dark .picker-option.is-new { color: #fff; border-top-color: var(--dark-line); }
.theme-dark .picker-photo { background: #c7d3e6; }
.theme-dark .picker-chosen { background: var(--dark-field); border-color: transparent; }
.theme-dark .picker-clear { color: var(--dark-soft); }

/* Step 3. */
.theme-dark .field span:first-child, .theme-dark .choice legend { color: var(--dark-soft); font-weight: 400; font-size: 15px; }
.theme-dark .field { margin-bottom: 26px; }
.theme-dark .field-note { color: var(--dark-soft); }
.theme-dark .choice span { background: var(--dark-field); border-color: transparent; }
.theme-dark .choice input:checked + span { color: var(--navy-deep); background: var(--lime); border-color: var(--lime); font-weight: 500; }
.theme-dark .primary { min-height: 54px; border-radius: 12px; font-size: 17px; }

/* Match ready. */
.theme-dark .link-card { background: var(--dark-card); border: 0; border-radius: 16px; }
.theme-dark .link-card h2 { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; font-size: 17px; color: #fff; }
.theme-dark .link-card h2 svg { width: 24px; height: 24px; fill: none; stroke: var(--lime); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.theme-dark .qr { width: 216px; margin: 0 auto; padding: 14px; background: #fff; border-radius: 14px; }
.theme-dark .qr-hint { margin: 10px 0 14px; text-align: center; color: var(--dark-soft); }
.theme-dark .secondary { min-height: 46px; display: flex; align-items: center; justify-content: center; color: #fff; background: var(--dark-field); border: 0; border-radius: 10px; }

/* Watching. */
.theme-dark .watch-stage { background: #000; }
.theme-dark .watch-body { padding: 18px 16px calc(28px + var(--safe-bottom)); }
.facing { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 6px; }
.side { display: flex; flex-direction: column; align-items: center; gap: 10px; min-width: 0; }
.side-tiles { display: flex; flex-direction: column; align-items: center; gap: 12px; min-width: 0; max-width: 100%; }
.side-tile { display: flex; flex-direction: column; align-items: center; gap: 5px; min-width: 0; max-width: 100%; font-size: 14px; line-height: 1.25; text-align: center; color: var(--dark-soft); text-decoration: none; overflow-wrap: anywhere; }
.side.is-winner .side-tile { color: #fff; }
.side.is-winner .side-photo { border-color: var(--lime); }
.side-photo { flex: none; display: flex; width: 54px; height: 54px; align-items: center; justify-content: center; object-fit: cover; font-size: 20px; color: var(--navy-deep); background: #c7d3e6; border: 2px solid var(--dark-line); border-radius: 50%; }
.side[data-count="3"] .side-photo { width: 44px; height: 44px; font-size: 16px; }
.facing-score { display: flex; flex-direction: column; align-items: center; gap: 6px; padding-top: 4px; }
.facing-digits { display: flex; align-items: center; gap: 10px; font: 500 58px/1 var(--display); font-variant-numeric: tabular-nums; }
.facing-digits i { width: 12px; height: 2px; background: var(--dark-soft); }
.facing-call { padding: 3px 12px; font: 600 17px/1.2 var(--display); letter-spacing: 0.02em; color: var(--navy-deep); background: var(--lime); border-radius: 999px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.facing-games { font-size: 13px; color: var(--dark-soft); }
.side.is-b .side-tile.is-serving::before { background: var(--blue-soft); }
.theme-dark .watch-description { display: table; margin: 16px auto 0; padding: 7px 14px; font-size: 15px; color: var(--lime); background: rgba(200, 242, 62, 0.13); border-radius: 999px; }
.theme-dark .watch-note { color: var(--dark-soft); text-align: center; }
.theme-dark .watch-note:empty { display: none; }
.theme-dark .watch-body .secondary { margin-top: 18px; }
@media (min-width: 760px) {
  .facing-digits { font-size: 76px; }
  .side-tiles { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 12px 18px; }
  .side-photo { width: 66px; height: 66px; }
  .side-tile { font-size: 15px; }
}

/* The ball beside whoever is serving now. */
.side-tile { position: relative; }
.side-tile.is-serving::before { content: ""; position: absolute; top: 0; left: calc(50% + 14px); z-index: 1; width: 14px; height: 14px; background: var(--lime); border: 2px solid var(--dark-bg); border-radius: 50%; }

/* The scoreboard on the live picture. */
/* Only in full screen: on the page the score is right below the picture, and the space is better left to it. */
.bug { display: none; position: absolute; left: 10px; bottom: 10px; max-width: calc(100% - 110px); overflow: hidden; font: 600 15px/1 var(--display); color: #fff; background: rgba(7, 22, 52, 0.92); border-radius: 6px; }
.bug-row { position: relative; display: flex; align-items: stretch; min-height: 24px; padding-left: 16px; }
.bug-row + .bug-row { border-top: 1px solid rgba(255, 255, 255, 0.16); }
.bug-row.is-serving::before { content: ""; position: absolute; left: 5px; top: 50%; width: 7px; height: 7px; background: var(--lime); border-radius: 50%; transform: translateY(-50%); }
.bug-name { flex: 1; min-width: 0; align-self: center; padding-right: 8px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.bug-game, .bug-point { display: flex; align-items: center; justify-content: center; font-variant-numeric: tabular-nums; }
.bug-game { width: 22px; color: rgba(255, 255, 255, 0.72); }
.bug-row[data-server]::before { content: attr(data-server); left: 3px; width: 11px; height: 11px; font-size: 9px; line-height: 11px; text-align: center; color: var(--navy-deep); }
.bug-point { width: 32px; color: var(--navy-deep); background: var(--lime); }
@media (min-width: 760px) { .bug { font-size: 20px; } .bug-row { min-height: 32px; } .bug-point { width: 42px; } .bug-game { width: 28px; } }

/* Full screen. */
.watch-tool { display: flex; width: 38px; height: 38px; align-items: center; justify-content: center; padding: 0; color: #fff; background: rgba(7, 22, 52, 0.82); border: 0; border-radius: 8px; }
.watch-tool svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.watch-full.is-on svg { transform: rotate(180deg); }
#sound .icon-muted, #sound.is-muted .icon-sound { display: none; }
#sound.is-muted .icon-muted { display: block; }
#score-toggle.is-on { color: var(--navy-deep); background: var(--lime); }
.no-scroll { overflow: hidden; }
.watch-stage:fullscreen { width: 100%; height: 100%; aspect-ratio: auto; }
.watch-stage.is-full { position: fixed; inset: 0; z-index: 20; width: 100vw; height: 100dvh; aspect-ratio: auto; }
.watch-stage:fullscreen .bug, .watch-stage.is-full .bug { display: block; left: 18px; bottom: 18px; font-size: clamp(17px, 2.6vmax, 26px); }
.watch-stage:fullscreen .bug-row, .watch-stage.is-full .bug-row { min-height: 2em; padding-left: 1.1em; }
.watch-stage:fullscreen .bug-game, .watch-stage.is-full .bug-game { width: 1.6em; }
.watch-stage:fullscreen .bug-point, .watch-stage.is-full .bug-point { width: 2.5em; }
@media (orientation: portrait) {
  .watch-stage.is-full { inset: auto; left: 50%; top: 50%; width: 100dvh; height: 100vw; transform: translate(-50%, -50%) rotate(90deg); }
}
/* A phone held sideways watches full screen by itself; turning it back returns to the page. */
@media (orientation: landscape) and (max-height: 500px) {
  .theme-dark .watch-stage { position: fixed; inset: 0; z-index: 20; aspect-ratio: auto; height: 100dvh; }
  .theme-dark .watch-full { display: none; }
  .theme-dark .bug { display: block; font-size: 18px; }
  .theme-dark .bug-row { min-height: 30px; }
}
.watch-stage.score-on .bug { display: block; }
.watch-stage.score-off .bug { display: none; }

.watch-replay { margin-top: 16px; text-align: center; text-decoration: none; }

/* The scoreboard of the scoring page: a row per team, the serving mark, photos, names, the server dots, games won
   and the points (lime for the first team, blue for the second, as in the app). */
.board { overflow: hidden; color: #fff; background: var(--dark-card, var(--navy)); border-radius: 18px; }
.board-row { display: flex; align-items: center; gap: 10px; min-height: 60px; padding-left: 12px; font-size: 16px; }
.board-row + .board-row { border-top: 1px solid rgba(255, 255, 255, 0.1); }
.board-serve { flex: none; width: 12px; height: 12px; border-radius: 50%; }
.board-row.is-serving.is-a .board-serve { background: var(--lime); }
.board-row.is-serving.is-b .board-serve { background: var(--blue-soft); }
.board-faces { flex: none; display: flex; }
.board-photo { display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; object-fit: cover; font-size: 14px; color: var(--navy-deep); background: #c7d3e6; border: 2px solid var(--dark-card, var(--navy)); border-radius: 50%; }
.board-photo + .board-photo { margin-left: -10px; }
.board-team { flex: 1; min-width: 0; line-height: 1.2; overflow-wrap: anywhere; }
.board-row.is-winner .board-team { color: var(--lime); font-weight: 500; }
.board-servers { flex: none; display: flex; gap: 5px; }
.board-servers i { width: 10px; height: 10px; border: 1.5px solid rgba(255, 255, 255, 0.45); border-radius: 50%; }
.board-row.is-a .board-servers i.is-on { background: var(--lime); border-color: var(--lime); }
.board-row.is-b .board-servers i.is-on { background: var(--blue-soft); border-color: var(--blue-soft); }
.board-games { flex: none; width: 26px; text-align: center; font: 500 22px/1 var(--display); color: rgba(255, 255, 255, 0.75); font-variant-numeric: tabular-nums; }
.board-points { flex: none; align-self: stretch; display: flex; align-items: center; justify-content: center; width: 64px; font: 600 32px/1 var(--display); font-variant-numeric: tabular-nums; }
.board-row.is-a .board-points { color: var(--navy-deep); background: var(--lime); }
.board-row.is-b .board-points { color: var(--navy-deep); background: var(--blue-soft); }

/* Scoring: the call in big numbers, two big targets for one hand, wrong taps undone below. */
.score-body { min-height: 100dvh; }
.score-page { display: flex; flex-direction: column; gap: 12px; width: min(100%, 560px); min-height: 100dvh; margin: 0 auto; padding: calc(12px + var(--safe-top)) 14px calc(14px + var(--safe-bottom)); }
.score-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.score-title h1 { margin: 0; font: 600 26px/1.1 var(--display); color: #fff; }
.score-title p { margin: 2px 0 0; font-size: 14px; color: var(--dark-soft); }
.live-pill { display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px; font-size: 14px; color: var(--dark-soft); background: rgba(255, 255, 255, 0.08); border-radius: 999px; }
.live-pill::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: rgba(255, 255, 255, 0.4); }
.live-pill.is-live { color: #fff; background: rgba(217, 45, 32, 0.22); }
.live-pill.is-live::before { background: #ff3b30; }
.toast { align-self: center; margin: -2px 0 -6px; padding: 6px 16px; font-weight: 500; color: var(--navy-deep); background: var(--lime); border-radius: 999px; }
.call { display: flex; align-items: center; justify-content: center; gap: 14px; min-height: 120px; font: 700 clamp(84px, 30vw, 136px)/1 var(--display); font-variant-numeric: tabular-nums; color: #fff; }
.call i { width: 0.34em; height: 0.07em; background: rgba(255, 255, 255, 0.3); }
.call .call-server.is-a { color: var(--lime); }
.call .call-server.is-b { color: var(--blue-soft); }
.call.is-games { font-size: clamp(56px, 20vw, 88px); color: var(--dark-soft); }
.server-line { display: flex; align-items: center; gap: 10px; align-self: center; margin: 0; padding: 6px 16px 6px 6px; font-size: 15px; background: rgba(255, 255, 255, 0.07); border-radius: 999px; }
.server-photo { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; object-fit: cover; font-size: 14px; color: var(--navy-deep); background: #c7d3e6; border: 2px solid var(--lime); border-radius: 50%; }
.rally-button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 14px; border: 0; border-radius: 26px; }
.rally-button b { font-size: 30px; font-weight: 600; }
.rally-button small { font-size: 16px; overflow-wrap: anywhere; }
.rally-button.is-win { flex: 1.4; min-height: 150px; color: var(--navy-deep); background: var(--lime); }
.rally-button.is-win.is-b { color: #fff; background: var(--blue-soft); }
.rally-button.is-lose { flex: 1; min-height: 100px; color: #fff; background: var(--dark-card); }
.rally-button.is-lose small { color: var(--dark-soft); }
.rally-button:disabled { opacity: 0.45; }
.score-page .error:empty { display: none; }
.score-page .error { margin: 0; text-align: center; }
.finish-note { margin: 0; text-align: center; color: var(--lime); }
.score-tools { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.score-tool { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 60px; padding: 8px 6px; font-size: 16px; font-weight: 500; color: #fff; background: var(--dark-card); border: 0; border-radius: 18px; text-decoration: none; }
.score-tool svg { flex: none; width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.score-tool.is-end { color: #ff8a80; }
.score-tool.is-finish { color: var(--navy-deep); background: var(--lime); }
.score-tool:disabled { opacity: 0.45; }

/* Choosing who serves, before each game. */
.serve-sheet { position: fixed; inset: 0; z-index: 5; display: flex; flex-direction: column; gap: 18px; padding: calc(24px + var(--safe-top)) 16px calc(20px + var(--safe-bottom)); overflow-y: auto; background: var(--dark-bg, var(--navy-deep)); }
.serve-sheet h2 { margin: 0; font: 600 28px/1.15 var(--display); text-align: center; color: #fff; }
.serve-group { margin: 0; padding: 0; border: 0; }
.serve-group legend { margin-bottom: 10px; padding: 0; font-size: 15px; color: var(--dark-soft); }
.serve-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.serve-choice { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 64px; padding: 12px 8px; font-size: 16px; color: #fff; background: var(--dark-card); border: 2px solid transparent; border-radius: 16px; overflow-wrap: anywhere; }
.serve-choice[aria-pressed="true"] { border-color: var(--lime); }
.serve-photo { display: flex; align-items: center; justify-content: center; width: 52px; height: 52px; object-fit: cover; font-size: 20px; color: var(--navy-deep); background: #c7d3e6; border-radius: 50%; }
.serve-sheet .primary { min-height: 56px; margin-top: auto; border-radius: 16px; font-size: 18px; }
.serve-sheet .primary:disabled { opacity: 0.45; }
.serve-sheet .secondary { min-height: 50px; }

.choice-row-3 { grid-template-columns: repeat(3, 1fr); }
.terms { margin: -8px 0 18px; font-size: 13px; }
