/* Codenames Tournament dashboard. Dark by default (follows the OS), with a
   light theme; [data-theme] on <html> overrides the OS choice. */

:root {
  --bg: #0d0f17;
  --surface: #151926;
  --surface-2: #1b2031;
  --surface-raised: #20263a;
  --border: #272d42;
  --border-strong: #353c57;
  --text: #e7e9f2;
  --text-dim: #a3a9c0;
  --text-faint: #6f7690;
  --accent: #7c8cff;
  --accent-soft: rgba(124, 140, 255, 0.14);
  --blue: #4c8dff;
  --blue-soft: rgba(76, 141, 255, 0.15);
  --red: #f05d5d;
  --red-soft: rgba(240, 93, 93, 0.15);
  --green: #3ccf7e;
  --green-soft: rgba(60, 207, 126, 0.14);
  --amber: #f2b23e;
  --amber-soft: rgba(242, 178, 62, 0.15);
  --purple: #b48cff;
  --purple-soft: rgba(180, 140, 255, 0.15);
  --chart-grid: rgba(120, 130, 170, 0.16);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  --radius: 10px;
  --radius-sm: 6px;
  --gap: 12px;
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f4f5f9; --surface: #ffffff; --surface-2: #f6f7fb; --surface-raised: #ffffff;
    --border: #e1e4ee; --border-strong: #cdd2e1;
    --text: #171a26; --text-dim: #4f5670; --text-faint: #858ba3;
    --accent: #4f5fe0; --accent-soft: rgba(79, 95, 224, 0.1);
    --blue: #2563eb; --blue-soft: rgba(37, 99, 235, 0.1);
    --red: #dc2f2f; --red-soft: rgba(220, 47, 47, 0.09);
    --green: #148a4b; --green-soft: rgba(20, 138, 75, 0.1);
    --amber: #b7790b; --amber-soft: rgba(183, 121, 11, 0.12);
    --purple: #7c4ddb; --purple-soft: rgba(124, 77, 219, 0.1);
    --chart-grid: rgba(60, 70, 110, 0.12);
    --shadow: 0 1px 2px rgba(20, 25, 50, 0.06);
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #f4f5f9; --surface: #ffffff; --surface-2: #f6f7fb; --surface-raised: #ffffff;
  --border: #e1e4ee; --border-strong: #cdd2e1;
  --text: #171a26; --text-dim: #4f5670; --text-faint: #858ba3;
  --accent: #4f5fe0; --accent-soft: rgba(79, 95, 224, 0.1);
  --blue: #2563eb; --blue-soft: rgba(37, 99, 235, 0.1);
  --red: #dc2f2f; --red-soft: rgba(220, 47, 47, 0.09);
  --green: #148a4b; --green-soft: rgba(20, 138, 75, 0.1);
  --amber: #b7790b; --amber-soft: rgba(183, 121, 11, 0.12);
  --purple: #7c4ddb; --purple-soft: rgba(124, 77, 219, 0.1);
  --chart-grid: rgba(60, 70, 110, 0.12);
  --shadow: 0 1px 2px rgba(20, 25, 50, 0.06);
  color-scheme: light;
}

