/* SpotBid Live Scoring — dark sports visual language (BRD §29)
   Player names lead, team names follow; scores are the largest thing on any card. */
:root {
  --bg: #0d0c14;
  --surface: #16151f;
  --surface-2: #1e1c2b;
  --line: #2b2940;
  --fg: #f4f3fa;
  --muted: #9c99b5;
  --accent: #8b6cff;
  --accent-ink: #ffffff;
  --accent-soft: rgba(139, 108, 255, 0.16);
  --ball: #d4ec3a;            /* pickleball optic yellow: LIVE, GAME POINT, serve */
  --ball-ink: #1b2200;
  --ok: #3ddc97;
  --warn: #ffb547;
  --danger: #ff6b6b;
  --radius: 14px;
  --display: "Barlow Condensed", "Roboto Condensed", "Arial Narrow", system-ui, sans-serif;
  --body: "Barlow", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  /* status surfaces */
  --ok-bg: #0f3324; --danger-bg: #3a1418; --warn-bg: #3a2500; --trump-bg: #3a2a00;
  --danger-fg: #ffb3b3; --info-fg: #d6ccff; --line-strong: #3b3858;
  --ball-text: var(--ball);        /* highlight used as text or outline */
  --hero-glow: rgba(139, 108, 255, 0.35); --hero-a: #1b1830; --hero-b: #121119;
  --bar-bg: rgba(13, 12, 20, 0.92);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  color-scheme: dark;
}

/* Light theme. data-theme is set on <html> before first paint by views/partials/theme_head.php
   (user choice > tournament default; "system" follows the device). Brand colours from
   Admin > Settings > Appearance are injected after this file and win over these defaults. */
