/* ---------- Reset ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
/* Every page except the OBS overlay is already dark. Saying so (here and in
   each page's color-scheme meta) stops phone browsers with a "dark mode for
   websites" setting from darkening it again and dimming the balls and buttons. */
@media (prefers-color-scheme: dark) {
  body:not(.scoreboard) { color-scheme: dark; }
}
body {
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: #111;
  background: #f5f5f7;
}
/* Touch-friendly defaults: no double-tap zoom, no text-selection flicker on taps. */
button, a.btn, .ball, input {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* ===================================================================
   Landing / match list
   =================================================================== */
body.landing {
  min-height: 100vh;
  background: linear-gradient(135deg, #0f172a, #1e293b);
  color: #e2e8f0;
  padding: 32px 16px;
}
.landing-wrap {
  max-width: 880px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.landing-header h1 { margin: 0 0 8px; font-size: 32px; }
.landing-header p { margin: 0; color: #94a3b8; font-size: 14px; }

.new-match-card {
  background: #0b1220;
  border: 1px solid #1e293b;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}
.new-match-card h2 { margin: 0 0 16px; font-size: 18px; }
.new-match-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 16px;
}
.new-match-form label {
  display: flex;
  flex-direction: column;
  font-size: 12px;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  gap: 6px;
  min-width: 0; /* allow grid items to shrink instead of forcing overflow */
}
.new-match-form label .muted { text-transform: none; letter-spacing: 0; color: #64748b; }
.new-match-form input {
  padding: 10px 12px;
  background: #020617;
  color: #e2e8f0;
  border: 1px solid #334155;
  border-radius: 8px;
  font-size: 15px;
}
.new-match-form .form-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  margin-top: 4px;
}

/* Checkbox + label on one line (used in both new-match form and scorer controls) */
.checkbox-label {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}
.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  cursor: pointer;
  accent-color: #2563eb;
}
.checkbox-label span { font-size: 13px; color: #94a3b8; }
.new-match-form .checkbox-label { grid-column: 1 / -1; }

/* Shared button styles (used on landing + match rows) */
.btn {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border: 1px solid #334155;
  background: #1e293b;
  color: #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
}
.btn:hover { background: #334155; }
/* display:inline-flex above would otherwise beat the browser's [hidden] rule,
   so a hidden .btn (e.g. the admin-only Invite button) would still show. */
.btn[hidden] { display: none !important; }
.btn.primary { background: #2563eb; border-color: #2563eb; color: white; }
.btn.primary:hover { background: #1d4ed8; }
.btn.danger { background: transparent; border-color: #7f1d1d; color: #fca5a5; }
.btn.danger:hover { background: #450a0a; }

/* Match list */
.matches-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.matches-header h2 { margin: 0; font-size: 18px; }
.match-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.match-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: #0b1220;
  border: 1px solid #1e293b;
  border-radius: 10px;
  padding: 14px 18px;
}
.match-info { flex: 1; min-width: 0; }
.match-players { font-size: 16px; font-weight: 700; color: #e2e8f0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.match-players .vs { color: #64748b; font-weight: 400; margin: 0 6px; }
.sport-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.sport-pill.snooker  { background: #1e3a8a; color: #93c5fd; }
.sport-pill.pool     { background: #14532d; color: #86efac; }
.sport-pill.darts    { background: #7f1d1d; color: #fecaca; }
.sport-pill.shootout { background: #78350f; color: #fcd34d; }
.match-label {
  display: inline-block;
  margin-top: 6px;
  padding: 2px 10px;
  border-radius: 999px;
  background: #0f1e3d;
  border: 1px solid #1e40af;
  color: #bfdbfe;
  font-size: 12px;
  font-weight: 600;
}
.match-meta { font-size: 12px; color: #94a3b8; margin-top: 4px; }
.match-meta code { background: #020617; padding: 1px 6px; border-radius: 4px; font-size: 11px; }
.match-actions { display: flex; gap: 8px; flex-shrink: 0; }
.empty-state {
  text-align: center;
  color: #64748b;
  padding: 32px;
  background: #0b1220;
  border: 1px dashed #1e293b;
  border-radius: 10px;
  margin: 0;
}

/* ===================================================================
   Scorer
   =================================================================== */
body.scorer {
  padding: 24px;
  max-width: 1100px;
  margin: 0 auto;
  color: #e2e8f0;
  position: relative;
}
/* Viewport-wide dark background without breaking the centered max-width body. */
body.scorer::before {
  content: '';
  position: fixed;
  inset: 0;
  background: #020617;
  z-index: -1;
}

.top-nav {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 14px;
  background: #0b1220;
  color: #e2e8f0;
  border-radius: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.top-nav .nav-link {
  color: #e2e8f0;
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
}
.top-nav .nav-link:hover { background: #1e293b; }
.top-nav .nav-link[hidden] { display: none; }
.top-nav .nav-spacer { flex: 1; }
.top-nav .nav-meta { font-size: 13px; color: #94a3b8; }
.top-nav .nav-meta code {
  background: #020617;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
  color: #e2e8f0;
  margin-left: 4px;
}

.scorer-header {
  margin-bottom: 20px;
}
.scorer-header h1 { margin: 0; font-size: 22px; color: #e2e8f0; }

.game-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 16px;
  background: #0b1220;
  padding: 16px;
  border-radius: 10px;
  border: 1px solid #1e293b;
  margin-bottom: 20px;
}
/* Section header always takes a full row so it doesn't fight flex children */
.game-controls .section-header,
.snooker-controls .section-header,
.frame-end-controls .section-header,
.players-section .section-header {
  flex-basis: 100%;
}
.game-controls label { display: flex; flex-direction: column; font-size: 13px; color: #94a3b8; }
.game-controls input {
  margin-top: 6px;
  padding: 8px 10px;
  border: 1px solid #334155;
  background: #020617;
  color: #e2e8f0;
  border-radius: 6px;
  font-size: 16px;
  width: 140px;
}
.game-controls .danger {
  margin-left: auto;
  padding: 10px 16px;
  background: #ef4444;
  color: white;
  border: 0;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
}
.game-controls .danger:hover { background: #dc2626; }

/* Arm-then-confirm state — button visibly waits for a second tap. */
button.armed {
  background: #f59e0b !important;
  border-color: #b45309 !important;
  color: #1a1a1a !important;
  animation: pulse-armed 0.9s ease-in-out infinite;
}
@keyframes pulse-armed {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.5); }
  50%      { box-shadow: 0 0 0 6px rgba(245, 158, 11, 0); }
}

/* ---------- Snooker controls ---------- */
.snooker-controls,
.frame-end-controls {
  background: #0b1220;
  border: 1px solid #1e293b;
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Section headings shared across scorer sections */
.section-header {
  border-bottom: 1px solid #1e293b;
  padding-bottom: 12px;
  margin-bottom: 4px;
}
.section-heading {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: #e2e8f0;
  letter-spacing: 0.2px;
}
.section-hint {
  margin: 6px 0 0;
  font-size: 13px;
  color: #94a3b8;
  line-height: 1.5;
}

/* Tiny hint shown under field labels (or inline in checkboxes) */
.field-hint {
  display: block;
  font-size: 11px;
  font-weight: 400;
  color: #64748b;
  font-style: italic;
  text-transform: none;
  letter-spacing: 0;
  margin: 2px 0 4px;
  line-height: 1.4;
}
.field-hint.inline {
  display: inline;
  margin: 0;
}

/* Players section frame mirrors the snooker-controls look */
.players-section {
  background: #0b1220;
  border: 1px solid #1e293b;
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Overlay-toggle checkboxes group */
.overlay-toggles {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  align-items: center;
}
.overlay-toggles .checkbox-label { margin: 0; }

/* Reset-frame row inside the End-of-frame section */
.reset-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 4px;
  padding-top: 14px;
  border-top: 1px dashed #1e293b;
}
.reset-row .danger {
  padding: 10px 16px;
  background: #ef4444;
  color: white;
  border: 0;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
}
.reset-row .danger:hover { background: #dc2626; }
.row-hint.inline-hint {
  margin: 0;
  flex: 1;
  min-width: 240px;
}

/* Free-ball toggle dot — empty ring when off, filled green when on */
.action-row .toggle .toggle-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid currentColor;
  background: transparent;
  margin-right: 8px;
  vertical-align: middle;
  transition: background 120ms ease, border-color 120ms ease;
}
.action-row .toggle.on .toggle-dot {
  background: #fff;
  border-color: #fff;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.7);
}

/* Recent-shots history strip under the break/reds line on the scorer. */
.sp-history {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  justify-content: center;
  align-items: center;
  margin-top: 8px;
  max-width: 380px;
}
.sp-history:empty { display: none; }
.shot-icon,
.shot-chip {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  font-family: var(--bz-mono);
  flex: 0 0 auto;
}
.shot-icon-red    { background: #dc2626; color: #fff; }
.shot-icon-yellow { background: #fbbf24; color: #000; }
.shot-icon-green  { background: #16a34a; color: #fff; }
.shot-icon-brown  { background: #7c4a1e; color: #fff; }
.shot-icon-blue   { background: #2563eb; color: #fff; }
.shot-icon-pink   { background: #f472b6; color: #000; }
.shot-icon-black  { background: #111827; color: #fff; border: 1px solid #475569; }
/* Long pots get a white ring; free balls a dashed outline. */
.shot-icon.long { box-shadow: 0 0 0 2px #fff, 0 0 0 3px rgba(0, 0, 0, 0.45); }
.shot-icon.free { outline: 2px dashed #fff; outline-offset: 1px; }
.shot-chip {
  width: auto;
  min-width: 20px;
  border-radius: 6px;
  padding: 0 6px;
  background: var(--bz-ink-700);
  color: var(--bz-bone);
  border: 1px solid var(--bz-ink-600);
}
.shot-chip-miss   { background: #7f1d1d; color: #fee2e2; border-color: #991b1b; }
.shot-chip-safety { background: #1e3a8a; color: #dbeafe; border-color: #1d4ed8; }
.shot-chip-foul   { background: #7c2d12; color: #ffedd5; border-color: #9a3412; }

/* Active-player highlight on the score preview */
.score-preview .sp-side {
  position: relative;
  padding: 6px 8px;
  border-radius: 8px;
  transition: background 150ms ease, box-shadow 150ms ease;
}
.score-preview .sp-side:has(.sp-arrow:not(:empty)) {
  background: rgba(201, 162, 39, 0.08);
  box-shadow: inset 0 0 0 1px rgba(201, 162, 39, 0.35);
}
.score-preview .sp-side:has(.sp-arrow:not(:empty)) .sp-name {
  color: #fde68a;
}

/* Subtle dividers between rows inside the Live scoring panel */
.snooker-controls > .ball-row,
.snooker-controls > .action-row,
.snooker-controls > .foul-row {
  padding-top: 14px;
  border-top: 1px dashed #1e293b;
}

.multi-red-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.multi-red-row button {
  padding: 6px 14px;
  border: 1px solid #7f1d1d;
  background: #450a0a;
  color: #fca5a5;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.multi-red-row button:hover:not(:disabled) { background: #7f1d1d; color: #fee2e2; }
.multi-red-row button:disabled { opacity: 0.35; cursor: not-allowed; }

.ball-row { display: flex; gap: 12px; justify-content: center; }
.ball {
  width: 72px;
  height: 72px;
  flex-shrink: 0;
  border: 2px solid rgba(0, 0, 0, 0.15);
  border-radius: 50%;
  font-size: 24px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 100ms ease, opacity 100ms ease;
  /* Inner shading + highlight to feel spherical rather than flat. */
  box-shadow:
    inset -6px -6px 10px rgba(0, 0, 0, 0.35),
    inset 4px 4px 8px rgba(255, 255, 255, 0.25),
    0 2px 4px rgba(0, 0, 0, 0.2);
}
.ball:hover:not(:disabled) { transform: scale(1.05); }
.ball:disabled { opacity: 0.25; cursor: not-allowed; }
.ball-red    { background: #dc2626; color: #fff; }
.ball-yellow { background: #fbbf24; color: #000; }
.ball-green  { background: #16a34a; color: #fff; }
.ball-brown  { background: #7c4a1e; color: #fff; }
.ball-blue   { background: #2563eb; color: #fff; }
.ball-pink   { background: #f472b6; color: #000; }
.ball-black  { background: #111827; color: #fff; }

.action-row, .foul-row, .frame-row {
  display: flex;
  gap: 10px;
  align-items: center;
}
.action-row .action,
.foul-row button,
.frame-row button {
  padding: 10px 16px;
  border: 1px solid #334155;
  background: #1e293b;
  color: #e2e8f0;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.action-row .action:hover,
.foul-row button:hover,
.frame-row button:hover { background: #334155; }
.action-row .toggle.on {
  background: #16a34a;
  border-color: #15803d;
  color: white;
}
.action-row .undo {
  background: #451a03;
  border-color: #7c2d12;
  color: #fdba74;
}
.action-row .undo:hover { background: #7c2d12; color: #ffedd5; }
.row-label {
  min-width: 120px;
  font-size: 13px;
  color: #94a3b8;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.row-hint {
  margin: -6px 0 0 132px;  /* aligns under the buttons, past the 120px row-label */
  font-size: 12px;
  color: #64748b;
  font-style: italic;
  line-height: 1.4;
}
@media (max-width: 900px) {
  .row-hint { margin-left: 0; }
}
.foul-row button {
  min-width: 56px;
  background: #450a0a;
  border-color: #7f1d1d;
  color: #fca5a5;
}
.foul-row button:hover { background: #7f1d1d; color: #fee2e2; }
.frame-row button { background: #172554; border-color: #1e3a8a; color: #93c5fd; }
.frame-row button:hover { background: #1e3a8a; color: #dbeafe; }
.frame-row button.big {
  flex: 1;
  padding: 18px 20px;
  font-size: 18px;
  font-weight: 700;
}

/* Match-winner row — gold tint so it reads as more significant than a frame award. */
.frame-row.match-row button {
  background: #451a03;
  border-color: #c9a227;
  color: #fde68a;
}
.frame-row.match-row button:hover { background: #78350f; color: #fff; }

.snooker-result {
  min-height: 20px;
  font-size: 14px;
  font-weight: 600;
  color: #cbd5e1;
}
.snooker-result.is-foul { color: #fca5a5; }

/* ---------- Score preview at top of scorer ---------- */
/* Sticks to the top of the viewport so the score stays visible while scrolling
   the controls below — important for tablet scoring where the live-scoring
   section is below the fold. */
.score-preview {
  position: sticky;
  top: 0;
  z-index: 20;
  background: #0b1220;
  color: #e2e8f0;
  border-radius: 12px;
  padding: 12px 20px;
  margin-bottom: 20px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}
.sp-side { min-width: 0; }
.sp-left { text-align: left; }
.sp-right { text-align: right; }
.sp-name {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sp-right .sp-name { justify-content: flex-end; }
.sp-arrow { color: #c9a227; font-size: 14px; }
.sp-arrow:empty { display: none; }

.sp-score {
  font-size: 56px;
  font-weight: 800;
  line-height: 1;
  color: #fff;
  font-variant-numeric: tabular-nums;
  margin-top: 4px;
}
.sp-sub { font-size: 13px; color: #94a3b8; margin-top: 4px; }
.sp-sub strong { color: #e2e8f0; font-weight: 700; margin-left: 2px; }

.sp-center { text-align: center; }
.sp-dash {
  font-size: 48px;
  color: #475569;
  line-height: 1;
  font-weight: 400;
}
.sp-meta {
  margin-top: 10px;
  display: flex;
  gap: 14px;
  justify-content: center;
  font-size: 12px;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  flex-wrap: wrap;
}
.sp-meta strong {
  color: #e2e8f0;
  font-weight: 700;
  margin-left: 4px;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 700px) {
  .score-preview { padding: 14px; }
  .sp-score { font-size: 44px; }
  .sp-dash { font-size: 36px; }
}
/* Phones: the middle column (break, reds, best of, recent shots) sized to its
   content and squeezed the names to nothing. Players side by side on top, each
   with half the width; the middle drops to its own full-width row below. */
@media (max-width: 600px) {
  .score-preview { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px 10px; }
  .sp-center { grid-column: 1 / -1; grid-row: 2; }
  .sp-dash { display: none; }
  .sp-meta { margin-top: 0; gap: 4px 14px; }
  .sp-history { margin: 6px auto 0; }
  /* Long names wrap onto a second line instead of being cut off. */
  .sp-name { white-space: normal; overflow-wrap: break-word; line-height: 1.2; align-items: flex-start; font-size: 13px; letter-spacing: 0.2px; gap: 4px; }
  .sp-name > span:not(.sp-arrow) { min-width: 0; }
  .sp-arrow { font-size: 11px; line-height: 1.45; }
  .score-preview .sp-side { padding: 6px; }
}

/* ====================================================================
   Touch / narrow-viewport pass — tablets, phones, scoring court-side
   ==================================================================== */
@media (max-width: 900px) {
  body.scorer { padding: 16px; }

  .game-controls {
    flex-wrap: wrap;
    gap: 12px;
  }
  .game-controls input { font-size: 18px; padding: 12px; }
  .game-controls .danger { margin-left: 0; width: 100%; padding: 14px; }

  .active-toggle .active-buttons button {
    flex: 1;
    padding: 14px 10px;
    font-size: 15px;
  }

  .status-bar {
    flex-wrap: wrap;
    gap: 12px 24px;
  }

  .snooker-controls { padding: 14px; gap: 16px; }

  /* Balls: full row on tablet, wrap to 2 rows below ~600px */
  .ball-row { flex-wrap: wrap; gap: 10px; }
  .ball { width: 66px; height: 66px; font-size: 22px; }

  .multi-red-row { flex-wrap: wrap; }
  .multi-red-row button { padding: 10px 16px; font-size: 15px; }

  .action-row, .foul-row, .frame-row { flex-wrap: wrap; gap: 8px; }
  .action-row .action,
  .foul-row button,
  .frame-row button {
    padding: 14px 18px;
    font-size: 16px;
    min-height: 48px;       /* Apple HIG minimum tap target */
  }
  .foul-row button { min-width: 60px; }
  .row-label {
    min-width: 100%;
    font-size: 11px;
    margin-bottom: -4px;
  }

  .players { grid-template-columns: 1fr !important; }
  .player-card input { font-size: 18px; padding: 12px; }
  .score-row button { width: 52px; height: 52px; font-size: 22px; }
}

@media (max-width: 600px) {
  .new-match-form { grid-template-columns: 1fr; }
  .match-row {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .match-actions > .btn { flex: 1; justify-content: center; }

  .ball { width: 56px; height: 56px; font-size: 18px; }
  .ball-row { justify-content: space-around; }
}

/* Remove hover scale on coarse pointers (touch) — feels janky after a tap */
@media (hover: none) and (pointer: coarse) {
  .ball:hover:not(:disabled) { transform: none; }
}

.active-toggle { display: flex; flex-direction: column; gap: 6px; }
.active-toggle .active-label { font-size: 13px; color: #94a3b8; }
.active-toggle .active-buttons { display: flex; gap: 6px; }
.active-toggle button {
  padding: 8px 12px;
  border: 1px solid #334155;
  background: #1e293b;
  color: #e2e8f0;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
}
.active-toggle button:hover { background: #334155; }
.active-toggle button.selected {
  background: #2563eb;
  color: white;
  border-color: #1d4ed8;
}

.players { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.player-card {
  background: #0b1220;
  border: 1px solid #1e293b;
  border-radius: 10px;
  padding: 20px;
}
.player-card label {
  display: block;
  font-size: 13px;
  color: #94a3b8;
  margin-bottom: 12px;
}
.player-card input {
  display: block;
  margin-top: 6px;
  padding: 8px 10px;
  border: 1px solid #334155;
  background: #020617;
  color: #e2e8f0;
  border-radius: 6px;
  font-size: 16px;
  width: 100%;
}
.player-card .handicap-label input { width: 120px; }
.total-line {
  font-size: 14px;
  color: #94a3b8;
  margin: 8px 0 16px;
}
.total-line .total { font-size: 28px; color: #e2e8f0; font-weight: 700; margin: 0 8px; }
.total-line .breakdown { font-size: 13px; color: #64748b; margin-left: 4px; }

.score-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
}
.score-row .label { width: 60px; color: #94a3b8; font-size: 13px; }
.score-row button {
  width: 44px; height: 44px;
  border: 1px solid #334155;
  background: #1e293b;
  color: #e2e8f0;
  border-radius: 8px;
  font-size: 20px;
  cursor: pointer;
}
.score-row button:hover { background: #334155; }
.score-row .score {
  min-width: 60px;
  text-align: center;
  font-size: 32px;
  font-weight: 700;
  color: #e2e8f0;
}
.score-row .score.small { font-size: 24px; }

/* ===================================================================
   Table view — big-screen player-facing scoreboard (/table/:gameId)
   Designed for a TV / large monitor in the room, readable at distance.
   =================================================================== */
/* ===========================================================================
   Table view — full-screen branded scoreboard for a TV / second monitor.
   Matches the Scoreline product mockup: navy board, brand header + LIVE,
   name + big score box (active player in red), a centre frame/break column and
   the snooker ball row. Sport-aware (snooker points / pool frames / darts 501).
   The legacy .table-* rules below are inert — the markup now uses .tv-*.
   =========================================================================== */
body.table-view {
  margin: 0; padding: 0; height: 100vh; min-height: 100vh; overflow: hidden;
  color: var(--bz-bone); font-family: var(--bz-sans);
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(230, 57, 70, 0.18), transparent 60%),
    linear-gradient(180deg, var(--bz-ink-900), var(--bz-ink-950));
  display: flex; align-items: stretch; justify-content: center;
}
.tv-stage {
  width: 100%; max-width: 1600px; height: 100%; box-sizing: border-box;
  display: flex; flex-direction: column;
  padding: clamp(16px, 3vh, 48px) clamp(20px, 4vw, 72px);
}

/* Header bar — brand · sport · LIVE */
.tv-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding-bottom: clamp(10px, 1.6vh, 22px); border-bottom: 1px solid var(--bz-ink-700);
}
.tv-brand { line-height: 0; }
.tv-brand img { height: clamp(26px, 3.4vh, 48px); width: auto; display: block; }
.tv-sport { text-align: center; }
.tv-sport {
  font-family: var(--bz-mono); font-size: clamp(12px, 1.5vw, 22px);
  text-transform: uppercase; letter-spacing: 3px; color: var(--bz-bone-dim);
}
.tv-live {
  display: inline-flex; align-items: center; gap: 8px; font-weight: 700;
  font-family: var(--bz-mono); font-size: clamp(11px, 1.3vw, 18px);
  text-transform: uppercase; letter-spacing: 2px; color: var(--bz-signal-light);
}
.tv-live i {
  width: 10px; height: 10px; border-radius: 999px; background: var(--bz-signal);
  box-shadow: 0 0 10px var(--bz-signal); animation: tv-blink 1.6s ease-in-out infinite;
}
@keyframes tv-blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

.tv-headmid { display: inline-flex; align-items: baseline; gap: 10px; min-width: 0; }
.tv-matchlabel[hidden] { display: none; }
.tv-matchlabel {
  font-family: var(--bz-mono); font-size: clamp(10px, 1.1vw, 16px);
  text-transform: uppercase; letter-spacing: 2px; color: var(--bz-butter);
}
.tv-matchlabel::before { content: "·"; margin-right: 10px; color: var(--bz-bone-dim); }

/* Body: player | centre | player */
.tv-body {
  flex: 1; min-height: 0; display: grid; align-items: center;
  grid-template-columns: 1fr auto 1fr; gap: clamp(16px, 3vw, 56px);
}
.tv-player { display: flex; flex-direction: column; align-items: center; gap: clamp(10px, 2vh, 26px); min-width: 0; }
.tv-name {
  font-size: clamp(18px, 2.4vw, 40px); font-weight: 700; letter-spacing: 0.5px; color: var(--bz-bone);
  text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
}
.tv-score {
  width: 100%; max-width: clamp(220px, 26vw, 460px); display: grid; place-items: center;
  background: var(--bz-bone); color: var(--bz-ink-950); border-radius: clamp(14px, 1.6vw, 26px);
  font-family: var(--bz-mono); font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1;
  font-size: clamp(90px, 15vw, 240px); padding: clamp(8px, 1.6vh, 26px) clamp(10px, 2vw, 34px);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.45);
  transition: background 200ms ease, color 200ms ease, box-shadow 200ms ease;
}
/* [hidden] must beat the display:grid above (snooker/darts/frames variants). */
.tv-score[hidden] { display: none; }
.tv-player.active .tv-name { color: var(--bz-signal-light); }
.tv-player.active .tv-score {
  background: var(--bz-signal); color: #fff;
  box-shadow: 0 0 0 3px rgba(230, 57, 70, 0.35), 0 18px 50px rgba(230, 57, 70, 0.4);
}
.tv-darts-stats[hidden] { display: none; }
.tv-darts-stats {
  display: flex; gap: clamp(16px, 2vw, 34px); justify-content: center;
  font-family: var(--bz-mono); font-size: clamp(13px, 1.4vw, 22px);
  text-transform: uppercase; letter-spacing: 1px; color: var(--bz-bone-dim);
}
.tv-darts-stats strong { color: var(--bz-bone); margin-left: 6px; }

/* Centre column — frame/leg score, format, break */
.tv-center {
  display: flex; flex-direction: column; align-items: center; gap: clamp(2px, 0.6vh, 8px);
  text-align: center; min-width: clamp(120px, 14vw, 220px);
}
.tv-c-label {
  font-family: var(--bz-mono); font-size: clamp(11px, 1.2vw, 18px);
  text-transform: uppercase; letter-spacing: 3px; color: var(--bz-bone-dim);
}
.tv-c-frames[hidden] { display: none; }
.tv-c-sets[hidden] { display: none; }
.tv-c-sets { display: flex; flex-direction: column; align-items: center; margin-bottom: clamp(6px, 1.2vh, 16px); }
.tv-c-sets .tv-c-frames { color: var(--bz-signal-light); }
.tv-c-frames {
  display: flex; align-items: baseline; gap: clamp(6px, 0.8vw, 14px);
  font-family: var(--bz-mono); font-weight: 700; font-variant-numeric: tabular-nums;
  font-size: clamp(34px, 5vw, 84px); color: var(--bz-bone); line-height: 1;
}
.tv-c-frames i { color: var(--bz-bone-dim); font-style: normal; font-weight: 400; }
.tv-c-format { font-family: var(--bz-mono); font-size: clamp(11px, 1.1vw, 16px); color: var(--bz-bone-dim); letter-spacing: 1px; }
.tv-c-format [hidden] { display: none; }
.tv-c-format strong { color: var(--bz-bone); }
.tv-c-break[hidden] { display: none; }
.tv-c-break { margin-top: clamp(8px, 1.4vh, 20px); }
.tv-c-breakval {
  font-family: var(--bz-mono); font-weight: 700; font-variant-numeric: tabular-nums;
  font-size: clamp(28px, 3.4vw, 56px); color: var(--bz-signal-light); line-height: 1;
}

/* Snooker ball row */
.tv-balls[hidden] { display: none; }
.tv-balls {
  display: flex; justify-content: center; align-items: flex-start;
  gap: clamp(10px, 1.6vw, 28px); padding: clamp(10px, 2vh, 26px) 0 clamp(4px, 1vh, 12px);
}
.tv-ball { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.tv-ball::before {
  content: ""; width: clamp(20px, 2.4vw, 40px); height: clamp(20px, 2.4vw, 40px); border-radius: 999px;
  box-shadow: inset 0 -3px 5px rgba(0, 0, 0, 0.45), inset 0 3px 4px rgba(255, 255, 255, 0.25);
}
.tv-ball b {
  font-family: var(--bz-mono); font-weight: 700; font-variant-numeric: tabular-nums;
  font-size: clamp(13px, 1.3vw, 20px); color: var(--bz-bone-dim);
}
.tv-ball-red::before    { background: #dc2626; }
.tv-ball-yellow::before { background: #fbbf24; }
.tv-ball-green::before  { background: #16a34a; }
.tv-ball-brown::before  { background: #7c4a1e; }
.tv-ball-blue::before   { background: #2563eb; }
.tv-ball-pink::before   { background: #f472b6; }
.tv-ball-black::before  { background: #111827; box-shadow: inset 0 -3px 5px rgba(0, 0, 0, 0.6), inset 0 3px 4px rgba(255, 255, 255, 0.15), 0 0 0 1px var(--bz-ink-600); }

/* Footer — remaining points (snooker) */
.tv-foot[hidden] { display: none; }
.tv-foot {
  text-align: center; padding-top: clamp(8px, 1.4vh, 18px); border-top: 1px solid var(--bz-ink-700);
  font-family: var(--bz-mono); font-size: clamp(12px, 1.3vw, 20px);
  text-transform: uppercase; letter-spacing: 2px; color: var(--bz-bone-dim);
}
.tv-foot strong { color: var(--bz-bone); margin-left: 8px; }

/* Portrait / phone fallback: stack the sides, drop the centre to the bottom */
@media (orientation: portrait) and (max-width: 900px) {
  .tv-body { grid-template-columns: 1fr; grid-auto-rows: auto; gap: 18px; }
  .tv-center { order: 3; }
  .tv-score { font-size: clamp(80px, 30vw, 200px); }
}

/* --- Legacy table-view rules (inert; markup now uses .tv-*) --- */
body.table-view-legacy-unused {
  margin: 0;
  padding: 0;
  background: #000;
  color: #fff;
  height: 100vh;
  overflow: hidden;
  font-family: "Arial Narrow", Arial, sans-serif;
  display: flex;
  flex-direction: column;
}

.table-board {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  background: #222;  /* thin divider between the two sides */
  min-height: 0;
}

.table-side {
  background: #000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2vh 4vw;
  position: relative;
  transition: background 200ms ease, box-shadow 200ms ease;
  min-width: 0;
  overflow: hidden;
}

/* Active player glows gold — visible from across the room. */
.table-side.active {
  background: #0a0a0a;
  box-shadow: inset 0 0 0 6px #c9a227;
  animation: table-pulse 2s ease-in-out infinite;
}
.table-side.active .table-name { color: #c9a227; }
@keyframes table-pulse {
  0%, 100% { box-shadow: inset 0 0 0 6px #c9a227, inset 0 0 30px rgba(201, 162, 39, 0.15); }
  50%      { box-shadow: inset 0 0 0 6px #c9a227, inset 0 0 60px rgba(201, 162, 39, 0.35); }
}

.table-name {
  font-size: clamp(24px, 4vw, 72px);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: #cbd5e1;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  transition: color 200ms ease;
}

.table-score {
  font-size: clamp(160px, 30vw, 560px);
  font-weight: 900;
  line-height: 0.85;
  font-variant-numeric: tabular-nums;
  color: #fff;
  letter-spacing: -0.05em;
  margin: 2vh 0;
}

.table-frames {
  font-size: clamp(18px, 2.4vw, 42px);
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 2px;
}
.table-frames strong {
  color: #fff;
  font-weight: 800;
  margin-left: 10px;
  font-size: 1.4em;
  font-variant-numeric: tabular-nums;
}

/* Darts variant — remaining score replaces snooker total; smaller darts stats below. */
.table-score-darts { color: #fff; }
/* display:flex below would otherwise override the [hidden] attribute, leaving
   the darts Avg/Last stats visible for snooker & pool. Force hidden to win. */
.table-darts-stats[hidden] { display: none; }
.table-darts-stats {
  display: flex;
  gap: 24px;
  justify-content: center;
  font-size: clamp(14px, 1.6vw, 28px);
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-top: 10px;
}
.table-darts-stats strong {
  color: #fff;
  font-weight: 800;
  margin-left: 6px;
  font-variant-numeric: tabular-nums;
}

/* ===========================================================================
   Shot-stats bar — full-width strip under the score bar on the OBS overlay.
   Shows only the active player, centred. Snooker only; slides down when the
   scorer enables "Shot stats".
   =========================================================================== */
.stats-bar {
  position: fixed;
  top: 72px;          /* league strip (28) + tv-bar (44) — sits directly under the score bar */
  left: 0;
  width: 100%;
  display: flex;
  z-index: 2;         /* above the break/ahead bars, below the tv-bar (3) */
  font-family: Arial, sans-serif;
  /* Hidden state — slides up behind the tv-bar, mirroring the break bar. */
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
  transition: transform 280ms ease, opacity 280ms ease;
}
.stats-bar.visible { transform: translateY(0); opacity: 1; pointer-events: auto; }
/* Only the active player's side is shown — it fills the full width. */
.stats-bar-side[hidden] { display: none; }
.stats-bar-side {
  flex: 1 1 0;
  display: flex;
  align-items: center;
  justify-content: center;   /* centre the active player's name + stats */
  gap: clamp(10px, 1.6vw, 26px);
  height: 40px;
  padding: 0 clamp(14px, 2vw, 34px);
  background: linear-gradient(180deg, #1d2433 0%, #11151f 100%);
  border: 2px solid #000;
  border-top: 0;            /* share the tv-bar's bottom edge */
  color: #fff;
  overflow: hidden;
}
.stats-bar-left { border-right: 2px solid #000; }
.stats-bar-right { flex-direction: row-reverse; }
.stats-bar-name {
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  white-space: nowrap;
  font-size: clamp(13px, 1.5vw, 20px);
}
.stats-bar-metrics {
  display: flex;
  gap: clamp(10px, 1.6vw, 26px);
}
.sb-metric {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  white-space: nowrap;
}
.sb-k {
  font-size: clamp(9px, 1vw, 12px);
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #93a1b5;
}
.sb-v {
  font-weight: 800;
  font-size: clamp(13px, 1.5vw, 20px);
  font-variant-numeric: tabular-nums;
}
/* Scoreline-themed snooker: tint the bar with the brand red top border. */
.scoreboard[data-sport="snooker"][data-theme="scoreline"] .stats-bar-side {
  background: linear-gradient(180deg, #141b2d 0%, #0b1020 100%);
  border-top-color: #e63946;
}

/* ===========================================================================
   Scorer shot-stats panel — read-out grid (metric labels + the two players).
   =========================================================================== */
.stats-grid {
  display: grid;
  grid-template-columns: auto 1fr 1fr;
  gap: 6px 14px;
}
.stats-col { display: flex; flex-direction: column; gap: 6px; }
.stats-col .stats-label,
.stats-col .stats-metric,
.stats-col .stats-value {
  display: flex;
  align-items: center;
  min-height: 30px;
}
.stats-head .stats-metric { justify-content: flex-end; }
.stats-col[data-stats-col] { text-align: center; }
.stats-col[data-stats-col] .stats-label,
.stats-col[data-stats-col] .stats-value { justify-content: center; }
body.scorer .stats-metric { color: var(--bz-bone-dim); font-weight: 600; }
body.scorer .stats-label { color: var(--bz-bone); font-weight: 800; }
body.scorer .stats-value {
  color: var(--bz-bone);
  font-family: var(--bz-mono);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
body.scorer .stats-col[data-stats-col] {
  background: var(--bz-ink-900);
  border: 1px solid var(--bz-ink-700);
  border-radius: 10px;
  padding: 8px 10px;
}

/* Pool: Frames are the headline number — scale them up to fill the space the
 * snooker score would normally occupy. */
.table-view[data-sport="pool"] .table-frames {
  font-size: clamp(40px, 6vw, 96px);
  margin: 2vh 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}
.table-view[data-sport="pool"] .table-frames strong {
  margin-left: 0;
  font-size: clamp(160px, 30vw, 560px);
  font-weight: 900;
  line-height: 0.85;
  letter-spacing: -0.05em;
  color: #fff;
}

.table-footer {
  background: #111;
  padding: 1.5vh 4vw;
  display: flex;
  justify-content: center;
  gap: 4vw;
  flex-wrap: wrap;
  font-size: clamp(14px, 1.6vw, 28px);
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 2px;
  border-top: 1px solid #222;
}
.table-footer strong {
  color: #fff;
  font-weight: 800;
  margin-left: 10px;
  font-variant-numeric: tabular-nums;
}
.table-footer [hidden] { display: none; }

/* League / match-label header on table view — big, gold, prominent */
.table-header {
  background: #0a0a0a;
  padding: 2vh 4vw 1.5vh;
  text-align: center;
  border-bottom: 2px solid #c9a227;
}
.table-header[hidden] { display: none; }
.table-league {
  font-size: clamp(20px, 2.6vw, 44px);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 4px;
  color: #c9a227;
}
.table-league:empty { display: none; }
.table-match-label {
  font-size: clamp(14px, 1.6vw, 26px);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: #cbd5e1;
  margin-top: 0.6vh;
}
.table-match-label:empty { display: none; }

/* Portrait / phone fallback: stack the two sides vertically */
@media (orientation: portrait) and (max-width: 900px) {
  .table-board { grid-template-columns: 1fr; grid-template-rows: 1fr 1fr; }
  .table-score { font-size: clamp(120px, 40vw, 300px); }
}

/* ===================================================================
   Scoreboard — TV snooker lower-third, OBS overlay
   =================================================================== */
body.scoreboard {
  background: transparent;
  overflow: hidden;
  height: 100vh;
  font-family: Arial, sans-serif;
}
body.scoreboard.bg-dark {
  background: #111;
}

body.scoreboard .tv-bar[hidden] { display: none; }
body.scoreboard .tv-bar {  /* scoped: the table-view header is also a .tv-bar */
  position: fixed;
  top: 28px;    /* leaves room for the league strip above */
  left: 0;
  display: flex;
  width: 100%;
  height: 44px;                  /* 40 content + 2×2 border */
  border: 2px solid #000;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
  z-index: 3;  /* sits above the break/ahead bars so they slide out from behind */
}
/* The table-view header reuses the bare `.tv-bar` selector with a flex gap +
   space-between + bottom padding + align-items:center. Scope those OUT of the
   broadcast lower-third, which must be solid full-height blocks flush against
   each other (no gaps, no white slivers above/below the name blocks). */
body.scoreboard .tv-bar {
  gap: 0;
  justify-content: flex-start;
  padding-bottom: 0;
  align-items: stretch;
}
/* Black dividers between the inner cells. */
.tv-bar .player:not(.right),
.tv-bar .score-box,
.tv-bar .frames {
  border-right: 2px solid #000;
}

/* League strip sits above the tv-bar. Hidden when no league + no label. */
.league-strip {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 28px;
  background: #000;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: Arial, sans-serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 0 16px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border: 2px solid #000;
}
.league-strip[hidden] { display: none; }
.league-strip .league-sep { color: #c9a227; font-weight: 400; }

/* Name blocks — gold */
.tv-bar .player {
  flex: 1;
  background: #c9a227;
  color: #000;
  display: flex;
  align-items: center;
  padding: 0 14px;
  font-weight: bold;
  font-size: 17px;
  text-transform: uppercase;
  gap: 8px;
  white-space: nowrap;
  overflow: hidden;
}
/* Extra padding on the OUTSIDE edge (away from the scoring area) so the
   names aren't flush against the edge of the screen / stream frame. */
.tv-bar .player:not(.right) { padding-left: 28px; }
.tv-bar .player.right { justify-content: flex-end; padding-right: 28px; }

.tv-bar .arrow { font-size: 18px; color: #000; text-shadow: none; }
.tv-bar .arrow:empty { display: none; }
/* Push arrows to the inside edge of each gold block, next to the scoring area. */
.tv-bar .player:not(.right) .arrow { margin-left: auto; }
.tv-bar .player.right .arrow { margin-right: auto; }

.tv-bar .hcap {
  font-size: 13px;
  font-weight: 700;
  opacity: 0.7;
}
.tv-bar .hcap:empty { display: none; }

/* Center block — holds the two score-boxes and the frames display */
.tv-bar .center {
  display: flex;
  align-items: center;
  background: #ddd;
}

/* Current-score boxes — light grey, black text */
.tv-bar .score-box {
  width: 70px;
  text-align: center;
  font-size: 20px;
  font-weight: bold;
  background: #e5e5e5;
  color: #000;
  padding: 0;
  line-height: 40px;
  font-variant-numeric: tabular-nums;
}

/* Center frames block — teal (World Snooker style), shows "P1frames (bestOf) P2frames" */
.tv-bar .frames {
  min-width: 90px;
  text-align: center;
  background: #0e6e5a;
  color: #fff;
  font-weight: bold;
  font-size: 18px;
  padding: 0 14px;
  line-height: 40px;
  font-variant-numeric: tabular-nums;
}
.tv-bar .frames .target {
  margin: 0 8px;
  color: #9fd9cb;
  font-weight: 600;
}
.tv-bar .frames .target:empty { display: none; }

/* =================================================================== */
/* Pool lower-third — Brownz Media brand (deep navy + accent red).      */
/* Bigger, bolder, with stacked "Race to N" in the centre.              */
/* =================================================================== */
.pool-bar {
  position: fixed;
  top: 28px;             /* sits below the league strip */
  left: 0;
  width: 100%;
  height: 96px;
  display: flex;
  /* Colours come from the match's board colours (scoreboard.js sets the
     --sb-* custom properties); the fallbacks are the standard look. */
  background: var(--sb-board, #0E1A2B);   /* deep navy — Brownz Media base */
  color: var(--sb-names, #fff);
  font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif;
  border: 2px solid #000;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.55);
  z-index: 3;
  overflow: hidden;
}
.pool-bar[hidden] { display: none; }

/* Subtle red + yellow stripe along the bottom edge — a quiet nod to UK 8-ball
 * ball colours without painting whole panels in them. */
.pool-bar::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: linear-gradient(
    to right,
    #E63946 0%, #E63946 48%,
    #FFD400 52%, #FFD400 100%
  );
  pointer-events: none;
}

/* Player name panels — flex to fill the outer ends */
.pool-player {
  flex: 1 1 0;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 36px;
  font-size: calc(32px * var(--sb-text-scale, 1));
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  background: var(--sb-board, #0E1A2B);
  transition: background 180ms ease, box-shadow 180ms ease;
}
.pool-player-right { justify-content: flex-end; }
.pool-name {
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

/* Active-player accent — brightens the panel and adds a red top-edge glow */
.pool-player.is-active {
  background: var(--sb-board-active, #1F2F4A);
  box-shadow: inset 0 4px 0 0 var(--sb-accent, #E63946);
}
.pool-player.is-active .pool-name {
  color: var(--sb-names, #fff);
  text-shadow: 0 0 18px var(--sb-accent-glow, rgba(230, 57, 70, 0.55));
}

.pool-arrow {
  color: var(--sb-accent, #E63946);
  font-size: 26px;
  text-shadow: 0 0 10px var(--sb-accent-glow, rgba(230, 57, 70, 0.7));
  flex-shrink: 0;
}
.pool-arrow:empty { display: none; }

/* Optional handicap figure beside the name (scorer toggle). */
.pool-hcp {
  flex-shrink: 0;
  padding: 2px 10px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.12);
  color: #FFD400;
  font-size: 0.6em;
  letter-spacing: 1px;
}
.pool-hcp[hidden] { display: none; }
.pool-player-left .pool-arrow { margin-left: auto; }
.pool-player-right .pool-arrow { margin-right: auto; }

/* Frame numbers — huge, dominant, centre-flanking */
.pool-frame {
  flex: 0 0 130px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: calc(64px * var(--sb-num-scale, 1));
  font-weight: 900;
  color: var(--sb-numbers, #fff);
  background: var(--sb-scores, #162338);   /* one shade lighter than the player panels */
  font-variant-numeric: tabular-nums;
  letter-spacing: -1px;
  border-left: 1px solid #000;
  border-right: 1px solid #000;
}

/* Centre "RACE TO N" panel — accent-red, label stacked above the number */
.pool-target {
  flex: 0 0 150px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--sb-accent, #E63946);   /* Brownz Media accent red */
  color: var(--sb-accent-text, #fff);
  padding: 6px 0;
  border-left: 1px solid #000;
  border-right: 1px solid #000;
}
.pool-target-label {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: inherit;
  opacity: 0.9;
  line-height: 1;
  margin-bottom: 4px;
}
.pool-target-value {
  font-size: calc(44px * var(--sb-num-scale, 1));
  font-weight: 900;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
/* Pool match clock: the centre panel shows the time left instead of the race. */
.pool-target .pool-race, .pool-target .pool-clock { display: contents; }
.pool-target .pool-clock[hidden], .pool-target.clock-on .pool-race { display: none; }
.pool-target.clock-on .pool-target-value { font-size: calc(36px * var(--sb-num-scale, 1)); }
.pool-target.clock-on .pool-target-value.is-long { font-size: calc(28px * var(--sb-num-scale, 1)); }
.pool-target.clock-expired { animation: pm-clock-blink 0.8s steps(2, start) infinite; }
/* Sets match: set score in the centre, the race in each set underneath. */
.pool-target-sub {
  font-size: 11px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase;
  opacity: 0.9; line-height: 1; margin-top: 4px;
}
.pool-target-sub[hidden] { display: none; }
.pool-target.has-sets .pool-target-label { letter-spacing: 2px; }
.pool-target.has-sets .pool-target-value { font-size: calc(36px * var(--sb-num-scale, 1)); }

/* The pool-bar replaces the tv-bar — push the league strip's neighbours down. */
.scoreboard[data-sport="pool"] .league-strip {
  background: var(--sb-board, #0E1A2B);    /* match the pool-bar base, no harsh black gap */
  border-color: var(--sb-board, #0E1A2B);
  color: var(--sb-names, #fff);
}
.scoreboard[data-sport="pool"] .league-strip .league-sep {
  color: var(--sb-accent, #E63946);
}
/* Custom board colours: the red/yellow stripe becomes the accent colour. */
.scoreboard.custom-colors .pool-bar::after { background: var(--sb-accent); }
.scoreboard.light-board .pool-bar .cue-ball-marker { box-shadow: 0 0 0 1.5px rgba(0, 0, 0, 0.55); }

/* Responsive squeeze for narrower OBS scenes (e.g. 1280px composing) */
@media (max-width: 1400px) {
  .pool-bar { height: 88px; }
  .pool-player { font-size: calc(26px * var(--sb-text-scale, 1)); padding: 0 24px; }
  .pool-frame { flex-basis: 110px; font-size: calc(56px * var(--sb-num-scale, 1)); }
  .pool-target { flex-basis: 130px; }
  .pool-target-value { font-size: calc(38px * var(--sb-num-scale, 1)); }
}
@media (max-width: 1100px) {
  .pool-bar { height: 80px; }
  .pool-player { font-size: calc(22px * var(--sb-text-scale, 1)); padding: 0 18px; letter-spacing: 1px; }
  .pool-frame { flex-basis: 90px; font-size: calc(48px * var(--sb-num-scale, 1)); }
  .pool-target { flex-basis: 110px; }
  .pool-target-label { font-size: 11px; letter-spacing: 3px; }
  .pool-target-value { font-size: calc(32px * var(--sb-num-scale, 1)); }
}

/* Text style (pool scorer → Board text). Size comes in through --sb-text-scale
   / --sb-num-scale; the font and capitals are body attributes. Each font is
   loaded on demand by scoreboard.js. */
.scoreboard[data-board-font="condensed"] :is(.pool-bar, .pool-stats-bar, .league-strip) { font-family: 'Oswald', 'Arial Narrow', sans-serif; }
.scoreboard[data-board-font="block"] :is(.pool-bar, .pool-stats-bar, .league-strip) { font-family: 'Bebas Neue', 'Arial Narrow', sans-serif; }
.scoreboard[data-board-font="rounded"] :is(.pool-bar, .pool-stats-bar, .league-strip) { font-family: 'Nunito', 'Arial Rounded MT Bold', sans-serif; }
.scoreboard[data-board-font="slab"] :is(.pool-bar, .pool-stats-bar, .league-strip) { font-family: 'Roboto Slab', Rockwell, serif; }
/* Bebas Neue only comes in one weight — don't let the browser fake bold. */
.scoreboard[data-board-font="block"] .pool-bar * { font-weight: 400; }
.scoreboard.names-as-typed .pool-player { text-transform: none; letter-spacing: 0.5px; }

/* Ball colours — which group each player is on (UK 8-ball reds/yellows, or
   spots/stripes). Shown by the name; open table hides them. */
.pool-ball {
  flex-shrink: 0;
  display: inline-block;
  width: 0.8em;
  height: 0.8em;
  border-radius: 50%;
  box-shadow: inset -0.08em -0.1em 0.18em rgba(0, 0, 0, 0.45), 0 0 0 1.5px rgba(0, 0, 0, 0.5);
  vertical-align: middle;
}
.pool-ball[hidden] { display: none; }
/* The ball's colour comes in as --ball-c (set by JS from the match's ball
   colours); data-ball picks the look — solid, spot or stripe. */
.pool-ball[data-ball="red"], .pool-ball[data-ball="yellow"] {
  background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.6) 0%, rgba(255, 255, 255, 0) 45%),
              var(--ball-c, #e0141e);
}
.pool-ball[data-ball="spots"] {
  background: radial-gradient(circle at 50% 50%, #fff 0 26%, transparent 28%),
              radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.45) 0%, rgba(255, 255, 255, 0) 45%),
              var(--ball-c, #1d3fc4);
}
.pool-ball[data-ball="stripes"] {
  background: radial-gradient(circle at 50% 50%, #fff 0 18%, transparent 20%),
              linear-gradient(180deg, #f1f1f1 0 26%, var(--ball-c, #e8a317) 26% 74%, #f1f1f1 74%);
}
/* Once groups are picked, the stripe along the bottom of the bar shows them:
   player 1's colour under the left half, player 2's under the right. */
.scoreboard.balls-picked .pool-bar::after {
  background: linear-gradient(to right, var(--ball-left) 0 50%, var(--ball-right) 50% 100%);
  height: 5px;
}

/* =================================================================== */
/* Darts score box — compact corner graphic in the style of TV darts:  */
/* a row per player (throw marker, name, avg, legs, remaining), a      */
/* format header and a checkout line. Brownz navy + red/yellow.        */
/* =================================================================== */
.darts-box {
  position: fixed;
  top: 40px;
  left: 40px;
  width: 470px;
  font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif;
  color: #fff;
  filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.55));
  z-index: 3;
  transform-origin: top left;
}
.darts-box[hidden] { display: none; }
.scoreboard[data-darts-pos="tr"] .darts-box { left: auto; right: 40px; transform-origin: top right; }
.scoreboard[data-darts-pos="bl"] .darts-box { top: auto; bottom: 40px; transform-origin: bottom left; }
.scoreboard[data-darts-pos="br"] .darts-box { top: auto; left: auto; bottom: 40px; right: 40px; transform-origin: bottom right; }

.darts-box-title {
  width: fit-content;
  max-width: 100%;
  height: 24px;
  line-height: 24px;
  padding: 0 12px;
  background: #E63946;
  border-radius: 4px 4px 0 0;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.darts-box-title[hidden] { display: none; }
.darts-box-title:not([hidden]) + .darts-box-head { border-top-left-radius: 0; }
.scoreboard[data-darts-pos="tr"] .darts-box-title,
.scoreboard[data-darts-pos="br"] .darts-box-title { margin-left: auto; }
.scoreboard[data-darts-pos="tr"] .darts-box-title:not([hidden]) + .darts-box-head,
.scoreboard[data-darts-pos="br"] .darts-box-title:not([hidden]) + .darts-box-head { border-top-left-radius: 4px; border-top-right-radius: 0; }

.darts-box-head,
.darts-row {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) 58px 52px 92px;
  align-items: stretch;
}
/* Sets match: an extra Sets column before Legs. */
.darts-box.has-sets { width: 522px; }
.darts-box.has-sets .darts-box-head,
.darts-box.has-sets .darts-row { grid-template-columns: 22px minmax(0, 1fr) 58px 52px 52px 92px; }
.darts-box:not(.has-sets) .darts-box-sets { display: none; }
.darts-box-head {
  height: 24px;
  background: #000;
  border-radius: 4px 4px 0 0;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
  box-shadow: inset 0 -2px 0 #E63946;
}
.darts-box-format {
  grid-column: 1 / 3;
  align-self: center;
  padding-left: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #fff;
}
.darts-box-col { align-self: center; text-align: center; }

.darts-row {
  position: relative;
  height: 46px;
  background: #0E1A2B;
  border-top: 1px solid #000;
  transition: background 180ms ease;
}
.darts-row + .darts-row { border-radius: 0 0 4px 4px; }
.darts-box.has-checkout .darts-row + .darts-row { border-radius: 0; }
.darts-row.is-active { background: #1F2F4A; }
.darts-row-throw {
  align-self: center;
  justify-self: center;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: transparent;
  transition: background 180ms ease, box-shadow 180ms ease;
}
.darts-row.is-active .darts-row-throw {
  background: #E63946;
  box-shadow: 0 0 8px rgba(230, 57, 70, 0.9);
}
.darts-row-name {
  align-self: center;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: 8px;
}
.darts-row-avg,
.darts-row-sets,
.darts-row-legs,
.darts-row-score {
  display: flex;
  align-items: center;
  justify-content: center;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.darts-row-avg {
  font-size: 15px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.7);
}
.darts-row-sets,
.darts-row-legs {
  font-size: 26px;
  font-weight: 900;
  background: #162338;
  border-left: 1px solid #000;
}
.darts-row-sets { background: #E63946; }
.darts-row-score {
  font-size: 34px;
  font-weight: 900;
  letter-spacing: -0.5px;
  background: #24385A;
  border-left: 1px solid #000;
  transition: background 180ms ease, color 180ms ease;
}
.darts-row.is-active .darts-row-score { background: #FFD400; color: #0E1A2B; }

/* Last visit — pops out beside the score for a few seconds. */
.darts-row-visit {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 100%;
  min-width: 64px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #E63946;
  border-radius: 0 4px 4px 0;
  font-size: 22px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  opacity: 0;
  transform: translateX(-12px);
  transition: opacity 200ms ease, transform 260ms cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
  z-index: -1;
}
.darts-row-visit.visible { opacity: 1; transform: translateX(0); }
.darts-row-visit.is-bust { background: #3a4458; color: #ffb4b4; font-size: 16px; letter-spacing: 2px; }
.darts-row-visit.is-max { background: #FFD400; color: #0E1A2B; }
.scoreboard[data-darts-pos="tr"] .darts-row-visit,
.scoreboard[data-darts-pos="br"] .darts-row-visit {
  left: auto;
  right: 100%;
  border-radius: 4px 0 0 4px;
  transform: translateX(12px);
}
.scoreboard[data-darts-pos="tr"] .darts-row-visit.visible,
.scoreboard[data-darts-pos="br"] .darts-row-visit.visible { transform: translateX(0); }

/* Checkout route for the player to throw (2–170, not the bogey numbers). */
.darts-box-checkout {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 30px;
  padding: 0 12px;
  background: #E63946;
  border-top: 1px solid #000;
  border-radius: 0 0 4px 4px;
}
.darts-box-checkout[hidden] { display: none; }
.darts-box-checkout-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85);
}
.darts-box-checkout-route {
  margin-left: auto;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 1px;
  white-space: pre;
}

/* Leg / set / match banners dock as a strip just under the score box (or
   just over it when the box sits at the bottom). */
.darts-box .winner-banner,
.darts-box .match-winner-banner {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: 100%;
  border: 0;
  border-radius: 4px;
  transform: translateY(-8px);
}
.scoreboard[data-darts-pos="bl"] .darts-box :is(.winner-banner, .match-winner-banner),
.scoreboard[data-darts-pos="br"] .darts-box :is(.winner-banner, .match-winner-banner) {
  top: auto;
  bottom: calc(100% + 6px);
  transform: translateY(8px);
}
.darts-box :is(.winner-banner, .match-winner-banner).visible { transform: translateY(0); }
.darts-box .winner-banner { height: 36px; }
.darts-box .winner-banner-inner { font-size: 18px; line-height: 36px; letter-spacing: 2px; }
.darts-box .match-winner-banner { height: 46px; }
.darts-box .match-winner-inner { font-size: 22px; line-height: 46px; letter-spacing: 3px; }

/* Narrower OBS canvases (1280×720 etc.) — shrink the whole box. */
@media (max-width: 1400px) { .darts-box { transform: scale(0.8); } }
@media (max-width: 1100px) { .darts-box { transform: scale(0.7); } }

/* =================================================================== */
/* Snooker overlay themes. BBC Style is the base palette above; every   */
/* other theme is a set of --st-* variables read by the rules below.    */
/* Scoreline (navy + red) is the free default; the rest are Club Pro.   */
/* 'custom' takes the match's boardColors (--sb-*, set in scoreboard.js).*/
/* Pool and darts have their own bars, so none of this touches them.    */
/* =================================================================== */
.scoreboard[data-sport="snooker"] {
  --st-bar: #0E1A2B; --st-text: #fff; --st-score: #162338; --st-num: #fff;
  --st-accent: #E63946; --st-accent-text: #fff; --st-deep: #0a1422; --st-border: #000;
  --st-glow: rgba(230, 57, 70, 0.6);
}
/* Continental: white bar, ink text, bright blue frames cell, italic names. */
.scoreboard[data-sport="snooker"][data-theme="continental"] {
  --st-bar: #ffffff; --st-text: #0b1d3a; --st-score: #e9eef6; --st-num: #0b1d3a;
  --st-accent: #0050d8; --st-accent-text: #fff; --st-deep: #dfe6f1; --st-border: #b9c4d6;
  --st-glow: transparent;
}
.scoreboard[data-sport="snooker"][data-theme="continental"] .tv-bar .player,
.scoreboard[data-sport="snooker"][data-theme="continental"] .tv-bar .frames { font-style: italic; }
/* Arena: black and gold, wide-spaced names. */
.scoreboard[data-sport="snooker"][data-theme="arena"] {
  --st-bar: #0b0b0b; --st-text: #f3ead3; --st-score: #1c1c1c; --st-num: #f3ead3;
  --st-accent: #c9a227; --st-accent-text: #0b0b0b; --st-deep: #000; --st-border: #000;
  --st-glow: rgba(201, 162, 39, 0.55);
}
.scoreboard[data-sport="snooker"][data-theme="arena"] .tv-bar .player { letter-spacing: 2px; }
/* Baize: club green and cream. */
.scoreboard[data-sport="snooker"][data-theme="baize"] {
  --st-bar: #0f3d2e; --st-text: #f4ecd8; --st-score: #14513c; --st-num: #fff;
  --st-accent: #f4ecd8; --st-accent-text: #0f3d2e; --st-deep: #0a2b20; --st-border: #06261c;
  --st-glow: rgba(244, 236, 216, 0.4);
}
/* Neon: deep purple with a teal glow, for streams. */
.scoreboard[data-sport="snooker"][data-theme="neon"] {
  --st-bar: #110b24; --st-text: #fff; --st-score: #1d1540; --st-num: #fff;
  --st-accent: #00e5c7; --st-accent-text: #110b24; --st-deep: #0a0618; --st-border: #000;
  --st-glow: rgba(0, 229, 199, 0.7);
}
/* Custom: the club's own colours; Scoreline fills any that aren't set. */
.scoreboard[data-sport="snooker"][data-theme="custom"] {
  --st-bar: var(--sb-board, #0E1A2B); --st-text: var(--sb-names, #fff);
  --st-score: var(--sb-scores, #162338); --st-num: var(--sb-numbers, #fff);
  --st-accent: var(--sb-accent, #E63946); --st-accent-text: var(--sb-accent-text, #fff);
  --st-deep: var(--sb-board, #0a1422); --st-glow: var(--sb-accent-glow, rgba(230, 57, 70, 0.6));
}

.scoreboard[data-sport="snooker"]:not([data-theme="bbc"]) .league-strip {
  background: var(--st-bar);
  color: var(--st-text);
  border-color: var(--st-bar);
}
.scoreboard[data-sport="snooker"]:not([data-theme="bbc"]) .league-strip .league-sep { color: var(--st-accent); }
.scoreboard[data-sport="snooker"]:not([data-theme="bbc"]) .tv-bar { border-color: var(--st-border); }
.scoreboard[data-sport="snooker"]:not([data-theme="bbc"]) .tv-bar .player:not(.right),
.scoreboard[data-sport="snooker"]:not([data-theme="bbc"]) .tv-bar .score-box,
.scoreboard[data-sport="snooker"]:not([data-theme="bbc"]) .tv-bar .frames { border-right-color: var(--st-border); }
.scoreboard[data-sport="snooker"]:not([data-theme="bbc"]) .tv-bar .player { background: var(--st-bar); color: var(--st-text); }
.scoreboard[data-sport="snooker"]:not([data-theme="bbc"]) .tv-bar .arrow { color: var(--st-accent); text-shadow: 0 0 8px var(--st-glow); }
.scoreboard[data-sport="snooker"]:not([data-theme="bbc"]) .tv-bar .center { background: var(--st-bar); }
.scoreboard[data-sport="snooker"]:not([data-theme="bbc"]) .tv-bar .score-box { background: var(--st-score); color: var(--st-num); }
.scoreboard[data-sport="snooker"]:not([data-theme="bbc"]) .tv-bar .frames { background: var(--st-accent); color: var(--st-accent-text); }
.scoreboard[data-sport="snooker"]:not([data-theme="bbc"]) .tv-bar .frames .target { color: inherit; opacity: 0.8; }

/* Break bar + ahead tracker follow the theme so the whole broadcast matches. */
.scoreboard[data-sport="snooker"]:not([data-theme="bbc"]) .break-bar,
.scoreboard[data-sport="snooker"]:not([data-theme="bbc"]) .ahead-tracker {
  background: var(--st-bar);
  border-color: var(--st-border);
}
.scoreboard[data-sport="snooker"]:not([data-theme="bbc"]) .break-balls { background: var(--st-deep); }
.scoreboard[data-sport="snooker"]:not([data-theme="bbc"]) .break-stat .stat-value,
.scoreboard[data-sport="snooker"]:not([data-theme="bbc"]) .ahead-stat .stat-value { color: var(--st-text); }
.scoreboard[data-sport="snooker"]:not([data-theme="bbc"]) .break-stat .stat-label,
.scoreboard[data-sport="snooker"]:not([data-theme="bbc"]) .ahead-stat .stat-label { color: var(--st-text); opacity: 0.7; }

/* Floating glass bar for the themed overlays: inset from the screen edges,
   rounded, the bar colour see-through (the table shows behind it) while the
   score and frames cells stay solid. No hard borders or dividers. The
   translucent fill is a ::before layer so the text stays fully opaque. */
.scoreboard[data-sport="snooker"]:not([data-theme="bbc"]) { --st-inset: 24px; --st-glass: 0.82; }
.scoreboard[data-sport="snooker"]:not([data-theme="bbc"]) .tv-bar,
.scoreboard[data-sport="snooker"]:not([data-theme="bbc"]) .league-strip,
.scoreboard[data-sport="snooker"]:not([data-theme="bbc"]) .break-bar,
.scoreboard[data-sport="snooker"]:not([data-theme="bbc"]) .ahead-tracker {
  background: transparent;
  border: 0;
  box-shadow: none;
  isolation: isolate;
}
.scoreboard[data-sport="snooker"]:not([data-theme="bbc"]) .tv-bar::before,
.scoreboard[data-sport="snooker"]:not([data-theme="bbc"]) .league-strip::before,
.scoreboard[data-sport="snooker"]:not([data-theme="bbc"]) .break-bar::before,
.scoreboard[data-sport="snooker"]:not([data-theme="bbc"]) .ahead-tracker::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--st-bar);
  opacity: var(--st-glass);
  border-radius: inherit;
}
.scoreboard[data-sport="snooker"]:not([data-theme="bbc"]) .tv-bar {
  left: var(--st-inset);
  width: calc(100% - 2 * var(--st-inset));
  border-radius: 6px;
  overflow: hidden;
}
.scoreboard[data-sport="snooker"]:not([data-theme="bbc"]) .tv-bar .player,
.scoreboard[data-sport="snooker"]:not([data-theme="bbc"]) .tv-bar .center { background: transparent; }
.scoreboard[data-sport="snooker"]:not([data-theme="bbc"]) .tv-bar .player:not(.right),
.scoreboard[data-sport="snooker"]:not([data-theme="bbc"]) .tv-bar .score-box,
.scoreboard[data-sport="snooker"]:not([data-theme="bbc"]) .tv-bar .frames { border-right: 0; }
.scoreboard[data-sport="snooker"]:not([data-theme="bbc"]) .tv-bar .score-box,
.scoreboard[data-sport="snooker"]:not([data-theme="bbc"]) .tv-bar .frames { line-height: 44px; }
/* League / match label: a narrower tab sitting on top of the bar. */
.scoreboard[data-sport="snooker"]:not([data-theme="bbc"]) .league-strip {
  left: 25%;
  width: 50%;
  border-radius: 6px 6px 0 0;
}
/* Break bar and ahead tracker hang under the bar's ends. */
.scoreboard[data-sport="snooker"]:not([data-theme="bbc"]) .break-bar,
.scoreboard[data-sport="snooker"]:not([data-theme="bbc"]) .ahead-tracker.side-left { left: calc(var(--st-inset) + 6px); }
.scoreboard[data-sport="snooker"]:not([data-theme="bbc"]) .ahead-tracker.side-right { right: calc(var(--st-inset) + 6px); }
.scoreboard[data-sport="snooker"]:not([data-theme="bbc"]) .break-bar,
.scoreboard[data-sport="snooker"]:not([data-theme="bbc"]) .ahead-tracker { border-radius: 0 0 6px 6px; }
/* Shot stats: a centred glass tab under the bar (sized to its content) in the
   theme's colours, so the break bar (left) and ahead tracker (right) still show. */
.scoreboard[data-sport="snooker"]:not([data-theme="bbc"]) .stats-bar {
  left: 0;
  right: 0;
  width: fit-content;
  max-width: calc(100% - 2 * var(--st-inset) - 12px);
  margin: 0 auto;
  border-radius: 0 0 6px 6px;
  overflow: hidden;
  isolation: isolate;
}
.scoreboard[data-sport="snooker"]:not([data-theme="bbc"]) .stats-bar::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--st-bar);
  opacity: var(--st-glass);
}
.scoreboard[data-sport="snooker"]:not([data-theme="bbc"]) .stats-bar-side {
  flex: 0 0 auto;
  height: 38px;
  background: transparent;
  border: 0;
  color: var(--st-text);
}
.scoreboard[data-sport="snooker"]:not([data-theme="bbc"]) .stats-bar-name { font-size: clamp(12px, 1.2vw, 16px); }
.scoreboard[data-sport="snooker"]:not([data-theme="bbc"]) .stats-bar .sb-v { font-size: clamp(12px, 1.2vw, 17px); color: var(--st-text); }
.scoreboard[data-sport="snooker"]:not([data-theme="bbc"]) .stats-bar .sb-k { color: var(--st-text); opacity: 0.65; }

/* Numbers: the scoreline is the biggest thing on screen; the tabs underneath
   (break, ahead, shot stats) share one smaller size and label style. */
.scoreboard[data-sport="snooker"]:not([data-theme="bbc"]) .tv-bar .score-box { font-size: 24px; }
.scoreboard[data-sport="snooker"]:not([data-theme="bbc"]) .tv-bar .frames { font-size: 22px; }
/* No "best of" set: keep a gap so 0 and 0 don't read as "00". */
.scoreboard[data-sport="snooker"]:not([data-theme="bbc"]) .tv-bar .frames .target:empty { display: inline-block; width: 14px; margin: 0; }
.scoreboard[data-sport="snooker"]:not([data-theme="bbc"]) .break-stat .stat-value,
.scoreboard[data-sport="snooker"]:not([data-theme="bbc"]) .ahead-stat .stat-value,
.scoreboard[data-sport="snooker"]:not([data-theme="bbc"]) .stats-bar .sb-v { font-size: 18px; }
.scoreboard[data-sport="snooker"]:not([data-theme="bbc"]) .break-stat .stat-label,
.scoreboard[data-sport="snooker"]:not([data-theme="bbc"]) .ahead-stat .stat-label,
.scoreboard[data-sport="snooker"]:not([data-theme="bbc"]) .stats-bar .sb-k { font-size: 11px; letter-spacing: 1px; }

/* Edge pop: soft drop shadow plus a faint glow in the theme's accent outside,
   and a thin bright rim (brighter along the top) inside. */
.scoreboard[data-sport="snooker"]:not([data-theme="bbc"]) .tv-bar,
.scoreboard[data-sport="snooker"]:not([data-theme="bbc"]) .league-strip,
.scoreboard[data-sport="snooker"]:not([data-theme="bbc"]) .break-bar,
.scoreboard[data-sport="snooker"]:not([data-theme="bbc"]) .ahead-tracker,
.scoreboard[data-sport="snooker"]:not([data-theme="bbc"]) .stats-bar {
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45), 0 0 10px var(--st-glow);
}
.scoreboard[data-sport="snooker"]:not([data-theme="bbc"]) .tv-bar::after,
.scoreboard[data-sport="snooker"]:not([data-theme="bbc"]) .league-strip::after,
.scoreboard[data-sport="snooker"]:not([data-theme="bbc"]) .break-bar::after,
.scoreboard[data-sport="snooker"]:not([data-theme="bbc"]) .ahead-tracker::after,
.scoreboard[data-sport="snooker"]:not([data-theme="bbc"]) .stats-bar::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

/* =================================================================== */
/* Scoreline credit bug — small top-right pill, like a TV channel bug.  */
/* Always visible on Scoreline-themed snooker and on pool overlays      */
/* (which always use the Scoreline aesthetic). Hidden when the per-     */
/* match `showScorelineCredit` flag is set to false.                    */
/* =================================================================== */
.scoreline-bug {
  position: fixed;
  top: 5px;             /* sits inside the 28px league strip */
  right: 8px;
  z-index: 10;
  display: none;        /* hidden by default — sport/theme rules below opt in */
  align-items: center;
  gap: 5px;
  height: 18px;
  padding: 0 9px;
  background: rgba(14, 26, 43, 0.85);
  border: 1px solid rgba(230, 57, 70, 0.4);
  border-radius: 999px;
  font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  pointer-events: none;
}
.scoreline-bug-dot {
  display: inline-block;
  width: 5px;
  height: 5px;
  background: #E63946;
  border-radius: 50%;
  box-shadow: 0 0 5px rgba(230, 57, 70, 0.8);
}
/* Show on Scoreline-themed snooker, pool and darts */
.scoreboard[data-sport="snooker"][data-theme="scoreline"] .scoreline-bug,
.scoreboard[data-sport="pool"] .scoreline-bug,
.scoreboard[data-sport="darts"] .scoreline-bug {
  display: inline-flex;
}
/* Darts: docked to the score box — the right end of the match-label row, or
   the blank header cell over the scores when there's no label. Mirrored to
   the left when the box sits on the right (the label tab is right-aligned). */
.darts-box .scoreline-bug {
  position: absolute;
  top: 3px;
  right: 0;
}
.scoreboard[data-darts-pos="tr"] .darts-box .scoreline-bug,
.scoreboard[data-darts-pos="br"] .darts-box .scoreline-bug { right: auto; left: 0; }
.scoreboard[data-darts-pos="tr"] .darts-box:not(.has-title) .scoreline-bug,
.scoreboard[data-darts-pos="br"] .darts-box:not(.has-title) .scoreline-bug { left: auto; right: 0; }
/* Per-match opt-out */
.scoreboard.no-scoreline-credit .scoreline-bug {
  display: none !important;
}

/* ===== Break bar (docked directly below the score bar) ===== */
.break-bar {
  position: fixed;
  left: 0;
  top: 72px;           /* league strip (28) + tv-bar (44 incl. border) */
  display: flex;
  align-items: stretch;
  background: #1a1a1a;
  color: #fff;
  font-family: Arial, sans-serif;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
  border: 2px solid #000;
  border-top: 0;                /* share the tv-bar's bottom edge */
  border-bottom-right-radius: 4px;
  overflow: hidden;
  z-index: 1;
  /* Hidden state — slides up behind the tv-bar. */
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
  transition: transform 320ms cubic-bezier(0.22, 1, 0.36, 1), opacity 240ms ease-out;
}
.break-bar.visible {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.break-balls {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  background: #0f3520;  /* snooker-cloth green */
  min-height: 0;
}
.break-balls:empty { display: none; }

.break-ball {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  box-shadow: inset -2px -2px 3px rgba(0, 0, 0, 0.4), 0 0 2px rgba(0, 0, 0, 0.6);
  flex-shrink: 0;
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}
.break-ball-red    { background: #dc2626; }
.break-ball-yellow { background: #fbbf24; }
.break-ball-green  { background: #16a34a; }
.break-ball-brown  { background: #7c4a1e; }
.break-ball-blue   { background: #2563eb; }
.break-ball-pink   { background: #f472b6; }
.break-ball-black  { background: #111827; }

.break-stats {
  display: flex;
  align-items: stretch;
}
.break-stat {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  min-width: 0;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
}
.break-stat .stat-label {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: #c9a227;  /* gold, matches name blocks */
}
.break-stat .stat-value {
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

/* ===== Winner banners — overlay the lower-third ===== */
/* Brownz Media colour scheme: deep navy with accent red.                */
/* Sits at top: 28px (under the league strip) so it covers the tv-bar /  */
/* pool-bar entirely for the duration of the celebration.                */

.winner-banner,
.match-winner-banner {
  position: fixed;
  top: 28px;
  left: 0;
  width: 100%;
  overflow: hidden;
  white-space: nowrap;
  border: 2px solid #000;
  border-top: 0;
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
  transition: transform 320ms cubic-bezier(0.22, 1, 0.36, 1), opacity 240ms ease-out;
}
.winner-banner.visible,
.match-winner-banner.visible {
  transform: translateY(0);
  opacity: 1;
}

/* --- Frame-winner: red wash with white type, height matches the lower-third --- */
.winner-banner {
  height: 44px;        /* default: matches snooker tv-bar */
  background:
    linear-gradient(90deg,
      #B12734 0%, #E63946 50%, #B12734 100%);
  color: #fff;
  z-index: 4;
  box-shadow: 0 6px 18px rgba(230, 57, 70, 0.45);
}
.scoreboard[data-sport="pool"] .winner-banner { height: 96px; }

.winner-banner-inner {
  display: inline-block;
  padding-left: 100%;  /* start off-screen right */
  font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif;
  font-weight: 900;
  text-transform: uppercase;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  font-size: 22px;
  line-height: 40px;
  letter-spacing: 3px;
}
.scoreboard[data-sport="pool"] .winner-banner-inner {
  font-size: 36px;
  line-height: 92px;
  letter-spacing: 4px;
}
.winner-banner.visible .winner-banner-inner {
  animation: banner-scroll 10s linear 1;
}
@keyframes banner-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-100%); }
}

/* --- Match-winner: deeper red with a gold edge gradient — most prominent --- */
.match-winner-banner {
  height: 64px;        /* default: snooker height (a bit taller than frame banner) */
  background:
    linear-gradient(90deg,
      #5A0F18 0%, #C42E3A 18%, #E63946 50%, #C42E3A 82%, #5A0F18 100%);
  color: #fff;
  z-index: 5;          /* above frame-winner banner */
  box-shadow: 0 8px 28px rgba(230, 57, 70, 0.6);
  position: relative;
}
.match-winner-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(255, 212, 0, 0.18) 100%);
  pointer-events: none;
}
.scoreboard[data-sport="pool"] .match-winner-banner { height: 120px; }

.match-winner-inner {
  display: inline-block;
  padding-left: 100%;
  font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif;
  font-weight: 900;
  text-transform: uppercase;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
  font-size: 28px;
  line-height: 60px;
  letter-spacing: 4px;
  position: relative;  /* sits above the inner gold gradient overlay */
  z-index: 1;
}
.scoreboard[data-sport="pool"] .match-winner-inner {
  font-size: 44px;
  line-height: 116px;
  letter-spacing: 5px;
}
.match-winner-banner.visible .match-winner-inner {
  animation: banner-scroll 20s linear 1;
}

/* ===== Ahead / remaining tracker — docks under the active player's side ===== */
.ahead-tracker {
  position: fixed;
  top: 72px;           /* same level as break bar, under the tv-bar */
  display: flex;
  align-items: stretch;
  background: #1a1a1a;
  color: #fff;
  font-family: Arial, sans-serif;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
  border: 2px solid #000;
  border-top: 0;
  overflow: hidden;
  z-index: 1;
  /* Hidden state — slides up behind the tv-bar. */
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
  transition: transform 320ms cubic-bezier(0.22, 1, 0.36, 1), opacity 240ms ease-out;
}
.ahead-tracker.side-left  { left: 0;  right: auto; border-bottom-right-radius: 4px; }
.ahead-tracker.side-right { right: 0; left: auto;  border-bottom-left-radius: 4px; }
.ahead-tracker.visible {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.ahead-stat {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 18px;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
}
.ahead-stat:first-child { border-left: 0; }
.ahead-stat .stat-label {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: #c9a227;       /* gold accent — matches name blocks */
}
.ahead-stat .stat-value {
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.ahead-stat .stat-value:empty { display: none; }

/* ===================================================================
   Auth pages (login, signup, reset) + dashboard club cards
   =================================================================== */
.auth-wrap {
  max-width: 460px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.auth-card {
  background: #0b1220;
  border: 1px solid #1e293b;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}
.auth-card h2 { margin: 0 0 16px; font-size: 18px; }
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.auth-form h3 { margin: 0 0 4px; font-size: 14px; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.5px; }
.auth-form label {
  display: flex;
  flex-direction: column;
  font-size: 12px;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  gap: 6px;
}
.auth-form label .muted { text-transform: none; letter-spacing: 0; color: #64748b; }
.auth-form input {
  padding: 10px 12px;
  background: #020617;
  color: #e2e8f0;
  border: 1px solid #334155;
  border-radius: 8px;
  font-size: 15px;
}
.auth-form button { align-self: flex-start; }
.auth-error {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fecaca;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
}
.auth-banner {
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.4);
  color: #bbf7d0;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 12px;
}
.auth-links {
  margin-top: 16px;
  font-size: 13px;
  color: #94a3b8;
}
.auth-links a { color: #60a5fa; text-decoration: none; }
.auth-links a:hover { text-decoration: underline; }

/* Dashboard header (logged-in user banner + sign-out) */
.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
}
.muted-line { color: #94a3b8; font-size: 14px; margin: 0; }
.header-actions { display: flex; gap: 8px; }

/* Club cards on the dashboard — one per club the user belongs to */
.club-card {
  background: #0b1220;
  border: 1px solid #1e293b;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  margin-bottom: 24px;
}
.club-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid #1e293b;
}
.club-header h2 { margin: 0 0 4px; font-size: 20px; }
.club-meta { font-size: 13px; }
.club-invite {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #94a3b8;
}
.club-invite code {
  background: #020617;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid #334155;
  font-size: 13px;
  color: #e2e8f0;
}
.club-body { display: flex; flex-direction: column; gap: 20px; }
/* `display: flex` above would otherwise override the [hidden] attribute when a
   club card is collapsed — force it hidden so the toggle actually collapses. */
.club-body[hidden] { display: none; }
.club-new-match { padding: 16px; background: #020617; border: 1px solid #1e293b; border-radius: 8px; }

/* Add-club / join-club composite card at the bottom of the dashboard */
.add-club-card {
  background: #0b1220;
  border: 1px solid #1e293b;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}
.add-club-card h2 { margin: 0 0 16px; font-size: 18px; }
.add-club-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
@media (max-width: 640px) {
  .add-club-grid { grid-template-columns: 1fr; }
  .new-match-form { grid-template-columns: 1fr; }
}

/* =================================================================== */
/* Dashboard — collapsed club cards, toolbar & modal                   */
/* =================================================================== */
.clubs-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 8px 0 16px;
}
.clubs-toolbar[hidden] { display: none; }
.clubs-title { margin: 0; font-size: 18px; }

/* Collapsed-card layout: the header is a full-width toggle row. */
.club-card { margin-bottom: 16px; }
.club-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
/* Only show the header divider/spacing when the card is expanded. */
.club-card.collapsed .club-header { margin-bottom: 0; padding-bottom: 0; border-bottom: 0; }

.club-toggle {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  background: none;
  border: 0;
  padding: 4px 0;
  cursor: pointer;
  text-align: left;
  color: inherit;
  min-width: 0;
}
.club-chevron {
  font-size: 14px;
  color: var(--bz-bone-dim, #94a3b8);
  flex: 0 0 auto;
  width: 14px;
}
.club-titles { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.club-name { font-size: 20px; font-weight: 800; line-height: 1.1; }
.club-count { font-size: 13px; }
.club-actions { display: flex; gap: 8px; flex-wrap: wrap; flex: 0 0 auto; }

.club-invite-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--bz-bone-dim, #94a3b8);
}
.club-invite-row .club-meta { margin-left: auto; }

/* The match form sits inside the modal, so drop its sunken-panel framing. */
.modal-body .club-new-match { padding: 0; background: none; border: 0; }

/* Add-sponsor modal: preview of the picked logo. */
.sponsor-preview {
  max-width: 100%;
  max-height: 120px;
  object-fit: contain;
  align-self: flex-start;
  padding: 8px;
  border-radius: 8px;
  background: var(--bz-ink-900, #060d18);
  border: 1px solid var(--bz-ink-700, #1e293b);
}
.sponsor-preview[hidden] { display: none; }

/* Searchable player combobox (type to filter the roster, ▾ to browse, or type a new name). */
.combo { position: relative; display: flex; align-items: stretch; }
.combo .combo-input { flex: 1 1 auto; min-width: 0; border-top-right-radius: 0; border-bottom-right-radius: 0; }
.combo-toggle {
  flex: 0 0 auto;
  width: 40px;
  border: 1px solid var(--bz-ink-700, #1e293b);
  border-left: 0;
  border-radius: 0 10px 10px 0;
  background: var(--bz-ink-950, #020617);
  color: var(--bz-bone-dim, #94a3b8);
  font-size: 12px;
  cursor: pointer;
}
.combo-toggle:hover { color: var(--bz-bone, #fff); }
/* Team mode: free text only — hide the dropdown affordance, restore full radius. */
.combo.no-pick .combo-toggle { display: none; }
.combo.no-pick .combo-input { border-radius: 10px; }
.combo-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 5;
  margin: 0;
  padding: 4px;
  list-style: none;
  background: var(--bz-ink-900, #060d18);
  border: 1px solid var(--bz-ink-700, #1e293b);
  border-radius: 10px;
  max-height: 210px;
  overflow-y: auto;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.55);
}
.combo-list[hidden] { display: none; }
.combo-option {
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  color: var(--bz-bone, #e2e8f0);
  font-size: 14px;
}
.combo-option:hover,
.combo-option.active { background: var(--bz-ink-700, #1e293b); }

/* Manage-clubs modal content: create form, divider, join form stacked. */
.manage-clubs { display: flex; flex-direction: column; gap: 8px; }
.manage-clubs h3 { margin: 0 0 12px; font-size: 16px; }
.manage-divider {
  display: flex;
  align-items: center;
  text-align: center;
  color: var(--bz-bone-dim, #94a3b8);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 6px 0;
}
.manage-divider::before,
.manage-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--bz-ink-700, #1e293b);
}
.manage-divider span { padding: 0 12px; }

/* Invite-user modal */
.invite-panel { display: flex; flex-direction: column; gap: 14px; }
.invite-copy-row { display: flex; gap: 8px; margin-top: 6px; }
.invite-copy-row input { flex: 1 1 auto; min-width: 0; font-family: var(--bz-mono, monospace); font-size: 13px; }
.invite-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.invite-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: var(--bz-ink-950, #020617);
  border: 1px solid var(--bz-ink-700, #1e293b);
  border-radius: 8px;
}
.invite-url {
  flex: 1 1 auto;
  min-width: 0;
  font-family: var(--bz-mono, monospace);
  font-size: 12px;
  color: var(--bz-bone, #e2e8f0);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.invite-when { flex: 0 0 auto; font-size: 12px; }

/* ---- Modal ---- */
body.modal-open { overflow: hidden; }
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 6vh 16px 16px;
  background: rgba(2, 6, 23, 0.72);
  backdrop-filter: blur(3px);
  overflow-y: auto;
}
.modal-overlay[hidden] { display: none; }
.modal {
  width: 100%;
  max-width: 560px;
  background: linear-gradient(180deg, var(--bz-ink-800, #0b1220), var(--bz-ink-900, #060d18));
  border: 1px solid var(--bz-ink-700, #1e293b);
  border-radius: 16px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
  max-height: 88vh;
  animation: modal-pop 160ms ease;
}
@keyframes modal-pop {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--bz-ink-700, #1e293b);
}
.modal-title { margin: 0; font-size: 18px; }
.modal-close {
  background: none;
  border: 0;
  color: var(--bz-bone-dim, #94a3b8);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
  border-radius: 6px;
}
.modal-close:hover { color: var(--bz-bone, #fff); }
.modal.modal-wide { max-width: 760px; }
.modal-body { padding: 22px; overflow-y: auto; }
@media (max-width: 640px) {
  .club-header { align-items: flex-start; }
  .modal-overlay { padding: 2vh 10px; }
}

/* =================================================================== */
/* Darts scorer — number-pad UI                                        */
/* =================================================================== */
.darts-board {
  display: grid;
  grid-template-columns: 1fr 220px 1fr;
  gap: 16px;
  margin: 18px 0;
  background: #0b1220;
  border: 1px solid #1e293b;
  border-radius: 12px;
  padding: 22px;
  align-items: stretch;
}
.darts-side {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  padding: 18px 22px;
  border-radius: 10px;
  background: #0f172a;
  border: 2px solid transparent;
  transition: border-color 180ms ease, box-shadow 180ms ease;
  min-width: 0;
}
.darts-side.is-active {
  border-color: #E63946;
  box-shadow: 0 0 0 2px rgba(230, 57, 70, 0.25);
}
.darts-side-head {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 700;
  color: #e2e8f0;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.darts-side-right .darts-side-head { justify-content: flex-end; }
.darts-side-right .darts-side-meta { text-align: right; }
.darts-arrow { color: #E63946; font-size: 18px; }
.darts-arrow:empty { display: none; }
.darts-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.darts-remaining {
  font-size: 96px;
  font-weight: 900;
  line-height: 1;
  color: #fff;
  font-variant-numeric: tabular-nums;
  text-align: center;
  letter-spacing: -2px;
}
.darts-side.is-active .darts-remaining {
  text-shadow: 0 0 24px rgba(230, 57, 70, 0.45);
}
.darts-side-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  font-size: 13px;
  color: #94a3b8;
}
.darts-side-meta strong {
  color: #e2e8f0;
  font-weight: 700;
  margin-left: 4px;
  font-variant-numeric: tabular-nums;
}

.darts-board-mid {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  font-size: 13px;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 2px;
}
.darts-board-mid strong { color: #e2e8f0; font-weight: 800; font-size: 22px; }
.darts-board-mid .darts-format strong { font-size: 22px; }
.darts-board-mid .darts-leg-num strong { font-size: 28px; color: #E63946; }
.darts-throw-indicator {
  font-size: 12px;
  color: #cbd5e1;
  letter-spacing: 1px;
}

/* Visit entry */
.darts-entry {
  background: #0b1220;
  border: 1px solid #1e293b;
  border-radius: 12px;
  padding: 22px;
  margin: 18px 0;
}
.darts-input-row {
  display: flex;
  gap: 16px;
  align-items: stretch;
  margin: 10px 0 18px;
}
.darts-match-over[hidden] { display: none; }
.darts-input-actions .btn:disabled { opacity: 0.35; cursor: not-allowed; }
.darts-match-over {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding: 12px 16px;
  border-radius: 10px;
  background: rgba(230, 57, 70, 0.14);
  border: 1px solid rgba(230, 57, 70, 0.55);
  font-weight: 700;
}
.darts-visit-display {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #020617;
  border: 2px solid #1e293b;
  border-radius: 10px;
  font-size: 64px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  color: #fff;
  min-height: 96px;
}
.darts-input-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 140px;
}
.darts-input-actions .btn.big {
  font-size: 18px;
  padding: 14px 18px;
  font-weight: 800;
}

.darts-keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  max-width: 460px;
}
.darts-key {
  font-size: 28px;
  font-weight: 800;
  padding: 18px 0;
  background: #1e293b;
  color: #f1f5f9;
  border: 1px solid #334155;
  border-radius: 10px;
  cursor: pointer;
  font-variant-numeric: tabular-nums;
}
.darts-key:hover { background: #334155; }
.darts-key:active { background: #475569; }
.darts-key-wide { grid-column: 2 / 4; font-size: 22px; }

.darts-undo-row { margin-top: 14px; }

@media (max-width: 900px) {
  .darts-board { grid-template-columns: 1fr; }
  .darts-board-mid { flex-direction: row; flex-wrap: wrap; justify-content: center; }
  .darts-remaining { font-size: 72px; }
  .darts-input-row { flex-direction: column; }
  .darts-input-actions { flex-direction: row; min-width: 0; }
  .darts-input-actions .btn.big { flex: 1; }
}

/* ===================================================================
   Brownz Media brand refresh — auth + dashboard + guide
   Scoped under body.landing / body.guide so the OBS overlays, scorer
   and big-screen views keep their existing styling untouched. Fonts are
   loaded via <link> in each page head (Instrument Serif / Albert Sans /
   JetBrains Mono).
   =================================================================== */
:root {
  --bz-ink-950: #06101f;
  --bz-ink-900: #0a1628;
  --bz-ink-800: #131f33;
  --bz-ink-700: #1e2d45;
  --bz-ink-600: #2c3d5a;
  --bz-bone: #f5f0e6;
  --bz-bone-dim: #aeb8c7;
  --bz-signal: #e63946;
  --bz-signal-dark: #c42e3a;
  --bz-signal-light: #f25862;
  --bz-butter: #f5c242;
  --bz-serif: "Instrument Serif", Georgia, serif;
  --bz-sans: "Albert Sans", system-ui, -apple-system, sans-serif;
  --bz-mono: "JetBrains Mono", ui-monospace, monospace;
}

body.landing,
body.guide {
  background:
    radial-gradient(1100px 560px at 82% -12%, rgba(230, 57, 70, 0.16), transparent 60%),
    linear-gradient(180deg, var(--bz-ink-950), var(--bz-ink-900));
  background-attachment: fixed;
  color: var(--bz-bone);
  font-family: var(--bz-sans);
}
body.landing .landing-wrap { max-width: 1000px; }

/* Headings → display serif */
body.landing .landing-header h1 {
  font-family: var(--bz-serif);
  font-weight: 400;
  font-size: 46px;
  line-height: 1;
  letter-spacing: 0.4px;
  margin: 0 0 6px;
}
body.landing h1,
body.landing h2,
body.guide h2 { font-family: var(--bz-serif); font-weight: 400; letter-spacing: 0.3px; }
body.landing .muted-line,
body.landing .landing-header p { color: var(--bz-bone-dim); }

/* Header bar + help link */
body.landing .dashboard-header {
  align-items: center;
  border-bottom: 1px solid var(--bz-ink-700);
  padding-bottom: 18px;
}
.header-actions { display: flex; gap: 10px; align-items: center; }
.help-link {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--bz-mono); font-size: 12px; text-transform: uppercase; letter-spacing: 1px;
  color: var(--bz-bone-dim); text-decoration: none;
  border: 1px solid var(--bz-ink-700); border-radius: 999px; padding: 9px 15px;
  transition: color .15s, border-color .15s;
}
.help-link:hover { color: var(--bz-bone); border-color: var(--bz-signal); }

/* Buttons */
body.landing .btn,
body.guide .btn {
  font-family: var(--bz-sans); font-weight: 600; font-size: 14px;
  background: var(--bz-ink-700); color: var(--bz-bone);
  border: 1px solid var(--bz-ink-600); border-radius: 10px; padding: 10px 16px;
  transition: background .15s, border-color .15s, transform .05s;
}
body.landing .btn:hover,
body.guide .btn:hover { background: var(--bz-ink-600); }
body.landing .btn:active { transform: translateY(1px); }
body.landing .btn.primary,
body.guide .btn.primary {
  background: var(--bz-signal); border-color: var(--bz-signal); color: #fff;
  box-shadow: 0 10px 26px rgba(230, 57, 70, 0.28);
}
body.landing .btn.primary:hover,
body.guide .btn.primary:hover { background: var(--bz-signal-dark); border-color: var(--bz-signal-dark); }
body.landing .btn.danger {
  background: transparent; color: var(--bz-signal-light); border-color: rgba(230, 57, 70, 0.4);
}
body.landing .btn.danger:hover { background: rgba(230, 57, 70, 0.12); }

/* Cards */
body.landing .auth-card,
body.landing .add-club-card,
body.landing .club-card {
  background: linear-gradient(180deg, var(--bz-ink-800), var(--bz-ink-900));
  border: 1px solid var(--bz-ink-700);
  border-radius: 16px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.42);
}
body.landing .club-header { border-bottom: 1px solid var(--bz-ink-700); }
body.landing .invite-code { color: var(--bz-butter); }

/* Inputs / selects */
body.landing input[type="text"],
body.landing input[type="email"],
body.landing input[type="password"],
body.landing input[type="number"],
body.landing input[type="search"],
body.landing select,
body.landing .auth-form input,
body.landing .new-match-form input {
  background: var(--bz-ink-950); color: var(--bz-bone);
  border: 1px solid var(--bz-ink-700); border-radius: 10px;
}
body.landing input:focus,
body.landing select:focus {
  outline: none; border-color: var(--bz-signal);
  box-shadow: 0 0 0 3px rgba(230, 57, 70, 0.22);
}
body.landing .auth-form label,
body.landing .new-match-form label { color: var(--bz-bone-dim); }

/* ---------- Welcome hero (first run) ---------- */
.welcome-hero {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: 1.25fr 1fr; gap: 30px; align-items: center;
  background: linear-gradient(135deg, var(--bz-ink-800), var(--bz-ink-950));
  border: 1px solid var(--bz-ink-700); border-radius: 22px; padding: 40px;
}
.welcome-hero::before {
  content: ""; position: absolute; top: -50%; left: -30%; width: 70%; height: 160%;
  background: radial-gradient(circle, rgba(230, 57, 70, 0.45), transparent 70%);
  filter: blur(50px); pointer-events: none;
}
.welcome-hero .hero-copy { position: relative; z-index: 1; }
.welcome-hero .eyebrow {
  font-family: var(--bz-mono); font-size: 12px; letter-spacing: 2px; text-transform: uppercase;
  color: var(--bz-signal-light); margin: 0 0 12px;
}
.welcome-hero h1,
.welcome-hero h2 { font-size: 40px; line-height: 1.02; margin: 0 0 12px; }
.welcome-hero p { color: var(--bz-bone-dim); margin: 0 0 22px; max-width: 48ch; line-height: 1.5; }
.welcome-hero .hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-art { position: relative; z-index: 1; }
.hero-art svg { width: 100%; height: auto; display: block; filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.4)); }

/* Hero variant carrying the launch video. The video shows a full 1920px
   broadcast frame, so it needs more of the row than a device render does —
   at the default 1.25fr/1fr split the overlay type stops being readable. */
.welcome-hero-video { grid-template-columns: 1fr 1.15fr; }
.welcome-hero-video .stream-frame { max-width: 100%; }

/* Back link in auth/landing headers */
body.landing .back-link { display: inline-flex; align-items: center; margin-bottom: 16px; }

/* Landing header logo */
body.landing .landing-header .landing-logo-h1 { margin: 0 0 8px; line-height: 0; }
body.landing .landing-header .landing-logo-h1 img { height: 34px; width: auto; display: block; filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.5)); }

/* Hero device renders (transparent PNGs on the gradient hero) */
.hero-devices { position: relative; }
.hero-laptop { display: block; width: 100%; height: auto; filter: drop-shadow(0 22px 44px rgba(0, 0, 0, 0.55)); }
.hero-phone {
  position: absolute; left: -7%; bottom: -9%; width: 30%; height: auto;
  filter: drop-shadow(0 16px 30px rgba(0, 0, 0, 0.6));
}
.hero-tablet { display: block; width: 100%; height: auto; filter: drop-shadow(0 22px 44px rgba(0, 0, 0, 0.5)); }

/* Landscape "broadcast device" frame for real product screenshots
   (ported from the marketing site's phone-land mockup). */
.stream-frame {
  position: relative; width: 100%; max-width: 440px; margin: 0 auto;
  aspect-ratio: 1672 / 941; background: #050810;
  border-radius: 28px; padding: 8px; border: 1.5px solid #1a2236;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.06) inset,
    0 30px 70px -20px rgba(230, 57, 70, 0.45),
    0 40px 80px -30px rgba(0, 0, 0, 0.9);
}
.stream-frame::before {
  content: ""; position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  width: 20px; height: 84px; background: #050810; border-radius: 12px; z-index: 2;
}
.stream-frame .stream-screen { width: 100%; height: 100%; border-radius: 22px; overflow: hidden; background: #000; }
.stream-frame .stream-screen img,
.stream-frame .stream-screen video { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Sound toggle for the hero video — sits inside the device bezel, bottom-right.
   The video autoplays muted (the only kind of autoplay browsers allow), so this
   is how a visitor opts into the music. */
.stream-sound {
  position: absolute; right: 18px; bottom: 16px; z-index: 3;
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 12px; border: 1px solid rgba(245, 240, 230, 0.18); border-radius: 999px;
  background: rgba(6, 16, 31, 0.72);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  color: var(--bz-bone);
  font-family: var(--bz-sans); font-size: 12px; font-weight: 600; letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease;
}
.stream-sound:hover { background: rgba(6, 16, 31, 0.92); border-color: rgba(245, 240, 230, 0.34); }
.stream-sound:focus-visible { outline: 2px solid var(--bz-signal-light); outline-offset: 2px; }
.stream-sound[hidden] { display: none; }
/* Two classes deep so this beats `.hero-art svg`, which stretches decorative
   hero SVGs to the full column width. */
.stream-frame .stream-sound-icon {
  width: 15px; height: 15px; flex-shrink: 0;
  display: inline-block; filter: none;
}
.stream-sound-icon path {
  fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}
.stream-sound-icon .spk { fill: currentColor; stroke-width: 1.2; }
/* Muted shows the cross; pressed (sound on) shows the waves. */
.stream-sound-icon .on { display: none; }
.stream-sound[aria-pressed="true"] .stream-sound-icon .off { display: none; }
.stream-sound[aria-pressed="true"] .stream-sound-icon .on { display: inline; }

/* ---------- Getting-started steps ---------- */
.section-eyebrow {
  font-family: var(--bz-mono); font-size: 12px; letter-spacing: 2px; text-transform: uppercase;
  color: var(--bz-bone-dim); margin: 0 0 14px;
}
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.step {
  background: var(--bz-ink-900); border: 1px solid var(--bz-ink-700);
  border-radius: 14px; padding: 20px;
}
.step .step-num {
  font-family: var(--bz-mono); font-size: 13px; font-weight: 700; color: var(--bz-signal-light);
  border: 1px solid rgba(230, 57, 70, 0.4); border-radius: 999px;
  width: 30px; height: 30px; display: grid; place-items: center; margin-bottom: 14px;
}
.step h3 { font-family: var(--bz-sans); font-weight: 700; font-size: 15px; margin: 0 0 6px; color: var(--bz-bone); }
.step p { font-size: 13px; color: var(--bz-bone-dim); margin: 0; line-height: 1.5; }

/* ---------- Sport cards (match creation) ---------- */
/* Form labels are display:flex (and .checkbox-label is display:flex !important),
   which would override the browser's [hidden]{display:none}. Force hidden to win
   so the per-sport format fields (best-of / race-to / legs + snooker toggles)
   actually disappear when another sport is selected. */
.new-match-form label[hidden] { display: none !important; }
/* Same override for checkbox-labels (e.g. the Scoreline-credit option, hidden on
   the BBC theme) — display:flex !important would otherwise beat [hidden]. */
.checkbox-label[hidden] { display: none !important; }
.sport-field { grid-column: 1 / -1; }
.sport-field > .field-label {
  display: block; font-size: 12px; color: var(--bz-bone-dim);
  text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 10px;
}
/* Flow to the number of sports the club runs (2–4 cards) rather than a fixed
   3 columns, so adding Shootout doesn't force an unbalanced 3+1 wrap. */
.sport-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(108px, 1fr)); gap: 12px; }
.sport-card {
  position: relative; cursor: pointer; display: block;
  background: var(--bz-ink-900); border: 2px solid var(--bz-ink-700);
  border-radius: 14px; padding: 18px 14px; text-align: center;
  transition: border-color .15s, transform .1s, background .15s;
}
.sport-card:hover { border-color: var(--bz-ink-600); transform: translateY(-2px); }
.sport-card input { position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none; }
.sport-card .sport-icon { width: 54px; height: 54px; margin: 0 auto 10px; display: block; }
.sport-card .sport-name { font-weight: 700; font-size: 15px; color: var(--bz-bone); }
.sport-card .sport-sub { font-family: var(--bz-mono); font-size: 11px; color: var(--bz-bone-dim); margin-top: 3px; }
.sport-card.is-locked { opacity: 0.6; cursor: default; }
.sport-card.is-locked:hover { transform: none; }
.sport-card .pro-badge { display: inline-block; margin: 6px 0 0; }
.sport-card.selected { border-color: var(--bz-signal); background: rgba(230, 57, 70, 0.1); }
.sport-card.selected::after {
  content: "✓"; position: absolute; top: 8px; right: 11px;
  color: var(--bz-signal-light); font-weight: 700; font-size: 14px;
}

/* Sport selection chips — "which sports does this club run" (create + settings).
   Selectors use .sport-picks .sport-pick to outrank `.auth-form label`. */
.sport-picks { display: flex; gap: 10px; flex-wrap: wrap; }
.sport-picks .sport-pick {
  position: relative;
  /* .auth-form label stacks its contents in a column; keep the chip on one line. */
  display: inline-flex; flex-direction: row; align-items: center; gap: 8px;
  cursor: pointer; user-select: none;
  border: 1.5px solid var(--bz-ink-600); border-radius: 10px; padding: 9px 16px 9px 12px;
  font-size: 14px; font-weight: 600; color: var(--bz-bone-dim); text-transform: none; letter-spacing: 0;
  background: var(--bz-ink-900);
  transition: border-color .15s, color .15s, background .15s;
}
/* The real checkbox stays focusable for keyboard and screen readers, but the
   tick box below is what's drawn. */
.sport-picks .sport-pick input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.sport-picks .sport-pick::before {
  content: ""; flex: 0 0 auto; width: 18px; height: 18px; border-radius: 5px;
  border: 1.5px solid var(--bz-ink-600); background: var(--bz-ink-950);
  display: grid; place-items: center; font-size: 12px; line-height: 1; color: #fff;
}
.sport-picks .sport-pick:hover { border-color: var(--bz-bone-dim); color: var(--bz-bone); }
.sport-picks .sport-pick:has(input:checked) { border-color: var(--bz-signal); color: var(--bz-bone); background: rgba(230, 57, 70, 0.1); }
.sport-picks .sport-pick:has(input:checked)::before { content: "✓"; background: var(--bz-signal); border-color: var(--bz-signal); }
.sport-picks .sport-pick:has(input:focus-visible) { outline: 2px solid var(--bz-signal-light); outline-offset: 2px; }

/* ---------- Guide page ---------- */
body.guide { padding: 0; }
/* Signed-in visitors get the app nav on guide-layout pages (see sendPage).
   These pages have no body gutter, so the nav needs no negative margin. */
body.guide .app-nav { margin: 0; }
body.guide.has-app-nav .guide-wrap { padding-top: 8px; }
.guide-wrap { max-width: 880px; margin: 0 auto; padding: 32px 20px 80px; }
.guide-top {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px;
}
.guide-top .brand { font-family: var(--bz-serif); font-size: 26px; color: var(--bz-bone); text-decoration: none; }
/* Sticky mobile CTA: on phones, the marketing pages' header (logo + "Get started
   free") pins to the top so sign-up is one tap away however far down you read.
   Only headers whose button goes to /signup; docs and legal pages scroll as usual. */
@media (max-width: 700px) {
  .guide-top:has(> a.btn.primary[href="/signup"]) {
    position: sticky; top: 0; z-index: 40;
    margin: -32px -20px 8px; padding: 10px 20px;
    background: rgba(6, 16, 31, 0.94); border-bottom: 1px solid var(--bz-ink-700);
    -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  }
  .guide-top:has(> a.btn.primary[href="/signup"]) .brand { font-size: 22px; }
  /* In-page links (#setup) land below the pinned bar, not under it. */
  body.guide:has(.guide-top > a.btn.primary[href="/signup"]) [id] { scroll-margin-top: 72px; }
}
.guide-hero { padding: 40px 0 28px; border-bottom: 1px solid var(--bz-ink-700); margin-bottom: 36px; }
.guide-hero .eyebrow {
  font-family: var(--bz-mono); font-size: 12px; letter-spacing: 2px; text-transform: uppercase;
  color: var(--bz-signal-light); margin: 0 0 12px;
}
.guide-hero h1 { font-family: var(--bz-serif); font-weight: 400; font-size: 52px; line-height: 1; margin: 0 0 12px; }
.guide-hero p { color: var(--bz-bone-dim); font-size: 17px; margin: 0; max-width: 60ch; line-height: 1.5; }
.guide-toc { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 40px; }
.guide-toc a {
  font-family: var(--bz-mono); font-size: 12px; text-transform: uppercase; letter-spacing: 1px;
  color: var(--bz-bone-dim); text-decoration: none;
  border: 1px solid var(--bz-ink-700); border-radius: 999px; padding: 8px 14px;
}
.guide-toc a:hover { color: var(--bz-bone); border-color: var(--bz-signal); }
.guide-section { display: flex; gap: 22px; padding: 28px 0; border-bottom: 1px solid var(--bz-ink-700); scroll-margin-top: 20px; }
.guide-section:last-child { border-bottom: 0; }
.guide-section .guide-icon {
  flex: 0 0 64px; width: 64px; height: 64px;
  background: var(--bz-ink-800); border: 1px solid var(--bz-ink-700); border-radius: 16px;
  display: grid; place-items: center;
}
.guide-section .guide-icon svg { width: 38px; height: 38px; }
.guide-section h2 { font-size: 26px; margin: 2px 0 10px; color: var(--bz-bone); }
.guide-section p { color: var(--bz-bone-dim); line-height: 1.6; margin: 0 0 12px; }
.guide-section ol, .guide-section ul { color: var(--bz-bone-dim); line-height: 1.7; margin: 0 0 6px; padding-left: 20px; }
.guide-section li { margin-bottom: 6px; }
.guide-section > div > h3 { font-size: 19px; color: var(--bz-bone); margin: 22px 0 6px; }
.guide-section strong { color: var(--bz-bone); }
.guide-section code {
  font-family: var(--bz-mono); font-size: 0.88em; background: var(--bz-ink-950);
  border: 1px solid var(--bz-ink-700); border-radius: 6px; padding: 2px 6px; color: var(--bz-butter);
}
.guide-tip {
  background: rgba(245, 194, 66, 0.08); border: 1px solid rgba(245, 194, 66, 0.3);
  border-radius: 10px; padding: 12px 16px; font-size: 14px; color: var(--bz-bone-dim);
}
.guide-tip strong { color: var(--bz-butter); }

/* ---------- About: "Built with clubs" credit cards ---------- */
.credit-card {
  background: var(--bz-ink-800); border: 1px solid var(--bz-ink-700); border-radius: 14px;
  padding: 20px 22px; margin: 18px 0;
}
.guide-section .credit-card .credit-name { margin: 0; font-size: 18px; }
.guide-section .credit-card .credit-where { margin: 2px 0 14px; font-size: 14px; color: var(--bz-butter); }
.credit-card .credit-yt { margin-top: 10px; }
.credit-quote { margin: 0 0 16px; padding-left: 14px; border-left: 3px solid var(--bz-signal-light); }
.guide-section .credit-quote p { font-family: "Instrument Serif", serif; font-size: 21px; font-style: italic; color: var(--bz-bone); margin: 0; }

/* ---------- Annotated guide screenshots (numbered callout pins) ---------- */
.guide-shot {
  position: relative; display: block; margin: 18px 0 0; line-height: 0;
  border: 1px solid var(--bz-ink-700); border-radius: 12px; overflow: hidden;
  background: var(--bz-ink-950); box-shadow: 0 16px 40px rgba(0, 0, 0, 0.42);
}
.guide-shot img { display: block; width: 100%; height: auto; }
/* Real club streams: local thumbnail linking to YouTube (see js/yt-facade.js). */
.stream-thumb { position: relative; display: block; }
.stream-play {
  position: absolute; inset: 0; margin: auto; width: 68px; height: 68px; border-radius: 999px;
  background: rgba(230, 57, 70, 0.92); color: #fff; font-size: 26px; line-height: 0;
  display: grid; place-items: center; box-shadow: 0 6px 24px rgba(0, 0, 0, 0.55);
}
.stream-thumb:hover .stream-play, .stream-thumb:focus-visible .stream-play { transform: scale(1.08); }
.stream-frame-embed { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; }
.stream-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 760px) { .stream-grid { grid-template-columns: 1fr; } }
.guide-shot figcaption {
  line-height: 1.4; padding: 9px 14px; font-family: var(--bz-mono);
  font-size: 12px; letter-spacing: 0.5px; color: var(--bz-bone-dim);
  background: var(--bz-ink-900); border-top: 1px solid var(--bz-ink-700);
}
.guide-shot .pin {
  position: absolute; transform: translate(-50%, -50%);
  width: 30px; height: 30px; border-radius: 999px; z-index: 2;
  background: var(--bz-signal); color: #fff;
  font-family: var(--bz-mono); font-weight: 700; font-size: 14px; line-height: 0;
  display: grid; place-items: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.6), 0 0 0 4px rgba(230, 57, 70, 0.3);
}
.guide-legend { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.guide-legend li { display: flex; align-items: flex-start; gap: 11px; font-size: 14px; color: var(--bz-bone-dim); line-height: 1.5; }
.guide-legend .n {
  flex: 0 0 22px; width: 22px; height: 22px; border-radius: 999px; margin-top: 1px;
  background: var(--bz-signal); color: #fff;
  display: grid; place-items: center; font-family: var(--bz-mono); font-weight: 700; font-size: 12px; line-height: 0;
}
.guide-legend strong { color: var(--bz-bone); }

/* ---------- Auth split (sign-in showcase) ---------- */
body.landing.auth-page { display: grid; place-items: center; min-height: 100vh; }
.auth-shell { width: min(980px, 100%); }
.auth-split {
  display: grid; grid-template-columns: 1.08fr 0.92fr;
  background: linear-gradient(180deg, var(--bz-ink-800), var(--bz-ink-900));
  border: 1px solid var(--bz-ink-700); border-radius: 24px; overflow: hidden;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}
.auth-showcase {
  position: relative; overflow: hidden; padding: 46px 42px;
  background: linear-gradient(150deg, #16243c, #0a1628 72%);
  display: flex; flex-direction: column; gap: 18px;
}
.auth-showcase::before {
  content: ""; position: absolute; top: -40%; right: -30%; width: 80%; height: 160%;
  background: radial-gradient(circle, rgba(230, 57, 70, 0.5), transparent 70%);
  filter: blur(55px); pointer-events: none;
}
.auth-showcase > * { position: relative; z-index: 1; }
.auth-brand { display: flex; align-items: center; gap: 10px; }
.auth-brand .dot { width: 10px; height: 10px; border-radius: 999px; background: var(--bz-signal); box-shadow: 0 0 12px var(--bz-signal); }
.auth-brand .name { font-family: var(--bz-serif); font-size: 26px; color: var(--bz-bone); }
.auth-showcase .eyebrow {
  font-family: var(--bz-mono); font-size: 11px; letter-spacing: 2px; text-transform: uppercase;
  color: var(--bz-signal-light); margin: 8px 0 0;
}
.auth-showcase h2 { font-size: 34px; line-height: 1.05; margin: 2px 0 2px; color: var(--bz-bone); }
.auth-showcase .lead { color: var(--bz-bone-dim); margin: 0; font-size: 15px; line-height: 1.5; max-width: 42ch; }
.auth-showcase .showcase-art svg { width: 100%; height: auto; display: block; filter: drop-shadow(0 14px 30px rgba(0, 0, 0, 0.45)); }
.auth-features { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 11px; }
.auth-features li { display: flex; align-items: center; gap: 11px; font-size: 14px; color: var(--bz-bone-dim); }
.auth-features li .tick {
  flex: 0 0 18px; width: 18px; height: 18px; border-radius: 999px;
  background: rgba(230, 57, 70, 0.15); color: var(--bz-signal-light);
  display: grid; place-items: center; font-size: 11px; font-weight: 700;
}
/* Showcase v2 — image logo + device art on a table backdrop + horizontal feature row (login) */
.auth-showcase.showcase-v2 {
  gap: 16px;
  background:
    linear-gradient(180deg, rgba(8, 16, 32, 0.94) 0%, rgba(8, 16, 32, 0.74) 46%, rgba(8, 16, 32, 0.58) 100%),
    url("/img/showcase-bg.png") center/cover no-repeat;
}
.auth-showcase .auth-logo { height: 36px; width: auto; align-self: flex-start; display: block; margin-bottom: 2px; filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.5)); }
.auth-showcase .showcase-art { position: relative; margin: 8px 0 4px; }
.showcase-laptop {
  display: block; width: 78%; height: auto; margin: 0 auto;
  position: relative; z-index: 1;
  filter: drop-shadow(0 22px 44px rgba(0, 0, 0, 0.6));
}
.showcase-phone {
  position: absolute; left: -1%; bottom: -7%; width: 25%; height: auto; z-index: 2;
  filter: drop-shadow(0 16px 30px rgba(0, 0, 0, 0.6));
}
.showcase-tablet {
  position: absolute; right: -3%; bottom: -2%; width: 40%; height: auto; z-index: 2;
  filter: drop-shadow(0 18px 34px rgba(0, 0, 0, 0.6));
}
.auth-features.auth-features-row {
  grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 6px;
}
.auth-features.auth-features-row li {
  flex-direction: column; align-items: flex-start; gap: 8px;
  font-size: 12.5px; line-height: 1.4;
}
.auth-features.auth-features-row .pt-icon {
  flex: 0 0 auto; width: 30px; height: 30px; border-radius: 9px;
  background: rgba(230, 57, 70, 0.14); color: var(--bz-signal-light);
  display: grid; place-items: center;
}
.auth-features.auth-features-row .pt-icon svg { width: 16px; height: 16px; }

/* Panel v2 — uppercase field labels + arrow on submit */
.auth-panel-v2 .auth-form label {
  font-family: var(--bz-mono); font-size: 10px; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--bz-bone-dim);
}
.auth-panel-v2 .auth-form input { text-transform: none; letter-spacing: 0; }
.auth-panel-v2 .auth-form .btn.primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.auth-panel-v2 .auth-form .btn-arrow { font-size: 17px; line-height: 1; transition: transform 0.15s ease; }
.auth-panel-v2 .auth-form .btn.primary:hover .btn-arrow { transform: translateX(3px); }

.auth-panel { padding: 50px 44px; display: flex; flex-direction: column; justify-content: center; }
.auth-panel > h2 { font-size: 26px; margin: 0 0 4px; color: var(--bz-bone); }
.auth-panel .panel-sub { color: var(--bz-bone-dim); font-size: 14px; margin: 0 0 22px; }
.auth-panel .auth-form button { align-self: stretch; margin-top: 4px; }
body.landing .auth-links { color: var(--bz-bone-dim); }
body.landing .auth-links a { color: var(--bz-signal-light); text-decoration: none; }
body.landing .auth-links a:hover { text-decoration: underline; }

/* Sign in with Google — white button per Google's branding guidelines */
.btn.google-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; box-sizing: border-box;
  background: #fff; border: 1px solid #dadce0; color: #1f1f1f;
  font-weight: 600; text-decoration: none;
}
.btn.google-btn:hover { background: #f2f2f2; }
.btn.google-btn svg { width: 18px; height: 18px; flex: none; }
#oauthError { margin-bottom: 12px; }
.auth-divider {
  display: flex; align-items: center; gap: 12px; margin: 18px 0;
  color: var(--bz-bone-dim); font-size: 12px; text-transform: uppercase; letter-spacing: 1px;
}
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--bz-ink-600); }

@media (max-width: 760px) {
  .dashboard-header { flex-direction: column; align-items: flex-start; gap: 14px; }
  .dashboard-header .header-actions { flex-wrap: wrap; }
  .welcome-hero { grid-template-columns: 1fr; padding: 28px; }
  .hero-art { max-width: 280px; margin: 4px auto 0; }
  /* The 280px cap suits the device-render PNGs; the hero video needs the full
     column or the overlay type inside it stops being readable. */
  .hero-art-video { max-width: 100%; }
  .hero-art-video .stream-frame { max-width: 100%; }
  .stream-sound { right: 12px; bottom: 12px; padding: 6px 10px; font-size: 11px; }
  .steps { grid-template-columns: 1fr; }
  .sport-cards { grid-template-columns: 1fr; }
  .guide-hero h1 { font-size: 40px; }
  .guide-section { flex-direction: column; gap: 14px; }
  .auth-split { grid-template-columns: 1fr; }
  .auth-panel { order: -1; padding: 34px 26px; }
  .auth-showcase { padding: 30px 26px; }
  .auth-showcase .showcase-art { display: none; }
  .auth-showcase.showcase-v2 .showcase-art { display: block; }
  .auth-features.auth-features-row { grid-template-columns: 1fr; gap: 10px; }
  .auth-features.auth-features-row li { flex-direction: row; align-items: center; }
}

/* ===================================================================
   Brownz brand refresh — scorer control panels (body.scorer)
   Recolours the operator UI to match the dashboard. Snooker ball buttons
   (.ball) keep their functional colours and are intentionally left alone.
   =================================================================== */
body.scorer { color: var(--bz-bone); font-family: var(--bz-sans); }
body.scorer::before {
  background:
    radial-gradient(1100px 560px at 82% -12%, rgba(230, 57, 70, 0.12), transparent 60%),
    linear-gradient(180deg, var(--bz-ink-950), var(--bz-ink-900));
}

/* Top nav */
body.scorer .top-nav { background: linear-gradient(180deg, var(--bz-ink-800), var(--bz-ink-900)); border: 1px solid var(--bz-ink-700); }
body.scorer .top-nav .nav-link { color: var(--bz-bone); }
body.scorer .top-nav .nav-link:hover { background: var(--bz-ink-700); color: #fff; }
body.scorer .top-nav .nav-meta { color: var(--bz-bone-dim); font-family: var(--bz-mono); }
body.scorer .top-nav .nav-meta code { background: var(--bz-ink-950); color: var(--bz-butter); }

/* Headings + hint text */
body.scorer .scorer-header h1 { font-family: var(--bz-serif); font-weight: 400; font-size: 30px; color: var(--bz-bone); }
body.scorer .section-heading { font-family: var(--bz-serif); font-weight: 400; font-size: 20px; color: var(--bz-bone); }
body.scorer .section-header { border-bottom-color: var(--bz-ink-700); }
body.scorer .section-hint,
body.scorer .row-hint,
body.scorer .field-hint,
body.scorer .game-controls label,
body.scorer .row-label,
body.scorer .active-toggle .active-label { color: var(--bz-bone-dim); }

/* Panels */
body.scorer .game-controls,
body.scorer .snooker-controls,
body.scorer .frame-end-controls,
body.scorer .players-section,
body.scorer .score-preview,
body.scorer .player-card {
  background: linear-gradient(180deg, var(--bz-ink-800), var(--bz-ink-900));
  border: 1px solid var(--bz-ink-700);
}

/* Inputs / selects */
body.scorer input,
body.scorer select {
  background: var(--bz-ink-950) !important; color: var(--bz-bone) !important; border-color: var(--bz-ink-700) !important;
}
body.scorer input:focus,
body.scorer select:focus { outline: none; border-color: var(--bz-signal) !important; box-shadow: 0 0 0 3px rgba(230, 57, 70, 0.22); }

/* Score preview */
body.scorer .sp-name, body.scorer .sp-score { color: var(--bz-bone); }
body.scorer .sp-score { font-family: var(--bz-mono); }
body.scorer .sp-sub, body.scorer .sp-meta, body.scorer .sp-dash, body.scorer .sp-arrow { color: var(--bz-bone-dim); }

/* Neutral buttons (NOT .ball). Bigger tap targets for touch scoring. */
body.scorer .active-toggle button,
body.scorer .frame-row button,
body.scorer .multi-red-row button,
body.scorer .foul-row button,
body.scorer .score-row button,
body.scorer .action {
  background: var(--bz-ink-700); color: var(--bz-bone);
  border: 1px solid var(--bz-ink-600); border-radius: 10px;
  font-family: var(--bz-sans); font-weight: 600; min-height: 46px; cursor: pointer;
}
body.scorer .active-toggle button:hover,
body.scorer .frame-row button:hover,
body.scorer .multi-red-row button:hover,
body.scorer .foul-row button:hover,
body.scorer .score-row button:hover,
body.scorer .action:hover { background: var(--bz-ink-600); }

/* Selected "at the table" player → brand red */
body.scorer .active-toggle button.selected { background: var(--bz-signal); border-color: var(--bz-signal); color: #fff; }

/* Danger / reset */
body.scorer .danger,
body.scorer .game-controls .danger { background: var(--bz-signal); border-color: var(--bz-signal); color: #fff; }
body.scorer .danger:hover,
body.scorer .game-controls .danger:hover { background: var(--bz-signal-dark); }

/* Darts number-pad keys (neutral — not colour-coded) */
body.scorer .darts-key { background: var(--bz-ink-800); border-color: var(--bz-ink-700); color: var(--bz-bone); }
body.scorer .darts-key:hover { background: var(--bz-ink-700); }
body.scorer .darts-remaining { color: var(--bz-bone); }

/* Darts Enter = brand-red primary (matches the app); Bust = amber caution so
   the two aren't both red side by side. */
body.scorer .btn.primary { background: var(--bz-signal); border-color: var(--bz-signal); color: #fff; }
body.scorer .btn.primary:hover { background: var(--bz-signal-dark); border-color: var(--bz-signal-dark); }
body.scorer .btn.danger { background: var(--bz-butter); border-color: var(--bz-butter); color: var(--bz-ink-950); }
body.scorer .btn.danger:hover { filter: brightness(0.94); }

/* ---------- Standings + roster (body.landing) ---------- */
.standings-block { margin-top: 18px; overflow-x: auto; }
.standings-rule { margin-top: 14px; }
/* A tie the draw is waiting on (organiser picks the order). */
.tourney-tie {
  margin: 14px 0 0; padding: 12px 14px; border: 1px solid var(--bz-butter); border-radius: 12px;
  display: flex; flex-direction: column; gap: 10px; color: var(--bz-bone);
}
.tourney-tie p { margin: 0; }
.tourney-tie-picks { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.tourney-tie-picks label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--bz-bone-dim); }
.tourney-tie-picks select { width: 100%; padding: 8px 10px; font: inherit; }
.standings-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.standings-table caption {
  text-align: left; font-family: var(--bz-serif); font-size: 20px; color: var(--bz-bone); padding: 6px 0 10px;
}
.standings-table th, .standings-table td { padding: 9px 10px; text-align: center; border-bottom: 1px solid var(--bz-ink-700); }
.standings-table th {
  font-family: var(--bz-mono); font-size: 11px; letter-spacing: 1px; text-transform: uppercase;
  color: var(--bz-bone-dim); font-weight: 600;
}
.standings-table td { color: var(--bz-bone); }
.standings-table .rank { width: 36px; color: var(--bz-bone-dim); }
.standings-table .who { text-align: left; font-weight: 600; }
.standings-table .who a { color: inherit; text-decoration: none; }
.standings-table .who a:hover { text-decoration: underline; }
.standings-table tbody tr:first-child .rank { color: var(--bz-signal-light); font-weight: 700; }
.standings-table .diff { color: var(--bz-bone-dim); }

.add-player-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.add-player-row input { flex: 1; min-width: 180px; }
.roster-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.roster-item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--bz-ink-900); border: 1px solid var(--bz-ink-700); border-radius: 10px;
  padding: 10px 14px; color: var(--bz-bone);
}
.roster-item .btn.danger { padding: 6px 12px; font-size: 13px; }
.roster-empty { padding: 8px 0; }

/* Roster rows with handicap/nickname + inline edit */
.hcp-input { width: 84px; }
.roster-item { flex-wrap: wrap; }
.roster-main { display: flex; align-items: baseline; gap: 12px; flex: 1; min-width: 0; }
.roster-name { color: var(--bz-bone); text-decoration: none; font-weight: 600; }
.roster-name:hover { color: var(--bz-signal-light); }
.roster-hcp { font-family: var(--bz-mono); font-size: 12px; color: var(--bz-bone-dim); }
.roster-actions { display: flex; gap: 8px; }
.roster-actions .btn { padding: 6px 12px; font-size: 13px; }
.roster-edit[hidden] { display: none; }
.roster-edit { display: flex; gap: 12px; flex-wrap: wrap; align-items: end; width: 100%; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--bz-ink-700); }
.roster-edit label { display: flex; flex-direction: column; gap: 5px; font-size: 11px; letter-spacing: 0.5px; text-transform: uppercase; color: var(--bz-bone-dim); }
.h2h-record { font-family: var(--bz-mono); color: var(--bz-bone); }

/* Player profile */
.profile-meta { display: flex; gap: 32px; flex-wrap: wrap; }
.profile-stat { display: flex; flex-direction: column; gap: 7px; }
.profile-stat-label { font-family: var(--bz-mono); font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--bz-bone-dim); }
.profile-stat-value { font-size: 22px; color: var(--bz-bone); font-weight: 700; }
.form-chips { display: flex; gap: 5px; }
.form-chip { width: 24px; height: 24px; border-radius: 6px; display: grid; place-items: center; font-size: 12px; font-weight: 700; font-family: var(--bz-mono); }
.form-chip.win { background: rgba(34, 197, 94, 0.18); color: #86efac; }
.form-chip.loss { background: rgba(230, 57, 70, 0.18); color: var(--bz-signal-light); }

/* ===================================================================
   Site footer — legal links (dashboard, auth pages, guide/legal pages)
   =================================================================== */
.site-footer {
  border-top: 1px solid var(--bz-ink-700);
  margin-top: 56px;
  padding: 44px 20px 28px;
  color: var(--bz-bone-dim);
  font-family: var(--bz-sans);
}
.site-footer .footer-inner {
  max-width: 1000px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 40px 56px;
  justify-content: space-between;
}
.footer-brand { max-width: 280px; }
.footer-logo {
  font-family: var(--bz-serif); font-size: 26px; letter-spacing: 0.3px;
  color: var(--bz-bone); text-decoration: none; display: inline-block; line-height: 0;
}
.footer-logo img { height: 30px; width: auto; display: block; }
.footer-tagline { margin: 12px 0 0; font-size: 14px; line-height: 1.6; color: var(--bz-bone-dim); }
.footer-social { display: flex; width: fit-content; align-items: center; gap: 8px; margin-top: 14px; padding: 4px 0; font-size: 14px; color: var(--bz-bone-dim); text-decoration: none; }
.footer-social:hover { color: var(--bz-bone); }
.footer-social + .footer-social { margin-top: 4px; }
.footer-cols { display: flex; flex-wrap: wrap; gap: 48px; }
.footer-col { display: flex; flex-direction: column; gap: 3px; }
.footer-col h4 {
  margin: 0 0 3px; font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1.4px; color: var(--bz-bone);
}
.footer-col a { color: var(--bz-bone-dim); text-decoration: none; font-size: 14px; padding: 4px 0; } /* ≥24px tap target, same visual spacing */
.footer-col a:hover { color: var(--bz-bone); }
.footer-divider { max-width: 1000px; margin: 34px auto 0; height: 1px; background: var(--bz-ink-700); }
.footer-bottom {
  max-width: 1000px; margin: 18px auto 0;
  display: flex; flex-wrap: wrap; gap: 10px;
  align-items: center; justify-content: space-between;
}
.footer-meta { font-size: 13px; color: var(--bz-bone-dim); }
body.auth-page .site-footer { background: transparent; }
@media (max-width: 760px) {
  .site-footer .footer-inner { gap: 30px; }
  .footer-cols { gap: 32px; width: 100%; }
}

/* ===================================================================
   Support pages (Help Centre, Contact, Report a Bug, Feedback)
   =================================================================== */
.support-form {
  display: flex; flex-direction: column; gap: 16px;
  max-width: 580px; margin-top: 4px;
}
.support-form label {
  display: flex; flex-direction: column; gap: 7px;
  font-size: 13px; font-weight: 600; color: var(--bz-bone);
}
.support-form label .muted { font-weight: 400; color: var(--bz-bone-dim); }
.support-form input,
.support-form textarea,
.support-form select {
  font-family: var(--bz-sans); font-size: 15px; color: var(--bz-bone);
  background: var(--bz-ink-950); border: 1px solid var(--bz-ink-600);
  border-radius: 10px; padding: 11px 13px; width: 100%; box-sizing: border-box;
}
.support-form textarea { min-height: 140px; resize: vertical; line-height: 1.55; }
.support-form input:focus,
.support-form textarea:focus,
.support-form select:focus { outline: none; border-color: var(--bz-signal); }
/* Honeypot — visually hidden, off-screen, not announced. */
.support-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.support-form button { align-self: flex-start; }
.support-note {
  background: rgba(34, 197, 94, 0.12); border: 1px solid rgba(34, 197, 94, 0.4);
  color: #bbf7d0; padding: 11px 15px; border-radius: 10px; font-size: 14px; line-height: 1.5;
}
.support-error {
  background: rgba(230, 57, 70, 0.14); border: 1px solid rgba(230, 57, 70, 0.45);
  color: #fecaca; padding: 11px 15px; border-radius: 10px; font-size: 14px;
}
.support-cards {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px; margin: 6px 0 10px;
}
.support-card {
  display: block; text-decoration: none; color: inherit;
  background: var(--bz-ink-800); border: 1px solid var(--bz-ink-700);
  border-radius: 14px; padding: 20px; transition: border-color .15s, transform .05s;
}
.support-card:hover { border-color: var(--bz-signal); }
.support-card:active { transform: translateY(1px); }
.support-card h3 { margin: 0 0 6px; font-size: 17px; color: var(--bz-bone); }
.support-card p { margin: 0; font-size: 14px; color: var(--bz-bone-dim); line-height: 1.5; }
.support-faq { margin-top: 8px; }
.support-faq h3 { font-size: 17px; color: var(--bz-bone); margin: 20px 0 6px; }
.support-faq p { color: var(--bz-bone-dim); line-height: 1.6; margin: 0 0 12px; max-width: 70ch; }

/* ===================================================================
   Legal pages (Terms, Privacy, Cookies, Acceptable Use)
   Reuse the guide shell (body.guide) for the dark theme + header.
   =================================================================== */
.legal-body { margin-top: 8px; }
.legal-body h2 {
  font-family: var(--bz-serif); font-weight: 400; font-size: 28px;
  color: var(--bz-bone); margin: 34px 0 12px; letter-spacing: 0.3px;
}
.legal-body h3 {
  font-size: 18px; font-weight: 700; color: var(--bz-bone); margin: 22px 0 8px;
}
.legal-body p,
.legal-body li { color: var(--bz-bone-dim); line-height: 1.7; }
.legal-body p { margin: 0 0 12px; max-width: 70ch; }
.legal-body ul, .legal-body ol { margin: 0 0 14px; padding-left: 22px; max-width: 70ch; }
.legal-body li { margin-bottom: 7px; }
.legal-body strong { color: var(--bz-bone); }
/* In-text links. Guide-layout pages wrap content in .guide-wrap, not <main>,
   so their rule can't depend on <main> or links fall back to browser blue. */
body.landing main :is(p, li) a:not(.btn),
body.guide :is(p, li, td, .guide-tip) a:not(.btn) { color: var(--bz-signal-light); }
.legal-body a { color: var(--bz-signal-light); text-decoration: none; }
.legal-body a:hover { text-decoration: underline; }
.legal-body code {
  font-family: var(--bz-mono); font-size: 0.9em;
  background: var(--bz-ink-950); color: var(--bz-butter);
  padding: 1px 6px; border-radius: 5px;
}
.legal-body table {
  width: 100%; border-collapse: collapse; margin: 4px 0 18px;
  font-size: 14px; color: var(--bz-bone-dim);
}
.legal-body th, .legal-body td {
  text-align: left; padding: 9px 12px; border: 1px solid var(--bz-ink-700);
  vertical-align: top;
}
.legal-body th { color: var(--bz-bone); font-weight: 700; background: var(--bz-ink-800); }
.legal-updated {
  font-family: var(--bz-mono); font-size: 12px; text-transform: uppercase;
  letter-spacing: 1px; color: var(--bz-bone-dim);
}
.legal-nav {
  display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 8px;
}
.legal-nav a {
  font-family: var(--bz-mono); font-size: 12px; text-transform: uppercase; letter-spacing: 1px;
  color: var(--bz-bone-dim); text-decoration: none;
  border: 1px solid var(--bz-ink-700); border-radius: 999px; padding: 7px 13px;
}
.legal-nav a:hover { color: var(--bz-bone); border-color: var(--bz-signal); }
.legal-nav a.current { color: var(--bz-bone); border-color: var(--bz-signal); background: rgba(230, 57, 70, 0.12); }


/* ===========================================================================
   Snooker Shootout — clock widget, scorer clock controls, create-form config
   The widget (.sclock) is shared by the overlay, the table view and the
   scorer's silent readout. Built by /js/shootout-clock.js.
   ======================================================================== */

/* --- create-match form: shot-clock config grid ---
   Spans the full form width (it's a grid item in the 2-col new-match-form) and
   its inputs are allowed to shrink (min-width:0) so the nested grid can't push
   the modal wider than its container. */
.new-match-form .shootout-config { grid-column: 1 / -1; }
.shootout-config { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.shootout-config .field-label { font-weight: 700; color: var(--bz-bone, #e2e8f0); }
.shootout-config .field-hint { font-size: 12px; color: #94a3b8; margin: 0 0 4px; line-height: 1.4; }
.shootout-config-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.shootout-config-grid label { display: flex; flex-direction: column; font-size: 12px; color: #94a3b8; gap: 4px; min-width: 0; }
.shootout-config-grid input { min-width: 0; width: 100%; }
/* create-match dialog: short note replacing the old config block */
.shootout-note { grid-column: 1 / -1; font-size: 12px; color: #94a3b8; line-height: 1.5; margin: 0; }
.new-match-form .shootout-note[hidden] { display: none; }
.shootout-config-grid label.is-disabled { opacity: 0.4; }

/* ============================================================
   Compact mobile ref scorer — clock + scores + scoring in one
   view, with setup tucked into a collapsible panel.
   ============================================================ */
.shootout-scorer { padding: 12px; }
.shootout-scorer .top-nav { gap: 8px; padding: 8px 12px; margin-bottom: 10px; }

/* Live panel: scores + clock; sticky so it stays in view while scoring. */
.ref-live {
  position: sticky; top: 6px; z-index: 5;
  background: #0b1220; border: 1px solid #1e293b; border-radius: 12px;
  padding: 10px; margin-bottom: 12px; display: flex; flex-direction: column; gap: 10px;
}
.ref-scores { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rs-side {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 6px; border-radius: 10px; background: #131f33; border: 1px solid transparent;
}
.rs-side.is-active { background: #14233f; border-color: #2747a6; box-shadow: inset 0 0 0 1px #2747a6; }
.rs-name {
  font-family: var(--bz-sans); font-size: 13px; font-weight: 700; color: #cbd5e1;
  text-transform: uppercase; letter-spacing: 0.5px; display: flex; align-items: center; gap: 6px;
  max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rs-arrow { color: #f25862; font-size: 14px; }
.rs-pts { font-family: var(--bz-mono); font-weight: 700; font-size: 40px; line-height: 1; color: #fff; font-variant-numeric: tabular-nums; }

.ref-clockbar { display: flex; align-items: stretch; gap: 8px; }
.ref-clockbar .clock-readout {
  flex: 1; display: flex; justify-content: center; align-items: center;
  background: #020617; border: 1px solid #1e293b; border-radius: 10px; padding: 6px 10px;
}
.ref-clockbar .clock-readout .sci-num { font-size: 30px; }
.ref-clockbar .clock-readout .sci-time { font-size: 24px; }
.ref-clock-btns { display: flex; gap: 8px; }
.ref-clock-btns button {
  padding: 0 16px; border-radius: 10px; border: 1px solid #1e293b; background: #131f33;
  color: #e2e8f0; font-family: var(--bz-mono); font-weight: 700; font-size: 14px; cursor: pointer; white-space: nowrap;
}
.ref-clock-btns button.primary { background: #16a05a; border-color: #16a05a; color: #04140b; }
.ref-clock-btns button:hover { filter: brightness(1.08); }
.ref-clock-btns button:disabled { opacity: 0.4; cursor: not-allowed; }

/* Scoring pad — large tap targets; 7 balls always fit one row. */
.ref-pad { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.shootout-scorer .ball-row { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.shootout-scorer .ball { width: 100%; height: auto; aspect-ratio: 1 / 1; font-size: clamp(16px, 4.5vw, 24px); }
.shootout-scorer .foul-row { display: flex; align-items: center; gap: 8px; }
.shootout-scorer .foul-row .row-label { flex: 0 0 auto; font-size: 12px; color: #94a3b8; text-transform: uppercase; letter-spacing: 1px; }
.shootout-scorer .foul-row button { flex: 1; padding: 12px 0; font-size: 16px; }
.shootout-scorer .action-row { display: flex; gap: 8px; }
.shootout-scorer .switch-player { flex: 1 1 auto; font-size: 18px; padding: 16px; }
/* Undo gets its own centred row — a big, easy-to-hit target for mis-taps. */
.shootout-scorer .undo-row { justify-content: center; }
.shootout-scorer .action.undo { flex: 0 1 260px; font-size: 18px; padding: 16px; }

/* Break history: sequence of balls potted this break, as coloured value pips. */
.break-history {
  display: flex; align-items: center; gap: 10px;
  background: #0f3520; border: 1px solid #14532d; border-radius: 10px;
  padding: 8px 12px; min-width: 0;
}
.break-history[hidden] { display: none; }
.break-history .bh-label {
  flex: 0 0 auto; font-size: 11px; font-weight: 700; letter-spacing: 1px;
  text-transform: uppercase; color: #86efac;
}
.break-history .bh-balls {
  flex: 1 1 auto; display: flex; align-items: center; gap: 5px;
  overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.break-history .bh-balls::-webkit-scrollbar { display: none; }
.break-history .bh-total {
  flex: 0 0 auto; font-family: var(--bz-mono); font-weight: 800; font-size: 24px;
  color: #fff; font-variant-numeric: tabular-nums;
}
/* Dark text on the light-coloured balls for legibility. */
.break-history .break-ball-yellow { color: #000; text-shadow: none; }

/* Setup panel (collapsed by default). */
.ref-setup { background: #0b1220; border: 1px solid #1e293b; border-radius: 12px; margin-bottom: 28px; }
.ref-setup > summary { cursor: pointer; padding: 14px 16px; font-weight: 700; font-size: 15px; color: #e2e8f0; list-style: none; display: flex; align-items: center; gap: 8px; }
.ref-setup > summary::-webkit-details-marker { display: none; }
.ref-setup > summary::before { content: "\2699"; opacity: 0.8; }
.ref-setup[open] > summary { border-bottom: 1px solid #1e293b; }
.ref-setup-body { padding: 16px; display: flex; flex-direction: column; gap: 16px; }
.ref-setup-body input[type="text"], .ref-setup-body input[type="number"] {
  background: #020617; color: #e2e8f0; border: 1px solid #334155; border-radius: 8px; padding: 10px 12px; font-size: 15px; width: 100%;
}
.ref-setup-body .name-label, .ref-setup-body .match-label-field {
  display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.5px;
}
.ref-setup-body .players { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ref-setup-body .player-setup { display: flex; flex-direction: column; gap: 10px; }
.ref-setup-body .reset-row { display: flex; gap: 10px; }
.ref-setup-body .reset-row .danger { flex: 1; }

/* Narrow screens: stack the clock readout above its buttons so Start/Pause and
   Reset Shot sit on their own full-width line instead of being squished. */
@media (max-width: 600px) {
  .ref-clockbar { flex-direction: column; align-items: stretch; }
  .ref-clock-btns { display: flex; }
  .ref-clock-btns button { flex: 1; padding: 12px 8px; }
}

/* --- the clock widget itself --- */
.sclock {
  display: inline-flex; align-items: center; gap: clamp(10px, 1.6vw, 22px);
  font-family: var(--bz-mono, monospace);
}
.sclock-shot { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.sclock-ring {
  --p: 100;
  position: relative;
  width: clamp(70px, 9vw, 130px); height: clamp(70px, 9vw, 130px);
  border-radius: 50%;
  display: grid; place-items: center;
  /* conic progress ring; the inner mask leaves a thick rim */
  background:
    radial-gradient(closest-side, var(--bz-ink-900, #0a1628) 70%, transparent 72% 100%),
    conic-gradient(var(--sclock-accent, #16a05a) calc(var(--p) * 1%), rgba(255,255,255,0.12) 0);
  transition: background 120ms linear;
}
.sclock-shot-num {
  font-size: clamp(30px, 4.4vw, 64px); font-weight: 700; line-height: 1;
  color: var(--bz-bone, #f5f0e6); font-variant-numeric: tabular-nums;
}
.sclock-shot-label, .sclock-match-label {
  font-size: clamp(9px, 0.9vw, 12px); letter-spacing: 2px; text-transform: uppercase;
  color: var(--bz-bone-dim, #aeb8c7);
}
.sclock-match { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.sclock-match-time {
  font-size: clamp(22px, 3vw, 44px); font-weight: 700; line-height: 1;
  color: var(--bz-bone, #f5f0e6); font-variant-numeric: tabular-nums;
}

/* state colours — drive the ring accent + number colour */
.sclock[data-state="run"]     { --sclock-accent: #16a05a; }
.sclock[data-state="warn"]    { --sclock-accent: var(--bz-butter, #f5c242); }
.sclock[data-state="warn"]    .sclock-shot-num { color: var(--bz-butter, #f5c242); }
.sclock[data-state="expired"] { --sclock-accent: var(--bz-signal, #e63946); animation: sclock-flash 0.5s steps(1) infinite; }
.sclock[data-state="expired"] .sclock-shot-num { color: var(--bz-signal-light, #f25862); }
.sclock[data-state="paused"]  { --sclock-accent: #475569; opacity: 0.78; }
.sclock[data-state="idle"]    { --sclock-accent: #475569; }
.sclock[data-state="timeup"]  { --sclock-accent: var(--bz-signal, #e63946); }
.sclock[data-state="timeup"]  .sclock-match-time { color: var(--bz-signal-light, #f25862); }

@keyframes sclock-flash {
  0%   { filter: none; }
  50%  { filter: drop-shadow(0 0 14px rgba(230,57,70,0.85)); }
}

/* --- overlay (OBS): inline clock that sits in the score-bar centre cell,
   replacing the frames cell. Same height/feel as the rest of the lower third. --- */
.tv-bar .shootout-inline { display: flex; }
.tv-bar .shootout-inline[hidden] { display: none; }
.tv-bar .shootout-inline .sclock-inline {
  display: flex; align-items: center; gap: 20px;
  height: 40px; padding: 0 20px;
  background: #0e6e5a;            /* classic (BBC) theme: matches the teal frames cell it replaces */
  border-right: 2px solid #000;   /* divider before player 2's score box */
  font-family: var(--bz-mono, monospace);
}
/* Scoreline theme keeps its red centre accent. */
.scoreboard[data-theme="scoreline"] .tv-bar .shootout-inline .sclock-inline { background: #E63946; }
.sci-seg { display: flex; align-items: baseline; gap: 7px; }
.sci-k {
  font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85);
}
.sci-num, .sci-time {
  font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1;
  color: #fff;
}
.sci-num { font-size: 26px; min-width: 30px; text-align: center; }
.sci-time { font-size: 22px; }
/* state cues — shot number goes amber in the warning window; the whole cell
   flashes at expiry; the match time goes amber when match time is up. */
.sclock-inline[data-state="warn"]    .sci-num  { color: var(--bz-butter, #f5c242); }
.sclock-inline[data-state="expired"]            { animation: sclock-inline-flash 0.45s steps(1) infinite; }
.sclock-inline[data-state="timeup"]  .sci-time { color: var(--bz-butter, #f5c242); }
.sclock-inline[data-state="paused"]             { opacity: 0.9; }
/* brightness-based flash so it reads on either the teal or red band */
@keyframes sclock-inline-flash { 50% { filter: brightness(1.7); } }

/* --- table view: clock sits in the centre column --- */
/* Pool match clock on the big screen, under the frame count. */
.tv-pool-clock {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  margin-top: 10px; padding: 8px 22px; border-radius: 14px;
  background: var(--bz-signal); color: #fff; font-family: var(--bz-mono);
}
.tv-pool-clock[hidden] { display: none; }
.tv-pool-clock span { font-size: clamp(11px, 1.1vw, 16px); letter-spacing: 2px; text-transform: uppercase; }
.tv-pool-clock strong { font-size: clamp(32px, 4.4vw, 72px); line-height: 1; }
.tv-pool-clock[data-state="expired"] { animation: pm-clock-blink 0.8s steps(2, start) infinite; }
.tv-shootout-clock { display: flex; justify-content: center; padding: 6px 0; }
.tv-shootout-clock[hidden] { display: none; }

/* --- scorer: silent readout + control buttons --- */
.clock-controls {
  background: #0b1220; border: 1px solid #1e293b; border-radius: 10px;
  padding: 16px; margin-bottom: 20px; display: flex; flex-direction: column; gap: 14px;
}
.clock-readout { display: flex; justify-content: center; padding: 6px 0; }
.clock-readout .sclock { gap: 18px; }
.clock-buttons { display: flex; flex-wrap: wrap; gap: 10px; }
.clock-buttons button {
  flex: 1 1 auto; min-width: 120px; padding: 14px 16px; border-radius: 10px;
  border: 1px solid #1e293b; background: #131f33; color: #e2e8f0;
  font-family: var(--bz-mono, monospace); font-weight: 700; font-size: 15px; cursor: pointer;
}
.clock-buttons button:hover { background: #1e2d45; }
.clock-buttons button.primary { background: #16a05a; border-color: #16a05a; color: #04140b; }
.clock-buttons button.primary:hover { background: #1fb567; }
.clock-buttons button.danger { background: transparent; border-color: #7f1d1d; color: #fca5a5; }
.clock-buttons button.danger:hover { background: #450a0a; }
.clock-buttons button.armed { background: var(--bz-signal, #e63946); border-color: var(--bz-signal, #e63946); color: #fff; }

/* big, obvious switch-player button on the shootout scorer */
.shootout-scorer .switch-player {
  flex: 1 1 100%; background: #1e3a8a; border-color: #1e3a8a; color: #dbeafe;
  font-size: 18px; padding: 16px;
}
.shootout-scorer .switch-player:hover { background: #2747a6; }

/* Club Pro gate badge — on locked scorer toggles and the dashboard Shootout card. */
.pro-badge {
  margin-left: 8px;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(29, 185, 84, 0.15);
  color: #13d670;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none;
  white-space: nowrap;
}
.pro-badge:hover { background: rgba(29, 185, 84, 0.28); }
.checkbox-label.is-locked span { opacity: 0.6; }

/* ===========================================================================
   Pool frame-stats bar — both players' stats under the pool bar, with the
   average frame time in the centre (lines up with the "Race to" box).
   =========================================================================== */
.pool-stats-bar {
  position: fixed;
  top: 124px;           /* league strip (28) + pool bar (96) */
  left: 0;
  width: 100%;
  display: flex;
  z-index: 2;
  font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif;
  color: #fff;
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
  transition: transform 280ms ease, opacity 280ms ease;
}
.pool-stats-bar[hidden] { display: none; }
.pool-stats-bar.visible { transform: translateY(0); opacity: 1; }
.pool-stats-side {
  flex: 1 1 0;
  display: flex;
  align-items: center;
  height: 40px;
  padding: 0 36px;
  background: linear-gradient(180deg, #16243a 0%, #0b1424 100%);
  border: 2px solid #000;
  border-top: 0;
  overflow: hidden;
}
.pool-stats-right { justify-content: flex-end; }
.pool-stats-right .stats-bar-metrics { flex-direction: row-reverse; }
.pool-stats-centre {
  flex: 0 0 auto;
  min-width: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  background: #E63946;
  border-bottom: 2px solid #000;
}
.pool-stats-centre .sb-k { color: rgba(255, 255, 255, 0.85); }
.pool-stats-bar .sb-metric[hidden] { display: none; }
@media (max-width: 1400px) { .pool-stats-bar { top: 116px; } }
/* Custom board colours: the stats bar follows the scoreboard — score-box
   colour fading into the board, name colour for text, accent in the centre. */
.scoreboard.custom-colors .pool-stats-bar { color: var(--sb-names); }
.scoreboard.custom-colors .pool-stats-side {
  background: linear-gradient(180deg, var(--sb-scores) 0%, var(--sb-board) 100%);
}
.scoreboard.custom-colors .pool-stats-bar .sb-k { color: inherit; opacity: 0.72; }
.scoreboard.custom-colors .pool-stats-centre { background: var(--sb-accent); color: var(--sb-accent-text); }
.scoreboard.custom-colors .pool-stats-centre .sb-k { opacity: 0.85; }

/* ===========================================================================
   Pool scoreboard V2 — floating glass bar (pool scorer → Scoreboard style).
   Same markup and board colours as Classic: the bar is inset from the screen
   edges and rounded, the board colour is see-through (the table shows behind
   it) while the frame and race-to cells stay solid, and the league label and
   frame stats hang off it as matching tabs. Mirrors the snooker glass themes.
   The translucent fill is a ::before layer so the text stays fully opaque;
   ::after stays the ball-colour stripe along the bottom.
   =========================================================================== */
.scoreboard[data-sport="pool"][data-pool-style="v2"] { --pv-inset: 24px; --pv-glass: 0.82; --pv-h: 72px; }
.scoreboard[data-sport="pool"][data-pool-style="v2"] .pool-bar {
  left: var(--pv-inset);
  width: calc(100% - 2 * var(--pv-inset));
  height: var(--pv-h);
  background: transparent;
  border: 0;
  border-radius: 8px;
  isolation: isolate;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45), 0 0 12px var(--sb-accent-glow, rgba(230, 57, 70, 0.55));
}
.scoreboard[data-sport="pool"][data-pool-style="v2"] .pool-bar::before,
.scoreboard[data-sport="pool"][data-pool-style="v2"] .league-strip::before,
.scoreboard[data-sport="pool"][data-pool-style="v2"] .pool-stats-bar::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--sb-board, #0E1A2B);
  opacity: var(--pv-glass);
  border-radius: inherit;
}
.scoreboard[data-sport="pool"][data-pool-style="v2"] .pool-bar::after { height: 3px; }
.scoreboard[data-sport="pool"][data-pool-style="v2"].balls-picked .pool-bar::after { height: 4px; }

/* Names: transparent panels; the player at the table gets a soft lift and an
   accent line along the top instead of a solid block. */
.scoreboard[data-sport="pool"][data-pool-style="v2"] .pool-player {
  background: transparent;
  padding: 0 28px;
  font-size: calc(26px * var(--sb-text-scale, 1));
  letter-spacing: 1px;
}
.scoreboard[data-sport="pool"][data-pool-style="v2"] .pool-player.is-active {
  background: rgba(255, 255, 255, 0.07);
  box-shadow: inset 0 3px 0 0 var(--sb-accent, #E63946);
}
.scoreboard[data-sport="pool"][data-pool-style="v2"].light-board .pool-player.is-active { background: rgba(0, 0, 0, 0.05); }
.scoreboard[data-sport="pool"][data-pool-style="v2"] .pool-arrow { font-size: 20px; }

/* Frames and race-to: solid cells, no black dividers, slimmer numbers. */
.scoreboard[data-sport="pool"][data-pool-style="v2"] .pool-frame {
  flex-basis: 100px;
  font-size: calc(46px * var(--sb-num-scale, 1));
  border: 0;
}
.scoreboard[data-sport="pool"][data-pool-style="v2"] .pool-target {
  flex-basis: 124px;
  padding: 4px 0;
  border: 0;
}
.scoreboard[data-sport="pool"][data-pool-style="v2"] .pool-target-label { font-size: 11px; letter-spacing: 3px; margin-bottom: 3px; }
.scoreboard[data-sport="pool"][data-pool-style="v2"] .pool-target-value { font-size: calc(32px * var(--sb-num-scale, 1)); }
.scoreboard[data-sport="pool"][data-pool-style="v2"] .pool-target.clock-on .pool-target-value,
.scoreboard[data-sport="pool"][data-pool-style="v2"] .pool-target.has-sets .pool-target-value { font-size: calc(28px * var(--sb-num-scale, 1)); }
.scoreboard[data-sport="pool"][data-pool-style="v2"] .pool-target.clock-on .pool-target-value.is-long { font-size: calc(22px * var(--sb-num-scale, 1)); }
.scoreboard[data-sport="pool"][data-pool-style="v2"] .pool-target-sub { font-size: 10px; margin-top: 3px; }

/* League / match label: a narrower glass tab sitting on top of the bar. */
.scoreboard[data-sport="pool"][data-pool-style="v2"] .league-strip {
  left: 25%;
  width: 50%;
  background: transparent;
  border: 0;
  border-radius: 8px 8px 0 0;
  isolation: isolate;
}

/* Frame stats: a centred glass tab under the bar, sized to its content. */
.scoreboard[data-sport="pool"][data-pool-style="v2"] .pool-stats-bar {
  top: calc(28px + var(--pv-h));
  left: 0;
  right: 0;
  width: fit-content;
  max-width: calc(100% - 2 * var(--pv-inset) - 16px);
  margin: 0 auto;
  border-radius: 0 0 8px 8px;
  overflow: hidden;
  isolation: isolate;
  color: var(--sb-names, #fff);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
}
.scoreboard[data-sport="pool"][data-pool-style="v2"] .pool-stats-side {
  flex: 0 0 auto;
  height: 38px;
  padding: 0 24px;
  background: transparent;
  border: 0;
}
.scoreboard[data-sport="pool"][data-pool-style="v2"] .pool-stats-centre {
  min-width: 124px;
  border: 0;
  background: var(--sb-accent, #E63946);
  color: var(--sb-accent-text, #fff);
}
.scoreboard[data-sport="pool"][data-pool-style="v2"] .pool-stats-bar .sb-k { color: inherit; opacity: 0.7; font-size: 11px; letter-spacing: 1px; }
.scoreboard[data-sport="pool"][data-pool-style="v2"] .pool-stats-bar .sb-v { font-size: 18px; }

/* Winner banners: the same floating, rounded shape over the bar. */
.scoreboard[data-sport="pool"][data-pool-style="v2"] .winner-banner,
.scoreboard[data-sport="pool"][data-pool-style="v2"] .match-winner-banner {
  left: var(--pv-inset);
  width: calc(100% - 2 * var(--pv-inset));
  border: 0;
  border-radius: 8px;
}
.scoreboard[data-sport="pool"][data-pool-style="v2"] .winner-banner { height: var(--pv-h); }
.scoreboard[data-sport="pool"][data-pool-style="v2"] .winner-banner-inner { font-size: 30px; line-height: var(--pv-h); }
.scoreboard[data-sport="pool"][data-pool-style="v2"] .match-winner-banner { height: calc(var(--pv-h) + 16px); }
.scoreboard[data-sport="pool"][data-pool-style="v2"] .match-winner-inner { font-size: 38px; line-height: calc(var(--pv-h) + 16px); }

/* Narrower OBS scenes (e.g. 1280px composing). */
@media (max-width: 1400px) {
  .scoreboard[data-sport="pool"][data-pool-style="v2"] { --pv-inset: 16px; --pv-h: 64px; }
  .scoreboard[data-sport="pool"][data-pool-style="v2"] .pool-player { font-size: calc(22px * var(--sb-text-scale, 1)); padding: 0 20px; }
  .scoreboard[data-sport="pool"][data-pool-style="v2"] .pool-frame { flex-basis: 86px; font-size: calc(40px * var(--sb-num-scale, 1)); }
  .scoreboard[data-sport="pool"][data-pool-style="v2"] .pool-target { flex-basis: 108px; }
  .scoreboard[data-sport="pool"][data-pool-style="v2"] .pool-target-value { font-size: calc(28px * var(--sb-num-scale, 1)); }
}
@media (max-width: 1100px) {
  .scoreboard[data-sport="pool"][data-pool-style="v2"] { --pv-inset: 12px; --pv-h: 58px; }
  .scoreboard[data-sport="pool"][data-pool-style="v2"] .pool-player { font-size: calc(19px * var(--sb-text-scale, 1)); padding: 0 14px; }
  .scoreboard[data-sport="pool"][data-pool-style="v2"] .pool-frame { flex-basis: 74px; font-size: calc(34px * var(--sb-num-scale, 1)); }
  .scoreboard[data-sport="pool"][data-pool-style="v2"] .pool-target { flex-basis: 96px; }
}

/* Pool scorer: tag / dry-break buttons show their selected state. */
body.scorer .pool-how-row button.selected,
body.scorer .pool-dry-row button.selected,
body.scorer .pool-balls-row button.selected {
  background: var(--bz-signal, #e63946);
  border-color: var(--bz-signal, #e63946);
  color: #fff;
}
.frame-row.pool-how-row[hidden] { display: none; }
.pool-balls-row button { display: inline-flex; align-items: center; gap: 8px; }
.pool-balls-row .pool-ball, .sp-name .pool-ball { font-size: 18px; }
.pm-name .pool-ball { font-size: 1em; margin-right: 0.3em; }

/* Spotted cue ball — marks who broke the current pool frame (overlay + scorer).
   Drawn like a match cue ball: one red spot facing out and the others just
   showing round the edge. Same size as the ball-colour balls. */
.cue-ball-marker {
  flex-shrink: 0;
  display: inline-block;
  width: 0.8em;
  height: 0.8em;
  border-radius: 50%;
  background: radial-gradient(circle at 46% 44%, #d62828 0 15%, transparent 16.5%),
              radial-gradient(16% 7% at 48% 4%, #d62828 0 80%, transparent 100%),
              radial-gradient(7% 15% at 96% 52%, #d62828 0 80%, transparent 100%),
              radial-gradient(7% 15% at 4% 48%, #d62828 0 80%, transparent 100%),
              radial-gradient(16% 7% at 44% 96%, #d62828 0 80%, transparent 100%),
              radial-gradient(circle at 35% 30%, #ffffff 0%, #eef1f4 50%, #b9c2cc 100%);
  box-shadow: inset -0.08em -0.1em 0.18em rgba(0, 0, 0, 0.3), 0 0 6px rgba(255, 255, 255, 0.35);
  vertical-align: middle;
}
.cue-ball-marker[hidden] { display: none; }

/* =================================================================== */
/* App top nav (dashboard) — brand, links, account dropdown            */
/* =================================================================== */
/* Shared sidebar (partials/app-nav.html). One ground with the page, split
   from it by a single rule; the club switcher scopes the club links. */
body.has-app-nav { padding-left: calc(var(--app-nav-w) + 16px); }
:root { --app-nav-w: 232px; }
.app-nav {
  position: fixed; inset: 0 auto 0 0; z-index: 50;
  width: var(--app-nav-w);
  display: flex; flex-direction: column;
  background: var(--bz-ink-950);
  border-right: 1px solid var(--bz-ink-800);
  font-family: var(--bz-sans);
}
.app-nav-bar { display: flex; align-items: center; height: 64px; padding: 0 20px; flex: 0 0 auto; }
.app-nav-brand { display: flex; align-items: center; }
.app-nav-brand img { height: 22px; width: auto; display: block; }

.app-nav-links {
  flex: 1 1 auto; min-height: 0; overflow-y: auto;
  display: flex; flex-direction: column; gap: 20px;
  padding: 4px 12px 12px;
}
.app-nav-group { display: flex; flex-direction: column; gap: 2px; }
.app-nav-group[hidden] { display: none; }
.app-nav-group-label { margin: 0 0 4px; padding: 0 10px; font-size: 12px; font-weight: 600; color: #8592a8; }
.app-nav-group a {
  display: flex; align-items: center; min-height: 34px; padding: 0 10px; border-radius: 8px;
  color: var(--bz-bone-dim); text-decoration: none; font-size: 14px; font-weight: 500;
  transition: color .15s, background-color .15s;
}
.app-nav-group a:hover { color: var(--bz-bone); background: var(--bz-ink-900); }
.app-nav-group a[aria-current="page"] { color: var(--bz-bone); background: var(--bz-ink-800); font-weight: 600; }
.app-nav-group a[hidden] { display: none; }

/* Club switcher */
.club-switch { position: relative; }
.club-switch-btn {
  display: grid; grid-template-columns: 1fr auto; align-items: center; column-gap: 8px;
  width: 100%; padding: 8px 10px; border-radius: 10px; text-align: left;
  background: var(--bz-ink-900); border: 0; color: var(--bz-bone); cursor: pointer;
  font-family: var(--bz-sans);
}
.club-switch-btn:hover, .club-switch-btn[aria-expanded="true"] { background: var(--bz-ink-800); }
.club-switch-label { grid-column: 1; font-size: 12px; color: var(--bz-bone-dim); }
.club-switch-name { grid-column: 1; font-size: 15px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.club-switch-caret { grid-column: 2; grid-row: 1 / 3; font-size: 11px; color: var(--bz-bone-dim); }
.club-switch-panel, .user-menu-panel {
  position: absolute; left: 0; right: 0; z-index: 2;
  padding: 6px; display: flex; flex-direction: column;
  background: var(--bz-ink-800); border: 1px solid var(--bz-ink-700); border-radius: 12px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5);
}
.club-switch-panel { top: calc(100% + 6px); max-height: 60vh; overflow-y: auto; }
.club-switch-panel[hidden], .user-menu-panel[hidden] { display: none; }
#clubSwitchList { display: flex; flex-direction: column; }
#clubSwitchList:not(:empty) { padding-bottom: 6px; margin-bottom: 6px; border-bottom: 1px solid var(--bz-ink-700); }
.club-switch-panel a {
  display: block; padding: 9px 10px; border-radius: 8px;
  color: var(--bz-bone); text-decoration: none; font-size: 14px; font-weight: 500;
}
.club-switch-panel a:hover { background: var(--bz-ink-700); }
.club-switch-panel a[aria-current] { font-weight: 700; }
.club-switch-panel a[aria-current]::after { content: " ✓"; color: var(--bz-bone-dim); }
#clubSwitchManage { color: var(--bz-bone-dim); }

/* Account, pinned to the foot of the sidebar */
.user-menu { position: relative; margin-top: auto; }
.user-menu-btn {
  display: flex; align-items: center; gap: 10px; width: 100%;
  background: none; border: 0; border-radius: 10px; padding: 8px 10px;
  color: var(--bz-bone); font: 500 13px var(--bz-sans); text-align: left;
  cursor: pointer;
}
.user-menu-btn:hover, .user-menu-btn[aria-expanded="true"] { background: var(--bz-ink-900); }
.user-avatar {
  width: 28px; height: 28px; border-radius: 50%; flex: 0 0 auto;
  display: grid; place-items: center;
  background: var(--bz-ink-700); color: var(--bz-bone); font-size: 13px; font-weight: 800;
}
.user-menu-label { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-menu-caret { font-size: 11px; color: var(--bz-bone-dim); }
.user-menu-panel { bottom: calc(100% + 6px); }
.user-menu-head {
  margin: 0; padding: 8px 10px 10px;
  font-size: 12px; color: var(--bz-bone-dim);
  display: flex; flex-direction: column; gap: 2px;
}
.user-menu-head strong {
  color: var(--bz-bone); font-size: 14px; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.user-menu-panel a,
.user-menu-panel button {
  display: block; width: 100%; text-align: left;
  padding: 9px 10px; border-radius: 8px;
  background: none; border: 0;
  color: var(--bz-bone); font: 500 14px var(--bz-sans); text-decoration: none;
  cursor: pointer;
}
.user-menu-panel a:hover,
.user-menu-panel button:hover { background: var(--bz-ink-700); }
.user-menu-panel button[hidden] { display: none; }
.user-menu-panel hr { border: 0; border-top: 1px solid var(--bz-ink-700); margin: 6px 0; }
.user-menu-panel .user-menu-signout { color: var(--bz-signal-light); }

.app-nav :focus-visible { outline: 2px solid var(--bz-bone); outline-offset: 2px; }

.app-nav-toggle {
  display: none;
  width: 40px; height: 40px; padding: 0 10px; margin-left: auto;
  background: none; border: 1px solid var(--bz-ink-700); border-radius: 10px;
  flex-direction: column; justify-content: center; gap: 4px;
  cursor: pointer;
}
.app-nav-toggle span { display: block; height: 2px; background: var(--bz-bone); border-radius: 2px; }

/* Phone and small tablet: a top bar; the sidebar opens as a full sheet. */
@media (max-width: 900px) {
  body.has-app-nav { padding-top: 0; padding-left: 16px; }
  .app-nav {
    position: sticky; top: 0; inset: auto; width: auto;
    margin: 0 -16px 24px; border-right: 0; border-bottom: 1px solid var(--bz-ink-800);
  }
  .app-nav-bar { height: 56px; padding: 0 16px; }
  .app-nav-toggle { display: flex; }
  .app-nav-links {
    display: none;
    position: fixed; top: 56px; left: 0; right: 0; bottom: 0;
    padding: 12px 16px 16px; background: var(--bz-ink-950);
  }
  .app-nav-links.open { display: flex; }
  .app-nav-group a { min-height: 44px; font-size: 16px; }
}
body.is-tv.has-app-nav { padding-left: 16px; }

/* Page title row under the nav */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.page-head[hidden] { display: none; }
body.landing .page-head h1 { margin: 0; font-size: 36px; line-height: 1.1; }
.page-head .muted-line { margin-top: 6px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; flex: 0 0 auto; }

/* Club card / match rows: keep action buttons a consistent height */
body.landing .club-actions,
body.landing .match-actions { align-items: center; }
body.landing .club-invite-row .btn { padding: 6px 12px; font-size: 13px; }

@media (max-width: 760px) {
  body.landing .page-head h1 { font-size: 30px; }
  .page-head { flex-wrap: wrap; }
}

/* =================================================================== */
/* Admin back-office (/admin)                                          */
/* =================================================================== */
.admin-tabs {
  display: flex; gap: 4px;
  border-bottom: 1px solid var(--bz-ink-700);
  overflow-x: auto; scrollbar-width: none; /* six tabs scroll sideways on a phone */
}
.admin-tabs::-webkit-scrollbar { display: none; }
.admin-tabs [role="tab"] {
  background: none; border: 0; border-bottom: 2px solid transparent;
  margin-bottom: -1px; padding: 10px 14px;
  color: var(--bz-bone-dim); font: 600 15px var(--bz-sans);
  cursor: pointer;
}
.admin-tabs [role="tab"]:hover { color: var(--bz-bone); }
.admin-tabs [role="tab"][aria-selected="true"] { color: var(--bz-bone); border-bottom-color: var(--bz-signal); }
.admin-panel[hidden] { display: none; }

.admin-search { display: flex; gap: 10px; flex-wrap: wrap; }
.admin-search input { flex: 1 1 260px; min-width: 0; padding: 10px 12px; font-size: 14px; }
.admin-search-sm input { padding: 8px 10px; }
.admin-search select { flex: 0 0 auto; padding: 10px 12px; font-size: 14px; }
.admin-hint { margin: 14px 0 8px; font-size: 13px; }

/* Users and Matches: a details list, one row each, columns headed. */
.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.admin-table th {
  text-align: left; white-space: nowrap; padding: 8px 8px;
  font: 600 11px var(--bz-mono); letter-spacing: 0.6px; text-transform: uppercase; color: var(--bz-bone-dim);
  border-bottom: 1px solid var(--bz-ink-600);
}
.admin-table td { padding: 8px 8px; vertical-align: middle; border-bottom: 1px solid var(--bz-ink-700); color: var(--bz-bone-dim); }
.admin-table tbody tr:hover { background: rgba(255, 255, 255, 0.025); }
.admin-table tr.is-suspended td:first-child { box-shadow: inset 3px 0 0 var(--bz-signal); }
.admin-table .at-main { min-width: 170px; }
/* Last seen: active and login on their own lines in the table. */
.admin-table .at-seen > span { display: block; }
.admin-table .at-when { white-space: nowrap; }
.admin-table code { font-family: var(--bz-mono); font-size: 12px; color: var(--bz-bone); }
.admin-row-title {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
  font-weight: 600; font-size: 14px; color: var(--bz-bone); overflow-wrap: anywhere;
}
.admin-row-meta { font-size: 12px; color: var(--bz-bone-dim); margin-top: 2px; }
.admin-table td.admin-row-actions { white-space: nowrap; text-align: right; }
.admin-row-actions > .btn, .admin-row-actions > .kebab { margin-left: 4px; }
.admin-row-actions .kebab { display: inline-block; }
body.landing .admin-row-actions .btn { padding: 5px 10px; font-size: 12px; }
.admin-table .club-chips { gap: 4px; }
.admin-table .club-chip { font-size: 12px; padding: 2px 3px 2px 8px; white-space: nowrap; }
.admin-table .admin-badge, .admin-table .plan-badge, .admin-table .club-chip-plan { white-space: nowrap; }
/* Emails break only before the @ (see admin.js), never mid-word. */
.admin-users .admin-row-title { overflow-wrap: normal; }
.admin-table time { color: var(--bz-bone); }
.admin-table .muted-when { font-style: italic; }
.admin-msg { margin: 4px 0 0; font-size: 12px; color: #13d670; white-space: normal; }
.admin-msg.err { color: var(--bz-signal-light); }
.admin-msg[hidden] { display: none; }
.admin-score { font-family: var(--bz-mono); color: var(--bz-butter); }

.admin-badge {
  font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 999px;
  background: rgba(29, 185, 84, 0.16); color: #13d670;
}
.admin-badge.live { background: rgba(245, 194, 66, 0.16); color: var(--bz-butter); }
.admin-badge.warn { background: rgba(230, 57, 70, 0.16); color: var(--bz-signal-light); }
.admin-badge.muted { background: var(--bz-ink-700); color: var(--bz-bone-dim); }

.club-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.club-chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 13px; padding: 3px 4px 3px 10px; border-radius: 999px;
  background: var(--bz-ink-700); color: var(--bz-bone);
}
.club-chip button {
  width: 20px; height: 20px; border-radius: 50%; border: 0; padding: 0;
  background: none; color: var(--bz-bone-dim); font-size: 15px; line-height: 1; cursor: pointer;
}
.club-chip button:hover { background: rgba(230, 57, 70, 0.25); color: #fff; }

.club-pick { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.club-pick li {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 10px; border-radius: 8px; background: var(--bz-ink-900);
}
body.landing .club-pick .btn { padding: 6px 12px; font-size: 13px; }

.match-edit { display: grid; grid-template-columns: minmax(0, 1fr) 110px; gap: 14px 12px; }
.match-edit[hidden] { display: none; }
.match-edit label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--bz-bone-dim); }
.match-edit input, .match-edit select { padding: 9px 10px; font-size: 14px; min-width: 0; }
.match-edit .result { grid-column: 1 / -1; max-width: 260px; }
.match-edit-actions { grid-column: 1 / -1; display: flex; gap: 8px; }
.match-edit-note { grid-column: 1 / -1; font-size: 12px; }

/* Narrow screens: each row stacks into a block, cells labelled inline. */
@media (max-width: 1100px) {
  .admin-table thead { display: none; }
  .admin-table, .admin-table tbody, .admin-table tr, .admin-table td { display: block; }
  .admin-table tr { padding: 10px 0; border-bottom: 1px solid var(--bz-ink-700); }
  .admin-table td { border: 0; padding: 2px 0; }
  .admin-table td[data-label]::before { content: attr(data-label) ": "; color: var(--bz-bone-dim); }
  .admin-table td[data-label] { display: inline-block; margin-right: 14px; }
  .admin-table td.admin-row-actions { text-align: left; padding-top: 8px; }
  .admin-row-actions > .btn:first-child { margin-left: 0; }
  .admin-table .at-seen > span { display: inline; }
  .admin-table .at-seen > span + span::before { content: '· '; }
  .admin-table td .club-chips { display: inline-flex; vertical-align: middle; }
}
@media (max-width: 640px) {
  .admin-tabs [role="tab"] { padding: 10px 10px; font-size: 14px; white-space: nowrap; flex: none; }
}

/* =================================================================== */
/* Pool scorer — player mode (full-screen big buttons for a tablet)    */
/* =================================================================== */
body.player-mode-on { overflow: hidden; }
.pm {
  position: fixed; inset: 0; z-index: 100;
  /* The players' row fills the screen but never shrinks below its content;
     on a short screen the whole view scrolls instead of overlapping. */
  display: grid; grid-template-rows: auto minmax(min-content, 1fr) auto auto; gap: 16px;
  overflow-y: auto; overscroll-behavior: contain;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right))
           max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  background: var(--bz-ink-950); color: var(--bz-bone); font-family: var(--bz-sans);
  user-select: none; -webkit-user-select: none;
}
.pm[hidden] { display: none; }
.pm button { font-family: var(--bz-sans); cursor: pointer; touch-action: manipulation; }

.pm-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; }
.pm-title { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; min-width: 0; }
.pm-label { font-size: clamp(16px, 2.4vw, 22px); font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--bz-butter); }
.pm-race {
  padding: 6px 16px; border-radius: 999px; border: 2px solid var(--bz-signal);
  font-size: clamp(20px, 3.2vmin, 30px); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--bz-bone);
}
.pm-race strong { color: var(--bz-butter); font-family: var(--bz-mono); font-size: 1.2em; }
.pm-race[hidden] { display: none; }
.pm-top-actions { display: flex; gap: 8px; flex-shrink: 0; }
.pm-small {
  min-height: 44px; padding: 0 14px; border-radius: 10px; font-size: 14px; font-weight: 600;
  background: var(--bz-ink-800); color: var(--bz-bone-dim); border: 1px solid var(--bz-ink-700);
}
.pm-small[hidden] { display: none; }
.pm-exit { position: relative; overflow: hidden; }
.pm-exit::after {
  content: ''; position: absolute; left: 0; bottom: 0; height: 3px; width: 0;
  background: var(--bz-signal); transition: width 0s;
}
.pm-exit.holding::after { width: 100%; transition: width 1.5s linear; }

/* Match clock bar: red, under the top row, once the organiser switches it on. */
.pm.has-clock { grid-template-rows: auto auto minmax(min-content, 1fr) auto auto; }
.pm-clock {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px;
  min-height: 72px; padding: 8px 20px; border-radius: 16px;
  background: var(--bz-signal); color: #fff;
}
.pm-clock[hidden] { display: none; }
.pm-clock-label { justify-self: start; font-size: clamp(16px, 2.4vmin, 22px); font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.pm-clock-num { font-family: var(--bz-mono); font-size: clamp(40px, 7vmin, 72px); font-weight: 700; line-height: 1; }
.pm-clock-hint { justify-self: end; text-align: right; font-size: clamp(14px, 2.2vmin, 20px); font-weight: 700; }
/* Last 5 minutes: the time pulses. Time up: the whole bar blinks. */
.pm-clock[data-state="warn"] .pm-clock-num { animation: pm-clock-pulse 1s ease-in-out infinite; }
.pm-clock[data-state="expired"] { animation: pm-clock-blink 0.8s steps(2, start) infinite; }
/* Flashes when the organiser turns it on, so the players notice. */
.pm-clock.flash { animation: pm-clock-flash 0.5s ease-in-out 6; }
@keyframes pm-clock-flash { 50% { background: #fff; color: var(--bz-signal); } }
@keyframes pm-clock-pulse { 50% { opacity: 0.45; } }
@keyframes pm-clock-blink { 50% { background: #7a1219; } }

.pm-players { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.pm-player {
  display: flex; flex-direction: column; gap: 10px;
  padding: 10px; border-radius: 22px; border: 2px solid var(--bz-ink-600);
  background: var(--bz-ink-900);
}
.pm-award {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: space-between; gap: 8px;
  padding: clamp(14px, 2.6vmin, 28px) 14px clamp(14px, 2vmin, 20px);
  border-radius: 16px; border: 0;
  background: linear-gradient(180deg, var(--bz-ink-800), var(--bz-ink-900)); color: var(--bz-bone);
}
.pm-award:active:not(:disabled) { background: var(--bz-ink-700); }
.pm-name {
  display: flex; align-items: center; justify-content: center; gap: 12px; max-width: 100%;
  font-size: clamp(26px, 4.6vmin, 48px); font-weight: 800; line-height: 1.1; text-align: center;
  overflow-wrap: anywhere;
}
.pm-breaking {
  font-size: clamp(14px, 2vmin, 18px); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--bz-bone-dim); visibility: hidden;
}
.pm-breaking.on { visibility: visible; }
.pm-score { font-family: var(--bz-mono); font-weight: 700; font-size: clamp(110px, 26vmin, 280px); line-height: 1; }
.pm-sub { font-size: clamp(18px, 2.8vmin, 26px); font-weight: 700; color: var(--bz-bone-dim); }
.pm-cta {
  display: block; width: 100%; padding: clamp(16px, 2.6vmin, 24px) 12px; border-radius: 14px;
  background: var(--bz-signal); color: #fff; font-size: clamp(22px, 3.4vmin, 32px); font-weight: 800;
}
.pm-award:disabled { cursor: default; }
.pm-award:disabled .pm-cta { opacity: 0.4; }
.pm-minus {
  min-height: 60px; border-radius: 14px;
  background: var(--bz-ink-800); color: var(--bz-bone); border: 1px solid var(--bz-ink-600);
  font-size: clamp(18px, 2.6vmin, 24px); font-weight: 700;
}
.pm-minus:active:not(:disabled) { background: var(--bz-ink-600); }
.pm-minus:disabled { opacity: 0.35; cursor: default; }
/* Before the first frame: whoever won the lag taps Breaks first. */
.pm-lag {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 56px; border-radius: 14px;
  background: var(--bz-ink-800); color: var(--bz-bone); border: 2px solid var(--bz-ink-600);
  font-size: clamp(18px, 2.6vmin, 24px); font-weight: 700;
}
.pm-lag[hidden] { display: none; }
.pm-lag .cue-ball-marker { font-size: 1.1em; opacity: 0.45; }
.pm-lag.selected { border-color: var(--bz-butter); background: var(--bz-ink-700); }
.pm-lag.selected .cue-ball-marker { opacity: 1; }
.pm-balls { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pm-balls button {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 56px; border-radius: 14px;
  background: var(--bz-ink-800); color: var(--bz-bone); border: 2px solid var(--bz-ink-600);
  font-size: clamp(18px, 2.6vmin, 24px); font-weight: 700;
}
.pm-balls .pool-ball { font-size: 1.2em; }
.pm-balls button.selected { border-color: var(--bz-butter); background: var(--bz-ink-700); }
.pm-balls button:disabled { opacity: 0.35; cursor: default; }
.pm-player.winner { border-color: var(--bz-butter); box-shadow: 0 0 0 4px rgba(245, 194, 66, 0.25); }
.pm-player.winner .pm-cta { visibility: hidden; }
.pm-player.done .pm-award { opacity: 0.5; }
.pm-player.done .pm-cta { visibility: hidden; }

.pm-banner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px;
  padding: 16px 20px; border-radius: 16px; background: var(--bz-butter); color: var(--bz-ink-950);
}
.pm-banner[hidden] { display: none; }
.pm-banner-text { margin: 0; font-size: clamp(20px, 3vmin, 28px); font-weight: 800; }
.pm-confirm-match {
  min-height: 72px; padding: 0 28px; border-radius: 14px; border: 0;
  background: var(--bz-ink-950); color: var(--bz-butter); font-size: clamp(20px, 3vmin, 26px); font-weight: 800;
}
.pm-confirm-match[hidden] { display: none; }

.pm-bottom { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; }
.pm-hint { margin: 0; font-size: clamp(16px, 2.4vmin, 20px); color: var(--bz-bone-dim); }
.pm-undo {
  min-height: 72px; padding: 0 32px; border-radius: 14px;
  background: var(--bz-ink-700); color: var(--bz-bone); border: 1px solid var(--bz-ink-600);
  font-size: clamp(20px, 3vmin, 26px); font-weight: 700;
}
.pm-undo[hidden] { display: none; }

.pm-toast {
  position: fixed; left: 50%; top: 84px; transform: translateX(-50%); z-index: 101;
  max-width: calc(100% - 32px); padding: 14px 22px; border-radius: 12px;
  background: var(--bz-bone); color: var(--bz-ink-950); font-size: 20px; font-weight: 700;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}
.pm-toast[hidden] { display: none; }

body.scorer .top-nav .pm-enter {
  font: inherit; font-weight: 700; cursor: pointer;
  background: var(--bz-signal); color: #fff; border: 0; border-radius: 8px; padding: 8px 14px;
}
body.scorer .top-nav .pm-enter:hover { background: var(--bz-signal-dark); color: #fff; }

/* Phones, portrait (narrow) or landscape (short): the tablet sizes don't fit, so tighten everything. */
@media (max-width: 560px), (max-height: 500px) {
  .pm {
    gap: 10px;
    padding: max(10px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right))
             max(10px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
  }
  .pm-top { min-height: 0; }
  .pm-title { gap: 4px 10px; }
  .pm-label { font-size: 13px; }
  .pm-race { padding: 3px 10px; font-size: 15px; border-width: 1.5px; }
  .pm-small { min-height: 36px; padding: 0 10px; font-size: 13px; }
  .pm-players { gap: 10px; }
  .pm-player { gap: 6px; padding: 6px; border-radius: 16px; }
  .pm-award { justify-content: center; gap: 4px; padding: 8px 10px; border-radius: 12px; }
  .pm-name { font-size: clamp(18px, 5vmin, 26px); }
  .pm-breaking { display: none; } /* the cue-ball marker still shows who's breaking */
  .pm-score { font-size: clamp(44px, 11vh, 120px); }
  .pm-sub { font-size: 13px; }
  .pm-cta { padding: 10px; border-radius: 10px; font-size: 17px; }
  .pm-minus { min-height: 40px; border-radius: 10px; font-size: 15px; }
  .pm-balls { gap: 6px; }
  .pm-lag { min-height: 36px; border-radius: 10px; font-size: 15px; }
  /* At 0–0 the "Frames won" line says nothing new: make room for Breaks first. */
  .pm-player:has(.pm-lag:not([hidden])) .pm-sub { display: none; }
  .pm-clock { grid-template-columns: auto 1fr; min-height: 0; padding: 8px 12px; gap: 2px 10px; border-radius: 12px; }
  .pm-clock-label { font-size: 12px; }
  .pm-clock-num { grid-row: span 2; justify-self: end; font-size: 34px; }
  .pm-clock-hint { justify-self: start; text-align: left; font-size: 12px; }
  .pm-balls button { min-height: 40px; border-radius: 10px; font-size: 15px; gap: 6px; }
  .pm-hint { display: none; }
  .pm-banner { padding: 10px 14px; gap: 8px 12px; }
  .pm-banner-text { font-size: 17px; }
  .pm-undo, .pm-confirm-match { min-height: 48px; padding: 0 18px; font-size: 17px; }
  .pm-toast { top: 56px; font-size: 16px; }
}
/* Narrow portrait phones: stack the players, with Reds, Yellows and −1 frame
   on one row under each score to save height. */
@media (max-width: 560px) {
  .pm-players { grid-template-columns: 1fr; }
  .pm-player { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: 1fr auto; }
  .pm-award { grid-column: 1 / -1; }
  .pm-balls { display: contents; }
  .pm-minus { padding: 0 4px; }
}
/* Landscape phones: side by side, so the score can take more of the height. */
@media (max-height: 500px) and (min-width: 561px) {
  .pm-score { font-size: clamp(44px, 20vh, 110px); }
}

/* =================================================================== */
/* Pool scorer — board colours                                         */
/* =================================================================== */
.board-colours { flex-direction: column; align-items: stretch; }
.colour-presets { display: flex; flex-wrap: wrap; gap: 8px; }
.colour-presets button {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px;
  border-radius: 10px; border: 1px solid var(--bz-ink-600); background: var(--bz-ink-700); color: var(--bz-bone);
  font: inherit; font-weight: 600; cursor: pointer;
}
.colour-presets button:hover { background: var(--bz-ink-600); }
.colour-presets button.selected { border-color: var(--bz-butter); box-shadow: 0 0 0 2px rgba(245, 194, 66, 0.35); }
.preset-swatch {
  width: 26px; height: 18px; border-radius: 4px; border: 1px solid rgba(255, 255, 255, 0.25);
  background: linear-gradient(90deg, var(--s1) 0 62%, var(--s2) 62% 100%);
}
.colour-pickers { display: flex; flex-wrap: wrap; gap: 12px 20px; }
.colour-pickers[hidden] { display: none; }
.game-controls .colour-pickers input[type="color"] {
  width: 64px; height: 40px; padding: 2px; cursor: pointer;
}
.ball-colour-pickers { align-items: flex-end; }
.ball-colours-reset {
  min-height: 40px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--bz-ink-600);
  background: var(--bz-ink-700); color: var(--bz-bone); font: inherit; font-weight: 600; cursor: pointer;
}
.ball-colours-reset[hidden] { display: none; }
.board-text { display: flex; flex-wrap: wrap; gap: 12px 20px; }
.board-text label { min-width: 150px; }
.colour-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.colour-actions button {
  min-height: 44px; padding: 0 16px; border-radius: 10px; border: 0;
  background: var(--bz-signal); color: #fff; font: inherit; font-weight: 700; cursor: pointer;
}
.colour-actions button:hover { background: var(--bz-signal-dark); }
.colour-actions button:disabled { opacity: 0.6; cursor: default; }

/* =================================================================== */
/* Account page (/account)                                             */
/* =================================================================== */
.settings-card h2 { margin: 0; font-size: 22px; }
.settings-card-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap;
  margin-bottom: 18px;
}
.settings-card-head .muted-line { margin-top: 4px; }
.save-status { font-size: 13px; font-weight: 600; color: #13d670; min-height: 1em; }
.save-status.err { color: var(--bz-signal-light); }
.acct-banner {
  margin: 0; padding: 12px 16px; border-radius: 12px; font-size: 14px; font-weight: 600;
  background: rgba(29, 185, 84, 0.12); border: 1px solid rgba(29, 185, 84, 0.35); color: #86efac;
}
.acct-banner p { margin: 0 0 10px; font-weight: 500; }
.acct-banner a { color: inherit; }
.acct-banner.muted { background: var(--bz-ink-800); border-color: var(--bz-ink-700); color: var(--bz-bone-dim); }

/* Your clubs: one row per club with its plan and the action for it. */
.acct-clubs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.acct-club {
  display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap;
  padding: 14px 16px; border: 1px solid var(--bz-ink-700); border-radius: 12px; background: var(--bz-ink-900);
}
.acct-club-main { flex: 1 1 320px; display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; min-width: 0; }
.acct-clubs .acct-club a.acct-club-name { font-weight: 700; font-size: 16px; color: var(--bz-bone); text-decoration: none; overflow-wrap: anywhere; }
.acct-clubs .acct-club a.acct-club-name:hover { text-decoration: underline; }
.acct-club-status { flex-basis: 100%; margin: 0; font-size: 13px; color: var(--bz-bone-dim); }
.acct-club-status.warn { color: var(--bz-butter); }
.acct-club-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.acct-club-msg { flex-basis: 100%; margin: 0; font-size: 13px; color: var(--bz-signal-light); }
.acct-club-msg[hidden] { display: none; }
.plan-pill {
  font-size: 11px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 3px 9px; border-radius: 999px; background: var(--bz-ink-700); color: var(--bz-bone-dim);
}
.plan-pill-pro, .plan-pill-growth, .plan-pill-enterprise {
  background: rgba(230, 57, 70, 0.14); color: var(--bz-signal-light); border: 1px solid rgba(230, 57, 70, 0.35);
}

/* Monthly / yearly switch */
.cycle-toggle {
  display: inline-flex; padding: 3px; gap: 2px; flex: 0 0 auto;
  background: var(--bz-ink-950); border: 1px solid var(--bz-ink-700); border-radius: 10px;
}
.cycle-btn {
  border: 0; border-radius: 8px; padding: 7px 12px; background: none; cursor: pointer;
  font: 600 13px var(--bz-sans); color: var(--bz-bone-dim);
}
.cycle-btn:hover { color: var(--bz-bone); }
.cycle-btn[aria-pressed="true"] { background: var(--bz-ink-700); color: var(--bz-bone); }
.cycle-save { color: #13d670; font-weight: 700; }

/* Plan comparison */
.plan-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.plan-card {
  display: flex; flex-direction: column;
  padding: 18px; border: 1px solid var(--bz-ink-700); border-radius: 14px; background: var(--bz-ink-900);
}
.plan-card.is-featured { border-color: var(--bz-signal); box-shadow: 0 0 0 1px var(--bz-signal) inset; }
.plan-card.is-coming { opacity: 0.72; }
.plan-name {
  margin: 0; font: 700 15px var(--bz-sans); color: var(--bz-bone);
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.plan-price { margin: 10px 0 0; font: 800 28px var(--bz-sans); color: var(--bz-bone); letter-spacing: -0.5px; }
.plan-sub { margin: 2px 0 0; font-size: 13px; color: var(--bz-bone-dim); min-height: 1.3em; }
.plan-features { list-style: none; margin: 16px 0 0; padding: 14px 0 0; border-top: 1px solid var(--bz-ink-700); }
.plan-features li { position: relative; padding: 5px 0 5px 22px; font-size: 13.5px; color: var(--bz-bone); }
.plan-features li::before { content: "✓"; position: absolute; left: 0; color: #13d670; font-weight: 700; }
.plan-features li.is-base { padding-left: 0; color: var(--bz-bone-dim); font-weight: 600; }
.plan-features li.is-base::before { content: none; }
.plan-features li.is-soon { color: var(--bz-bone-dim); }
.plan-features li.is-soon::before { content: "○"; color: var(--bz-bone-dim); }
.settings-card .soon {
  display: inline-block; vertical-align: middle; margin-left: 4px;
  font-size: 10px; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase;
  padding: 2px 7px; border-radius: 999px; background: var(--bz-ink-700); color: var(--bz-bone-dim);
}
.settings-card .plan-name .soon { margin-left: 0; }
.acct-enterprise { margin: 14px 0 0; }
.acct-enterprise a { color: var(--bz-signal-light); }

@media (max-width: 760px) {
  .plan-grid { grid-template-columns: 1fr; }
  .acct-club-actions, .acct-club-actions .btn { width: 100%; }
}

/* =================================================================== */
/* Club settings (/clubs/:id/settings)                                 */
/* =================================================================== */
.cs-form { gap: 18px; }
.cs-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.cs-fields .cs-help { font-size: 12px; text-transform: none; letter-spacing: 0; color: var(--bz-bone-dim); }
.cs-form-actions { display: flex; align-items: center; gap: 12px; }
body.landing .btn:disabled { opacity: 0.45; cursor: default; box-shadow: none; }
body.landing .btn:disabled:active { transform: none; }

/* Invite + Plan sit side by side on wide screens. */
.cs-pair { display: grid; grid-template-columns: 1.4fr 1fr; gap: 24px; align-items: stretch; }
.cs-pair > .settings-card { display: flex; flex-direction: column; align-items: flex-start; }
.cs-pair > .settings-card[hidden] { display: none; }
.cs-pair:has(> #planCard[hidden]) { grid-template-columns: 1fr; }
.cs-invite { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 16px 0 12px; }
.cs-code {
  font: 700 24px var(--bz-mono); letter-spacing: 3px; color: var(--bz-butter);
  padding: 8px 16px; border-radius: 10px; background: var(--bz-ink-950); border: 1px solid var(--bz-ink-700);
}
.cs-link-btn {
  background: none; border: 0; padding: 0; cursor: pointer;
  font: 600 13px var(--bz-sans); color: var(--bz-bone); text-decoration: underline; text-underline-offset: 3px;
}
.cs-link-btn:hover { color: var(--bz-signal-light); }
.cs-hint { font-size: 12px; margin-top: 4px; }
.cs-plan { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin-bottom: 16px; flex: 1; }
.cs-plan .muted-line.warn { color: var(--bz-butter); }

/* Members: a compact divided list rather than boxed rows. */
.cs-count {
  display: inline-block; vertical-align: middle; margin-left: 6px;
  font: 700 12px var(--bz-sans); padding: 2px 8px; border-radius: 999px;
  background: var(--bz-ink-700); color: var(--bz-bone-dim);
}
.cs-members { list-style: none; margin: 0; padding: 0; }
.cs-members li {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0; border-top: 1px solid var(--bz-ink-700);
}
.cs-members li:first-child { border-top: 0; padding-top: 0; }
.cs-avatar {
  flex: 0 0 auto; width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 800; font-size: 13px;
  background: var(--bz-ink-700); color: var(--bz-bone);
}
.cs-member-email { flex: 1 1 auto; min-width: 0; font-weight: 600; overflow-wrap: anywhere; }
.cs-you {
  margin-left: 6px; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 999px;
  background: rgba(230, 57, 70, 0.14); color: var(--bz-signal-light);
}
.cs-member-joined { flex: 0 0 auto; font-size: 13px; color: var(--bz-bone-dim); }

/* Leave club: a quiet row at the end, not a full card. */
.cs-leave {
  display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap;
  padding: 18px 20px; border: 1px solid rgba(230, 57, 70, 0.3); border-radius: 14px;
  background: var(--bz-ink-900);
}
.cs-leave h2 { margin: 0 0 4px; font-size: 18px; }
.cs-leave .muted-line { max-width: 60ch; }

@media (max-width: 760px) {
  .cs-fields, .cs-pair { grid-template-columns: 1fr; }
  .cs-member-joined { display: none; }
}

/* ---------- Tournaments (body.landing) ---------- */
.tourney-form { display: flex; flex-direction: column; gap: 14px; margin-top: 14px; }
.tourney-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.tourney-row[hidden], .tourney-row label[hidden] { display: none; }
.tourney-form select, .tourney-form textarea { width: 100%; padding: 10px 12px; font: inherit; }
body.landing .tourney-form textarea {
  background: var(--bz-ink-950); color: var(--bz-bone); border: 1px solid var(--bz-ink-700); border-radius: 10px;
}
.tourney-players { border: 1px solid var(--bz-ink-700); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.tourney-players[hidden] { display: none; }
#divisionTabs .btn[aria-pressed="true"] { border-color: var(--bz-signal); background: rgba(230, 57, 70, 0.14); }
.race-stage h4 { margin: 4px 0 8px; font-size: 14px; color: var(--bz-bone); }
.race-stage + .race-stage { margin-top: 6px; }
.auth-form .race-all { flex-direction: row; align-items: center; justify-content: flex-start; gap: 10px; margin-bottom: 8px; }
.auth-form .race-all input { width: 90px; flex: none; }
.race-inputs { display: flex; align-items: center; gap: 6px; }
.race-inputs input { min-width: 0; flex: 1; }
.tourney-check[hidden] { display: none; }
.tourney-players legend { padding: 0 6px; color: var(--bz-bone); font-weight: 600; }
.tourney-pick { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tourney-chip {
  display: inline-flex; align-items: center; gap: 8px; font: inherit; font-size: 14px; cursor: pointer;
  background: var(--bz-ink-900); color: var(--bz-bone); border: 1px solid var(--bz-ink-600); border-radius: 999px; padding: 7px 14px;
}
.tourney-chip[aria-pressed="true"] { border-color: var(--bz-signal); background: rgba(230, 57, 70, 0.14); }
.tourney-chip b:empty { display: none; }
.tourney-chip small { color: var(--bz-bone-dim); font-size: 12px; }
.tourney-dd { position: relative; align-self: flex-start; }
.tourney-dd > summary { list-style: none; cursor: pointer; }
.tourney-dd > summary::-webkit-details-marker { display: none; }
.tourney-dd-panel {
  position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; width: min(360px, calc(100vw - 90px));
  display: flex; flex-direction: column; gap: 8px; padding: 10px;
  background: var(--bz-ink-900); border: 1px solid var(--bz-ink-600); border-radius: 12px; box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
}
.tourney-dd-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.tourney-dd-row {
  width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 8px; text-align: left;
  font: inherit; font-size: 14px; color: var(--bz-bone); background: none; border: 0; border-radius: 8px; padding: 8px 10px; cursor: pointer;
}
.tourney-dd-row:hover, .tourney-dd-row:focus-visible { background: var(--bz-ink-800); }
.tourney-dd-row small { color: var(--bz-bone-dim); font-size: 12px; }
.tourney-dd-row b { font-family: var(--bz-mono); font-size: 11px; color: var(--bz-bone-dim); border: 1px solid var(--bz-ink-600); border-radius: 999px; padding: 1px 7px; }
.tourney-dd-row[aria-pressed="true"] b { background: var(--bz-signal); border-color: var(--bz-signal); color: #fff; }
.tourney-dd-foot { display: flex; align-items: center; gap: 8px; }
.tourney-dd-foot span { flex: 1; text-align: center; font-size: 13px; }
.tourney-dd-panel input, .tourney-find input {
  flex: 1 1 200px; min-width: 0; padding: 9px 12px; font: inherit;
  background: var(--bz-ink-950); color: var(--bz-bone); border: 1px solid var(--bz-ink-700); border-radius: 10px;
}
.tourney-dd-panel input { flex: none; }
.list-pager { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
body.landing .list-pager .btn { min-width: 36px; padding: 6px 10px; font-size: 13px; justify-content: center; }
body.landing .list-pager .btn.is-current { border-color: var(--bz-signal); color: #fff; background: rgba(230, 57, 70, 0.16); }
.list-pager-gap { font-size: 13px; color: var(--bz-bone-dim); padding: 0 2px; }
.list-pager-count { flex-basis: 100%; text-align: center; font-size: 13px; }
body.landing .list-search {
  width: 100%; margin-bottom: 10px; padding: 9px 12px; font: inherit;
  background: var(--bz-ink-950); color: var(--bz-bone); border: 1px solid var(--bz-ink-700); border-radius: 10px;
}
.tourney-find { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.tourney-find input { flex: 0 1 320px; }
.tourney-chip b { font-family: var(--bz-mono); font-size: 11px; background: var(--bz-signal); color: #fff; border-radius: 999px; padding: 1px 7px; }
.auth-form .tourney-check { flex-direction: row; align-items: center; gap: 8px; text-transform: none; letter-spacing: 0; }
/* The form labels' display:flex would otherwise beat [hidden] (Random draw on a league, race on Shootout). */
.auth-form label[hidden] { display: none; }

.tourney-champion {
  margin: 0; padding: 14px 18px; border-radius: 14px; font-family: var(--bz-serif); font-size: 26px;
  background: rgba(245, 194, 66, 0.12); border: 1px solid rgba(245, 194, 66, 0.4); color: var(--bz-butter);
}
.tourney-tables { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; margin-top: 14px; }
.tourney-table { background: var(--bz-ink-900); border: 1px solid var(--bz-ink-700); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.tourney-table-head { display: flex; justify-content: space-between; align-items: center; }
.tourney-table-score b { font-family: var(--bz-mono); color: var(--bz-butter); margin: 0 6px; }
.tourney-links { display: flex; flex-wrap: wrap; gap: 6px; }
.tourney-clock { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; font-size: 13px; font-weight: 600; color: var(--bz-bone-dim); }
.tourney-clock select { width: auto; padding: 5px 8px; font-size: 13px; }
.tourney-clock-left { color: var(--bz-signal); font-weight: 700; }
body.landing .tourney-clock .btn { padding: 6px 10px; font-size: 12px; }
body.landing .tourney-links .btn { padding: 6px 10px; font-size: 12px; }
.tourney-tag { font-family: var(--bz-mono); font-size: 11px; text-transform: uppercase; letter-spacing: 1px; padding: 3px 8px; border-radius: 999px; background: var(--bz-ink-700); color: var(--bz-bone-dim); }
.tourney-tag { white-space: nowrap; }
/* Live: blinking green. Finished: solid red. */
.tourney-tag.is-live { background: #13a85a; color: #fff; animation: tag-blink 1.2s ease-in-out infinite; }
.tourney-tag.is-finished { background: var(--bz-signal); color: #fff; }
.tourney-tag.is-ready { background: rgba(245, 194, 66, 0.14); color: var(--bz-butter); }
@keyframes tag-blink { 50% { opacity: 0.35; } }
@media (prefers-reduced-motion: reduce) { .tourney-tag.is-live { animation: none; } }
.tourney-ready .roster-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tourney-ready select { padding: 8px 10px; font: inherit; }
@media (max-width: 640px) { .tourney-ready { flex-direction: column; align-items: stretch; } }

.tourney-stage { font-family: var(--bz-serif); font-weight: 400; font-size: 22px; margin: 22px 0 10px; }
.bracket { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 8px; }
.bracket-round { display: flex; flex-direction: column; gap: 10px; min-width: 210px; flex: 0 0 210px; }
/* Headings stay level at the top; only the match cards spread down the column. */
.bracket-matches { flex: 1; display: flex; flex-direction: column; justify-content: space-around; gap: 10px; }
.bracket-round.is-list .bracket-matches { justify-content: flex-start; }
.tourney-ready .roster-hcp { white-space: nowrap; }
/* Phones: the names on their own line, the match details (badge, round,
   table and score) wrapping underneath instead of running off the card. */
@media (max-width: 640px) {
  .tourney-ready .roster-main { flex-direction: column; align-items: flex-start; gap: 4px; }
  .tourney-ready .roster-hcp { white-space: normal; overflow-wrap: anywhere; }
}
.bracket-hint { display: none; margin: 0 0 10px; font-size: 12px; color: var(--bz-bone-dim); }
@media (max-width: 760px) { .bracket-hint { display: block; } }
.bracket-round h4 { margin: 0; font-family: var(--bz-mono); font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--bz-bone-dim); font-weight: 600; }
.tm { background: var(--bz-ink-900); border: 1px solid var(--bz-ink-700); border-radius: 10px; padding: 8px 10px; font-size: 14px; }
.tm.is-live { border-color: #13a85a; }
.tm-head .tourney-tag { font-size: 10px; padding: 2px 7px; }

/* Draw: List / Bracket switch, jump chips and sections. */
.draw-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.draw-head h2 { margin: 0; }
.draw-view { display: inline-flex; gap: 0; }
.draw-view .btn { border-radius: 0; min-height: 36px; padding: 0 14px; }
.draw-view .btn:first-child { border-radius: 10px 0 0 10px; }
.draw-view .btn:last-child { border-radius: 0 10px 10px 0; }
body .draw-view .btn[aria-pressed="true"], body .draw-view .btn[aria-pressed="true"]:hover { background: var(--bz-signal); border-color: var(--bz-signal); color: #fff; }
.draw-jump { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 4px; }
.draw-jump[hidden] { display: none; }
.draw-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--bz-ink-600); background: var(--bz-ink-800); color: var(--bz-bone);
  font-size: 13px; font-weight: 600; text-decoration: none;
}
.draw-chip:hover { border-color: var(--bz-bone-dim); }
.draw-chip-live { width: 8px; height: 8px; border-radius: 50%; background: #13d670; animation: tag-blink 1.2s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .draw-chip-live { animation: none; } }
.draw-section { scroll-margin-top: 90px; }
.draw-section + .draw-section { margin-top: 28px; padding-top: 6px; border-top: 1px solid var(--bz-ink-700); }

/* List view: each round a block, one line per match. */
.tl-round { margin-top: 16px; }
.tl-round h4 { margin: 0 0 8px; font-family: var(--bz-mono); font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--bz-bone-dim); font-weight: 600; }
.tl-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
/* "Show 120 byes" under a round whose byes are folded away. */
.bye-fold { display: block; margin: 8px 0 0; padding: 4px 0; font-size: 13px; }
p.bye-fold { color: var(--bz-bone-dim); }
.tl {
  display: grid; grid-template-columns: 130px minmax(0, 520px) 1fr; align-items: center; gap: 12px;
  background: var(--bz-ink-900); border: 1px solid var(--bz-ink-700); border-radius: 10px; padding: 8px 12px; font-size: 14px;
}
.tl.is-live { border-color: #13a85a; }
.tl.is-void { opacity: 0.45; }
.is-finding .tl:not(.is-found) { opacity: 0.35; }
.tl.is-found { border-color: var(--bz-butter); box-shadow: 0 0 0 1px var(--bz-butter); }
.tl-match { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; min-width: 0; }
.tl-player { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-player:last-child, .tl-player + * + .tl-player { text-align: right; }
.tl-match .tm-claim { grid-column: 1 / -1; margin-top: 0; }
.tl-player.is-win { font-weight: 700; color: var(--bz-bone); }
.tl-player.is-lose, .tl-player.is-empty { color: var(--bz-bone-dim); }
.tl-score { font-family: var(--bz-mono); }
/* League week heading: organisers can move the week's date in place. */
.week-date { margin-left: 8px; padding: 2px 6px; font: inherit; font-size: 11px; color: var(--bz-bone); background: var(--bz-ink-800, transparent); border: 1px solid var(--bz-ink-700); border-radius: 6px; color-scheme: dark; }
.standings-table .pts { color: var(--bz-signal-light); }
.tl-v { color: var(--bz-bone-dim); font-size: 12px; }
.tl-actions { justify-self: end; }
.tl-actions .tm-link { padding: 0; white-space: nowrap; }
@media (max-width: 760px) {
  .tl { grid-template-columns: 1fr auto; gap: 6px 10px; }
  .tl-match { grid-column: 1 / -1; grid-row: 2; }
}

/* Public draw (/t/:id): read-only. TV mode (?tv=1): just the draw, big, one
   section at a time. */
body.is-public #adminRow { display: none; }
body.is-public .guide-top { max-width: 880px; margin: 0 auto; padding: 20px 20px 0; }
body.is-tv .public-draw-about, body.is-tv #breaksCard,
body.is-tv .guide-top, body.is-tv .app-nav, body.is-tv .site-footer, body.is-tv .tourney-find,
body.is-tv #readyCard, body.is-tv .draw-head, body.is-tv .draw-jump, body.is-tv .bracket-hint { display: none; }
body.is-tv main.landing-wrap { max-width: none; padding: 24px 32px; zoom: 1.35; }

/* Signed-out viewers: Scoreline logo above the draw, a short "what is this" at the bottom. */
/* Lined up with the page content below it (main.landing-wrap is 1000px wide). */
body.is-public .guide-top.public-draw-top { max-width: 1000px; padding: 20px 0 0; gap: 12px; }
@media (max-width: 1040px) { body.is-public .guide-top.public-draw-top { padding: 16px 16px 0; } }
.public-draw-logo img { height: 28px; width: auto; display: block; }
@media (max-width: 480px) { .public-draw-logo img { height: 22px; } }
.public-draw-about { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.public-draw-about img { height: 26px; width: auto; }
.public-draw-about p { margin: 0; color: var(--bz-bone-dim); line-height: 1.55; }
.public-draw-about strong { color: var(--bz-bone); }
.public-draw-about-actions { display: flex; flex-wrap: wrap; gap: 10px; }
/* Highest breaks (snooker). */
.tourney-breaks-entry { border: 1px solid var(--bz-ink-700); border-radius: 10px; padding: 8px 12px 10px; margin: 0 0 14px; display: grid; gap: 8px; }
.tourney-breaks-entry[hidden] { display: none; }
.tourney-breaks-entry .tourney-result-row { margin: 0; }
.tourney-breaks-entry legend { padding: 0 6px; font-size: 13px; color: var(--bz-bone-dim); }
.tourney-breaks { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 6px; }
.tourney-breaks li {
  display: grid; grid-template-columns: 2.2em 3.2em 1fr; align-items: baseline; gap: 10px;
  padding: 8px 12px; border-radius: 8px; background: var(--bz-ink-900);
}
.tourney-breaks .bk-rank { color: var(--bz-bone-dim); font-family: var(--bz-mono); font-size: 13px; }
.tourney-breaks .bk-val { font-family: var(--bz-mono); font-weight: 700; font-size: 18px; color: var(--bz-bone); }
.tourney-breaks .bk-who { min-width: 0; }
.tourney-breaks .bk-who strong { color: var(--bz-bone); }
.tourney-breaks .bk-who .bk-sub { display: block; font-size: 13px; color: var(--bz-bone-dim); }
.tourney-breaks .bk-century .bk-val { color: var(--bz-signal-light); }

/* Club branding (Club Pro): logo by the title, background darkened so the
   draw stays readable, sponsor logos under the draw / along the bottom on TV. */
body.landing.has-draw-bg {
  background: linear-gradient(rgba(10, 10, 14, 0.72), rgba(10, 10, 14, 0.72)), var(--draw-bg) center / cover fixed;
}
/* Club's draw colour: re-points the navy shades inside the page content, so
   panels take the colour, match boxes a darker shade and borders a lighter one. */
main.has-draw-color {
  --bz-ink-800: var(--draw-color);
  --bz-ink-900: color-mix(in srgb, var(--draw-color) 70%, black);
  --bz-ink-700: color-mix(in srgb, var(--draw-color) 80%, white);
}
.brand-color { display: flex; align-items: center; gap: 12px; }
.brand-slot .cs-help { font-size: 12px; color: var(--bz-bone-dim); }
.brand-color input[type="color"] { width: 56px; height: 36px; padding: 2px; border-radius: 8px; cursor: pointer; }
.tourney-title { display: flex; align-items: center; gap: 16px; min-width: 0; }
.tourney-logo { height: 64px; width: auto; max-width: 180px; object-fit: contain; flex: none; }
.tourney-logo[hidden] { display: none; }
@media (max-width: 760px) { .tourney-logo { height: 44px; max-width: 110px; } }
.tourney-sponsors {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 16px 32px;
  padding: 14px 18px; border-radius: 12px; background: rgba(255, 255, 255, 0.92);
}
.tourney-sponsors[hidden] { display: none; }
.tourney-sponsors img { height: 44px; width: auto; max-width: 180px; object-fit: contain; display: block; }
/* Tournament actions in the page header: share + TV, the rest behind ⋮. */
.tourney-actions { align-items: center; }
@media (max-width: 640px) { .tourney-actions { flex-shrink: 1; min-width: 0; } } /* its buttons wrap on a phone */
.kebab-check {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 9px 10px; border-radius: 8px;
  color: var(--bz-bone); font: 500 14px var(--bz-sans); cursor: pointer; white-space: nowrap;
}
.kebab-check:hover { background: var(--bz-ink-700); }
/* On/off switch built from the checkbox itself, so it stays a real form control. */
.kebab-check input[role="switch"] {
  appearance: none; -webkit-appearance: none; flex: 0 0 auto;
  position: relative; width: 36px; height: 20px; margin: 0; border-radius: 999px;
  background: var(--bz-ink-600); cursor: pointer; transition: background-color .15s;
}
.kebab-check input[role="switch"]::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--bz-bone); transition: transform .15s;
}
.kebab-check input[role="switch"]:checked { background: var(--bz-signal); }
.kebab-check input[role="switch"]:checked::after { transform: translateX(16px); }
.kebab-check input[role="switch"]:focus-visible { outline: 2px solid var(--bz-bone); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  .kebab-check input[role="switch"], .kebab-check input[role="switch"]::after { transition: none; }
}
.kebab-check[hidden], .kebab-panel [hidden] { display: none; }
body.is-tv main.landing-wrap { padding-bottom: 110px; }
body.is-tv .tourney-sponsors { position: fixed; left: 0; right: 0; bottom: 0; border-radius: 0; z-index: 5; }

/* All tables on TV (/t/:id?tables=1): every table's big-screen view in a grid. */
body.is-tables-wall main.landing-wrap { zoom: 1; padding: 16px; }
body.is-tables-wall #champion, body.is-tables-wall #standingsCard, body.is-tables-wall #drawCard { display: none; }
.tables-wall {
  display: grid; grid-template-columns: repeat(var(--cols, 2), 1fr); grid-auto-rows: 1fr; gap: 10px;
  height: calc(100vh - 130px);
}
.tables-wall[hidden] { display: none; }
.tables-wall iframe { width: 100%; height: 100%; border: 1px solid var(--bz-ink-700); border-radius: 10px; background: var(--bz-ink-950); }
body.is-tables-wall:has(.tourney-sponsors:not([hidden])) .tables-wall { height: calc(100vh - 220px); }

/* WD / FF / DQ next to a player on the draw. */
.tourney-outcome { font-family: var(--bz-mono); font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 4px; background: var(--bz-signal); color: #fff; vertical-align: middle; }

/* Club settings: branding uploads. */
.brand-slots { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; width: 100%; }
.brand-slots[hidden] { display: none; }
.brand-slot { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.brand-slot-wide { grid-column: 1 / -1; }
.brand-slot-wide .cs-fields { width: 100%; }
.brand-thumbs { display: flex; flex-wrap: wrap; gap: 12px; }
.brand-thumb { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 12px; }
.brand-thumb img { height: 64px; width: auto; max-width: 160px; object-fit: contain; border-radius: 6px; background: var(--bz-ink-800, #1c1c22); padding: 6px; }
@media (max-width: 760px) {
  .brand-slots, .brand-slot-wide .cs-fields { grid-template-columns: 1fr; }
}
.is-finding .tm:not(.is-found) { opacity: 0.35; }
.tm.is-found { border-color: var(--bz-butter); box-shadow: 0 0 0 1px var(--bz-butter); }
.tm.is-void { opacity: 0.45; }
.tm-head { display: flex; justify-content: space-between; gap: 8px; font-family: var(--bz-mono); font-size: 10px; letter-spacing: 0.6px; text-transform: uppercase; color: var(--bz-bone-dim); margin-bottom: 4px; }
.tm-row { display: flex; justify-content: space-between; gap: 8px; padding: 3px 0; }
.tm-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tm-row b { font-family: var(--bz-mono); }
.tm-row.is-win { font-weight: 700; color: var(--bz-bone); }
.tm-row.is-lose, .tm-row.is-empty { color: var(--bz-bone-dim); }
.tm-link { background: none; border: 0; padding: 4px 0 0; font: inherit; font-size: 12px; color: var(--bz-signal-light); cursor: pointer; }
.tm-link:hover { text-decoration: underline; }
.tm-link + .tm-link { margin-left: 12px; }

.tourney-result[hidden] { display: none; }
.tourney-result .muted-line { margin: 4px 0 16px; }
/* Tournaments list: Import + New tournament. Side by side when they fit;
   on a phone they share the row below the heading, then stack. */
.tourney-list-actions { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; }
@media (max-width: 640px) {
  .tourney-list-actions { flex: 1 1 100%; }
  .tourney-list-actions > .btn { flex: 1 1 180px; justify-content: center; text-align: center; }
}
/* Player link (play.html): reporting a King of the Hill result. */
/* Each match stacks: opponent, round and date, result, then its buttons on their own row. */
.play-list .roster-main { flex-direction: column; align-items: flex-start; gap: 4px; flex: 1 1 100%; }
.play-list .roster-actions { flex: 1 1 100%; flex-wrap: wrap; margin-top: 10px; }
.claim-line { margin: 6px 0 0; font-size: 13px; color: var(--bz-bone-dim); }
.claim-line.is-ask { color: #f2b84b; font-weight: 600; }
.claim-line.is-disputed { color: #f25862; }
.report-form { flex: 1 1 100%; margin-top: 12px; padding: 12px; border: 1px solid var(--bz-ink-700); border-radius: 10px; background: var(--bz-ink-950); }
.report-form[hidden] { display: none; }
.report-who { display: flex; gap: 18px; margin-bottom: 10px; font-weight: 600; }
.report-who label { display: inline-flex; align-items: center; gap: 6px; }
.report-score { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-weight: 600; }
.report-score label { display: inline-flex; align-items: center; gap: 8px; }
.report-score input { width: 64px; padding: 8px; font: inherit; text-align: center; }
.report-form .muted-line { margin: 8px 0 10px; font-size: 13px; }
/* Organiser's draw: a player-reported result waiting, or disputed. */
.tm-claim { display: block; margin-top: 4px; font-size: 12px; color: #f2b84b; }
.tm-claim.is-disputed { color: #f25862; }

/* Import from CueScore: what the draw will be, checked before creating it. */
.import-summary { border: 1px solid var(--bz-ink-700); border-radius: 12px; padding: 12px 14px; background: var(--bz-ink-900); }
.import-summary[hidden] { display: none; }
.import-summary h3 { margin: 0 0 6px; font-size: 16px; }
.import-summary p { margin: 4px 0; font-size: 14px; }
.import-summary .import-warning { color: #f2b84b; }
/* Enter the draw yourself: the typed draw and its running check. */
.draw-entry textarea {
  width: 100%; min-height: 220px; padding: 10px 12px; resize: vertical; line-height: 1.5;
  font-family: var(--bz-mono); font-size: 14px;
  background: var(--bz-ink-950); color: var(--bz-bone); border: 1px solid var(--bz-ink-700); border-radius: 10px;
}
.draw-entry-count { margin: 10px 0 4px; font-weight: 600; font-size: 14px; }
.draw-entry-date { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; font-weight: 600; font-size: 14px; }
.draw-entry-date[hidden] { display: none; }
.draw-entry-date input { padding: 6px 8px; font: inherit; }
.round-copy { padding: 0; margin-left: 8px; font-family: var(--bz-sans, inherit); letter-spacing: 0; text-transform: none; font-size: 12px; }
.draw-entry-errors { margin: 0 0 6px; padding-left: 18px; color: #f25862; font-size: 13px; }
.draw-entry-errors:empty { display: none; }
.draw-entry .draw-entry-left { margin: 0 0 14px; font-size: 13px; max-height: 6.5em; overflow-y: auto; }
.draw-entry-hint { margin: 10px 0 0; }
.draw-entry-hint .tm-link { padding: 0; font-size: inherit; }
/* Open knockout draw: players through from their group, tapped in pairs. */
.open-draw-label { margin: 12px 0 8px; font-size: 13px; color: var(--bz-bone-dim); }
.open-draw-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.open-draw-chip {
  display: inline-flex; align-items: baseline; gap: 6px; padding: 8px 12px; min-height: 40px;
  border: 1px solid var(--bz-ink-600); border-radius: 999px; background: var(--bz-ink-800);
  color: var(--bz-bone); font: inherit; font-size: 14px;
}
button.open-draw-chip { cursor: pointer; }
button.open-draw-chip:hover:not(:disabled) { border-color: var(--bz-bone-dim); }
/* The seeded groups knockout placed by hand: one row per first-round match. */
.ko-edit { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.ko-edit li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ko-edit select { flex: 1 1 140px; min-width: 0; padding: 8px 10px; font: inherit; }
.ko-edit-n { width: 1.6em; color: var(--bz-bone-dim); font-size: 13px; }
.ko-edit-v { color: var(--bz-bone-dim); }
.ko-edit-warn { flex-basis: 100%; margin-left: 2.2em; font-size: 12px; color: var(--bz-butter); }
button.open-draw-chip:disabled { opacity: 0.45; cursor: not-allowed; }
.open-draw-chip small { font-size: 12px; color: var(--bz-bone-dim); }
.open-draw-chip[aria-pressed="true"] { border-color: var(--bz-butter); box-shadow: 0 0 0 1px var(--bz-butter); }
.open-draw-actions { margin-top: 12px; }
.open-draw-actions[hidden] { display: none; }
#openDrawWaiting { margin: 10px 0 0; }
#openDrawWaiting:empty { display: none; }
.open-draw-drawn { margin-top: 8px; }
.tourney-result-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; font-weight: 600; }
.tourney-result-row input { width: 80px; padding: 8px 10px; font: inherit; }
.tourney-result-row select { max-width: 60%; padding: 8px 10px; font: inherit; }
.tourney-result-row[hidden] { display: none; }
body.landing .tourney-result-row select,
body.landing .tourney-result-row input {
  background: var(--bz-ink-950); color: var(--bz-bone); border: 1px solid var(--bz-ink-700); border-radius: 10px;
}

/* Club buttons (js/club-nav.js): same spot and look as the dashboard club card. */
body.landing .page-actions .btn.is-current { border-color: var(--bz-signal); color: #fff; background: rgba(230, 57, 70, 0.16); }
.page-actions:empty { display: none; }

.tourney-list-link { text-decoration: none; transition: border-color .15s, background .15s; }
.tourney-list-link:hover { border-color: var(--bz-signal); background: var(--bz-ink-800); }
.tourney-list-link:hover .roster-name { color: var(--bz-signal-light); }
#list > li { list-style: none; display: flex; gap: 8px; align-items: stretch; }
#list > li > .tourney-list-link { flex: 1; min-width: 0; }
#list > li > .tourney-copy { flex: none; }

@media (max-width: 640px) {
  /* Phones: club buttons (dashboard card + club pages) fill the row, ⋮ beside the main one. */
  .club-actions, #clubNav { flex: 1 1 100%; flex-wrap: nowrap; }
  .club-actions > .btn, #clubNav > .btn { flex: 1; justify-content: center; text-align: center; }
  .tourney-list-link .roster-main { flex-wrap: wrap; row-gap: 2px; }
}

/* =================================================================== */
/* Standings + Player pages                                            */
/* =================================================================== */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* League / record tables. Fixed layout so every sport's table lines up. */
.st-table-wrap { overflow-x: auto; }
.st-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 14px; }
.st-table col.c-rank { width: 40px; }
.st-table col.c-num { width: 52px; }
.st-table col.c-pct { width: 70px; }
.st-table th {
  padding: 8px 6px; text-align: center; border-bottom: 1px solid var(--bz-ink-700);
  font: 600 11px var(--bz-mono); letter-spacing: 0.8px; text-transform: uppercase; color: var(--bz-bone-dim);
}
.st-table th abbr { text-decoration: none; cursor: help; }
.st-table td { padding: 10px 6px; text-align: center; border-bottom: 1px solid var(--bz-ink-800); font-variant-numeric: tabular-nums; }
.st-table tbody tr:last-child td { border-bottom: 0; }
.st-table tbody tr:hover td { background: rgba(255, 255, 255, 0.025); }
.st-table .rank { color: var(--bz-bone-dim); font-weight: 600; }
.st-table tr.is-top .rank { color: var(--bz-butter); }
.st-table .who { text-align: left; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-table .who a { color: var(--bz-bone); text-decoration: none; }
.st-table .who a:hover { color: var(--bz-signal-light); text-decoration: underline; }
.st-table .diff.pos { color: #13d670; }
.st-table .diff.neg { color: var(--bz-signal-light); }
.pl-record { table-layout: auto; }
.pl-record td.who { font-weight: 700; }

/* Roster: compact divided list; Edit opens the details in the modal. */
.st-add { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.st-add-name { flex: 1 1 240px; }
.st-add-name input { width: 100%; }
.st-add-hcp { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--bz-bone-dim); }
.st-add-hcp input { width: 96px; }
.st-add input, .st-edit input { padding: 10px 12px; font-size: 14px; }
.st-roster { list-style: none; margin: 0; padding: 0; }
.st-roster > li { padding: 8px 0; border-top: 1px solid var(--bz-ink-700); }
.st-roster > li:first-child { border-top: 0; padding-top: 0; }
.st-player { display: flex; align-items: center; gap: 12px; }
.st-player-name { flex: 1 1 auto; min-width: 0; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
body.landing .st-roster .st-player-name a { color: var(--bz-bone); font-weight: 600; text-decoration: none; }
body.landing .st-roster .st-player-name a:hover { color: var(--bz-signal-light); text-decoration: underline; }
.st-nick { font-size: 13px; color: var(--bz-bone-dim); }
.st-hcp {
  flex: 0 0 auto; font: 600 12px var(--bz-mono); padding: 2px 8px; border-radius: 999px;
  background: var(--bz-ink-700); color: var(--bz-bone-dim);
}
body.landing .st-edit-btn { padding: 6px 12px; font-size: 13px; }
.st-edit { display: grid; grid-template-columns: 1fr 120px; gap: 14px 12px; }
.st-edit[hidden] { display: none; }
.st-edit label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--bz-bone-dim); }
.st-edit .st-notes { grid-column: 1 / -1; }
.st-edit-actions { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.st-edit-actions .st-remove { margin-left: auto; color: var(--bz-signal-light); }
.st-edit-status:empty { display: none; }
.st-edit-status { flex-basis: 100%; }

/* Player profile */
.pl-stats {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1px;
  border: 1px solid var(--bz-ink-700); border-radius: 16px; overflow: hidden; background: var(--bz-ink-700);
}
.pl-stat { display: flex; flex-direction: column; gap: 8px; padding: 16px 18px; background: var(--bz-ink-900); }
.pl-label { font: 600 11px var(--bz-mono); letter-spacing: 0.8px; text-transform: uppercase; color: var(--bz-bone-dim); }
.pl-label small { font-size: 10px; letter-spacing: 0; text-transform: none; }
.pl-value { font: 800 24px var(--bz-sans); color: var(--bz-bone); line-height: 1; }
.pl-stat .form-chips { min-height: 24px; align-items: center; }
.pl-notes { margin: 0; padding: 12px 16px; border-left: 3px solid var(--bz-ink-600); color: var(--bz-bone-dim); font-size: 14px; }
.pl-h2h { list-style: none; margin: 0; padding: 0; }
.pl-h2h li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--bz-ink-700); }
.pl-h2h li:first-child { border-top: 0; padding-top: 0; }
.pl-opp { flex: 1 1 auto; min-width: 0; font-weight: 600; overflow-wrap: anywhere; }
.pl-h2h-rec { flex: 0 0 auto; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.pl-h2h-rec.is-ahead { color: #13d670; }
.pl-h2h-rec.is-behind { color: var(--bz-signal-light); }
.pl-h2h-rec.is-level { color: var(--bz-bone-dim); }

@media (max-width: 760px) {
  /* Phones: drop For/Against so the table fits without sideways scrolling. */
  .st-table .fa { display: none; }
  .st-table col.c-rank { width: 30px; }
  .st-table col.c-num { width: 34px; }
  .st-table col.c-pct { width: 52px; }
  .st-table th, .st-table td { padding-left: 3px; padding-right: 3px; }
  /* Full names on two lines beat "Ronnie Wal…". */
  .st-table .who { white-space: normal; overflow-wrap: anywhere; }
  .st-add .btn { flex: 1 1 auto; }
  .st-edit { grid-template-columns: 1fr; }
  .pl-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pl-stats .pl-stat:last-child { grid-column: 1 / -1; }
}

/* Kebab (⋮) overflow menu — secondary actions behind one button (js/kebab.js) */
.kebab { position: relative; flex: 0 0 auto; }
body.landing .btn.kebab-btn { padding: 10px 14px; font-size: 18px; line-height: 1; }
.kebab-btn[aria-expanded="true"] { background: var(--bz-ink-600, #334155); }
.kebab-panel {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 40;
  min-width: 180px; padding: 6px;
  background: var(--bz-ink-800, #0b1220); border: 1px solid var(--bz-ink-700, #1e293b); border-radius: 12px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5);
  display: flex; flex-direction: column;
}
.tourney-links .kebab-panel { left: 0; right: auto; }
.kebab-panel.up { top: auto; bottom: calc(100% + 6px); }
.kebab-panel[hidden] { display: none; }
.kebab-panel a,
.kebab-panel a:visited,
.kebab-panel button {
  display: block; width: 100%; text-align: left;
  padding: 9px 10px; border-radius: 8px;
  background: none; border: 0;
  color: var(--bz-bone, #e2e8f0); font: 500 14px var(--bz-sans, system-ui); text-decoration: none;
  cursor: pointer;
}
.kebab-panel a:hover,
.kebab-panel button:hover { background: var(--bz-ink-700, #1e293b); }
.kebab-panel hr { border: 0; border-top: 1px solid var(--bz-ink-700, #1e293b); margin: 6px 0; }
.kebab .kebab-panel a { color: var(--bz-bone, #e2e8f0); }
.kebab .kebab-panel a.is-current { color: #fff; background: rgba(230, 57, 70, 0.16); }
.kebab-panel .kebab-danger { color: var(--bz-signal-light, #fca5a5); }

/* ---------- Docs (public/docs/*, sidebar in partials/docs-nav.html) ---------- */
.docs-brand-tag {
  font-family: var(--bz-mono); font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--bz-signal-light); border: 1px solid var(--bz-ink-700); border-radius: 999px;
  padding: 3px 9px; margin-left: 6px; vertical-align: middle;
}
.docs-wrap { max-width: 1180px; margin: 0 auto; padding: 32px 20px 80px; }
.docs-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 48px; margin-top: 28px; }
.docs-main { max-width: 760px; min-width: 0; }

.docs-nav { position: sticky; top: 20px; align-self: start; z-index: 5; }
.docs-nav summary { display: none; }
.docs-nav a {
  display: block; padding: 6px 12px; margin: 1px 0; border-radius: 8px; border-left: 2px solid transparent;
  color: var(--bz-bone-dim); text-decoration: none; font-size: 14px; line-height: 1.35;
}
.docs-nav a:hover { color: var(--bz-bone); background: var(--bz-ink-800); }
.docs-nav a[aria-current="page"] { color: var(--bz-bone); background: rgba(230, 57, 70, 0.14); border-left-color: var(--bz-signal); }
.docs-nav .docs-nav-home { font-weight: 600; color: var(--bz-bone); }
.docs-nav-group {
  font-family: var(--bz-mono); font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--bz-signal-light); margin: 18px 12px 6px;
}

/* Docs search (public/js/docs-search.js) */
.docs-search { position: relative; margin: 0 0 14px; }
.docs-search input {
  width: 100%; box-sizing: border-box; padding: 9px 12px 9px 34px; border-radius: 10px;
  border: 1px solid var(--bz-ink-700); background: var(--bz-ink-800); color: var(--bz-bone);
  font: inherit; font-size: 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23999' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='7' cy='7' r='5'/%3E%3Cpath d='m11 11 3.5 3.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 11px 50%;
}
.docs-search input::placeholder { color: var(--bz-bone-dim); opacity: 0.8; }
.docs-search input:focus { outline: none; border-color: var(--bz-signal); }
.docs-search-results {
  position: absolute; top: calc(100% + 6px); left: 0; width: min(440px, calc(100vw - 40px)); max-height: 70vh; overflow-y: auto;
  background: var(--bz-ink-800); border: 1px solid var(--bz-ink-700); border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45); padding: 6px; z-index: 20;
}
.docs-search-results[hidden] { display: none; }
.docs-nav .docs-search-results a, .docs-search-results a {
  display: block; padding: 9px 11px; margin: 0; border: 0; border-radius: 8px; text-decoration: none; color: var(--bz-bone-dim);
}
.docs-nav .docs-search-results a:hover, .docs-search-results a:hover, .docs-search-results a[aria-selected="true"] { background: var(--bz-ink-700); color: var(--bz-bone-dim); }
.docs-search-title { display: block; color: var(--bz-bone); font-weight: 600; font-size: 14px; }
.docs-search-page { display: block; font-family: var(--bz-mono); font-size: 11px; letter-spacing: 0.5px; color: var(--bz-signal-light); margin-top: 2px; }
.docs-search-snippet { display: block; font-size: 13px; line-height: 1.45; margin-top: 4px; }
.docs-search-results mark { background: rgba(230, 57, 70, 0.22); color: var(--bz-bone); border-radius: 3px; padding: 0 1px; }
.docs-search-empty { margin: 0; padding: 10px 11px; font-size: 13px; line-height: 1.5; color: var(--bz-bone-dim); }
.docs-nav .docs-search-empty a, .docs-search-empty a { display: inline; padding: 0; margin: 0; border: 0; color: var(--bz-signal-light); text-decoration: underline; }
.docs-search-hero { max-width: 560px; margin: 22px 0 0; }
.docs-search-hero input { padding: 13px 14px 13px 40px; font-size: 16px; background-position: 14px 50%; border-radius: 12px; }
.docs-search-hero .docs-search-results { width: 100%; }

.docs-crumbs { font-family: var(--bz-mono); font-size: 12px; color: var(--bz-bone-dim); letter-spacing: 0.5px; }
.docs-crumbs a { color: var(--bz-bone-dim); }
.docs-crumbs span { margin: 0 6px; opacity: 0.6; }
.docs-hero { padding: 14px 0 22px; border-bottom: 1px solid var(--bz-ink-700); margin-bottom: 24px; }
.docs-hero h1 { font-family: var(--bz-serif); font-weight: 400; font-size: 46px; line-height: 1.05; margin: 0 0 12px; }
.docs-lede { color: var(--bz-bone-dim); font-size: 17px; line-height: 1.55; margin: 0 0 12px; }
.docs-meta { font-family: var(--bz-mono); font-size: 12px; color: var(--bz-bone-dim); opacity: 0.8; margin: 0; }

.docs-onpage {
  display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: baseline;
  background: var(--bz-ink-800); border: 1px solid var(--bz-ink-700); border-radius: 12px;
  padding: 12px 16px; margin-bottom: 28px; font-size: 14px;
}
.docs-onpage span { font-family: var(--bz-mono); font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--bz-bone-dim); width: 100%; }
.docs-onpage a { color: var(--bz-signal-light); text-decoration: none; }
.docs-onpage a:hover { text-decoration: underline; }

.docs-body { color: var(--bz-bone-dim); line-height: 1.7; font-size: 16px; }
.docs-body h2 { font-size: 30px; color: var(--bz-bone); margin: 40px 0 12px; scroll-margin-top: 20px; }
.docs-body > h2:first-child { margin-top: 8px; }
.docs-body h3 { font-size: 17px; color: var(--bz-bone); margin: 0 0 6px; }
.docs-body p { margin: 0 0 14px; }
.docs-body ol, .docs-body ul { margin: 0 0 16px; padding-left: 22px; }
.docs-body li { margin-bottom: 6px; }
.docs-body li > ul { margin: 6px 0 0; }
.docs-body strong { color: var(--bz-bone); }
.docs-body a:not(.btn) { color: var(--bz-signal-light); }
.docs-body code, .docs-body kbd {
  font-family: var(--bz-mono); font-size: 0.86em; background: var(--bz-ink-950);
  border: 1px solid var(--bz-ink-700); border-radius: 6px; padding: 2px 6px; color: var(--bz-butter);
  overflow-wrap: anywhere;
}
.docs-body .guide-shot { margin: 18px 0 22px; }
.docs-body .guide-legend { margin: -8px 0 18px; }
.docs-body .guide-tip, .docs-note { margin: 16px 0 20px; line-height: 1.6; }
.docs-body .stream-frame { margin: 0 0 24px; }
.docs-note {
  background: rgba(230, 57, 70, 0.08); border: 1px solid rgba(230, 57, 70, 0.32); border-left-width: 3px;
  border-radius: 10px; padding: 12px 16px; font-size: 14px; color: var(--bz-bone-dim);
}
.docs-note strong { color: var(--bz-signal-light); }

.docs-table-wrap { overflow-x: auto; margin: 0 0 18px; border: 1px solid var(--bz-ink-700); border-radius: 12px; }
.docs-table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 1.5; }
.docs-table th, .docs-table td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--bz-ink-700); vertical-align: top; }
.docs-table th { font-family: var(--bz-mono); font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--bz-bone-dim); background: var(--bz-ink-800); font-weight: 500; }
.docs-table tr:last-child td { border-bottom: 0; }

.docs-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.docs-cards-2 { grid-template-columns: 1fr 1fr; margin: 4px 0 18px; }
.docs-card {
  display: block; background: var(--bz-ink-800); border: 1px solid var(--bz-ink-700); border-radius: 14px;
  padding: 18px 18px 16px; color: var(--bz-bone-dim); text-decoration: none; font-size: 14px; line-height: 1.55;
}
.docs-card p { margin: 0 0 8px; }
.docs-card p:last-child { margin: 0; }
.docs-card h3 { font-family: var(--bz-sans); font-size: 16px; font-weight: 700; color: var(--bz-bone); margin: 0 0 6px; }
.docs-card-link { transition: border-color .15s, transform .15s; }
.docs-card-link:hover { border-color: var(--bz-signal); transform: translateY(-2px); }
.docs-card-cta { font-family: var(--bz-mono); font-size: 12px; color: var(--bz-signal-light); }
.docs-group { margin-bottom: 36px; }
.docs-index .docs-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 599px) { .docs-index .docs-cards { grid-template-columns: minmax(0, 1fr); } }
.docs-group h2 { font-size: 30px; margin: 0 0 14px; }
.docs-index .guide-hero p a { color: var(--bz-signal-light); }

.docs-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 44px 0 0; padding-top: 28px; border-top: 1px solid var(--bz-ink-700); }
.docs-pager:empty { display: none; }
.docs-pager a {
  display: block; padding: 14px 18px; border: 1px solid var(--bz-ink-700); border-radius: 12px;
  color: var(--bz-bone); text-decoration: none; font-weight: 600;
}
.docs-pager a:hover { border-color: var(--bz-signal); }
.docs-pager small { display: block; font-family: var(--bz-mono); font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--bz-bone-dim); font-weight: 400; margin-bottom: 4px; }
.docs-pager-next { text-align: right; grid-column: 2; }
.docs-still-stuck { margin-top: 28px; padding: 18px 20px; background: var(--bz-ink-800); border: 1px solid var(--bz-ink-700); border-radius: 14px; }
.docs-still-stuck h2 { font-size: 22px; margin: 0 0 6px; }
.docs-still-stuck p { margin: 0; color: var(--bz-bone-dim); line-height: 1.6; }
.docs-still-stuck a { color: var(--bz-signal-light); }
.docs-ready { text-align: center; padding: 36px 20px; margin-top: 12px; background: var(--bz-ink-800); border: 1px solid var(--bz-ink-700); border-radius: 18px; }
.docs-ready h2 { font-size: 34px; margin: 0 0 8px; }
.docs-ready p { color: var(--bz-bone-dim); margin: 0 0 18px; }
.docs-ready .btn { margin: 4px; }

@media (max-width: 899px) {
  .docs-layout { grid-template-columns: minmax(0, 1fr); gap: 20px; margin-top: 16px; }
  .docs-nav { position: static; }
  .docs-search-results { width: 100%; }
  .docs-nav details { position: static; background: var(--bz-ink-800); border: 1px solid var(--bz-ink-700); border-radius: 12px; padding: 4px 8px; }
  .docs-nav details[open] { padding-bottom: 12px; }
  .docs-nav summary { display: block; cursor: pointer; padding: 10px 6px; font-weight: 600; color: var(--bz-bone); list-style: none; }
  .docs-nav summary::after { content: "\25BE"; float: right; color: var(--bz-bone-dim); }
  .docs-nav summary::-webkit-details-marker { display: none; }
  .docs-hero h1 { font-size: 36px; }
  .docs-body h2 { font-size: 26px; }
  .docs-cards-2, .docs-pager { grid-template-columns: minmax(0, 1fr); }
  .docs-pager-next { grid-column: 1; }
}

/* Dashboard (index.html): one club, matches beside its tournaments.
   Grid: 2fr + 1fr with a 24px gap fills the 1160px column edge to edge. */
body.landing .landing-wrap.dash { max-width: 1160px; }
#clubNav:empty { display: none; }
.dash-head { align-items: flex-end; }
body.landing .dash-head h1 { font-size: 40px; }
.dash-meta {
  margin: 8px 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px;
  font-size: 14px; color: var(--bz-bone-dim);
}
.dash-meta #clubMetaText:empty { display: none; }
.dash-invite { display: inline-flex; align-items: center; gap: 8px; }
.dash-invite code { color: var(--bz-bone); font: 600 14px var(--bz-sans); letter-spacing: 0.04em; }
body.landing .dash-invite .btn { padding: 4px 10px; font-size: 13px; }

.dash-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.dash-grid[hidden] { display: none; }
.dash-panel { background: var(--bz-ink-900); border-radius: 14px; padding: 20px 20px 16px; }
.dash-panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
body.landing .dash-panel-head h2 { margin: 0; font: 700 18px var(--bz-sans); letter-spacing: 0; }
.dash-more { color: var(--bz-bone-dim); font-size: 14px; text-decoration: none; }
.dash-more:hover { color: var(--bz-bone); text-decoration: underline; }
.dash-panel .match-list { margin: 0; }
.dash-panel .empty-state { margin: 8px 0; }

.dash-tourneys { list-style: none; margin: 0 -8px; padding: 0; display: flex; flex-direction: column; }
body.landing main .dash-tourneys li a {
  display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 10px 8px; border-radius: 8px;
  color: var(--bz-bone); text-decoration: none;
}
body.landing main .dash-tourneys li a:hover { background: var(--bz-ink-800); }
.dash-tourneys a:focus-visible { outline: 2px solid var(--bz-bone); outline-offset: 0; }
.dash-tourneys li + li { border-top: 1px solid var(--bz-ink-800); }
.dash-t-name { font-weight: 700; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-t-meta { grid-column: 1; font-size: 13px; color: var(--bz-bone-dim); }
.dash-t-state { grid-column: 2; grid-row: 1 / 3; align-self: center; font-size: 13px; color: var(--bz-bone-dim); text-align: right; max-width: 120px; }
.dash-t-state.is-live { color: var(--bz-butter); font-weight: 600; }
.dash-loading { margin: 4px 0; }
.dash-loading[hidden], .dash-empty[hidden] { display: none; }
.dash-empty p { margin: 0 0 12px; color: var(--bz-bone-dim); font-size: 14px; line-height: 1.5; }

@media (max-width: 1100px) {
  .dash-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  body.landing .dash-head h1 { font-size: 30px; }
  .dash-head .page-actions { flex: 1 1 100%; }
  .dash-head .page-actions > * { flex: 1; justify-content: center; text-align: center; }
  .dash-panel { padding: 16px 12px 12px; margin: 0 -4px; }
}

/* One-off "new look" notice (js/app-nav.js). Sits in the page flow, never over it. */
.new-look {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px 16px;
  margin: 0 0 4px; padding: 12px 12px 12px 16px; border-radius: 12px;
  background: var(--bz-ink-800); border-left: 3px solid var(--bz-signal);
  font-family: var(--bz-sans); font-size: 14px; color: var(--bz-bone);
}
.new-look p { margin: 0; flex: 1 1 320px; line-height: 1.45; color: var(--bz-bone-dim); }
.new-look strong { color: var(--bz-bone); }
body.landing .new-look a { color: var(--bz-bone); font-weight: 600; white-space: nowrap; }
.new-look-close {
  width: 32px; height: 32px; border: 0; border-radius: 8px; background: none;
  color: var(--bz-bone-dim); font-size: 20px; line-height: 1; cursor: pointer;
}
.new-look-close:hover { background: var(--bz-ink-700); color: var(--bz-bone); }
.new-look :focus-visible { outline: 2px solid var(--bz-bone); outline-offset: 2px; }
.new-look .new-look-cta { color: #fff; white-space: nowrap; }
.new-look-actions { display: flex; align-items: center; gap: 8px 14px; flex: 1 0 auto; justify-content: flex-end; }
.new-look-actions .new-look-close { flex: none; }
@media (max-width: 640px) { .new-look-actions { justify-content: flex-start; } .new-look-actions .new-look-close { margin-left: auto; } }
/* "New" tag: on the free-tournaments notice and the sidebar Tournaments link. */
.new-badge {
  display: inline-block; margin-left: auto; padding: 1px 7px; border-radius: 999px;
  background: var(--bz-signal); color: #fff; font-size: 11px; font-weight: 700;
  letter-spacing: .04em; text-transform: uppercase; line-height: 1.5; vertical-align: 1px;
}
.new-look p .new-badge { margin: 0 4px 0 0; }

/* Player links: the one join link for the whole league, and the join page. */
.join-box { padding: 14px; margin-bottom: 18px; border: 1px solid var(--bz-ink-700); border-radius: 12px; }
.join-box h3 { margin-top: 0; }
#joinUrl { width: 100%; box-sizing: border-box; font-family: var(--bz-mono); font-size: 13px; margin: 8px 0; }
.join-division { font-family: var(--bz-mono); font-size: 12px; text-transform: uppercase; letter-spacing: 1px; color: var(--bz-butter); margin: 18px 0 6px; }
li.join-division { list-style: none; padding: 0; }
.join-list .roster-item { align-items: center; }
/* Player links rows: name with joined status under it on the left, the
   same three buttons on the right on every row. Stacked on narrow screens. */
.link-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 8px 12px; }
.link-row[hidden], .join-division[hidden] { display: none; }
.link-who { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.link-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.link-status { font-size: 12px; color: var(--bz-bone-dim); }
.link-status.is-joined { color: #34d399; font-weight: 600; }
.link-row .roster-actions { flex-wrap: nowrap; gap: 6px; }
.link-row .roster-actions .btn { white-space: nowrap; padding: 6px 10px; }
#joinUrl, #linksSearch {
  padding: 10px 12px; font-size: 14px; background: var(--bz-ink-950); color: var(--bz-bone);
  border: 1px solid var(--bz-ink-700); border-radius: 10px;
}
#joinUrl { font-family: var(--bz-mono); font-size: 13px; }
.links-tools { margin: 8px 0 12px; }
.links-tools #linksSearch { flex: 1; min-width: 160px; }
@media (max-width: 520px) {
  .link-row { grid-template-columns: 1fr; gap: 8px; }
  .link-row .roster-actions .btn { flex: 1; text-align: center; }
}
.join-search {
  width: 100%; box-sizing: border-box; margin: 6px 0 4px; padding: 12px 14px; font-size: 16px;
  background: var(--bz-ink-950); color: var(--bz-bone); border: 1px solid var(--bz-ink-700); border-radius: 10px;
}
.join-group[hidden], .join-list li[hidden] { display: none; }
.pm-cancel { background: transparent; border-style: dashed; color: var(--bz-bone-dim); }
.pm-cancel[hidden] { display: none; }
/* A player's own link: only Player mode, never the full scorer underneath. */
body.player-link > *:not(#playerMode):not(script):not(.pm-toast) { display: none !important; }
#playerBack[hidden] { display: none; }
.link-error { max-width: 520px; margin: 40px auto; }
.link-error h1 { margin-top: 0; }
.link-error p { color: var(--bz-bone-dim); line-height: 1.5; }
/* Wraps on a phone: the Write-up button drops to its own line rather than off the screen. */
.week-pager { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 4px 0 14px; }
.week-pager[hidden] { display: none; }
.week-pager .btn { flex: none; white-space: nowrap; }
.week-pager select {
  flex: 1 1 160px; min-width: 0; max-width: 320px; padding: 10px 12px; font-size: 15px; text-overflow: ellipsis;
  background: var(--bz-ink-950); color: var(--bz-bone); border: 1px solid var(--bz-ink-700); border-radius: 10px;
}
/* Write-up for socials */
.writeup-box textarea {
  width: 100%; box-sizing: border-box; margin: 8px 0; padding: 12px; font: 15px/1.5 var(--bz-sans, inherit);
  background: var(--bz-ink-950); color: var(--bz-bone); border: 1px solid var(--bz-ink-700); border-radius: 10px; resize: vertical;
}
.writeup-box select, .writeup-box input[type="date"] { padding: 8px 10px; background: var(--bz-ink-950); color: var(--bz-bone); border: 1px solid var(--bz-ink-700); border-radius: 8px; color-scheme: dark; }
.writeup-dates { display: inline-flex; flex-wrap: wrap; gap: 8px; }
.writeup-box pre { white-space: pre-wrap; font-size: 12px; max-height: 260px; overflow: auto; color: var(--bz-bone-dim); }
.writeup-box [hidden] { display: none !important; }

/* Player link: notifications / install banner (play.html), gone once done */
.app-banner {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin: 0 0 18px; padding: 14px 16px;
  border: 1px solid var(--bz-signal); border-radius: 14px;
  background: linear-gradient(135deg, rgba(230, 57, 70, 0.18), rgba(230, 57, 70, 0.06)), var(--bz-ink-900);
}
.app-banner[hidden] { display: none; }
.app-banner-text { flex: 1 1 240px; display: grid; gap: 4px; line-height: 1.45; }
.app-banner-text strong { font-size: 16px; }
.app-banner-text span { color: var(--bz-bone-dim); font-size: 14px; }
.app-banner-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.app-banner-actions .btn[hidden] { display: none; }
.push-on-line { margin-top: 18px; text-align: center; }

/* ---- Team league match card (match-card.js: captain.html, tournament.html) ---- */
.mc-wrap { flex: 1 1 100%; margin-top: 12px; }
.match-card { display: flex; flex-direction: column; gap: 10px; }
.mc-score { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; background: var(--bz-ink-800); }
.mc-score .mc-team { font-weight: 700; min-width: 0; overflow-wrap: anywhere; }
.mc-score .mc-team:last-child { text-align: right; }
.mc-team.is-mine { color: var(--bz-butter); }
.mc-total { font-family: var(--bz-mono); font-size: 24px; }
.mc-left { margin: 0; }
.mc-frame { border: 1px solid var(--bz-ink-700); border-radius: 12px; padding: 10px 12px; background: var(--bz-ink-900); }
.mc-frame.won-h { border-left: 4px solid var(--bz-signal); }
.mc-frame.won-a { border-right: 4px solid var(--bz-signal); }
.mc-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 13px; color: var(--bz-bone-dim); }
.mc-no { font-weight: 700; color: var(--bz-bone); }
.mc-type { font-family: var(--bz-mono); font-size: 11px; text-transform: uppercase; letter-spacing: 1px; }
.mc-table { margin-left: auto; max-width: 140px; }
.mc-row { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; }
.mc-side { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.mc-side:last-child { text-align: right; }
.mc-side select { width: 100%; min-width: 0; }
.mc-names { font-weight: 600; overflow-wrap: anywhere; }
.mc-vs { display: flex; flex-direction: column; gap: 6px; }
.mc-win { font: inherit; font-size: 13px; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--bz-ink-600); background: var(--bz-ink-800); color: var(--bz-bone); cursor: pointer; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mc-win.selected { background: var(--bz-signal); border-color: var(--bz-signal); color: #fff; font-weight: 700; }
.mc-win:disabled { opacity: 0.5; cursor: default; }
@media (max-width: 560px) {
  .mc-row { grid-template-columns: 1fr; }
  .mc-side:last-child { text-align: left; }
  .mc-vs { flex-direction: row; }
  .mc-vs .mc-win { flex: 1 1 0; max-width: none; }
  .mc-vs .mc-win[data-w="0"] { order: 0; }
}
/* Team league: player averages and team rosters on the league page */
.team-stats td.num, .team-stats th.num { text-align: right; font-family: var(--bz-mono); }
.team-roster-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 0; padding: 0; list-style: none; }
.team-roster-list li { font-size: 13px; padding: 3px 10px; border-radius: 999px; background: var(--bz-ink-800); }
.team-roster-list li.is-captain { background: rgba(245, 194, 66, 0.16); color: var(--bz-butter); }
.team-edit { border: 1px solid var(--bz-ink-700); border-radius: 12px; padding: 10px 12px; margin-bottom: 10px; }
.team-edit textarea { width: 100%; }
.team-roster-edit { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.team-card-host .match-card { margin: 4px 0 12px; }
.match-card select { padding: 9px 10px; font: inherit; font-size: 14px; }
.mc-side-label { display: none; font-size: 11px; font-family: var(--bz-mono); text-transform: uppercase; letter-spacing: 1px; color: var(--bz-bone-dim); }
.mc-side.is-mine .mc-side-label { color: var(--bz-butter); }
@media (max-width: 560px) { .mc-side-label { display: block; } }