/* ── Base ─────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-feature-settings: "tnum" 1, "cv11" 1;
  overflow-x: hidden;
}
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
p { margin: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; color: inherit; }
small { font-size: 0.8em; color: var(--text-faint); font-weight: 500; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.muted { color: var(--text-dim); }

/* ── Buttons, pills, bars ─────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 12px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface-2); color: var(--text);
  font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap;
  transition: background 0.15s, border-color 0.15s;
}
.btn:hover:not(:disabled) { border-color: var(--text-faint); background: var(--surface-raised); text-decoration: none; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12px; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--accent); filter: brightness(1.08); border-color: var(--accent); }
.btn-warn { color: var(--amber); border-color: color-mix(in srgb, var(--amber) 45%, transparent); background: var(--amber-soft); }
.btn-danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn-danger:hover:not(:disabled) { background: var(--red); filter: brightness(1.08); border-color: var(--red); }
.btn-danger-ghost { color: var(--red); border-color: color-mix(in srgb, var(--red) 40%, transparent); background: transparent; }
.btn-discord { background: #5865f2; border-color: #5865f2; color: #fff; }
.btn-discord:hover:not(:disabled) { background: #5865f2; filter: brightness(1.08); border-color: #5865f2; }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 32px; height: 32px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: transparent; color: var(--text-dim);
  cursor: pointer; font-size: 15px; font-weight: 600;
}
.icon-btn:hover { color: var(--text); border-color: var(--border-strong); }
.icon-btn.is-spinning .refresh-icon { display: inline-block; animation: spin 0.8s linear infinite; }
.icon-btn.is-error { color: var(--red); border-color: var(--red); }
@keyframes spin { to { transform: rotate(360deg); } }

.pill {
  display: inline-flex; align-items: center; height: 20px; padding: 0 7px;
  border-radius: 999px; font-size: 11px; font-weight: 600; white-space: nowrap;
  background: var(--surface-2); color: var(--text-dim); border: 1px solid var(--border);
}
.pill-green { color: var(--green); background: var(--green-soft); border-color: transparent; }
.pill-amber { color: var(--amber); background: var(--amber-soft); border-color: transparent; }
.pill-purple { color: var(--purple); background: var(--purple-soft); border-color: transparent; }
.pill-me { color: var(--accent); background: var(--accent-soft); border-color: transparent; }

.bar { display: block; height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; border: 1px solid var(--border); }
.bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--green)); border-radius: inherit; }
.bar-sm { height: 4px; }

/* ── Top bar ──────────────────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: 1400px; margin: 0 auto; padding: 8px 16px;
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-icon { font-size: 22px; line-height: 1; }
.brand-text { min-width: 0; }
.brand h1 { font-size: 16px; white-space: nowrap; }
.brand p { font-size: 12px; color: var(--text-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tabs { display: flex; gap: 2px; justify-self: center; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 2px; }
.tab { height: 28px; padding: 0 14px; border: 0; border-radius: 6px; background: transparent; color: var(--text-dim); font-size: 13px; font-weight: 500; cursor: pointer; }
.tab:hover { color: var(--text); }
.tab.active { background: var(--surface-raised); color: var(--text); box-shadow: var(--shadow); }
.topbar-actions { display: flex; align-items: center; gap: 6px; }
.user { display: flex; align-items: center; gap: 8px; }
.user img { width: 26px; height: 26px; border-radius: 50%; }
.user-name { font-size: 13px; font-weight: 500; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Page layout ──────────────────────────────────────────────────────── */
.page { max-width: 1400px; margin: 0 auto; padding: 14px 16px 40px; }
.layout {
  display: grid; gap: var(--gap);
  grid-template-columns: minmax(0, 1fr) 300px;
  grid-template-areas: "admin side" "current side" "rounds side";
  grid-template-rows: auto auto 1fr;
  align-items: start;
}
.admin-panel { grid-area: admin; }
.current-round { grid-area: current; min-width: 0; }
.rounds-list { grid-area: rounds; min-width: 0; }
.side-col { grid-area: side; position: sticky; top: 64px; max-height: calc(100vh - 76px); overflow: auto; border-radius: var(--radius); }

.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.panel-head h2 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-dim); }
.panel-note { font-size: 11px; color: var(--text-faint); }