:root[data-theme="light"] {
  --bg: #f4f4f9;
  --surface: #ffffff;
  --surface-2: #ecebf4;
  --line: #dcdae8;
  --line-strong: #c4c1d8;
  --fg: #16151f;
  --muted: #5d5a75;
  --accent-soft: rgba(139, 108, 255, 0.14);
  --ok: #0c8a54; --warn: #a75a00; --danger: #c72f3b;
  --ok-bg: #e2f5ea; --danger-bg: #fde7e9; --warn-bg: #fff0d9; --trump-bg: #fff0d9;
  --danger-fg: #9b1c26; --info-fg: #4630b8;
  --ball-text: #5d6b00;
  --hero-glow: rgba(139, 108, 255, 0.22); --hero-a: #ffffff; --hero-b: #efecfb;
  --bar-bg: rgba(244, 244, 249, 0.94);
  --shadow: 0 10px 30px rgba(22, 21, 31, 0.15);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font: 16px/1.5 var(--body); min-height: 100vh;
  font-variant-numeric: tabular-nums;
}
a { color: inherit; }
img { max-width: 100%; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
/* WebView / touch: no grey tap flash, no double-tap zoom delay on controls */
a, button, summary, label, select, input { -webkit-tap-highlight-color: transparent; }
button, .btn, a, summary, label, .choice, .point-btn { touch-action: manipulation; }
/* No overflow rules on <html>/<body>: those can stop the page scrolling in some mobile browsers
   and WebViews. Wide content scrolls inside its own box instead (.table-wrap, .tabs, .scroll-x). */
body { -webkit-font-smoothing: antialiased; }
body.scorer { overscroll-behavior-y: none; } /* no pull-to-refresh while scoring */
.admin-main { min-width: 0; }
/* 16px inputs stop iOS WebView zooming on focus */
input, select, textarea { font-size: 16px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

h1, h2, h3 { font-family: var(--display); font-weight: 700; letter-spacing: 0.01em; line-height: 1.1; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(28px, 5vw, 40px); }
h2 { font-size: 24px; }
h3 { font-size: 19px; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.upper { text-transform: uppercase; letter-spacing: 0.08em; }
.label { font: 600 12px/1.2 var(--body); text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); }

/* ---------- layout ---------- */
.wrap { max-width: 1120px; margin: 0 auto; padding-inline: 16px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack-lg { display: flex; flex-direction: column; gap: 32px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 16px; }
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 12px; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.section-head a { color: var(--accent); text-decoration: none; font-weight: 600; font-size: 14px; }

/* ---------- top bar & nav ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: var(--bar-bg);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top, 0px);
}
.topbar .wrap { display: flex; align-items: center; gap: 16px; min-height: 58px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; min-width: 0; }
.brand-mark { width: 30px; height: 30px; border-radius: 9px; background: var(--accent); display: grid; place-items: center; flex: none; }
.brand-mark svg { width: 18px; height: 18px; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-text b { font: 700 17px/1.1 var(--display); text-transform: uppercase; letter-spacing: 0.04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-text span { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topnav { margin-left: auto; display: flex; gap: 4px; }
.topnav a { text-decoration: none; padding: 8px 12px; border-radius: 10px; color: var(--muted); font-weight: 600; font-size: 15px; }
.topnav a[aria-current="page"], .topnav a:hover { color: var(--fg); background: var(--surface-2); }

.bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: none;
  background: var(--surface); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.bottomnav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 7px; text-decoration: none; color: var(--muted); font-size: 11px; font-weight: 600; }
.bottomnav a svg { width: 22px; height: 22px; }
.bottomnav a[aria-current="page"] { color: var(--fg); }
.bottomnav a[aria-current="page"] svg { color: var(--accent); }
@media (max-width: 760px) {
  .topnav { display: none; }
  .bottomnav { display: flex; }
  body.has-bottomnav main { padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
}
main { padding-block: 20px 48px; }

/* ---------- chips & badges ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; font: 700 11px/1 var(--body); text-transform: uppercase; letter-spacing: 0.08em; padding: 5px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.chip.live { background: var(--ball); color: var(--ball-ink); }
.chip.live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: pulse 1.4s infinite; }
.chip.gp { background: transparent; color: var(--ball-text); box-shadow: inset 0 0 0 1.5px var(--ball-text); }
.chip.final { background: var(--accent-soft); color: var(--accent); }
.chip.trump { background: var(--trump-bg); color: var(--warn); }
.chip.warn { background: var(--warn-bg); color: var(--warn); }
.chip.danger { background: var(--danger-bg); color: var(--danger); }
.chip.ok { background: var(--ok-bg); color: var(--ok); }
@keyframes pulse { 50% { opacity: 0.3; } }
@media (prefers-reduced-motion: reduce) { .chip.live::before { animation: none; } }

/* ---------- match card (player-first, BRD §11) ---------- */
.mcard { --card-border: color-mix(in srgb, #808080 45%, var(--line)); background: var(--surface); border: 1px solid var(--card-border); border-radius: 14px; padding: 9px 12px 10px; display: flex; flex-direction: column; gap: 7px; text-decoration: none; color: inherit; min-width: 0; }
a.mcard:hover { border-color: color-mix(in srgb, var(--accent) 60%, #808080); }
.mcard-head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.mcard-head .slot { font: 700 15px/1 var(--display); letter-spacing: 0.04em; color: var(--accent); }
.mcard-head .meta { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.mcard-head .right { margin-left: auto; display: flex; gap: 6px; flex: none; }
.mcard-head .chip { text-transform: uppercase; }
.mc-cols { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 8px; align-items: center; }
.mc-side { display: flex; flex-direction: column; gap: 4px; min-width: 0; align-items: flex-start; }
.mc-side.sB { align-items: flex-end; text-align: right; }
.mc-pl { display: flex; align-items: center; gap: 8px; min-width: 0; max-width: 100%; }
.mc-side.sB .mc-pl { flex-direction: row-reverse; }
.mc-pl .av { position: relative; overflow: hidden; flex: none; width: 34px; height: 34px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--surface-2, #2a2940); color: var(--fg); font: 700 11px/1 var(--body); }
.mc-pl .av img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.mc-pl b { font: 600 14px/1.2 var(--display); text-transform: uppercase; letter-spacing: 0.03em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.mc-pl .serve-dot { margin: 0; flex: none; width: 7px; height: 7px; }
.mc-team { font-size: 11.5px; color: var(--muted); display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; margin-top: 1px; }
.mc-team .team-swatch { width: 8px; height: 8px; border-radius: 2px; }
.mc-side.lost b { color: var(--muted); }
.mc-mid { display: grid; place-items: center; gap: 3px; min-width: 34px; }
.mc-vs { font: 700 11px/1 var(--display); color: var(--muted); letter-spacing: 0.1em; }
.mc-score { font: 700 24px/1 var(--display); white-space: nowrap; display: inline-flex; gap: 2px; }
.mc-score i { font-style: normal; color: var(--muted); }
.mc-score .w { color: var(--accent); } .mc-score .l { color: var(--muted); }
.mc-mid small { font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.mc-grp { display: flex; align-items: center; gap: 8px; font: 700 12px/1 var(--body); color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; margin: 6px 0 -2px; grid-column: 1 / -1; }
.mc-grp::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.mc-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 10px; }
.hscroll > .mcard { flex: 0 0 min(360px, 92%); scroll-snap-align: start; }
.side { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; }
.side .names { font: 700 19px/1.15 var(--display); text-transform: uppercase; letter-spacing: 0.02em; overflow-wrap: anywhere; }
.side .team { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; margin-top: 2px; }
.side .score { font: 700 34px/1 var(--display); min-width: 1.4ch; text-align: right; }
.side.won .score { color: var(--fg); }
.side.lost .score, .side.lost .names { color: var(--muted); }
.side.won .names::after { content: " ✓"; color: var(--ok); }
.serve-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--ball-text); margin-left: 6px; vertical-align: middle; }
.team-swatch { width: 9px; height: 9px; border-radius: 3px; display: inline-block; flex: none; }
.vs { font: 700 12px/1 var(--display); color: var(--muted); letter-spacing: 0.2em; display: flex; align-items: center; gap: 10px; }
.vs::before, .vs::after { content: ""; height: 1px; background: var(--line); flex: 1; }
.games-line { font-size: 13px; color: var(--muted); }

/* ---------- hero ---------- */
.hero { border-radius: 20px; padding: 24px; background:
    radial-gradient(120% 140% at 100% 0%, var(--hero-glow), transparent 55%),
    linear-gradient(160deg, var(--hero-a), var(--hero-b)); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 14px; }
.hero .kpis { display: flex; gap: 24px; flex-wrap: wrap; }
.kpi b { display: block; font: 700 30px/1 var(--display); }
.kpi span { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; overflow-y: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table.data { border-collapse: collapse; width: 100%; font-size: 15px; }
table.data th, table.data td { padding: 10px 12px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data th { font: 600 11px/1.2 var(--body); text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); background: var(--surface-2); }
table.data th:first-child, table.data td:first-child { text-align: left; }
table.data td.name, table.data th.name { text-align: left; white-space: normal; min-width: 150px; }
table.data tr:last-child td { border-bottom: 0; }
table.data td.pos { width: 36px; color: var(--muted); font-weight: 700; }
table.data tr.qualify td.pos { color: var(--accent); }
table.data td a { text-decoration: none; font-weight: 600; }
table.data td a:hover { text-decoration: underline; }
td.strong, .strong { font-weight: 700; }
.form-pills { display: inline-flex; gap: 3px; }
.form-pills i { font-style: normal; width: 18px; height: 18px; border-radius: 5px; display: inline-grid; place-items: center; font-size: 10px; font-weight: 700; }
.form-pills .W { background: var(--ok-bg); color: var(--ok); }
.form-pills .L { background: var(--danger-bg); color: var(--danger); }
.form-pills .D { background: var(--surface-2); color: var(--muted); }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.tabs a, .tabs button { flex: none; text-decoration: none; border: 1px solid var(--line); background: transparent; padding: 8px 14px; border-radius: 999px; font-weight: 600; font-size: 14px; color: var(--muted); cursor: pointer; }
.tabs a[aria-current="page"], .tabs button[aria-selected="true"] { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.tabs .count { opacity: 0.7; margin-left: 4px; }

/* ---------- forms & buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 12px; padding: 11px 18px; font-weight: 700; font-size: 15px; cursor: pointer; text-decoration: none; background: var(--surface-2); color: var(--fg); min-height: 44px; }
.btn:hover { filter: brightness(1.12); }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.ball { background: var(--ball); color: var(--ball-ink); }
.btn.danger { background: var(--danger-bg); color: var(--danger); }
.btn.ghost { background: transparent; box-shadow: inset 0 0 0 1px var(--line); }
.btn.small { padding: 6px 12px; min-height: 34px; font-size: 13px; border-radius: 9px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; filter: none; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { font-weight: 600; font-size: 14px; }
.field small { color: var(--muted); font-size: 12px; }
input[type=text], input[type=password], input[type=number], input[type=date], input[type=datetime-local], input[type=tel], select, textarea {
  background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; min-height: 44px; width: 100%;
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; }
.check { display: flex; gap: 10px; align-items: center; min-height: 44px; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 14px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.notice { border-radius: 12px; padding: 12px 14px; font-weight: 600; }
.notice.ok { background: var(--ok-bg); color: var(--ok); }
.notice.error { background: var(--danger-bg); color: var(--danger-fg); }
.notice.info { background: var(--accent-soft); color: var(--info-fg); }
.empty { border: 1px dashed var(--line); border-radius: var(--radius); padding: 28px 16px; text-align: center; color: var(--muted); }

/* ---------- profile ---------- */
.profile-head { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.avatar { width: 64px; height: 64px; border-radius: 18px; background: var(--surface-2); display: grid; place-items: center; font: 700 26px/1 var(--display); color: var(--accent); flex: none; }
.statgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.stat b { display: block; font: 700 26px/1.1 var(--display); }
.stat span { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }

/* ---------- timeline ---------- */
.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.timeline li { display: grid; grid-template-columns: 70px 1fr auto; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; align-items: center; }
.timeline li .t { color: var(--muted); font-size: 12px; }
.timeline li.muted-row { color: var(--muted); }

/* ---------- bracket ---------- */
.bracket { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 16px; align-items: start; }
.tie { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.tie header { padding: 10px 14px; background: var(--surface-2); display: flex; justify-content: space-between; }
.tie .team-row { display: flex; justify-content: space-between; padding: 12px 14px; border-top: 1px solid var(--line); font: 700 18px/1.2 var(--display); text-transform: uppercase; }
.tie .team-row.win { color: var(--ball-text); }

/* ---------- login ---------- */
.login-card { max-width: 420px; margin: 6vh auto 0; }

/* ---------- admin ---------- */
.admin-shell { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: 100vh; }
.admin-side { background: var(--surface); border-right: 1px solid var(--line); padding: 16px 12px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.admin-side .brand { padding: 4px 6px 16px; }
.admin-side a.nav { text-decoration: none; color: var(--muted); padding: 9px 12px; border-radius: 10px; font-weight: 600; font-size: 15px; }
.admin-side a.nav[aria-current="page"], .admin-side a.nav:hover { background: var(--surface-2); color: var(--fg); }
.admin-side .sep { height: 1px; background: var(--line); margin: 10px 4px; }
.admin-main { padding: 24px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
@media (max-width: 900px) {
  .admin-shell { grid-template-columns: minmax(0, 1fr); }
  .admin-side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--line); }
  .admin-side .brand { width: 100%; padding-bottom: 8px; }
  .admin-side .sep { display: none; }
  .admin-main { padding: 16px; }
}
.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.court { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.court.stale { border-color: var(--warn); }
.court .actions { display: flex; gap: 6px; flex-wrap: wrap; }
details.inline-form summary { cursor: pointer; list-style: none; }
details.inline-form summary::-webkit-details-marker { display: none; }
details.inline-form[open] { flex-basis: 100%; }
.inline-form form { display: flex; gap: 8px; flex-wrap: wrap; align-items: end; margin-top: 8px; }
.settings-row { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); align-items: start; }
.settings-row:last-child { border-bottom: 0; }
@media (max-width: 640px) { .settings-row { grid-template-columns: minmax(0, 1fr); gap: 8px; } }
.settings-row .what b { display: block; }
.settings-row .what small { color: var(--muted); }
.order-list { display: flex; flex-direction: column; gap: 6px; }
.order-item { display: flex; align-items: center; gap: 8px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 6px 8px; }
.order-item span { flex: 1; }
.order-item button { background: var(--surface-2); border: 0; border-radius: 8px; width: 32px; height: 32px; cursor: pointer; }
.rule-tag { font-size: 11px; font-weight: 700; padding: 3px 7px; border-radius: 6px; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.rule-tag.recalc { color: var(--info-fg); background: var(--accent-soft); }
.rule-tag.locked { color: var(--warn); background: var(--warn-bg); }
.preview-box { position: sticky; bottom: 0; background: var(--surface); border: 1px solid var(--accent); border-radius: var(--radius); padding: 14px 16px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }

/* ---------- scorer app ---------- */
body.scorer { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.scorer-top { display: flex; align-items: center; gap: 10px; padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 10px; border-bottom: 1px solid var(--line); background: var(--surface); }
.scorer-top .who { margin-left: auto; font-size: 13px; color: var(--muted); }
.net { font: 700 11px/1 var(--body); letter-spacing: 0.08em; text-transform: uppercase; padding: 6px 9px; border-radius: 999px; }
.net.online { background: var(--ok-bg); color: var(--ok); }
.net.offline { background: var(--danger-bg); color: var(--danger); }
.net.syncing { background: var(--warn-bg); color: var(--warn); }
.scorer-tabs { display: flex; gap: 0; border-bottom: 1px solid var(--line); background: var(--surface); }
.scorer-tabs button { flex: 1; background: none; border: 0; border-bottom: 3px solid transparent; padding: 12px 6px; font-weight: 700; color: var(--muted); cursor: pointer; }
.scorer-tabs button[aria-selected="true"] { color: var(--fg); border-bottom-color: var(--accent); }
.scorer-body { flex: 1; padding: 16px; display: flex; flex-direction: column; gap: 12px; max-width: 640px; width: 100%; margin: 0 auto; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(20px + env(safe-area-inset-bottom, 0px)); background: var(--fg); color: var(--bg); padding: 12px 16px; border-radius: 12px; font-weight: 700; z-index: 50; max-width: calc(100% - 32px); box-shadow: var(--shadow); }
.toast.error { background: var(--danger); color: #1a0505; }

.live-head { text-align: center; display: flex; flex-direction: column; gap: 4px; }
.live-head .label { color: var(--ball-text); }
.live-head .meta { font: 700 16px/1.2 var(--display); text-transform: uppercase; letter-spacing: 0.06em; }
.live-side { background: var(--surface); border: 2px solid var(--line); border-radius: 20px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.live-side.serving { border-color: var(--ball-text); }
.live-side .players { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.live-side .pname { font: 700 22px/1.1 var(--display); text-transform: uppercase; display: inline-flex; align-items: center; gap: 6px; }
.live-side .pname .role { font: 800 10px/1 var(--body); letter-spacing: 0.1em; padding: 4px 6px; border-radius: 6px; }
.live-side .pname .role.serve { background: var(--ball); color: var(--ball-ink); }
.live-side .pname .role.receive { background: var(--surface-2); color: var(--fg); }
.live-side .tname { color: var(--muted); font-size: 14px; }
.live-side .scoreline { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 12px; align-items: center; }
.big-score { font: 700 clamp(84px, 26vw, 140px)/0.9 var(--display); text-align: center; }
.point-btn { background: var(--accent); color: #fff; border: 0; border-radius: 18px; min-height: 96px; font: 800 24px/1 var(--display); letter-spacing: 0.06em; cursor: pointer; touch-action: manipulation; user-select: none; }
.point-btn:active { transform: scale(0.98); filter: brightness(1.15); }
.point-btn[disabled] { opacity: 0.35; }
.gp-banner { text-align: center; font: 800 18px/1 var(--display); letter-spacing: 0.14em; color: var(--ball-ink); background: var(--ball); border-radius: 12px; padding: 10px; }
.vs-mid { text-align: center; font: 700 14px/1 var(--display); letter-spacing: 0.3em; color: var(--muted); }
.live-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sheet-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 40; display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--surface); border-radius: 20px 20px 0 0; padding: 20px 16px calc(20px + env(safe-area-inset-bottom, 0px)); width: 100%; max-width: 640px; display: flex; flex-direction: column; gap: 14px; max-height: 90vh; max-height: 90dvh; overflow-y: auto; }
.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice { border: 2px solid var(--line); background: var(--bg); border-radius: 14px; padding: 14px 10px; font: 700 18px/1.2 var(--display); text-transform: uppercase; cursor: pointer; min-height: 64px; }
.choice[aria-pressed="true"] { border-color: var(--ball-text); background: #20230f; background: color-mix(in srgb, var(--ball) 12%, var(--bg)); }
.setup-summary { background: var(--surface-2); border-radius: 12px; padding: 12px 14px; font-weight: 600; }
.stepper { display: flex; align-items: center; gap: 10px; }
.stepper button { width: 48px; height: 48px; border-radius: 12px; border: 0; background: var(--surface-2); font-size: 22px; font-weight: 700; cursor: pointer; }
.stepper output { font: 700 40px/1 var(--display); min-width: 2ch; text-align: center; }
.net { white-space: nowrap; flex: none; }
.scorer-top .brand { flex: 1; min-width: 0; }
.scorer-top .who { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 30vw; }
@media (max-width: 480px) { .scorer-top .who { display: none; } }

.gp-banner.golden { background: linear-gradient(90deg, #ffd34d, var(--ball)); letter-spacing: 0.06em; font-size: 17px; }
.gp-banner.deuce { background: transparent; color: var(--ball-text); box-shadow: inset 0 0 0 2px var(--ball-text); }
.chip.golden { background: #ffd34d; color: #2a2000; }

/* ================================================================ mobile admin + WebView */
.admin-mobilebar, .admin-tabbar, .only-mobile { display: none; }
.icon-btn { width: 44px; height: 44px; border-radius: 12px; border: 0; background: var(--surface-2); display: inline-grid; place-items: center; cursor: pointer; flex: none; }
.icon-btn svg { width: 22px; height: 22px; }
.side-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.side-bottom { margin-top: auto; }
.nav-backdrop { display: none; }
.admin-tabbar a, .admin-tabbar button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 7px; text-decoration: none; color: var(--muted); font-size: 11px; font-weight: 600; background: none; border: 0; cursor: pointer; }
.admin-tabbar svg { width: 22px; height: 22px; }
.admin-tabbar [aria-current="page"] { color: var(--fg); }
.admin-tabbar [aria-current="page"] svg { color: var(--accent); }

@media (max-width: 900px) {
  .admin-mobilebar {
    display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 30;
    padding: calc(8px + env(safe-area-inset-top, 0px)) 16px 8px; background: var(--surface); border-bottom: 1px solid var(--line);
  }
  .mb-title { flex: 1; min-width: 0; display: flex; flex-direction: column; }
  .mb-title b { font: 700 18px/1.1 var(--display); text-transform: uppercase; letter-spacing: 0.04em; }
  .mb-title span { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .admin-shell { display: block; min-height: 0; }
  .admin-side {
    position: fixed; z-index: 50; top: 0; bottom: 0; left: 0; width: min(300px, 86vw); height: 100%;
    flex-direction: column; flex-wrap: nowrap; border-right: 1px solid var(--line); border-bottom: 0;
    padding: calc(12px + env(safe-area-inset-top, 0px)) 12px calc(12px + env(safe-area-inset-bottom, 0px));
    transform: translateX(-105%); transition: transform 0.22s ease; overflow-y: auto; visibility: hidden;
  }
  .admin-side .brand { width: auto; padding-bottom: 12px; }
  .admin-side .sep { display: block; }
  .admin-side a.nav { padding: 12px; font-size: 16px; }
  body.nav-open .admin-side { transform: none; visibility: visible; }
  body.nav-open { overflow: hidden; }
  .nav-backdrop:not([hidden]) { display: block; position: fixed; inset: 0; z-index: 45; background: rgba(0, 0, 0, 0.55); }
  .only-mobile { display: inline-grid; }
  .admin-main { padding: 16px 16px calc(88px + env(safe-area-inset-bottom, 0px)); gap: 16px; }
  .admin-tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .admin-main > .row.between > h1, .admin-main > h1 { font-size: 26px; }
}
@media (prefers-reduced-motion: reduce) { .admin-side { transition: none; } }

/* ---- tables that become cards on phones (cells carry data-label from their column header) */
@media (max-width: 640px) {
  .table-wrap:has(> table.stack-sm) { border: 0; background: transparent; overflow: visible; }
  table.data.stack-sm, table.data.stack-sm tbody { display: block; }
  table.data.stack-sm thead { display: none; }
  table.data.stack-sm tr {
    display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; padding: 12px 14px; margin-bottom: 10px;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  }
  table.data.stack-sm td { display: block; border: 0; padding: 0; text-align: left; white-space: normal; min-width: 0; overflow-wrap: anywhere; }
  table.data.stack-sm td[data-label]::before { content: attr(data-label); display: block; font: 600 10px/1.4 var(--body); text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
  table.data.stack-sm td.name { grid-column: 1 / -1; min-width: 0; font-size: 16px; }
  table.data.stack-sm td:first-child.name::before { display: none; }
  table.data.stack-sm td:not([data-label]), table.data.stack-sm td[data-label=""] { grid-column: 1 / -1; }
  table.data.stack-sm td[data-label=""]::before { display: none; }
  table.data.stack-sm td .btn { width: 100%; }
  table.data.stack-sm td[colspan] { grid-column: 1 / -1; }
}
/* WebViews without :has() keep a plain scrolling table wrapper; cards still render inside it */

/* ---- toggle switch (bigger tap target than a checkbox) */
.switch { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; position: relative; font-weight: 600; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { width: 46px; height: 28px; border-radius: 999px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); position: relative; flex: none; transition: background 0.15s; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--muted); transition: transform 0.15s, background 0.15s; }
.switch input:checked + .track { background: var(--accent); box-shadow: none; }
.switch input:checked + .track::after { transform: translateX(18px); background: #fff; }
.switch input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch input:disabled + .track { opacity: 0.45; }
.switch .state-on { display: none; }
.switch input:checked ~ .state-on { display: inline; }
.switch input:checked ~ .state-off { display: none; }

/* ---- settings: categories + guided setup */
.settings-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.seg { display: inline-flex; background: var(--surface-2); border-radius: 12px; padding: 4px; gap: 4px; }
.seg a { text-decoration: none; padding: 9px 14px; border-radius: 9px; font-weight: 700; font-size: 14px; color: var(--muted); min-height: 40px; display: inline-flex; align-items: center; }
.seg a[aria-current="page"] { background: var(--fg); color: var(--bg); }
.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.scroll-x::-webkit-scrollbar { display: none; }
.subtabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); }
.subtabs a { flex: none; text-decoration: none; padding: 10px 12px; font-weight: 600; font-size: 14px; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.subtabs a[aria-current="page"] { color: var(--fg); border-bottom-color: var(--accent); }
.subtabs .count { margin-left: 6px; font-size: 11px; background: var(--surface-2); padding: 1px 6px; border-radius: 999px; }
.settings-form .settings-row .what label { cursor: default; }
.settings-row .tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.settings-row .what small { display: block; }
.settings-row[hidden] { display: none; }
details.reason summary { cursor: pointer; color: var(--muted); padding: 6px 0; }
details.reason input { margin-top: 6px; }
.form-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.override-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px 16px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); }
.override-row:last-of-type { border-bottom: 0; }
.plain-list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }
.stepper-head { display: flex; flex-direction: column; gap: 10px; }
.progress { height: 6px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.steps { list-style: none; margin: 0; padding: 2px 0 4px; display: flex; gap: 6px; }
.steps li { flex: none; }
.steps a { display: flex; align-items: center; gap: 8px; text-decoration: none; padding: 6px 10px 6px 6px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); font-size: 13px; font-weight: 600; white-space: nowrap; }
.steps .dot { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); font-size: 12px; font-weight: 700; }
.steps li.done .dot { background: var(--ok-bg); color: var(--ok); }
.steps li.now a { border-color: var(--accent); color: var(--fg); }
.steps li.now .dot { background: var(--accent); color: #fff; }
@media (max-width: 640px) {
  .settings-head .seg { width: 100%; }
  .seg a { flex: 1; justify-content: center; }
  .steps li:not(.now) .txt { display: none; }
  .steps li:not(.now) a { padding: 6px; }
  .override-row { grid-template-columns: minmax(0, 1fr); }
  /* keep Save within thumb reach while the category is long */
  .settings-form .form-actions { position: sticky; bottom: calc(64px + env(safe-area-inset-bottom, 0px)); background: var(--surface); padding: 10px 0 4px; margin-bottom: -4px; z-index: 5; border-top: 1px solid var(--line); }
  .settings-form .form-actions .btn.primary { flex: 1; }
  .preview-box { bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }
}

/* ---- general phone polish for admin pages */
@media (max-width: 640px) {
  .panel { padding: 14px; }
  .court .actions .btn, .court .actions summary.btn { min-height: 40px; }
  .inline-form form { flex-direction: column; align-items: stretch; }
  .inline-form form .btn { width: 100%; }
  .kpi-row .stat b { font-size: 22px; }
  .kpi-row .stat span { font-size: 10px; }
  .row.between > form, .row.between > .row { width: 100%; }
}
.section-head { flex-wrap: wrap; }
@media (max-width: 640px) {
  /* stat tiles become one swipeable strip instead of an uneven grid */
  .kpi-row { display: flex; overflow-x: auto; gap: 8px; scrollbar-width: none; margin-inline: -16px; padding-inline: 16px; }
  .kpi-row::-webkit-scrollbar { display: none; }
  .kpi-row .stat { flex: 0 0 auto; min-width: 96px; }
}
.icon-btn.only-mobile { display: none; }
@media (max-width: 900px) { .icon-btn.only-mobile { display: inline-grid; } }

/* ================================================================ theme switch */
.theme-menu { position: relative; flex: none; }
.theme-menu summary { list-style: none; cursor: pointer; }
.theme-menu summary::-webkit-details-marker { display: none; }
.theme-menu summary svg { display: none; }
:root[data-theme-mode="dark"] .theme-menu .i-dark,
:root[data-theme-mode="light"] .theme-menu .i-light,
:root[data-theme-mode="system"] .theme-menu .i-system,
:root:not([data-theme-mode]) .theme-menu .i-dark { display: block; }
.theme-pop {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 60; min-width: 150px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 6px;
  display: flex; flex-direction: column; gap: 2px; box-shadow: var(--shadow);
}
.theme-pop button { background: none; border: 0; text-align: left; padding: 10px 12px; border-radius: 8px; font-weight: 600; cursor: pointer; min-height: 40px; }
.theme-pop button:hover { background: var(--surface-2); }
.theme-pop button[aria-pressed="true"] { background: var(--accent-soft); color: var(--fg); }
.theme-pop button[aria-pressed="true"]::after { content: " ✓"; color: var(--accent); }
.topbar .theme-menu { margin-left: 4px; }
@media (max-width: 760px) { .topbar .theme-menu { margin-left: auto; } }

/* ---- Login / Admin entry in the public header */
.acct-btn { display: inline-flex; align-items: center; gap: 6px; flex: none; min-height: 40px; padding: 0 14px; border-radius: 12px; text-decoration: none; font-weight: 700; font-size: 14px; background: var(--accent); color: var(--accent-ink); }
.acct-btn svg { width: 18px; height: 18px; }
.acct-btn.signed-in { background: var(--surface-2); color: var(--fg); }
.acct-btn:hover { filter: brightness(1.1); }
.topbar .theme-menu + .acct-btn { margin-left: 4px; }
@media (max-width: 760px) {
  .topbar .acct-btn { margin-left: auto; padding: 0 12px; }
  .topbar .theme-menu + .acct-btn { margin-left: 4px; }
}
@media (max-width: 340px) { .topbar .acct-btn span { display: none; } .topbar .acct-btn { width: 44px; padding: 0; justify-content: center; } }

/* ---- Horizontal scrollers (tables, tab rows): smooth touch swipe, keep the swipe inside the
   scroller so the page or a native WebView container does not steal it, and mouse drag on desktop */
.table-wrap, .tabs, .scroll-x, .kpi-row { -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
.drag-scroll { cursor: grab; }
.drag-scroll.dragging { cursor: grabbing; user-select: none; }
.drag-scroll.dragging a { pointer-events: none; }
.table-wrap::-webkit-scrollbar { height: 8px; }
.table-wrap::-webkit-scrollbar-thumb { background: var(--line); border-radius: 8px; }
.side-theme { display: flex; align-items: center; justify-content: space-between; padding: 6px 12px; }
.side-theme .theme-pop { right: auto; left: 0; top: auto; bottom: calc(100% + 6px); }
@media (max-width: 900px) { .only-desktop { display: none !important; } }

/* light-theme touch-ups for surfaces that were tuned for dark */
:root[data-theme="light"] .hero { border-color: var(--line); }
:root[data-theme="light"] .point-btn { color: var(--accent-ink); }
:root[data-theme="light"] .brand-mark svg circle:first-child { stroke: rgba(0,0,0,0.08); }
.point-btn { background: var(--accent); color: var(--accent-ink); }
.btn.primary { color: var(--accent-ink); }

/* colour setting */
.color-field { display: flex; gap: 8px; align-items: center; }
.color-field input[type=color] { width: 52px; height: 44px; padding: 2px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); flex: none; }
.color-field input[type=text] { font-family: var(--mono); }
.brand-preview { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 12px; border: 1px dashed var(--line); border-radius: 12px; }
/* team logo / player photo inside the avatar tile; falls back to initials if the image fails */
.avatar { position: relative; overflow: hidden; }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.empty.stack { align-items: center; }
.empty b { color: var(--fg); font-size: 16px; }

/* ---- Install app pop-up (assets/js/install.js) */
.install-sheet { position: fixed; z-index: 60; left: 0; right: 0; bottom: 0; padding: 12px 12px calc(12px + env(safe-area-inset-bottom, 0px)); display: flex; justify-content: center; pointer-events: none; opacity: 0; transform: translateY(16px); transition: opacity 0.2s ease, transform 0.2s ease; }
.install-sheet.open { opacity: 1; transform: none; }
body.has-bottomnav .install-sheet { bottom: 64px; }
@media (min-width: 761px) { body.has-bottomnav .install-sheet { bottom: 0; justify-content: flex-end; } }
.install-card { pointer-events: auto; width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow, 0 12px 40px rgba(0,0,0,0.35)); padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.install-head { display: flex; gap: 12px; align-items: flex-start; }
.install-head img { width: 48px; height: 48px; border-radius: 12px; flex: none; }
.install-head div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.install-head b { font: 700 18px/1.2 var(--display); }
.install-head span { color: var(--muted); font-size: 14px; }
.install-x { border: 0; background: var(--surface-2); color: var(--fg); width: 36px; height: 36px; border-radius: 10px; font-size: 22px; line-height: 1; cursor: pointer; flex: none; }
.install-actions { display: flex; gap: 8px; justify-content: flex-end; }
.install-actions .btn { flex: 1; }
.install-steps { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 8px; font-size: 15px; }
.install-steps .kbd { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 8px; background: var(--surface-2); font-weight: 700; vertical-align: middle; }
.install-more { display: none; }
.can-install .install-more { display: inline-flex; }
@media (prefers-reduced-motion: reduce) { .install-sheet { transition: none; } }

/* =====================================================================
   Scorer: Match setup + live scoring (court view)
   Team A = indigo, Team B = green, independent of the brand colour so the
   two sides never look alike.
   ===================================================================== */
body.scorer {
  --tA: #5b5cf6; --tA-ink: #ffffff; --tA-soft: rgba(91, 92, 246, 0.16); --tA-line: rgba(124, 125, 255, 0.55);
  --tB: #2faa5f; --tB-ink: #ffffff; --tB-soft: rgba(47, 170, 95, 0.16); --tB-line: rgba(70, 200, 120, 0.5);
  --court-a: #26307a; --court-b: #1e5a37; --court-line: rgba(255, 255, 255, 0.55);
}
:root[data-theme="light"] body.scorer { --tA: #4a4be0; --tB: #1f8f4c; --tA-soft: rgba(74, 75, 224, 0.1); --tB-soft: rgba(31, 143, 76, 0.1); --court-a: #3b46b0; --court-b: #2a8150; }
.only-in-match { display: none !important; }
body.in-match .only-in-match { display: inline-grid !important; }
body.in-match .only-out-match { display: none !important; }
body.in-match .scorer-tabs { display: none; }
body.in-match .scorer-top .who { display: none; }
.scorer-body { gap: 14px; padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px)); }

/* match bar */
.match-bar { display: flex; align-items: center; gap: 10px; }
.match-bar .icon-btn { width: 40px; height: 40px; background: transparent; }
.mb-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.mb-main b { font: 700 21px/1.1 var(--display); text-transform: uppercase; letter-spacing: 0.04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mb-main span:not(.chip) { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }
.mb-main .chip { align-self: flex-start; }
.mb-rules { text-align: right; font-size: 13px; line-height: 1.35; color: var(--muted); font-weight: 600; flex: none; }

/* avatars */
.av { position: relative; overflow: hidden; flex: none; width: 36px; height: 36px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--surface-2); color: var(--fg); font: 700 13px/1 var(--body); box-shadow: 0 0 0 2px var(--surface); }
.av.lg { width: 52px; height: 52px; font-size: 17px; }
.av.md { width: 42px; height: 42px; font-size: 14px; }
.av img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* setup: compact teams strip */
.vs-strip { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 8px; }
.vs-strip .vs { font: 700 13px/1 var(--display); color: var(--muted); letter-spacing: 0.1em; }
.vs-team { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 12px; min-width: 0; }
.vs-team.tA { background: var(--tA-soft); box-shadow: inset 3px 0 0 var(--tA); }
.vs-team.tB { background: var(--tB-soft); box-shadow: inset -3px 0 0 var(--tB); flex-direction: row-reverse; text-align: right; }
.vs-team b { font: 700 16px/1.1 var(--display); min-width: 0; overflow-wrap: break-word; }
.avs { display: flex; flex: none; }
.avs .av { width: 28px; height: 28px; font-size: 10px; box-shadow: 0 0 0 2px var(--bg); }
.avs .av + .av { margin-left: -8px; }

/* setup: answered steps collapse to one line */
.done-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.done-row .tick { width: 22px; height: 22px; border-radius: 50%; background: var(--tB); color: #fff; display: grid; place-items: center; font-size: 12px; flex: none; }
.done-row > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.done-row small { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; }
.done-row b { font-size: 14px; line-height: 1.25; }
.link-btn { background: none; border: 0; color: var(--muted); font-weight: 700; font-size: 13px; text-decoration: underline; cursor: pointer; padding: 8px 4px; min-height: 36px; flex: none; }
.link-btn.center { align-self: center; }

/* setup: the one question being asked */
.q { background: var(--surface); border: 1.5px solid var(--line-strong); border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.q h3 { margin: 0; font: 700 20px/1.25 var(--display); }
.q h3 .who { padding: 1px 8px; border-radius: 8px; color: #fff; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.q h3 .who.tA { background: var(--tA); } .q h3 .who.tB { background: var(--tB); }
.q > p { margin: 0; color: var(--muted); font-size: 13px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.three { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.b { min-height: 52px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--bg); color: var(--fg); font: 700 15px/1.15 var(--body); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; text-align: center; padding: 6px 8px; cursor: pointer; }
.b.tA { border-color: var(--tA-line); } .b.tB { border-color: var(--tB-line); }
.b:active { transform: scale(0.98); }
.b small { font: 600 12px/1.2 var(--body); color: var(--muted); }

/* setup + live: player rows with SERVER / RECEIVER highlight */
.team-block { display: flex; flex-direction: column; gap: 6px; }
.tb-h { display: flex; align-items: center; gap: 8px; font: 700 15px/1.1 var(--display); flex-wrap: wrap; }
.tb-h .pill { font: 800 10px/1 var(--body); letter-spacing: 0.1em; padding: 4px 7px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.team-block.tA .tb-h, .pl-col.tA .tb-h { color: var(--tA); } .team-block.tB .tb-h, .pl-col.tB .tb-h { color: var(--tB); }
:root:not([data-theme="light"]) .team-block.tA .tb-h, :root:not([data-theme="light"]) .pl-col.tA .tb-h { color: #a9a9ff; }
:root:not([data-theme="light"]) .team-block.tB .tb-h, :root:not([data-theme="light"]) .pl-col.tB .tb-h { color: #6fdc9b; }
.pl-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--bg); color: var(--fg); min-height: 52px; text-align: left; font: inherit; }
button.pl-row { cursor: pointer; }
.pl-row > b { flex: 1; min-width: 0; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-row > small { font-size: 12px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.pl-row .av { width: 32px; height: 32px; font-size: 11px; box-shadow: none; }
.pl-row.is-server, .pl-row.is-receiver { color: #fff; }
.pl-row.is-server.tA, .pl-row.is-receiver.tA { background: var(--tA); }
.pl-row.is-server.tB, .pl-row.is-receiver.tB { background: var(--tB); }
.pl-row.is-server { border-color: var(--ball); box-shadow: 0 0 0 1px var(--ball), 0 0 20px rgba(212, 236, 58, 0.18); }
.pl-row.is-receiver { border-color: #fff; box-shadow: 0 0 0 1px #fff; }
:root[data-theme="light"] .pl-row.is-receiver { border-color: #16151f; box-shadow: 0 0 0 1px #16151f; }
.pl-row.is-server .av, .pl-row.is-receiver .av { background: rgba(255, 255, 255, 0.22); color: #fff; }
.role { flex: none; font: 800 10px/1 var(--body); letter-spacing: 0.08em; padding: 5px 8px; border-radius: 999px; white-space: nowrap; }
.role.serve { background: var(--ball); color: var(--ball-ink); }
.role.receive { background: #fff; color: #16151f; }

/* live: two-team panel (names may wrap at word breaks in the narrow columns) */
.pl-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.pl-col { display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: 8px; border-radius: 14px; }
.pl-col.tA { background: var(--tA-soft); } .pl-col.tB { background: var(--tB-soft); }
.pl-col .tb-h { padding: 2px 2px 0; }
.pl-col .pl-row { gap: 8px; padding: 8px; align-items: center; }
.pl-txt { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-width: 0; flex: 1; }
.pl-txt b { font-size: 14px; line-height: 1.2; overflow-wrap: normal; word-break: normal; hyphens: auto; }
.pl-txt small { font-size: 12px; color: var(--muted); font-weight: 600; }
.pl-row.is-server .pl-txt small, .pl-row.is-receiver .pl-txt small { color: rgba(255, 255, 255, 0.85); }

/* live panel: no box fill; server / receiver shown by coloured name and tag */
.players-card .pl-row, .players-card .pl-row.is-server, .players-card .pl-row.is-receiver { background: var(--bg); border-color: var(--line); box-shadow: none; color: var(--fg); }
.players-card .pl-row .av { width: 42px; height: 42px; font-size: 13px; background: var(--surface-2); color: var(--fg); }
.players-card .pl-txt b { font-size: 17px; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.players-card .pl-row .pl-txt small { color: var(--muted); }
.players-card .pl-row.is-server.tA b, .players-card .pl-row.is-receiver.tA b { color: var(--tA); }
.players-card .pl-row.is-server.tB b, .players-card .pl-row.is-receiver.tB b { color: var(--tB); }
:root:not([data-theme="light"]) .players-card .pl-row.tA.is-server b, :root:not([data-theme="light"]) .players-card .pl-row.tA.is-receiver b { color: #a9a9ff; }
:root:not([data-theme="light"]) .players-card .pl-row.tB.is-server b, :root:not([data-theme="light"]) .players-card .pl-row.tB.is-receiver b { color: #6fdc9b; }
.players-card .role.receive { color: #fff; }
.players-card .pl-row.tA .role.receive { background: var(--tA); }
.players-card .pl-row.tB .role.receive { background: var(--tB); }

/* setup: Start button stays in view */
.setup-foot { position: sticky; bottom: 0; z-index: 5; margin: 0 -16px; padding: 10px 16px calc(12px + env(safe-area-inset-bottom, 0px)); background: var(--bg); border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.setup-foot .sum { font-size: 13px; color: var(--muted); text-align: center; }
.setup-foot .sum b { color: var(--fg); }
.start-btn { min-height: 56px; font: 800 21px/1 var(--display); letter-spacing: 0.04em; background: var(--tB); color: var(--tB-ink); border-radius: 14px; text-transform: none; }
.start-btn[disabled] { opacity: 0.35; }

/* live: action row */
.act-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) minmax(0, 1fr); gap: 8px; }
.act { min-height: 54px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface); color: var(--fg); font: 700 15px/1 var(--display); letter-spacing: 0.02em; white-space: nowrap; overflow: hidden; min-width: 0; text-transform: uppercase; display: inline-flex; align-items: center; justify-content: center; gap: 5px; cursor: pointer; padding: 0 6px; }
.act svg { width: 18px; height: 18px; flex: none; }
.act.primary { background: var(--tA); border-color: var(--tA); color: var(--tA-ink); }
.act[disabled] { opacity: 0.4; }

/* live: cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.bar-h { margin: 0; font: 700 18px/1.1 var(--display); padding-left: 10px; border-left: 4px solid var(--tB); }

/* live: score */
.score-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.score-card { border-radius: 16px; padding: 10px 8px 6px; text-align: center; border: 1.5px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
.score-card.tA { background: var(--tA-soft); } .score-card.tB { background: var(--tB-soft); }
.score-card.serving.tA { border-color: var(--tA); } .score-card.serving.tB { border-color: var(--tB); }
.score-card > span { font: 700 16px/1.15 var(--display); overflow-wrap: anywhere; }
.score-card .big-score { font-size: clamp(64px, 20vw, 104px); }
.point-btn { min-height: 92px; border-radius: 18px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font: 800 26px/1 var(--display); letter-spacing: 0.04em; }
.point-btn small { font: 600 13px/1.1 var(--body); letter-spacing: 0; opacity: 0.9; overflow-wrap: anywhere; padding: 0 6px; }
body.scorer .point-btn.tA { background: var(--tA); color: var(--tA-ink); }
body.scorer .point-btn.tB { background: var(--tB); color: var(--tB-ink); }

/* history */
.history { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 2px; max-height: 60vh; overflow-y: auto; }
.history li { display: grid; grid-template-columns: 56px 1fr; gap: 8px; padding: 9px 4px; border-bottom: 1px solid var(--line); font-size: 14px; }
.history .h-score { font: 700 17px/1.2 var(--display); }
@media (max-width: 429px) {
  .act { font-size: 14px; gap: 4px; } .act svg { width: 16px; height: 16px; }
  .act.primary { white-space: normal; line-height: 1.05; text-align: left; }
}
@media (max-width: 380px) {
  .act { font-size: 13px; }
}
@media (max-width: 340px) {
  .act svg { display: none; }
  .mb-rules { font-size: 12px; }
}

@media (max-width: 400px) { .pick .av { width: 30px; height: 30px; font-size: 11px; } .pick .radio { width: 16px; height: 16px; } .pick { padding: 8px 6px; } }

/* Short phones (iPhone SE etc.): keep the + POINT buttons above the fold */
@media (max-height: 760px) {
  body.in-match .scorer-body { gap: 10px; padding-top: 10px; }
  body.in-match .scorer-body > .card { padding: 10px 12px; gap: 8px; }
  body.in-match .score-sec .bar-h { display: none; }
  body.in-match .act { min-height: 46px; }
  body.in-match .score-card .big-score { font-size: clamp(52px, 15vw, 72px); }
  body.in-match .point-btn { min-height: 76px; }
  body.in-match .scorer-top { padding-top: calc(6px + env(safe-area-inset-top, 0px)); padding-bottom: 6px; }
}

/* =====================================================================
   Home dashboard
   ===================================================================== */
.home2 { --cA: #5b5cf6; }
.hero2 { position: relative; overflow: hidden; border-radius: 20px; border: 1px solid var(--line); padding: 22px 20px 18px; display: flex; flex-direction: column; gap: 18px; min-height: 196px;
  background: radial-gradient(120% 140% at 100% 0%, var(--hero-glow), transparent 55%), linear-gradient(160deg, var(--hero-a), var(--hero-b)); }
.hero2.has-img { background:
    linear-gradient(90deg, var(--hero-a) 0%, color-mix(in srgb, var(--hero-a) 88%, transparent) 38%, color-mix(in srgb, var(--hero-a) 20%, transparent) 70%, transparent 100%),
    var(--hero-img) right center / cover no-repeat, var(--hero-b); }
@supports not (background: color-mix(in srgb, red 50%, blue)) {
  .hero2.has-img { background: linear-gradient(90deg, rgba(27,24,48,1) 0%, rgba(27,24,48,.85) 40%, rgba(27,24,48,.15) 75%, rgba(27,24,48,0) 100%), var(--hero-img) right center / cover no-repeat, var(--hero-b); }
}
.hero2-art { position: absolute; right: -24px; top: 50%; transform: translateY(-50%) rotate(-12deg); width: 190px; height: 190px; opacity: 0.95; filter: drop-shadow(0 16px 40px rgba(212, 236, 58, 0.25)); pointer-events: none; }
.hero2-art svg { width: 100%; height: 100%; }
.hero2-txt { position: relative; display: flex; flex-direction: column; gap: 6px; max-width: 70%; }
.hero2-txt h1 { font-size: clamp(30px, 7vw, 44px); }
.hero2-txt p { margin: 0; color: var(--muted); font-weight: 500; }
.hero2-kpis { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); max-width: 560px; }
.hero2-kpis > div { display: flex; flex-direction: column; gap: 4px; padding: 0 12px; border-left: 1px solid var(--line-strong); }
.hero2-kpis > div:first-child { padding-left: 0; border-left: 0; }
.hero2-kpis b { font: 700 30px/1 var(--display); }
.hero2-kpis span { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: #2fd36f; box-shadow: 0 0 0 3px rgba(47, 211, 111, 0.2); display: inline-block; flex: none; }
.live-dot.big { width: 12px; height: 12px; margin-right: 10px; }
@media (prefers-reduced-motion: no-preference) { .live-dot { animation: livepulse 1.6s ease-in-out infinite; } }
@keyframes livepulse { 50% { box-shadow: 0 0 0 6px rgba(47, 211, 111, 0); } }

.sec-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.sec-head h2 { display: inline-flex; align-items: center; font-size: 24px; }
.sec-head .sub { color: var(--muted); font-size: 13px; }
.sec-head a { margin-left: auto; color: var(--accent); text-decoration: none; font-weight: 600; font-size: 14px; white-space: nowrap; }
.sec-ico { display: inline-grid; color: var(--accent); margin-right: 10px; }
.sec-ico svg { width: 24px; height: 24px; }
@media (max-width: 520px) { .sec-head .sub { display: none; } }

/* carousels */
.hs-wrap { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.hscroll { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding: 2px 2px 4px; margin: 0 -2px; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
.hscroll::-webkit-scrollbar { display: none; }
.hs-bar { align-self: center; width: 120px; height: 4px; border-radius: 4px; background: var(--surface-2); position: relative; overflow: hidden; }
.hs-bar i { position: absolute; top: 0; bottom: 0; left: 0; width: 30%; border-radius: 4px; background: var(--fg); opacity: 0.7; }
.hs-wrap.no-scroll .hs-bar { display: none; }

.dcard { flex: 0 0 min(300px, 84%); scroll-snap-align: start; background: var(--surface); border: 1.5px solid var(--line); border-radius: 16px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: var(--fg); min-width: 0; }
.dcard:hover { border-color: var(--line-strong); }
.dcard.is-live { border-color: color-mix(in srgb, #2fd36f 55%, var(--line)); }
.dcard.is-paused { border-color: var(--warn); }
.dcard.is-trump { border-color: color-mix(in srgb, var(--warn) 60%, var(--line)); }
.dc-head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.dc-head b { font: 700 16px/1 var(--display); letter-spacing: 0.04em; text-transform: uppercase; }
.dc-meta { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.dc-meta::before { content: "· "; }
.dc-head .chip { margin-left: auto; flex: none; text-transform: uppercase; }
.dc-side { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 4px 0; }
.dc-side.lost { opacity: 0.72; }
.dc-avs { display: flex; flex: none; }
.dc-avs .av, .prow .av { position: relative; overflow: hidden; width: 38px; height: 38px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--surface-2); color: var(--fg); font: 700 12px/1 var(--body); box-shadow: 0 0 0 2px var(--surface); flex: none; }
.dc-avs .av + .av { margin-left: -10px; }
.dc-avs .av img, .prow .av img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.dc-names { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.dc-names b { font: 700 15px/1.2 var(--display); text-transform: uppercase; letter-spacing: 0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.dc-names > span:not(.pair-line) { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dc-names .team-swatch { width: 10px; height: 10px; border-radius: 3px; flex: none; display: inline-block; }
.dc-names .serve-dot { margin-left: 6px; }
.dc-score { font: 700 34px/1 var(--display); flex: none; display: inline-flex; align-items: center; gap: 4px; min-width: 28px; justify-content: flex-end; }
.dc-score .tick { font-style: normal; color: var(--ok); font-size: 20px; }
.dc-vs { display: flex; align-items: center; gap: 10px; color: var(--muted); font: 700 11px/1 var(--body); letter-spacing: 0.14em; padding-left: 86px; }
.dc-vs::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* explore tabs */
.xtabs { display: grid; grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr)); gap: 4px; padding: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; }
.xtabs button { min-height: 48px; border: 0; border-radius: 12px; background: transparent; color: var(--muted); font: 700 15px/1.1 var(--body); display: flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; padding: 6px; }
.xtabs button svg { width: 20px; height: 20px; flex: none; }
.xtabs button[aria-selected="true"] { background: var(--accent); color: var(--accent-ink); }
@media (max-width: 520px) { .xtabs button { flex-direction: column; gap: 4px; font-size: 12px; min-height: 56px; } }
.xpanel { display: flex; flex-direction: column; gap: 10px; }
.xpanel[hidden] { display: none; }
.more-link { align-self: flex-end; color: var(--accent); text-decoration: none; font-weight: 600; font-size: 14px; }
.plist, .mlist { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.prow, .mrow { display: flex; align-items: center; gap: 12px; padding: 10px 14px; text-decoration: none; color: var(--fg); border-bottom: 1px solid var(--line); min-width: 0; }
.prow:last-child, .mrow:last-child { border-bottom: 0; }
.prow .pos { width: 20px; color: var(--muted); font-weight: 700; text-align: center; flex: none; }
.prow-txt, .mrow-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.prow-txt b, .mrow-txt b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 15px; }
.prow-txt small { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prow-val { display: flex; flex-direction: column; align-items: flex-end; flex: none; }
.prow-val b { font: 700 20px/1 var(--display); }
.prow-val small { color: var(--muted); font-size: 11px; }
.mrow .slot { font: 700 15px/1 var(--display); width: 30px; flex: none; }
.mrow-txt b { font-weight: 600; color: var(--muted); } .mrow-txt b.won { color: var(--fg); font-weight: 700; }
.mrow > small { color: var(--muted); font-size: 12px; white-space: nowrap; flex: none; }
.mrow-score { display: flex; flex-direction: column; align-items: flex-end; font: 700 17px/1.15 var(--display); flex: none; }
@media (min-width: 900px) {
  .hero2 { padding: 28px 28px 22px; min-height: 230px; }
  .hero2-art { width: 240px; height: 240px; right: 24px; }
}
.image-field { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.image-preview { width: 100%; max-width: 360px; aspect-ratio: 8 / 3; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); }
.image-preview.empty { display: grid; place-items: center; color: var(--muted); font-size: 13px; background: var(--surface-2); }
.image-field input[type=file] { font-size: 14px; max-width: 100%; }

@media (max-width: 600px) {
  .hero2 { padding: 18px 16px 16px; gap: 16px; }
  .hero2-art { width: 138px; height: 138px; right: -36px; top: 22px; transform: rotate(-12deg); opacity: 0.9; }
  .hero2-txt { max-width: calc(100% - 92px); }
  .hero2-txt h1 { font-size: clamp(26px, 7.4vw, 34px); }
  .hero2-kpis > div { padding: 0 8px; }
  .hero2-kpis b { font-size: 26px; }
  .hero2-kpis span { font-size: 10.5px; letter-spacing: 0.04em; gap: 4px; }
  .hero2-kpis .live-dot { width: 7px; height: 7px; }
  .xpanel table.data th, .xpanel table.data td { padding: 10px 7px; }
  .xpanel table.data td.name, .xpanel table.data th.name { min-width: 120px; }
}
.dc-serving { font-style: normal; display: inline-flex; align-items: center; gap: 4px; color: var(--ball-text); font-weight: 700; font-size: 12px; margin-left: 4px; }
.dc-serving .serve-dot { margin-left: 0; width: 7px; height: 7px; }
@media (max-width: 600px) {
  .hero2.has-img { background:
      linear-gradient(90deg, var(--hero-a) 0%, color-mix(in srgb, var(--hero-a) 92%, transparent) 45%, color-mix(in srgb, var(--hero-a) 55%, transparent) 80%, color-mix(in srgb, var(--hero-a) 25%, transparent) 100%),
      var(--hero-img) 70% center / cover no-repeat, var(--hero-b); }
}

/* ---- public matches: single team filter */
.team-filter { width: 100%; max-width: 360px; }

/* =====================================================================
   Admin fixtures: round tabs, progress cards, pairing screen
   ===================================================================== */
.round-tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.round-tabs::-webkit-scrollbar { display: none; }
.round-tabs a { flex: none; display: inline-flex; align-items: center; gap: 7px; padding: 9px 14px; border-radius: 12px; border: 1px solid var(--line); text-decoration: none; color: var(--muted); font-weight: 700; font-size: 14px; }
.round-tabs a[aria-current="page"] { background: var(--surface-2); color: var(--fg); border-color: var(--line-strong); }
.rd { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.rd.ok { background: #2fd36f; } .rd.warn { background: var(--warn); } .rd.no { background: var(--muted); opacity: 0.6; }
.fx-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.fx-stats > div { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 8px; text-align: center; }
.fx-stats b { display: block; font: 700 21px/1.1 var(--display); }
.fx-stats small { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 700; }
.fx-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
@media (max-width: 520px) { .fx-cards { grid-template-columns: 1fr; } }
.fx-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.fx-top { display: flex; align-items: flex-start; gap: 8px; }
.fx-top h3 { flex: 1; margin: 0; font: 700 18px/1.25 var(--display); min-width: 0; }
.fx-top h3 .team-swatch { margin-right: 5px; }
.fx-top .chip { flex: none; text-transform: uppercase; }
.fx-bar { height: 6px; border-radius: 6px; background: var(--surface-2); overflow: hidden; }
.fx-bar i { display: block; height: 100%; background: var(--ok); border-radius: 6px; }
.fx-meta { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.fx-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.fx-actions form { display: contents; }
.fx-actions .btn { min-height: 46px; }
.fx-actions .btn[disabled] { opacity: 0.4; }
.fx-matches summary { cursor: pointer; color: var(--muted); padding: 4px 0; }
.fx-matches[open] summary { margin-bottom: 8px; }
.round-release { display: flex; flex-direction: column; gap: 6px; align-items: stretch; text-align: center; max-width: 520px; }
.round-release .btn { min-height: 52px; font-size: 16px; }
.round-release .btn[disabled] { opacity: 0.4; }

.pair-page { display: flex; flex-direction: column; gap: 14px; max-width: 720px; }
.pair-head { display: flex; align-items: center; gap: 10px; }
.pair-head .icon-btn { background: transparent; }
.pair-title { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pair-title small { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; }
.pair-title h1 { font-size: 24px; line-height: 1.15; }
.pair-title .team-swatch { margin-right: 5px; }
.pair-when { display: grid; grid-template-columns: 1.4fr 1fr; gap: 8px; }
.pair-tools { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pair-tools .btn { min-height: 44px; font-size: 14px; }
.pair-grid { display: flex; flex-direction: column; gap: 8px; }
.pg-h, .prow2 { display: grid; grid-template-columns: 44px minmax(0, 1fr) minmax(0, 1fr); gap: 6px; }
.pg-h { font: 700 15px/1.1 var(--display); }
.pg-h .tA { color: #8f90ff; } .pg-h .tB { color: #45c97a; }
:root[data-theme="light"] .pg-h .tA { color: #4a4be0; } :root[data-theme="light"] .pg-h .tB { color: #1f8f4c; }
.prow2 { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 8px; align-items: stretch; }
.prow2.ok { border-color: color-mix(in srgb, var(--ok) 45%, var(--line)); }
.plb { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font: 700 16px/1 var(--display); }
.plb small { font: 700 9px/1 var(--body); color: var(--muted); letter-spacing: 0.06em; }
.pbox { min-height: 52px; border-radius: 10px; padding: 6px 9px; display: flex; flex-direction: column; justify-content: center; gap: 2px; font: 600 14px/1.2 var(--body); border: 1.5px solid transparent; text-align: left; color: var(--fg); cursor: pointer; min-width: 0; background: transparent; }
.pbox.tA { background: rgba(91, 92, 246, 0.16); } .pbox.tB { background: rgba(47, 170, 95, 0.16); }
.pbox.half { border-color: var(--warn); }
.pbox.empty { border: 1.5px dashed var(--line-strong); color: var(--muted); align-items: center; font-weight: 700; }
.pbox.locked { cursor: default; opacity: 0.8; }
.pbox .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pbox small { font-size: 11px; color: var(--muted); }
.pbox .tr { font: 800 9px/1 var(--body); color: var(--warn); letter-spacing: 0.08em; }
.pair-foot { position: sticky; bottom: 0; z-index: 5; display: grid; grid-template-columns: 1fr 2fr; gap: 8px; padding: 10px 0 calc(10px + env(safe-area-inset-bottom, 0px)); background: var(--bg); border-top: 1px solid var(--line); }
.pair-foot .btn { min-height: 50px; font-size: 16px; }
@media (max-width: 900px) { .pair-foot { bottom: calc(64px + env(safe-area-inset-bottom, 0px)); } }
.pk-sheet .pk-list { display: flex; flex-direction: column; gap: 6px; max-height: 46vh; overflow-y: auto; }
.pk { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--bg); color: var(--fg); text-align: left; cursor: pointer; font: inherit; min-height: 52px; }
.pk[disabled] { opacity: 0.4; cursor: not-allowed; }
.pk.on { border-color: var(--accent); background: var(--accent-soft); }
.pk .ck { width: 22px; height: 22px; border-radius: 6px; border: 2px solid var(--muted); display: grid; place-items: center; font-size: 13px; color: #fff; flex: none; }
.pk.on .ck { background: var(--accent); border-color: var(--accent); }
.pk .av { position: relative; overflow: hidden; width: 34px; height: 34px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; font: 700 12px/1 var(--body); flex: none; }
.pk .av img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pk b { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 15px; }
.pk small { color: var(--muted); font-size: 12px; font-weight: 600; white-space: nowrap; }
.pk small.busy { color: var(--warn); }
#pair-toast[hidden] { display: none; }
#pair-toast { bottom: calc(150px + env(safe-area-inset-bottom, 0px)); }
/* standings without a position column: qualifiers get an accent edge on the team name */
table.data tr.qualify td.name { box-shadow: inset 3px 0 0 var(--accent); }

/* ---- [photo] Name & [photo] Name on one line (home and Matches cards) */
.pair-line { display: flex; align-items: center; gap: 6px; min-width: 0; max-width: 100%; }
.pair-line .pp { display: inline-flex; align-items: center; gap: 7px; min-width: 0; flex: 0 1 auto; }
.pair-line .av { position: relative; overflow: hidden; flex: none; width: 30px; height: 30px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--surface-2); color: var(--fg); font: 700 11px/1 var(--body); }
.pair-line .av img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pair-line b { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font: 700 15px/1.2 var(--display); text-transform: uppercase; letter-spacing: 0.02em; display: block; }
.pair-line .amp { font-style: normal; color: var(--muted); font: 700 15px/1 var(--display); flex: none; }
.dc-names { gap: 6px; }
.mc-names { display: flex; flex-direction: column; gap: 6px; min-width: 0; flex: 1; }
.mcard .side { gap: 10px; }

/* =====================================================================
   Standings: compact table on phones, full table on wider screens;
   each row is an accordion (<details>) with the team's detail panel.
   ===================================================================== */
.stand { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.stand .st-h, .stand summary { display: grid; align-items: center; column-gap: 2px; padding: 0 10px;
  grid-template-columns: 24px minmax(0, 1fr) 30px 30px 30px 42px 18px; }
.stand .wide { display: none; }
.stand .st-h { background: var(--surface-2); height: 40px; font: 700 11px/1 var(--body); color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase; }
.stand .st-h > span:nth-child(n+3), .stand summary > span:nth-child(n+3) { text-align: center; }
.stand details { border-top: 1px solid var(--line); }
.stand summary { list-style: none; cursor: pointer; min-height: 56px; font-size: 15px; -webkit-tap-highlight-color: transparent; }
.stand summary::-webkit-details-marker { display: none; }
.stand summary:hover { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.stand summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.stand details[open] > summary { background: var(--surface-2); }
.stand .ps { font: 700 16px/1 var(--display); color: var(--muted); }
.stand .qual .ps { color: var(--accent); }
.stand .qual > summary { box-shadow: inset 3px 0 0 var(--accent); }
.stand .nm { display: flex; align-items: center; gap: 7px; font-weight: 700; min-width: 0; }
.stand .nm > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stand .nm .team-swatch { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.stand .pts { font: 800 19px/1 var(--display); }
.stand .chev { color: var(--muted); font-size: 13px; transition: transform 0.2s ease; }
.stand details[open] .chev { transform: rotate(180deg); color: var(--fg); }
.stand .up { color: var(--ok); } .stand .down { color: var(--danger); }
.st-cut { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-top: 1px solid var(--line); font: 800 10px/1 var(--body); letter-spacing: 0.12em; color: var(--accent); text-transform: uppercase; }
.st-cut::after { content: ""; flex: 1; height: 1px; background: var(--accent); opacity: 0.45; }
.st-panel { background: var(--bg); border-top: 1px solid var(--line); padding: 12px; display: flex; flex-direction: column; gap: 12px; }
.st-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.st-tiles > div { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 8px 4px; text-align: center; }
.st-tiles b { display: block; font: 700 19px/1.1 var(--display); }
.st-tiles small { font-size: 10px; color: var(--muted); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.st-panel .lbl { font: 700 11px/1 var(--body); color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase; }
.st-line { display: flex; align-items: center; gap: 10px; }
.st-last { display: flex; flex-direction: column; gap: 4px; }
.st-last a { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 8px; align-items: center; text-decoration: none; color: var(--fg); font-size: 13px; padding: 4px 0; }
.st-last .opp { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-last b { font: 700 15px/1 var(--display); }
.st-squad { display: flex; }
.st-squad .av { position: relative; overflow: hidden; width: 30px; height: 30px; border-radius: 50%; background: var(--surface-2); border: 2px solid var(--bg); display: grid; place-items: center; font: 700 10px/1 var(--body); margin-left: -8px; }
.st-squad .av:first-child { margin-left: 0; }
.st-squad .av img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.st-team { margin-left: auto; color: var(--accent); font-weight: 700; font-size: 14px; text-decoration: none; }
@media (max-width: 600px) { .hide-sm { display: none; } }
@media (min-width: 760px) {
  .stand .st-h, .stand summary { grid-template-columns: 34px minmax(160px, 1fr) repeat(3, 46px) repeat(3, 54px) 110px 56px 24px; padding: 0 14px; }
  .stand.has-d .st-h, .stand.has-d summary { grid-template-columns: 34px minmax(160px, 1fr) repeat(4, 46px) repeat(3, 54px) 110px 56px 24px; }
  .stand .wide { display: block; }
  .stand summary { min-height: 58px; }
  .st-panel { padding: 14px 18px; }
  .st-key { display: none; }
}
@media (min-width: 760px) { .st-panel > * { max-width: 620px; width: 100%; } }
.sched-panel summary { cursor: pointer; display: flex; flex-direction: column; gap: 2px; list-style: none; }
.sched-panel summary::-webkit-details-marker { display: none; }
.sched-panel summary > span { font-weight: 700; }
.sched-panel summary > span::after { content: " ▾"; color: var(--muted); }
.sched-panel[open] summary > small { display: none; }
.sched-panel[open] summary { margin-bottom: 8px; }
.when-ro { display: flex; flex-direction: column; gap: 3px; justify-content: center; padding: 8px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); min-height: 48px; }
.when-ro span { font-size: 13px; color: var(--muted); font-weight: 600; }
.when-ro b { font-size: 15px; }
.when-ro small { font-size: 11px; color: var(--muted); }

/* ---------- home Explore: Up next / Results rows ---------- */
.xr-list { display: flex; flex-direction: column; gap: 8px; }
.xr-grp { display: flex; align-items: center; gap: 6px; font: 700 11px/1 var(--body); color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; margin-top: 2px; }
.xr-grp b { color: var(--accent); font-weight: 800; }
.xr-grp::after { content: ""; flex: 1; height: 1px; background: var(--line); margin-left: 4px; }
.xr { display: grid; grid-template-columns: 42px minmax(0, 1fr); align-items: center; gap: 10px; padding: 9px 12px 9px 9px; background: var(--surface); border: 1px solid color-mix(in srgb, #808080 45%, var(--line)); border-radius: 14px; text-decoration: none; color: inherit; }
.xr:hover { border-color: color-mix(in srgb, var(--accent) 60%, #808080); }
.xr-slot { display: grid; place-items: center; height: 42px; border-radius: 10px; background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); font: 700 14px/1 var(--display); letter-spacing: 0.04em; }
.xr-slot.trump { box-shadow: inset 0 0 0 1.5px #e6b93a; }
.xr-lines { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.xr-ln { display: flex; align-items: center; gap: 8px; min-width: 0; }
.xr-bar { width: 3px; align-self: stretch; min-height: 28px; border-radius: 2px; flex: none; }
.xr-avs { display: flex; flex: none; }
.xr-avs .av { position: relative; overflow: hidden; width: 26px; height: 26px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--surface-2); color: var(--fg); font: 700 9px/1 var(--body); box-shadow: 0 0 0 2px var(--surface); }
.xr-avs .av + .av { margin-left: -6px; }
.xr-avs .av img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.xr-nm { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.xr-nm b { font: 600 13px/1.2 var(--display); text-transform: uppercase; letter-spacing: 0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.xr-nm b i { font-style: normal; color: var(--muted); margin: 0 4px; }
.xr-nm small { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.xr-pts { flex: none; font: 700 20px/1 var(--display); min-width: 28px; text-align: right; color: var(--muted); }
.xr-ln.won .xr-pts { color: var(--accent); }
.xr-ln.lost .xr-nm b { color: var(--muted); }
.xr-ln.lost .xr-avs { opacity: 0.6; }
.xr-key { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); }
.xr-key i { width: 11px; height: 11px; border-radius: 3px; box-shadow: inset 0 0 0 1.5px #e6b93a; }
.pg-h span { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.pg-h .tq { font: 700 10.5px/1 var(--body); letter-spacing: 0.06em; text-transform: uppercase; color: #e6b93a; }
.pg-h .tq.full { color: var(--muted); }
.switch .tq-note { display: block; font-size: 12px; color: var(--muted); font-weight: 500; margin-top: 3px; }
.switch .tq-note.full { color: var(--warn); }
.switch input:disabled ~ .track { opacity: 0.4; }

/* ---------- leaderboard: top point-getter ---------- */
.lb-lead { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 14px 16px; border-radius: 18px; text-decoration: none; color: inherit;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 28%, var(--surface)), var(--surface) 70%); border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--line)); }
.lb-av { position: relative; }
.lb-av .av { position: relative; overflow: hidden; width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); font: 700 18px/1 var(--display); box-shadow: 0 0 0 3px var(--accent); }
.lb-av .av img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.lb-av i { position: absolute; top: -13px; left: 50%; transform: translateX(-50%); font-style: normal; font-size: 18px; }
.lb-txt { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.lb-txt small { font: 800 10.5px/1 var(--body); letter-spacing: 0.1em; color: var(--accent); text-transform: uppercase; }
.lb-txt b { font: 700 20px/1.1 var(--display); text-transform: uppercase; overflow-wrap: anywhere; }
.lb-txt span { font-size: 12.5px; color: var(--muted); }
.lb-pts { text-align: right; } .lb-pts strong { display: block; font: 700 32px/1 var(--display); } .lb-pts em { font-style: normal; font-size: 11px; font-weight: 700; letter-spacing: 0.08em; color: var(--muted); }
.potm-star { color: #e6b93a; font-weight: 800; }

/* ---------- Trump: which team played it ---------- */
.trump-pill { display: inline-flex; align-items: center; gap: 8px; padding: 5px 10px; border-radius: 999px; border: 1px solid color-mix(in srgb, #e6b93a 55%, transparent); background: color-mix(in srgb, #e6b93a 12%, transparent); font: 700 11px/1 var(--display); letter-spacing: 0.06em; text-transform: uppercase; white-space: nowrap; max-width: 100%; overflow: hidden; }
.trump-pill b { color: #e6b93a; padding-right: 8px; border-right: 1px solid color-mix(in srgb, #e6b93a 45%, transparent); }
.trump-pill span { display: inline-flex; align-items: center; gap: 5px; color: var(--fg); min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.trump-pill i { width: 8px; height: 8px; border-radius: 2px; flex: none; }
:root[data-theme="light"] .trump-pill b { color: #a87b00; }
.mc-team.is-trump { color: var(--fg); }
.t-star { font-style: normal; color: #e6b93a; font-size: 12px; margin: 0 2px; }
.mc-potm { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 12px; color: var(--muted); border-top: 1px dashed var(--line); padding-top: 7px; }
.mc-potm b { color: #e6b93a; font: 700 12.5px/1 var(--display); text-transform: uppercase; letter-spacing: 0.02em; }
:root[data-theme="light"] .mc-potm b, :root[data-theme="light"] .t-star, :root[data-theme="light"] .potm-star { color: #a87b00; }

/* ---------- scorer: match complete + Player of the Match ---------- */
.res-card { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 8px; align-items: center; text-align: center; padding: 14px 12px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.res-side { display: flex; flex-direction: column; gap: 3px; min-width: 0; color: var(--muted); }
.res-side b { font: 700 13px/1.2 var(--display); text-transform: uppercase; overflow-wrap: anywhere; }
.res-side.won b { color: var(--fg); }
.res-side small { font-size: 11.5px; }
.res-tag { font: 800 10px/1 var(--body); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ok); }
.res-score { font: 700 40px/1 var(--display); display: grid; grid-auto-flow: column; align-items: center; gap: 2px; }
.res-score .w { color: var(--accent); } .res-score i { font-style: normal; color: var(--muted); }
.res-score small { grid-column: 1 / -1; font: 600 11px/1 var(--body); color: var(--muted); }
.potm-sec h3 { margin: 0; font: 700 18px/1.1 var(--display); display: flex; align-items: center; gap: 8px; }
.potm-sec .req { font: 800 10px/1 var(--body); letter-spacing: 0.08em; text-transform: uppercase; color: var(--danger); background: var(--danger-bg); padding: 4px 7px; border-radius: 999px; }
.potm-sec p { margin: 4px 0 10px; color: var(--muted); font-size: 13px; }
.potm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.potm-tl { display: flex; align-items: center; gap: 6px; font: 700 11px/1 var(--body); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.potm-tl i { width: 9px; height: 9px; border-radius: 2px; flex: none; }
.potm-pk { display: flex; align-items: center; gap: 10px; padding: 10px; min-height: 62px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface); color: var(--fg); text-align: left; cursor: pointer; min-width: 0; font: inherit; }
.potm-pk span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.potm-pk b { font: 600 14px/1.15 var(--display); text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.potm-pk small { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.potm-pk .av { position: relative; }
.potm-pk.on { border-color: #e6b93a; background: color-mix(in srgb, #e6b93a 12%, var(--surface)); box-shadow: 0 0 0 3px color-mix(in srgb, #e6b93a 22%, transparent); }
.potm-pk.on .av::after { content: "★"; position: absolute; right: -4px; bottom: -4px; width: 18px; height: 18px; border-radius: 50%; background: #e6b93a; color: #1a1200; font-size: 11px; display: grid; place-items: center; z-index: 2; }
.confirm-btn { min-height: 62px; display: grid; place-items: center; gap: 4px; font-size: 19px; }
.confirm-btn small { font: 600 12px/1.2 var(--body); opacity: 0.85; }
.confirm-btn:disabled { background: var(--surface-2); color: var(--muted); opacity: 1; }
/* side switch pop-up */
.sw-pop { text-align: center; display: flex; flex-direction: column; gap: 12px; padding-top: 4px; }
.sw-pop .sw-ic { width: 72px; height: 72px; margin: 0 auto; border-radius: 50%; display: grid; place-items: center; color: var(--ball-text, var(--ball)); background: color-mix(in srgb, var(--ball) 16%, transparent); }
.sw-pop .sw-ic svg { width: 36px; height: 36px; }
.sw-pop h2 { margin: 0; font: 700 30px/1 var(--display); text-transform: uppercase; }
.sw-pop p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.4; } .sw-pop p b { color: var(--fg); }
.sw-court { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 6px; }
.sw-court span { padding: 10px 6px; border-radius: 10px; font: 700 13px/1.1 var(--display); text-transform: uppercase; overflow-wrap: anywhere; }
.sw-court span.tA { color: var(--tA, #8f90ff); background: color-mix(in srgb, var(--tA, #8f90ff) 18%, transparent); }
.sw-court span.tB { color: var(--tB, #45c97a); background: color-mix(in srgb, var(--tB, #45c97a) 18%, transparent); }
.sw-court em { font-style: normal; color: var(--muted); }
.sw-pop .btn.ball { min-height: 56px; font-size: 18px; text-transform: uppercase; }
.potm-pk .av { width: 40px; height: 40px; flex: none; border-radius: 50%; display: grid; place-items: center; overflow: visible; background: var(--surface-2); color: var(--fg); font: 700 13px/1 var(--body); }
.potm-pk .av img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
/* cards with a score in the middle: a little tighter so "Sidharth N" fits on a 360–390px phone */
.mcard:has(.mc-score) .mc-cols { gap: 6px; }
.mcard:has(.mc-score) .mc-pl { gap: 6px; }
.mcard:has(.mc-score) .mc-pl .av { width: 28px; height: 28px; font-size: 9.5px; }
.mcard:has(.mc-score) .mc-pl b { font-size: 13px; letter-spacing: 0.01em; }
.mcard:has(.mc-score) .mc-score { font-size: 22px; }

/* ---------- scorer setup: coin toss + ready screen ---------- */
.setup-steps { display: flex; gap: 6px; margin-top: -4px; }
.setup-steps i { flex: 1; height: 4px; border-radius: 2px; background: var(--line); }
.setup-steps i.on { background: var(--ball); }
.b.on { border-color: var(--ball); background: color-mix(in srgb, var(--ball) 14%, var(--bg)); }
.b.tA.on { border-color: var(--tA); background: color-mix(in srgb, var(--tA) 24%, var(--bg)); }
.b.tB.on { border-color: var(--tB); background: color-mix(in srgb, var(--tB) 24%, var(--bg)); }
.q .lbl { font: 700 11px/1 var(--body); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-top: 2px; }
.q h3.q2 { font-size: 17px; margin-top: 4px; }
.q h3.center, .q p.center, p.center { text-align: center; }
.gold { color: #d9a521; }
:root:not([data-theme="light"]) .gold { color: #ffd76a; }
.coin-stage { display: grid; place-items: center; padding: 10px 0 4px; min-height: 150px; perspective: 600px; }
.coin { position: relative; width: 120px; height: 120px; border-radius: 50%; display: grid; place-items: center; align-content: center; color: #5a3d00;
  background: radial-gradient(circle at 35% 30%, #ffe28a, #d9a521 55%, #9c6c08); box-shadow: inset 0 0 0 7px rgba(255, 255, 255, 0.18), inset 0 0 0 9px rgba(0, 0, 0, 0.18), 0 10px 30px rgba(217, 165, 33, 0.35); }
.coin b { font: 800 44px/1 var(--display); }
.coin small { font: 800 11px/1 var(--body); letter-spacing: 0.18em; margin-top: 2px; }
.coin.sm { width: 62px; height: 62px; flex: none; } .coin.sm b { font-size: 24px; } .coin.sm small { font-size: 7px; }
.coin.spin { animation: coin-spin 1.5s cubic-bezier(.2, .7, .3, 1) both; }
@keyframes coin-spin {
  0% { transform: translateY(0) rotateX(0); }
  40% { transform: translateY(-60px) rotateX(1440deg); }
  100% { transform: translateY(0) rotateX(2880deg); }
}
@media (prefers-reduced-motion: reduce) { .coin.spin { animation: none; } }
.flip-btn { min-height: 58px; font-size: 19px; text-transform: uppercase; letter-spacing: 0.03em; }
.toss-res { display: flex; align-items: center; gap: 14px; padding: 4px 2px; }
.toss-res > div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.toss-res b { font: 800 24px/1 var(--display); text-transform: uppercase; }
.toss-res small { color: var(--muted); font-size: 13px; }
.win-pill { align-self: flex-start; margin-top: 4px; padding: 7px 12px; border-radius: 999px; font: 700 14px/1.1 var(--display); text-transform: uppercase; color: #fff; }
.win-pill.tA { background: var(--tA); } .win-pill.tB { background: var(--tB); }
.ready { background: var(--surface); border: 1.5px solid var(--line-strong); border-radius: 16px; overflow: hidden; }
.rs-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.rs-row:last-child { border-bottom: 0; }
.rs-av .av { width: 46px; height: 46px; }
.rs-txt { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; }
.rs-txt b { font: 700 19px/1.1 var(--display); text-transform: uppercase; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.rs-txt small { color: var(--muted); font-size: 12px; }
.role.ends { background: var(--surface-2); color: var(--fg); }
.rs-swap { min-width: 78px; min-height: 42px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--bg); color: var(--fg); font: 700 13px/1 var(--body); cursor: pointer; }
.ends-mini { display: grid; grid-template-columns: 1fr 1fr; width: 100%; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); font: 700 12px/1.15 var(--display); text-transform: uppercase; }
.ends-mini span { padding: 9px 6px; text-align: center; }
.ends-mini .tA { background: var(--tA-soft); } .ends-mini .tB { background: var(--tB-soft); }

/* =====================================================================
   Open tournaments (Spinz): splash, tournament list, registration,
   pools & knockout, admin schedule, scorer profile
   ===================================================================== */

/* ---------- splash ---------- */
.splash { position: fixed; inset: 0; z-index: 1000; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: radial-gradient(120% 80% at 50% 35%, var(--hero-a), var(--bg) 70%); color: var(--fg);
  padding: env(safe-area-inset-top, 0px) 24px calc(28px + env(safe-area-inset-bottom, 0px)); transition: opacity 0.4s ease, visibility 0.4s; cursor: pointer; }
.splash.out { opacity: 0; visibility: hidden; }
.splash-main { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center; animation: splash-in 0.6s ease both; }
.splash-logo { max-width: min(68vw, 300px); max-height: 34vh; object-fit: contain; }
.splash-mark { width: 84px; height: 84px; border-radius: 26px; background: var(--accent); display: grid; place-items: center; box-shadow: 0 18px 50px var(--hero-glow); }
.splash-mark svg { width: 52px; height: 52px; }
.splash-word { font: 800 clamp(48px, 15vw, 84px)/0.9 var(--display); letter-spacing: 0.06em; text-transform: uppercase; }
.splash-tag { color: var(--muted); font-size: 14px; letter-spacing: 0.04em; }
.splash-dots { display: flex; gap: 6px; margin-top: 8px; }
.splash-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--ball); animation: splash-dot 1s infinite ease-in-out; }
.splash-dots i:nth-child(2) { animation-delay: 0.15s; } .splash-dots i:nth-child(3) { animation-delay: 0.3s; }
.splash-foot { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.splash-foot small { font: 600 11px/1 var(--body); text-transform: uppercase; letter-spacing: 0.14em; color: var(--muted); }
.splash-foot img { height: 34px; max-width: 180px; object-fit: contain; }
.splash-preview { position: relative; inset: auto; min-height: 420px; border-radius: var(--radius); border: 1px solid var(--line); z-index: 0; cursor: default; }
@keyframes splash-in { from { opacity: 0; transform: translateY(10px) scale(0.97); } to { opacity: 1; transform: none; } }
@keyframes splash-dot { 0%, 100% { opacity: 0.25; transform: scale(0.8); } 50% { opacity: 1; transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .splash-main, .splash-dots i { animation: none; } }

.brand-logo { height: 34px; max-width: 120px; object-fit: contain; }
.site-foot { display: flex; align-items: center; justify-content: center; gap: 10px; padding-block: 28px calc(28px + env(safe-area-inset-bottom, 0px)); color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.12em; }
.site-foot img { height: 26px; max-width: 140px; object-fit: contain; }

/* ---------- tournament list (landing) ---------- */
.landing { padding-top: 20px; }
.land-hero { display: flex; flex-direction: column; gap: 8px; }
.land-hero h1 { font-size: clamp(32px, 7vw, 52px); text-transform: uppercase; }
.tcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 16px; }
.tcard { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; display: flex; flex-direction: column; min-width: 0; }
.tcard.is-live { border-color: color-mix(in srgb, var(--ball) 60%, var(--line)); }
.tcard-link { position: absolute; inset: 0; z-index: 1; }
.tcard-art { position: relative; height: 112px; display: flex; align-items: flex-end; justify-content: space-between; padding: 12px 14px;
  background: var(--tc-img, none) center / cover no-repeat, linear-gradient(135deg, var(--hero-a), var(--hero-b)); }
.tcard-art::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 30%, color-mix(in srgb, var(--surface) 75%, transparent)); }
.tcard-art > * { position: relative; }
.tcard-logo { width: 58px; height: 58px; border-radius: 16px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font: 800 22px/1 var(--display); overflow: hidden; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25); margin-bottom: -26px; }
.tcard-logo img { width: 100%; height: 100%; object-fit: cover; background: #fff; }
.tcard-body { padding: 30px 16px 16px; display: flex; flex-direction: column; gap: 8px; }
.tcard-body h2 { font-size: 24px; }
.tcard-stats { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--muted); }
.tcard-stats b { color: var(--fg); }
.tcard-stats .live-txt b { color: var(--ball-text); }
.tcard-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; position: relative; z-index: 2; }
.tcard-actions .btn { flex: 1 1 auto; }

/* ---------- registration ---------- */
.reg { max-width: 640px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; padding-top: 12px; }
.reg-head { display: flex; flex-direction: column; gap: 6px; }
.reg-form { display: flex; flex-direction: column; gap: 14px; }
.reg-step { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.reg-step h2, .step-card h2 { display: flex; align-items: center; gap: 10px; font-size: 22px; }
.num { width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: inline-grid; place-items: center; font: 800 15px/1 var(--body); flex: none; }
.lbl { font: 600 12px/1 var(--body); text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); margin-bottom: -6px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chipr { position: relative; cursor: pointer; }
.chipr input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chipr span { display: inline-flex; align-items: center; min-height: 42px; padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line-strong); font-weight: 700; font-size: 15px; color: var(--fg); background: var(--bg); }
.chipr input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.chipr input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.ev-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.ev { position: relative; cursor: pointer; min-width: 0; }
.ev input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.ev-card { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; padding: 12px 6px; border-radius: 14px; border: 1px solid var(--line-strong); background: var(--bg); height: 100%; }
.ev-card svg { width: 28px; height: 28px; color: var(--accent); }
.ev-card b { font: 700 16px/1.1 var(--display); text-transform: uppercase; letter-spacing: 0.03em; }
.ev-card small { font-size: 11px; color: var(--muted); }
.ev input:checked + .ev-card { border-color: var(--accent); box-shadow: inset 0 0 0 2px var(--accent); background: var(--accent-soft); }
.ev input:focus-visible + .ev-card { outline: 2px solid var(--accent); outline-offset: 2px; }
.ev.off { cursor: not-allowed; opacity: 0.5; }
@media (max-width: 380px) { .ev-grid { gap: 6px; } .ev-card b { font-size: 14px; } }
.ph-pick { display: flex; align-items: center; gap: 14px; }
.ph-circle { position: relative; width: 84px; height: 84px; flex: none; cursor: pointer; }
.ph-img { position: absolute; inset: 0; border-radius: 50%; background: var(--surface-2) center / cover no-repeat; border: 2px dashed var(--line-strong); }
.ph-img[style] { border-style: solid; border-color: var(--accent); }
.ph-cam { position: absolute; right: -2px; bottom: -2px; width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; box-shadow: 0 0 0 3px var(--surface); }
.ph-cam svg { width: 17px; height: 17px; }
.ph-file { position: absolute; width: 1px; height: 1px; opacity: 0; }
.ph-file:focus-visible ~ .ph-txt b { outline: 2px solid var(--accent); }
.ph-pick:focus-within .ph-img { box-shadow: 0 0 0 3px var(--accent-soft); }
.ph-txt { display: flex; flex-direction: column; gap: 2px; }
.ph-txt small { color: var(--muted); font-size: 13px; }
.gender-row { border: 0; padding: 0; margin: 0; }
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.reg-foot { display: flex; flex-direction: column; gap: 10px; padding-top: 4px; }
.reg-sum { font: 700 14px/1.2 var(--body); color: var(--muted); text-align: center; }
.reg-sum:empty { display: none; }
.center { text-align: center; }
.reg-done { align-items: center; text-align: center; margin-top: 4vh; }
.rd-tick { width: 64px; height: 64px; border-radius: 50%; background: var(--ok-bg); color: var(--ok); display: grid; place-items: center; font-size: 32px; font-weight: 800; }
.rd-players { display: flex; gap: 22px; justify-content: center; flex-wrap: wrap; }
.rd-p { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.rd-p small { color: var(--muted); font-size: 12px; }

/* ---------- pools & knockout ---------- */
.cat-tabs .add-tab { border-style: dashed; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--surface-2); border-radius: 12px; padding: 4px; gap: 4px; }
.seg a { text-align: center; padding: 9px 6px; border-radius: 9px; text-decoration: none; font-weight: 700; font-size: 14px; color: var(--muted); white-space: nowrap; }
.seg a[aria-selected="true"] { background: var(--surface); color: var(--fg); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18); }
.pool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 14px; }
.pool-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.step-card .pool-card { background: var(--bg); }
.pool-card header { display: flex; align-items: center; gap: 10px; }
.pool-card header h2, .pool-card header h3 { font-size: 20px; margin-right: auto; }
.pt { display: flex; flex-direction: column; font-size: 14px; }
.pt-h, .pt-r { display: grid; grid-template-columns: 20px minmax(0, 1fr) repeat(3, 24px) 34px 30px; gap: 4px; align-items: center; padding: 7px 4px; }
.pt-h { font: 600 11px/1 var(--body); color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; border-bottom: 1px solid var(--line); }
.pt-h span:nth-child(n+3), .pt-r span:nth-child(n+3) { text-align: center; }
.pt-r { border-bottom: 1px solid var(--line); }
.pt-r:last-child { border-bottom: 0; }
.pt-r.qual { box-shadow: inset 3px 0 0 var(--ok); background: color-mix(in srgb, var(--ok-bg) 45%, transparent); }
.pt-r .ps { font-weight: 800; color: var(--muted); text-align: center; }
.pt-r .nm { display: flex; align-items: center; gap: 8px; min-width: 0; }
.pt-r .nm b { display: flex; flex-direction: column; min-width: 0; font-weight: 700; line-height: 1.2; }
.pt-r .nm b span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 380px) { .pt-r .pt-avs { display: none; } }
.pt-r .pts { font-weight: 800; }
.pt-r .up { color: var(--ok); } .pt-r .down { color: var(--danger); }
.pt-avs { display: inline-flex; flex: none; }
.pt-avs .av { width: 26px; height: 26px; font-size: 9px; box-shadow: 0 0 0 2px var(--surface); }
.pt-avs .av + .av { margin-left: -8px; }
.qual-key { display: inline-block; width: 12px; height: 12px; border-radius: 3px; background: var(--ok-bg); box-shadow: inset 3px 0 0 var(--ok); vertical-align: -1px; }
.champ { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--radius); background: linear-gradient(135deg, var(--trump-bg), var(--surface)); border: 1px solid color-mix(in srgb, var(--warn) 40%, var(--line)); }
.champ > span { font-size: 30px; }
.champ small { display: block; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; }
.champ b { font: 800 24px/1.1 var(--display); }
.bracket2 { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, 1fr); gap: 14px; overflow-x: auto; padding-bottom: 6px; }
.br-col { display: flex; flex-direction: column; justify-content: space-around; gap: 12px; min-width: 0; }
.br-col h3 { font-size: 16px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.br-third { max-width: 320px; }
.ko-tie { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; text-decoration: none; color: inherit; }
.ko-tie.is-live { border-color: var(--ball); }
.ko-tie.is-bye { opacity: 0.7; }
.ko-slot { font: 700 11px/1 var(--body); text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); padding: 8px 12px 6px; display: flex; align-items: center; gap: 6px; }
.ko-team { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; border-top: 1px solid var(--line); }
.ko-team b { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.ko-team em { font-style: normal; font-weight: 800; font-size: 18px; }
.ko-team.win { background: var(--accent-soft); }
.ko-team.win b::after { content: " ✓"; color: var(--ok); }
.ko-team.lose { color: var(--muted); }
.entry-list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.step-card .entry-list { background: var(--bg); }
.entry { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-top: 1px solid var(--line); min-width: 0; }
.entry:first-child { border-top: 0; }
.entry form { margin-left: auto; }
.en-no { width: 22px; text-align: center; color: var(--muted); font-weight: 700; font-size: 13px; flex: none; }
.en-txt { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.en-txt b { font-weight: 700; overflow-wrap: anywhere; }
.en-txt small { color: var(--muted); font-size: 12px; }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); gap: 10px; }
.cat-card { display: flex; flex-direction: column; gap: 3px; padding: 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: inherit; }
.cat-card:hover { border-color: var(--accent); }
.cat-card b { font: 800 22px/1.1 var(--display); text-transform: uppercase; }
.cat-card small { color: var(--muted); }
.cc-ev { align-self: flex-start; font: 700 10px/1 var(--body); text-transform: uppercase; letter-spacing: 0.1em; padding: 4px 7px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); margin-bottom: 4px; }
.cc-ev.ev-mixed { background: var(--trump-bg); color: var(--warn); }
.cc-ev.ev-singles { background: var(--ok-bg); color: var(--ok); }
.cc-meta { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; font-size: 12px; color: var(--muted); margin-top: 6px; }

/* ---------- admin schedule ---------- */
.notice.warn { background: var(--warn-bg); color: var(--warn); }
.sched-top { flex-direction: row; flex-wrap: wrap; gap: 6px 24px; padding-block: 8px; }
.sched-top .switch small { font-weight: 500; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.steps a { display: flex; align-items: center; gap: 8px; padding: 10px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--muted); font-weight: 700; font-size: 13px; min-width: 0; }
.steps a span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.steps i { font-style: normal; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); flex: none; font-size: 12px; }
.steps .done a { color: var(--fg); } .steps .done i { background: var(--ok-bg); color: var(--ok); }
.steps .now a { color: var(--fg); border-color: var(--accent); } .steps .now i { background: var(--accent); color: var(--accent-ink); }
@media (max-width: 560px) { .steps a { flex-direction: column; gap: 4px; padding: 8px 4px; text-align: center; font-size: 11px; } .steps a span { white-space: normal; } }
.step-card { scroll-margin-top: 80px; }
.cat-settings summary, .pool-tables summary, .danger-zone summary { cursor: pointer; }
.danger-zone { color: var(--muted); }
.pool-make { display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.pool-make .field { width: min(100%, 420px); }
.pool-make fieldset { border: 0; padding: 0; margin: 0; }
.pc-team { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-top: 1px solid var(--line); min-width: 0; }
.pc-team > span:not(.pt-avs) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.pc-team select { width: auto; min-width: 64px; padding-block: 6px; min-height: 36px; }
.sm-list { display: flex; flex-direction: column; gap: 6px; }
.sm-grp { font: 700 12px/1 var(--body); text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); padding: 10px 2px 2px; }
.sm-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; grid-template-areas: "slot teams st" "edit edit edit"; gap: 8px 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); scroll-margin-top: 80px; }
.sm-row:target { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.sm-slot { grid-area: slot; font: 800 16px/1 var(--display); color: var(--accent); }
.sm-teams { grid-area: teams; display: flex; flex-wrap: wrap; gap: 2px 8px; align-items: baseline; min-width: 0; font-weight: 600; }
.sm-teams i { color: var(--muted); font-style: normal; font-size: 12px; }
.sm-teams .w { color: var(--ok); }
.sm-st { grid-area: st; display: flex; align-items: center; gap: 6px; justify-self: end; }
.sm-edit { grid-area: edit; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.sm-edit input[type=text] { width: 110px; min-height: 36px; padding-block: 6px; }
.sm-edit select { width: auto; max-width: 180px; min-height: 36px; padding-block: 6px; }
@media (min-width: 900px) { .sm-row { grid-template-columns: 44px minmax(0, 1fr) auto auto; grid-template-areas: "slot teams st edit"; } }

/* ---------- scorer: profile, cards ---------- */
.mcard .side.w .names { color: var(--ok); }
.prof-head { display: flex; align-items: center; gap: 12px; padding: 6px 2px; }
.prof-head b { display: block; font: 800 22px/1.1 var(--display); }
.prof-head small { color: var(--muted); }
.prof-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.prof-stats div { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 4px; text-align: center; }
.prof-stats b { display: block; font: 800 24px/1 var(--display); }
.prof-stats small { color: var(--muted); font-size: 11px; }
.prof-sec { display: flex; flex-direction: column; gap: 10px; }
.prof-sec h3 { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.prof-sec h3 .count { font: 700 12px/1 var(--body); background: var(--surface-2); padding: 4px 8px; border-radius: 999px; color: var(--muted); }
.empty.small { padding: 16px; font-size: 14px; }
@media (max-width: 700px) {
  .bracket2 { grid-auto-flow: row; grid-auto-columns: auto; overflow: visible; }
  .br-col { justify-content: flex-start; }
  .br-third { max-width: none; }
}