/* Status strip */
.status-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: var(--gap); margin-bottom: var(--gap); }
.stat { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); min-width: 0; }
.stat-wide { grid-column: span 2; }
.stat-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-faint); font-weight: 600; }
.stat-value { font-size: 18px; font-weight: 600; white-space: nowrap; }
.stat-sub { font-size: 11px; color: var(--text-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat .bar { margin-top: 4px; }
.stat.is-warn { border-color: color-mix(in srgb, var(--amber) 50%, var(--border)); }
.stat.is-warn .stat-value { color: var(--amber); }
.stat.is-bad .stat-value { color: var(--red); }
.stat.is-info .stat-value { color: var(--blue); }

/* Admin */
.admin-actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 12px; }
.admin-feedback { font-size: 12px; text-align: right; }
.is-good { color: var(--green); }
.is-bad { color: var(--red); }
.is-warn { color: var(--amber); }
.is-info { color: var(--blue); }
.note { flex-basis: 100%; font-size: 12px; }

/* ── Rounds & matches ─────────────────────────────────────────────────── */
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 2px 2px 10px; }
.section-head h2 { font-size: 17px; }
.section-head h2 small { margin-left: 6px; font-size: 13px; }
.current-round > .muted { margin: 0 2px 10px; }

.match-grid { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); }

.match {
  container-type: inline-size;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden; min-width: 0;
}
.match.is-active { border-color: color-mix(in srgb, var(--amber) 45%, var(--border)); }
.match.is-mine { box-shadow: 0 0 0 1px var(--accent), var(--shadow); }
.match-head { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.match-head h3 { font-size: 14px; }
.thread-link { margin-left: auto; font-size: 12px; font-weight: 500; white-space: nowrap; }

.live-status { display: flex; flex-wrap: wrap; gap: 4px 12px; padding: 6px 12px; font-size: 12px; color: var(--text-dim); border-bottom: 1px solid var(--border); }
.live-status .live { color: var(--text); font-weight: 500; }

.games { list-style: none; margin: 0; padding: 0; }
.game {
  display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: 8px;
  padding: 6px 12px; border-top: 1px solid var(--border);
}
.game:first-child { border-top: 0; }
.game.is-now { background: var(--amber-soft); }
.g-num { font-size: 11px; font-weight: 700; color: var(--text-faint); }
.g-teams { display: flex; align-items: center; gap: 6px; min-width: 0; }
.team { display: flex; align-items: center; gap: 4px; min-width: 0; flex: 1 1 0; padding: 2px 6px; border-radius: 5px; }
.team-blue { background: var(--blue-soft); }
.team-red { background: var(--red-soft); }
.team .amp { color: var(--text-faint); font-size: 11px; }
.vs { font-size: 10px; font-weight: 700; color: var(--text-faint); text-transform: uppercase; }
.p { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.p.spy { font-weight: 600; }
.p.spy::before { content: "🔎"; font-size: 10px; margin-right: 3px; filter: grayscale(0.3); }
.p.is-me { color: var(--accent); }

/* When a match card is narrow, stack the two teams. */
@container (max-width: 400px) {
  .game { grid-template-columns: 24px minmax(0, 1fr) auto; }
  .g-teams { flex-direction: column; align-items: stretch; gap: 3px; }
  .vs { display: none; }
}

.result {
  display: inline-flex; flex-direction: column; align-items: flex-end; justify-content: center;
  min-width: 78px; padding: 2px 8px; border-radius: 6px; font-size: 11px; line-height: 1.3;
  border: 1px solid transparent; white-space: nowrap; text-align: right;
}
.result b { font-weight: 600; font-size: 12px; }
.result small { font-size: 10px; color: inherit; opacity: 0.8; font-weight: 500; }
.r-blue { color: var(--blue); background: var(--blue-soft); }
.r-red { color: var(--red); background: var(--red-soft); }
.r-active { color: var(--amber); background: var(--amber-soft); }
.r-waiting, .r-pending { color: var(--text-faint); border-color: var(--border); }
.r-skipped { color: var(--text-faint); border-style: dashed; border-color: var(--border-strong); }
.result.editable { cursor: pointer; }
.result.editable:hover { border-color: currentColor; }
.chips .result { align-items: center; min-width: 0; }

/* Round lists */
.rounds-list { display: flex; flex-direction: column; gap: var(--gap); }
.round-group { display: flex; flex-direction: column; gap: 6px; }
.group-title { display: flex; align-items: center; gap: 8px; font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-dim); margin: 8px 2px 2px; }
.group-title .btn { margin-left: auto; text-transform: none; letter-spacing: 0; }
.show-more { align-self: center; }
.round { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.round > summary {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 12px; cursor: pointer; list-style: none; user-select: none;
}
.round > summary .bar { flex: 1 1 40px; min-width: 30px; }
.round > summary::-webkit-details-marker { display: none; }
.round > summary::after { content: "▸"; color: var(--text-faint); font-size: 11px; transition: transform 0.15s; width: 10px; }
.round[open] > summary::after { transform: rotate(90deg); }
.round > summary:hover { background: var(--surface-2); }
.round-name { font-weight: 600; font-size: 13px; }
.round-count { font-size: 12px; color: var(--text-faint); white-space: nowrap; }
.round.is-future .bar { visibility: hidden; }
.round[open] > .match-grid { padding: 10px; border-top: 1px solid var(--border); background: var(--bg); }

/* ── Standings ────────────────────────────────────────────────────────── */
.standings-head, .standing {
  display: grid; grid-template-columns: 26px minmax(0, 1fr) 40px 44px 40px; align-items: center; gap: 6px;
}
.standings-head { padding: 6px 12px 4px; font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-faint); font-weight: 600; }
.standings-head span:nth-child(n+3) { text-align: right; }
.standings { list-style: none; margin: 0; padding: 0 0 6px; }
.standing { padding: 5px 12px; font-size: 13px; }
.standing:nth-child(odd) { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.standing.is-me { background: var(--accent-soft); }
.standing.is-me .name { color: var(--accent); font-weight: 600; }
.standing.is-left { opacity: 0.55; }
.rank { font-size: 12px; color: var(--text-faint); font-weight: 600; text-align: center; }
.name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pts { font-weight: 700; text-align: right; }
.games, .avg { text-align: right; color: var(--text-dim); font-size: 12px; }
button.pts { background: none; border: 0; padding: 0; cursor: pointer; border-bottom: 1px dashed var(--text-faint); justify-self: end; }
.pts-input { width: 52px; height: 24px; padding: 0 4px; font: inherit; font-size: 12px; text-align: right; background: var(--surface-2); color: var(--text); border: 1px solid var(--accent); border-radius: 4px; }
.standings-divider { padding: 8px 12px 2px; font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-faint); border-top: 1px solid var(--border); margin-top: 6px; }
.empty-row { padding: 12px; color: var(--text-faint); font-size: 13px; }

.empty { text-align: center; padding: 36px 16px; background: var(--surface); border: 1px dashed var(--border-strong); border-radius: var(--radius); color: var(--text-dim); }
.empty span { font-size: 32px; }
.empty h2 { font-size: 17px; margin: 6px 0 4px; color: var(--text); }

/* ── Stats view ───────────────────────────────────────────────────────── */
#view-stats { display: flex; flex-direction: column; gap: var(--gap); }
#view-stats[hidden] { display: none; }
.filters { display: flex; flex-wrap: wrap; gap: 12px 24px; padding: 10px 12px; }
.filter-group { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.filter-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-faint); font-weight: 600; }
.filter-group input[type="range"] { width: 200px; accent-color: var(--accent); }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.filter-chip { height: 24px; padding: 0 9px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text-dim); font-size: 12px; cursor: pointer; }
.filter-chip.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 600; }

.trophies { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: var(--gap); }
.trophy { padding: 10px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); min-width: 0; }
.trophy-icon { font-size: 18px; float: right; }
.trophy-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-faint); font-weight: 600; }
.trophy-name { font-size: 15px; font-weight: 600; margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trophy-rate, .trophy-sub { font-size: 12px; color: var(--text-dim); }
.trophy-empty { font-size: 12px; color: var(--text-faint); margin-top: 6px; }

.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--gap); }
.stat-card { padding: 10px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.stat-card-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-faint); font-weight: 600; }
.stat-card-value { font-size: 20px; font-weight: 700; }
.stat-card-sub { font-size: 11px; color: var(--text-faint); }

.charts { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 440px), 1fr)); gap: var(--gap); }
.chart { margin: 0; padding: 10px 12px; min-width: 0; }
.chart figcaption { font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.chart-wrap { position: relative; height: 220px; }

.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th { position: sticky; top: 0; background: var(--surface-2); text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-faint); font-weight: 600; padding: 7px 10px; cursor: pointer; white-space: nowrap; border-bottom: 1px solid var(--border); }
.data-table td { padding: 6px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.data-table tbody tr:hover { background: var(--surface-2); }
.data-table .num { text-align: right; }
.data-table .hl { font-weight: 600; }
.sort-arrow { opacity: 0.35; font-size: 10px; }
.sort-arrow.on { opacity: 1; color: var(--accent); }

/* ── Dialogs ──────────────────────────────────────────────────────────── */
.dialog {
  width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 48px);
  padding: 0; border: 1px solid var(--border-strong); border-radius: 12px;
  background: var(--surface); color: var(--text); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}
.dialog-sm { width: min(420px, calc(100vw - 24px)); }
.dialog::backdrop { background: rgba(5, 7, 15, 0.6); backdrop-filter: blur(2px); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.dialog-head h2 { font-size: 16px; }
.dialog-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 12px; }
.dialog-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.foot-left, .foot-right { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.prose { font-size: 13px; color: var(--text-dim); }
.prose h3 { font-size: 13px; color: var(--text); margin: 12px 0 4px; }
.prose h3:first-child { margin-top: 0; }
.prose p + p { margin-top: 6px; }
.prose ul { margin: 4px 0; padding-left: 18px; }
.prose b { color: var(--text); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field-row { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 16px; }
.field-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-faint); font-weight: 600; }
.field input:not([type="checkbox"]), .inline-input input {
  height: 32px; padding: 0 10px; font: inherit; background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
}
.inline-input { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-dim); }
.inline-input input { width: 72px; }
.check { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-dim); cursor: pointer; }
.check.small { font-size: 12px; }
.check input { accent-color: var(--accent); }
.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.seg { height: 36px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--surface-2); cursor: pointer; font-weight: 600; }
.seg-blue.selected { background: var(--blue-soft); border-color: var(--blue); color: var(--blue); }
.seg-red.selected { background: var(--red-soft); border-color: var(--red); color: var(--red); }
.feedback { font-size: 12px; min-height: 16px; color: var(--text-faint); }

/* ── Responsive ───────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .layout { grid-template-columns: minmax(0, 1fr) 260px; }
}
@media (max-width: 860px) {
  .layout { grid-template-columns: minmax(0, 1fr); grid-template-areas: "admin" "current" "side" "rounds"; grid-template-rows: none; }
  .side-col { position: static; max-height: none; overflow: visible; }
  .topbar-inner { grid-template-columns: minmax(0, 1fr) auto; row-gap: 8px; }
  .tabs { grid-column: 1 / -1; grid-row: 2; justify-self: stretch; }
  .tab { flex: 1; }
}
@media (max-width: 560px) {
  .page { padding: 10px 10px 32px; }
  .topbar-inner { padding: 8px 10px; gap: 8px; }
  :root { --gap: 8px; }
  .status-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stat { padding: 8px 10px; }
  .stat-wide { grid-column: 1 / -1; }
  .stat-value { font-size: 16px; }
  .user-name, .user .pill { display: none; }
  .round.is-past > summary .pill-green { display: none; }
  .filter-group input[type="range"] { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
