/* CSP dark theme — single source of truth for the whole site.
   The public and admin templates all share these class names, so the visual
   language lives entirely here. Dark-only by design. */

:root {
  color-scheme: dark;

  /* Surfaces & text */
  --bg: #090d12;
  --bg-grad: linear-gradient(180deg, #111821 0, #090d12 260px, #090d12 100%);
  --surface: #141b24;
  --surface-soft: #1b2430;
  --surface-hover: #222d3a;
  --surface-panel: #10161e;
  --text: #edf3f8;
  --muted: #9aa7b4;
  --line: #2a3542;
  --line-strong: #405064;

  /* Accent */
  --blue: #4d9cff;
  --blue-bg: rgba(50, 119, 210, 0.2);
  --blue-border: rgba(77, 156, 255, 0.5);

  /* Semantic */
  --green: #55d489;
  --green-bg: rgba(63, 185, 80, 0.15);
  --green-border: rgba(74, 208, 125, 0.4);
  --amber: #e8bd4a;
  --amber-bg: rgba(210, 153, 34, 0.16);
  --amber-border: rgba(227, 179, 65, 0.4);
  --red: #ff675f;
  --red-bg: rgba(248, 81, 73, 0.16);
  --red-border: rgba(255, 107, 97, 0.42);

  --violet: #c69cff;
  --violet-bg: rgba(126, 87, 194, 0.18);
  --violet-border: rgba(198, 156, 255, 0.38);

  --shadow: 0 1px 1px rgba(0, 0, 0, 0.48), 0 14px 34px rgba(0, 0, 0, 0.22);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  background-image: var(--bg-grad);
  background-attachment: fixed;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--blue);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: #8cc0ff;
  text-decoration: none;
}

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---- Top bar / navigation ------------------------------------------------ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid #26313d;
  background: rgba(9, 13, 18, 0.94);
  backdrop-filter: saturate(125%) blur(10px);
}

.topbar-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: min(1480px, calc(100% - 1.4rem));
  min-height: 52px;
  margin: 0 auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-width: max-content;
  color: var(--text);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 30px;
  border: 1px solid var(--blue-border);
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(77, 156, 255, 0.28), rgba(24, 43, 68, 0.82));
  color: #d8eaff;
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.brand-copy {
  display: grid;
  gap: 0;
  line-height: 1.05;
}

.brand-copy strong {
  font-size: 1.02rem;
  letter-spacing: 0.04em;
}

.brand-copy small {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  min-width: 0;
}

.nav a,
.button,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0.34rem 0.68rem;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.05s ease;
}

.nav a:hover,
.button:hover,
button:hover {
  background: var(--surface-hover);
  border-color: var(--line);
}

.button:active,
button:active {
  transform: translateY(1px);
}

.nav a.active {
  border-color: var(--blue-border);
  background: var(--blue-bg);
  color: #cfe2ff;
}

.button,
button {
  border-color: var(--blue-border);
  background: var(--blue-bg);
  color: #d7e7ff;
}

.locale-switch {
  display: flex;
  gap: 0.25rem;
  margin-left: auto;
}

.locale-switch a {
  display: grid;
  place-items: center;
  min-width: 30px;
  min-height: 28px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.locale-switch a:hover,
.locale-switch a.active {
  border-color: var(--line);
  background: var(--surface-soft);
  color: var(--text);
}

/* ---- Admin nav ----------------------------------------------------------- */
.admin-nav {
  display: flex;
  align-items: stretch;
  gap: 0.55rem;
  margin: 0 0 1rem;
  padding: 0.55rem;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #0f151c;
  box-shadow: var(--shadow);
}

.admin-nav-group {
  display: grid;
  align-content: start;
  gap: 0.25rem;
  min-width: max-content;
  padding-right: 0.55rem;
  border-right: 1px solid var(--line);
}

.admin-nav-group:last-child {
  border-right: 0;
}

.admin-nav-group > span {
  padding-left: 0.4rem;
  color: #667586;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.admin-nav-group > div {
  display: flex;
  gap: 0.25rem;
}

.admin-nav-account {
  margin-left: auto;
}

.admin-nav a,
.admin-nav button {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0.34rem 0.58rem;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 650;
}

.admin-nav a:hover,
.admin-nav button:hover {
  border-color: var(--line);
  background: var(--surface-hover);
  color: var(--text);
}

.admin-nav a.active {
  border-color: var(--blue-border);
  background: var(--blue-bg);
  color: #cfe2ff;
}

.admin-nav form,
.row-actions form,
.job-grid form {
  margin: 0;
}

.admin-surface .page {
  width: min(1480px, calc(100% - 2rem));
}

.admin-surface .panel,
.admin-surface .filters,
.admin-surface .metric {
  border-color: #303c4a;
}

.admin-surface .metric {
  position: relative;
  overflow: hidden;
}

.admin-surface .metric::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 2px;
  background: linear-gradient(90deg, var(--blue), transparent 75%);
}

.admin-kpi-grid .metric {
  min-height: 74px;
  background:
    linear-gradient(180deg, rgba(77, 156, 255, 0.06), transparent 70%),
    var(--surface-panel);
}

.admin-kpi-grid .metric strong {
  font-size: 1.55rem;
}

.admin-health-panel,
.admin-ml-panel {
  border-color: #38495e;
}

.admin-health-panel {
  background:
    linear-gradient(90deg, rgba(85, 212, 137, 0.07), transparent 32%),
    var(--surface-panel);
}

.admin-premium-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  background:
    linear-gradient(90deg, rgba(232, 189, 74, 0.08), transparent 36%),
    var(--surface-panel);
}

.admin-premium-panel h2,
.admin-premium-panel p {
  margin-bottom: 0.35rem;
}

.admin-premium-panel form {
  margin: 0;
}

.admin-ml-panel {
  background:
    linear-gradient(180deg, rgba(77, 156, 255, 0.07), transparent 210px),
    var(--surface-panel);
}

/* ---- Layout -------------------------------------------------------------- */
.page {
  width: min(1320px, calc(100% - 1.4rem));
  margin: 1.25rem auto 3rem;
}

.page-head,
.section-head,
.match-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.page-head {
  padding-bottom: 0.4rem;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0.25rem;
  font-size: 1.55rem;
  line-height: 1.2;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0.8rem;
  font-size: 1.12rem;
}

h3 {
  margin-bottom: 0.45rem;
  font-size: 0.95rem;
}

.muted {
  color: var(--muted);
}

/* ---- Entities / avatars -------------------------------------------------- */
.entity-inline,
.entity-title {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  vertical-align: middle;
}

.entity-title {
  display: flex;
}

.avatar {
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface-soft);
}

.avatar.logo {
  border-radius: 7px;
}

.avatar.small {
  width: 24px;
  height: 24px;
  font-size: 0.7rem;
}

.avatar.hero-logo {
  width: 58px;
  height: 58px;
  border-radius: 10px;
}

.avatar.fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
  text-transform: uppercase;
}

/* ---- Notices ------------------------------------------------------------- */
.notice {
  margin: 1rem 0;
  padding: 0.72rem 0.9rem;
  border: 1px solid var(--amber-border);
  border-left-width: 4px;
  border-radius: var(--radius);
  background: var(--amber-bg);
  color: #f0d08a;
}

.notice.danger {
  border-color: var(--red-border);
  background: var(--red-bg);
  color: #ffb3ad;
}

/* ---- Badges / pills ------------------------------------------------------ */
.badge,
.status-pill,
.coverage,
.status-text {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 650;
  white-space: nowrap;
}

.badge.production,
.status-pill.production,
.status-text.production,
.status-text.finished,
.status-text.ok,
.coverage.high,
.badge.won,
.badge.finished,
.badge.best-of-known {
  border-color: var(--green-border);
  background: var(--green-bg);
  color: var(--green);
}

.badge.experimental,
.badge.pending,
.badge.scheduled,
.badge.map-unknown,
.status-text.experimental,
.status-text.skipped,
.coverage.medium {
  border-color: var(--amber-border);
  background: var(--amber-bg);
  color: var(--amber);
}

.badge.lost,
.badge.failed,
.badge.void,
.status-text.failed,
.status-text.error,
.coverage.low {
  border-color: var(--red-border);
  background: var(--red-bg);
  color: var(--red);
}

.badge.live,
.badge.running,
.coverage.unknown {
  border-color: var(--blue-border);
  background: var(--blue-bg);
  color: var(--blue);
}

/* Pulsing live indicator for added emphasis. */
.badge.live {
  position: relative;
  padding-left: 1.1rem;
}

.badge.live::before {
  content: "";
  position: absolute;
  left: 0.5rem;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 0 rgba(255, 107, 97, 0.6);
  animation: csp-pulse 1.6s infinite;
}

/* "Will not be played" maps and other de-emphasised badges. */
.badge.muted {
  opacity: 0.7;
}

/* Donation wallet addresses: wrap long strings instead of overflowing. */
code.wallet {
  word-break: break-all;
}

@keyframes csp-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 107, 97, 0.55);
  }
  70% {
    box-shadow: 0 0 0 7px rgba(255, 107, 97, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 107, 97, 0);
  }
}

/* ---- Cards / metrics ----------------------------------------------------- */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
  margin: 1.1rem 0;
}

.metric,
.panel,
.match-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-panel);
  box-shadow: var(--shadow);
}

.metric {
  min-height: 84px;
  padding: 0.95rem;
}

.metric span,
.kv-grid span,
.summary-list dt {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
}

.metric strong {
  display: block;
  margin-top: 0.3rem;
  font-size: 1.7rem;
  letter-spacing: -0.02em;
}

.panel {
  margin: 1.1rem 0;
  padding: 1rem;
  overflow-x: auto;
}

.two-column {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.kv-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}

.summary-list {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) minmax(80px, 1fr);
  gap: 0.5rem 1rem;
  margin: 0;
}

.summary-list dd {
  margin: 0;
  font-weight: 650;
  overflow-wrap: anywhere;
}

/* ---- Filters / forms ----------------------------------------------------- */
.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 0.8rem;
  margin: 1.1rem 0;
  padding: 0.95rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-panel);
}

.stack-form {
  display: grid;
  gap: 0.8rem;
}

.login-panel {
  width: min(420px, 100%);
  margin: 4rem auto;
  padding: 1.4rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.filters label {
  display: grid;
  gap: 0.25rem;
  color: var(--muted);
  font-size: 0.84rem;
}

.filters .check {
  display: flex;
  align-items: center;
  min-height: 36px;
  color: var(--text);
}

/* ---- Tabs ---------------------------------------------------------------- */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 1.1rem 0;
}

.tabs a {
  padding: 0.5rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-panel);
  color: var(--muted);
  font-weight: 650;
}

.tabs a:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.tabs a.active {
  background: var(--blue-bg);
  color: #cfe2ff;
  border-color: var(--blue-border);
}

select,
input {
  min-height: 36px;
  max-width: 100%;
  padding: 0.4rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--text);
  font: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

select:focus,
input:focus {
  outline: none;
  border-color: var(--blue-border);
  box-shadow: 0 0 0 3px var(--blue-bg);
}

::placeholder {
  color: #5e6b7a;
}

/* ---- Tables -------------------------------------------------------------- */
table {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto;
}

th,
td {
  padding: 0.6rem 0.65rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}

th {
  position: sticky;
  top: 0;
  background: var(--surface-soft);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
}

tbody tr {
  transition: background 0.12s ease;
}

tbody tr:hover {
  background: var(--surface-hover);
}

tbody tr.map-live {
  background: color-mix(in srgb, var(--accent, #e23) 12%, transparent);
}

tbody tr.map-upcoming {
  opacity: 0.62;
}

pre,
code {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.82rem;
}

code {
  padding: 0.1rem 0.35rem;
  border-radius: 5px;
  background: var(--surface-soft);
  color: #d7e7ff;
}

pre {
  margin: 0.6rem 0 0;
  padding: 0.8rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0a0d12;
  color: #c9d6e3;
}

/* ---- Match cards --------------------------------------------------------- */
.match-list {
  display: grid;
  gap: 0.9rem;
}

.match-card {
  padding: 0.95rem 1rem;
  transition: border-color 0.15s ease, transform 0.08s ease;
}

.match-card:hover {
  border-color: var(--line-strong);
}

.right-meta {
  display: grid;
  justify-items: end;
  gap: 0.3rem;
  min-width: 170px;
  text-align: right;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.job-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.55rem;
}

.job-grid button,
.row-actions button {
  width: 100%;
}

.admin-job-groups {
  display: grid;
  gap: 1rem;
}

.admin-job-group {
  padding-top: 0.8rem;
  border-top: 1px solid var(--line);
}

.admin-job-group:first-child {
  padding-top: 0;
  border-top: 0;
}

.admin-job-group h3 {
  margin-bottom: 0.55rem;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.admin-job-group button {
  display: grid;
  justify-items: start;
  min-height: 64px;
  padding: 0.65rem 0.75rem;
  border-color: var(--line);
  background: var(--surface-soft);
  text-align: left;
}

.admin-job-group button:hover {
  border-color: var(--blue-border);
  background: var(--blue-bg);
}

.admin-job-group button span {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 450;
}

.ml-control-grid {
  margin: 0.5rem 0 0.9rem;
}

.ml-control-grid button {
  display: grid;
  justify-items: start;
  min-height: 62px;
  padding: 0.65rem 0.75rem;
  border-color: var(--line);
  background: var(--surface-soft);
  text-align: left;
}

.ml-control-grid button:hover {
  border-color: var(--blue-border);
  background: var(--blue-bg);
}

.ml-control-grid button span {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 450;
}

.admin-wide-action {
  margin-top: 0.65rem;
}

.admin-wide-action button {
  display: grid;
  justify-items: start;
  width: 100%;
  min-height: 54px;
  padding: 0.65rem 0.8rem;
  border-color: var(--blue-border);
  background: var(--blue-bg);
  text-align: left;
}

.admin-wide-action button span {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 450;
}

.quality-table td,
.quality-table th {
  white-space: nowrap;
}

.quality-table tr.featured-line td {
  background: var(--blue-bg);
}

.compact-list {
  margin: 0;
  padding-left: 1.1rem;
}

/* ---- Predictions --------------------------------------------------------- */
.prediction-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 0.8rem;
}

.prediction-block {
  min-height: 118px;
  padding-top: 0.8rem;
  border-top: 1px solid var(--line);
}

.signal {
  margin-bottom: 0.25rem;
  font-size: 1.02rem;
  font-weight: 650;
}

.model-line,
.reason {
  color: var(--muted);
  font-size: 0.86rem;
}

.round-totals {
  margin-top: 0.8rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--line);
}

.map-row {
  padding: 0.45rem 0;
}

.line-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(90px, 1fr));
  gap: 0.35rem 0.75rem;
  margin-top: 0.35rem;
}

.market-board {
  display: grid;
  grid-template-columns: minmax(250px, 1.15fr) minmax(210px, 0.85fr);
  gap: 0.85rem 1rem;
  margin-top: 0.8rem;
}

.market-board-compact {
  grid-template-columns: minmax(0, 1fr);
}

.market-board-compact .winner-market {
  max-width: 760px;
}

.market-section {
  min-width: 0;
  padding-top: 0.65rem;
  border-top: 1px solid var(--line);
}

.market-section-wide {
  grid-column: 1 / -1;
}

.market-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  min-height: 24px;
  margin-bottom: 0.45rem;
}

.market-section-head h3 {
  margin: 0;
  font-size: 0.88rem;
}

.market-section-head .muted {
  font-size: 0.74rem;
}

.winner-market-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 0.6rem;
  align-items: center;
}

.winner-side,
.winner-pick {
  display: grid;
  min-width: 0;
  gap: 0.15rem;
}

.winner-side span,
.winner-pick span {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.76rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.winner-side strong {
  color: var(--blue);
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
}

.winner-side.right {
  text-align: right;
}

.winner-side.right strong {
  color: #c59cff;
}

.winner-pick {
  min-width: 110px;
  padding: 0.35rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  text-align: center;
}

.winner-pick strong {
  overflow: hidden;
  font-size: 0.84rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.prob-bar.compact-line {
  height: 7px;
  margin-top: 0.55rem;
}

.market-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 0.28rem;
  font-size: 0.84rem;
  font-variant-numeric: tabular-nums;
}

.market-table th {
  padding: 0 0.4rem 0.12rem;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-align: center;
  text-transform: uppercase;
}

.market-table td {
  padding: 0.32rem 0.45rem;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
  text-align: center;
}

.market-table td:first-child {
  border-left: 1px solid var(--line);
  border-radius: 7px 0 0 7px;
}

.market-table td:last-child {
  border-right: 1px solid var(--line);
  border-radius: 0 7px 7px 0;
}

.market-line {
  color: var(--text);
  font-weight: 800;
}

.market-under {
  color: var(--amber);
  font-weight: 800;
}

.market-over {
  color: var(--green);
  font-weight: 800;
}

.market-table tr.featured-line td {
  border-color: var(--blue-border);
  background: var(--blue-bg);
}

/* Over/Under probability bars (replace the text-only market-table on the
   public prediction board). Each line shows its threshold, a horizontal bar
   sized by P(over) and the over percentage, so a glance beats reading numbers. */
.ou-bar-list {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.ou-bar-list.compact {
  gap: 0.22rem;
}

.ou-bar-legend {
  display: grid;
  grid-template-columns: 34px 1fr 44px;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.1rem;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.ou-bar-legend span:last-child {
  text-align: right;
}

.ou-bar-row {
  display: grid;
  grid-template-columns: 34px 1fr 44px;
  gap: 0.5rem;
  align-items: center;
  font-variant-numeric: tabular-nums;
}

.ou-bar-line {
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 800;
  text-align: center;
}

.ou-bar-track {
  position: relative;
  display: block;
  width: 100%;
  height: 14px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface-soft);
}

.ou-bar-list.compact .ou-bar-track {
  height: 11px;
}

.ou-bar-fill {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #2f9e6b, var(--green));
  transition: width 0.4s ease;
}

.ou-bar-over {
  color: var(--green);
  font-size: 0.82rem;
  font-weight: 800;
  text-align: right;
}

.ou-bar-row.featured-line .ou-bar-track {
  border-color: var(--blue-border);
  background: var(--blue-bg);
}

.ou-bar-row.featured-line .ou-bar-line {
  color: var(--blue);
}

.ou-bar-row.featured-line .ou-bar-fill {
  background: linear-gradient(90deg, #3f7fd8, var(--blue));
}

/* Confidence pill: tiered (high/medium/low) read of how decisive the pick is. */
.confidence-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.2rem;
  padding: 0.1rem 0.4rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.confidence-dots {
  display: inline-flex;
  gap: 2px;
}

.confidence-dots i {
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: var(--line-strong);
}

.confidence-dots i.on {
  background: currentColor;
}

.confidence-pill.confidence-high {
  border-color: var(--green-border);
  background: var(--green-bg);
  color: var(--green);
}

.confidence-pill.confidence-medium {
  border-color: var(--amber-border);
  background: var(--amber-bg);
  color: var(--amber);
}

.confidence-pill.confidence-low {
  color: var(--muted);
}

.round-market-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 0.7rem;
}

.round-market {
  min-width: 0;
}

.round-market header {
  display: flex;
  justify-content: space-between;
  gap: 0.55rem;
  margin-bottom: 0.25rem;
}

.round-market header strong,
.round-market header span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.round-market header strong {
  font-size: 0.78rem;
  text-transform: uppercase;
}

.prediction-audit {
  background: #0f151c;
}

.audit-market-list {
  display: grid;
  gap: 0.55rem;
}

.audit-market {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.audit-market summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
  min-height: 42px;
  padding: 0.6rem 0.75rem;
  cursor: pointer;
  list-style: none;
}

.audit-market summary::-webkit-details-marker {
  display: none;
}

.audit-market summary span {
  overflow: hidden;
  color: var(--text);
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.audit-market summary strong {
  display: grid;
  place-items: center;
  min-width: 32px;
  min-height: 24px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 0.76rem;
}

.audit-market[open] summary {
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
}

.audit-table {
  min-width: 920px;
}

.audit-table code {
  color: #bcd7f8;
}

.audit-hint {
  margin: 0.75rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.table-scroll {
  overflow-x: auto;
}

/* ---- Quick links / summaries -------------------------------------------- */
.quick-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin-top: 1rem;
}

.quick-links a {
  padding: 0.55rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.quick-links a:hover {
  background: var(--surface-hover);
  border-color: var(--line-strong);
}

.run-summary {
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--line);
}

.metrics-row td {
  padding-top: 0;
  background: var(--surface-soft);
}

/* ---- Public match center ------------------------------------------------ */
.eyebrow {
  margin: 0 0 0.3rem;
  color: var(--blue);
  font-size: 0.73rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.button.secondary {
  border-color: var(--line);
  background: var(--surface);
  color: var(--text);
}

.compact-filters {
  padding: 0.75rem;
}

.empty-state {
  margin: 1rem 0;
  padding: 2.2rem 1rem;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: rgba(19, 25, 34, 0.65);
  text-align: center;
}

.schedule {
  display: grid;
  gap: 1.1rem;
}

.schedule-group {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.day-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 42px;
  padding: 0.55rem 0.9rem;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
}

.day-heading h2 {
  margin: 0;
  font-size: 0.94rem;
}

.day-heading span {
  color: var(--muted);
  font-size: 0.78rem;
}

.match-row {
  position: relative;
  display: grid;
  grid-template-columns: 90px minmax(360px, 1fr) minmax(210px, 0.65fr) 18px;
  align-items: center;
  gap: 1rem;
  min-height: 92px;
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  transition: background 0.16s ease, border-color 0.16s ease;
}

.match-row:last-child {
  border-bottom: 0;
}

.match-row:hover {
  background: var(--surface-hover);
  color: var(--text);
}

/* Live rows get a left accent stripe + tint so they pop in a long schedule,
   mirroring the .map-card.is-live treatment rather than relying only on the
   pulsing badge. */
.match-row.is-live {
  background: color-mix(in srgb, var(--red) 8%, var(--surface));
  box-shadow: inset 3px 0 0 var(--red);
}

.match-row.is-live:hover {
  background: color-mix(in srgb, var(--red) 12%, var(--surface-hover));
}

.match-time {
  display: grid;
  justify-items: center;
  gap: 0.2rem;
  padding-right: 0.8rem;
  border-right: 1px solid var(--line);
}

.match-time strong {
  font-size: 1.08rem;
  font-variant-numeric: tabular-nums;
}

.match-teams {
  position: relative;
  display: grid;
  grid-template-columns: minmax(120px, 1fr) 54px minmax(120px, 1fr);
  align-items: center;
  gap: 0.75rem;
  padding-bottom: 13px;
}

.match-team {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.65rem;
  min-width: 0;
}

.match-team.reverse {
  justify-content: flex-start;
}

.team-name {
  overflow: hidden;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.match-score {
  display: grid;
  place-items: center;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0c1118;
  font-variant-numeric: tabular-nums;
}

.match-context {
  display: grid;
  gap: 0.2rem;
  min-width: 0;
}

.match-context > strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.match-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.2rem;
}

.row-chevron {
  color: var(--muted);
  font-size: 1.5rem;
}

.badge.featured {
  border-color: rgba(187, 128, 255, 0.45);
  background: rgba(139, 92, 246, 0.16);
  color: #cdb2ff;
}

.prob-bar {
  display: flex;
  width: 100%;
  height: 10px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface-soft);
}

/* Inline probability row on match cards: a small % label on each side of a
   taller bar, so the prediction is legible at a glance instead of a 5px sliver. */
.prob-row {
  display: grid;
  grid-template-columns: 34px 1fr 34px;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.35rem;
}

.prob-row-label {
  color: var(--muted);
  font-size: 0.68rem;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.prob-row-label.team-one {
  color: var(--blue);
  text-align: right;
}

.prob-row-label.team-two {
  color: #c59cff;
  text-align: left;
}

.prob-bar.compact {
  position: relative;
  height: 8px;
}

.prob-bar.large {
  height: 14px;
}

.prob-side.team-one {
  background: linear-gradient(90deg, #3478d4, var(--blue));
}

.prob-side.team-two {
  background: linear-gradient(90deg, #b765dc, #8b5cf6);
}

.prob-labels {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.45rem;
  font-size: 0.88rem;
}

.prob-labels.large {
  font-size: 1rem;
}

.prediction-card {
  overflow: hidden;
}

.market-page-head {
  align-items: center;
}

.market-summary-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin: 0.8rem 0 1rem;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0f151c;
}

.market-summary-strip span {
  min-width: 0;
  padding: 0.65rem 0.8rem;
  border-right: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.82rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.market-summary-strip span:last-child {
  border-right: 0;
}

.market-summary-strip strong {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.prediction-match-title {
  min-width: 0;
}

.prediction-versus {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  color: var(--text);
}

.prediction-team {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.prediction-team.reverse {
  flex-direction: row-reverse;
}

.versus-mark {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
}

/* ---- Home --------------------------------------------------------------- */
.home-head {
  align-items: center;
  margin-bottom: 0.9rem;
}

.home-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.55rem;
}

.home-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  align-items: start;
  gap: 1rem;
}

.home-main {
  min-width: 0;
}

.home-sidebar {
  position: sticky;
  top: 78px;
  display: grid;
  gap: 0.85rem;
  min-width: 0;
}

.side-panel {
  position: relative;
  padding: 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

/* A thin accent stripe on top of each sidebar panel gives the otherwise
   identical boxes a touch of hierarchy. */
.side-panel::before {
  position: absolute;
  top: 0;
  right: 0.9rem;
  left: 0.9rem;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--blue), #8b5cf6);
  content: "";
  opacity: 0.55;
}

.side-panel.home-scoreboard::before {
  background: linear-gradient(90deg, var(--green), var(--blue));
}

.section-head.compact {
  align-items: center;
  margin-bottom: 0.75rem;
}

.section-head.compact h2 {
  margin: 0;
  font-size: 0.98rem;
}

.score-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
}

.score-grid div {
  min-width: 0;
  padding: 0.15rem 0.55rem 0.15rem 0;
  border-right: 1px solid var(--line);
}

.score-grid div:last-child {
  border-right: 0;
}

.score-grid span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
}

.score-grid strong {
  display: block;
  margin-top: 0.1rem;
  font-size: 1.35rem;
  font-variant-numeric: tabular-nums;
}

.ranking-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ranking-list li {
  display: grid;
  grid-template-columns: 26px 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.55rem;
  min-height: 38px;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--line);
}

.ranking-list li:last-child {
  border-bottom: 0;
}

.ranking-list a {
  overflow: hidden;
  color: var(--text);
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ranking-list a:hover {
  color: #cfe2ff;
}

.ranking-list li > span:last-child {
  color: var(--muted);
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}

/* The HLTV official rank is an external signal distinct from the internal
   strength rating, so it gets its own chip colour. */
.rank-hltv {
  margin-left: auto;
  padding: 0.05rem 0.35rem;
  border: 1px solid var(--amber-border);
  border-radius: 999px;
  background: var(--amber-bg);
  color: var(--amber);
  font-size: 0.66rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.ranking-list .rating {
  min-width: 32px;
  text-align: right;
}

.rank-num {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.compact-summary {
  grid-template-columns: minmax(110px, 1fr) auto;
  gap: 0.4rem 0.75rem;
}

.latest-model-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
  font-size: 0.86rem;
}

.latest-model-line strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.section-block.first-block {
  margin-top: 0;
}

.hero-banner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  align-items: center;
  gap: 2rem;
  margin-bottom: 1.5rem;
  padding: clamp(1.4rem, 4vw, 2.6rem);
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background:
    radial-gradient(circle at 85% 10%, rgba(90, 162, 255, 0.2), transparent 35%),
    linear-gradient(145deg, #151e29, #10161e);
  box-shadow: var(--shadow);
}

.hero-banner h1 {
  max-width: 720px;
  font-size: clamp(1.8rem, 4vw, 3rem);
}

.hero-banner > div > p:not(.eyebrow) {
  max-width: 680px;
  color: var(--muted);
  font-size: 1.02rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.2rem;
}

.hero-status {
  display: grid;
  justify-items: center;
  gap: 0.25rem;
  padding: 1.2rem;
  border: 1px solid var(--blue-border);
  border-radius: 8px;
  background: rgba(8, 15, 24, 0.58);
  text-align: center;
}

.hero-status strong {
  font-size: 3rem;
  line-height: 1;
}

.hero-status > span:last-child {
  color: var(--muted);
  font-size: 0.82rem;
}

.hero-status-sub {
  margin-top: 0.4rem;
  padding-top: 0.4rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
}

.section-block {
  margin: 1.5rem 0;
}

.section-head h2 {
  margin: 0;
}

/* ---- Match detail ------------------------------------------------------- */
.match-hero,
.prediction-spotlight {
  margin-bottom: 1rem;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(30, 40, 52, 0.96), rgba(14, 20, 28, 0.98));
  box-shadow: var(--shadow);
}

.match-hero {
  overflow: hidden;
  padding: 0;
}

.match-hero-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0.95rem;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  background: rgba(8, 12, 18, 0.24);
}

.match-hero-scoreboard {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 138px minmax(180px, 1fr);
  align-items: center;
  gap: 1rem;
  padding: 1.45rem 1rem 1.1rem;
}

.hero-team {
  display: grid;
  justify-items: end;
  gap: 0.75rem;
  text-align: right;
}

.hero-team.reverse {
  justify-items: start;
  text-align: left;
}

.hero-team h1 {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hero-team h1 a {
  color: var(--text);
}

.hero-team h1 a:hover {
  color: #cfe2ff;
}

.hero-team-logo {
  display: grid;
  place-items: center;
  width: 66px;
  height: 66px;
  object-fit: contain;
}

.hero-team-logo.fallback {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 1.2rem;
  font-weight: 800;
}

.hero-score {
  display: grid;
  justify-items: center;
  gap: 0.35rem;
  text-align: center;
}

.hero-score strong {
  font-size: 2.2rem;
  font-variant-numeric: tabular-nums;
}

.hero-score span {
  color: var(--muted);
  font-size: 0.82rem;
}

.admin-match-actions {
  justify-content: center;
  padding: 0.8rem 0.95rem 0.95rem;
  border-top: 1px solid var(--line);
}

.match-hero-strip {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(110px, auto));
  gap: 0;
  border-top: 1px solid var(--line);
  background: rgba(9, 13, 18, 0.42);
}

.match-hero-strip span {
  min-width: 0;
  padding: 0.55rem 0.75rem;
  border-right: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.match-hero-strip span:last-child {
  border-right: 0;
}

.prediction-spotlight {
  padding: 1rem;
}

/* On the match page the prediction is the reason the page exists, so the
   winner market inside the spotlight gets a hero-sized probability bar and a
   larger model pick instead of the compact list treatment. */
.prediction-spotlight .winner-market-row {
  gap: 0.9rem;
}

.prediction-spotlight .winner-side strong {
  font-size: 1.25rem;
}

.prediction-spotlight .winner-pick {
  min-width: 140px;
  padding: 0.55rem 0.8rem;
}

.prediction-spotlight .winner-pick strong {
  font-size: 1rem;
}

.prediction-spotlight .prob-bar.compact-line {
  height: 14px;
  margin-top: 0.7rem;
}

.prediction-spotlight .confidence-pill {
  font-size: 0.7rem;
}

.compact-notice {
  margin: 0.8rem 0;
  padding-block: 0.55rem;
  font-size: 0.84rem;
}

.match-subnav {
  position: sticky;
  top: 53px;
  z-index: 8;
  display: flex;
  gap: 0.35rem;
  margin: 0 0 1rem;
  padding: 0.5rem;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(16, 22, 30, 0.94);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.match-subnav a {
  flex: 0 0 auto;
  padding: 0.35rem 0.65rem;
  border-radius: 7px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.match-subnav a:hover {
  background: var(--blue-bg);
  color: #cfe2ff;
}

.match-section {
  scroll-margin-top: 120px;
  margin-block: 1.35rem;
}

.team-insight-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.team-insight-card {
  min-width: 0;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(145deg, var(--surface), rgba(19, 25, 34, 0.72));
  box-shadow: var(--shadow);
}

.team-insight-card > header {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 0.9rem;
}

.team-insight-card h3 {
  margin: 0;
}

.scope-toggle {
  display: inline-flex;
  gap: 0.2rem;
  margin-top: 0.35rem;
  padding: 0.15rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(8, 15, 24, 0.42);
}

.scope-btn {
  border: 0;
  background: transparent;
  color: var(--muted, #9aa6b2);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  cursor: pointer;
}

.scope-btn:hover {
  color: var(--text, #e8eef4);
}

.scope-btn.active {
  background: var(--accent, #2f6fed);
  color: #fff;
}

.scope-body[hidden] {
  display: none;
}

.team-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
}

.team-stat-grid > div {
  padding: 0.65rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(8, 15, 24, 0.42);
}

.team-stat-grid span,
.team-stat-grid strong {
  display: block;
}

.team-stat-grid span {
  color: var(--muted);
  font-size: 0.75rem;
}

.team-stat-grid strong {
  margin-top: 0.15rem;
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
}

.form-strip {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.8rem;
  overflow-x: auto;
}

.form-result {
  display: grid;
  grid-template-columns: 24px minmax(70px, 1fr) auto;
  align-items: center;
  gap: 0.35rem;
  min-width: 145px;
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
  color: var(--text);
  font-size: 0.76rem;
}

.form-result strong {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
}

.form-result span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.form-result.win strong {
  background: var(--green-bg);
  color: var(--green);
}

.form-result.loss strong {
  background: var(--red-bg);
  color: var(--red);
}

.form-result.draw strong,
.form-result.unknown strong {
  background: var(--amber-bg);
  color: var(--amber);
}

.player-stats-grid .panel {
  margin: 0;
}

.player-stats-card h3 {
  margin-top: 0;
}

.stats-table td:not(:first-child),
.stats-table th:not(:first-child) {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.player-tournament-table {
  min-width: 440px;
}

.prediction-table {
  min-width: 900px;
}

.stat-diff.positive {
  color: var(--green);
}

.stat-diff.negative {
  color: var(--red);
}

.h2h-score {
  display: grid;
  grid-template-columns: auto minmax(100px, 1fr) auto;
  align-items: center;
  gap: 0.65rem;
  min-width: 260px;
  text-align: center;
}

.h2h-score strong {
  font-size: 1.5rem;
  color: var(--blue);
}

.h2h-score span {
  color: var(--muted);
  font-size: 0.78rem;
}

.history-list {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.history-row {
  display: grid;
  grid-template-columns: 150px minmax(240px, 1fr) minmax(160px, 0.7fr);
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--line);
  color: var(--text);
}

.history-row:last-child {
  border-bottom: 0;
}

.history-row:hover {
  background: var(--surface-hover);
}

.history-row > span:last-child {
  color: var(--muted);
  text-align: right;
}

/* ---- Footer -------------------------------------------------------------- */
.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem;
  width: min(1280px, calc(100% - 2rem));
  margin: 0 auto 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.84rem;
}

/* ---- Responsive ---------------------------------------------------------- */
@media (max-width: 900px) {
  .admin-nav {
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    overflow-x: auto;
  }

  .admin-nav-group {
    flex: 0 0 auto;
  }

  .admin-nav-account {
    justify-self: auto;
  }

  .metric-grid,
  .kv-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .two-column,
  .prediction-columns,
  .market-board,
  .team-insight-grid,
  .home-layout {
    grid-template-columns: 1fr;
  }

  .market-section-wide {
    grid-column: auto;
  }

  .home-sidebar {
    position: static;
  }

  .market-summary-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .market-summary-strip span:nth-child(2) {
    border-right: 0;
  }

  .market-summary-strip span:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .match-hero-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .match-hero-strip span:nth-child(2) {
    border-right: 0;
  }

  .match-hero-strip span:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .match-row {
    grid-template-columns: 72px minmax(0, 1fr) 18px;
  }

  .match-context {
    grid-column: 2;
    padding-top: 0.5rem;
    border-top: 1px solid var(--line);
  }

  .row-chevron {
    grid-column: 3;
    grid-row: 1 / span 2;
  }

  .history-row {
    grid-template-columns: 1fr;
    gap: 0.2rem;
  }

  .history-row > span:last-child {
    text-align: left;
  }
}

@media (max-width: 640px) {
  .topbar-inner {
    align-items: stretch;
    flex-direction: column;
    gap: 0.6rem;
    padding: 0.55rem 0;
  }

  .locale-switch {
    margin-left: 0;
  }

  .page-head,
  .match-head,
  .home-head {
    align-items: stretch;
    flex-direction: column;
  }

  .home-actions {
    justify-content: flex-start;
  }

  .page {
    width: min(100% - 1rem, 1280px);
  }

  .metric-grid,
  .kv-grid,
  .line-grid {
    grid-template-columns: 1fr;
  }

  .winner-market-row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .winner-pick {
    grid-column: 1 / -1;
    order: 3;
  }

  .right-meta {
    justify-items: start;
    min-width: 0;
    text-align: left;
  }

  .hero-banner {
    grid-template-columns: 1fr;
  }

  .hero-status {
    display: none;
  }

  .match-row {
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 0.55rem;
    padding: 0.65rem;
  }

  .match-time {
    padding-right: 0.45rem;
  }

  .match-teams {
    grid-template-columns: minmax(80px, 1fr) 40px minmax(80px, 1fr);
    gap: 0.35rem;
  }

  .match-team {
    gap: 0.3rem;
  }

  .match-team .avatar {
    width: 26px;
    height: 26px;
  }

  .team-name {
    font-size: 0.84rem;
  }

  .match-context {
    grid-column: 1 / -1;
  }

  .row-chevron {
    display: none;
  }

  .match-subnav {
    position: static;
  }

  .team-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .score-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .h2h-score {
    min-width: 0;
  }

  .match-hero-scoreboard {
    grid-template-columns: 1fr 76px 1fr;
    gap: 0.7rem;
    padding-inline: 0.65rem;
  }

  .hero-team-logo {
    width: 52px;
    height: 52px;
  }

  .hero-team h1 {
    font-size: 1rem;
  }

  .hero-score strong {
    font-size: 1.65rem;
  }

  .prediction-versus {
    align-items: flex-start;
    flex-direction: column;
  }

  .prediction-team.reverse {
    flex-direction: row;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---- Match map cards (series view) ------------------------------------- */
.series-total-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.9rem;
  padding: 0.7rem 0.95rem;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface-soft);
}

.map-card-grid {
  display: grid;
  gap: 0.8rem;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
}

.map-profile-list {
  display: grid;
  gap: 0.7rem;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  margin-bottom: 0.9rem;
}

.map-profile {
  min-width: 0;
  overflow-x: auto;
  padding-top: 0.65rem;
  border-top: 1px solid var(--line);
}

.map-profile header {
  margin-bottom: 0.35rem;
}

.map-profile-table {
  font-size: 0.78rem;
}

.map-profile-table th,
.map-profile-table td {
  padding: 0.4rem 0.45rem;
  white-space: nowrap;
}

.map-card {
  display: grid;
  gap: 0.6rem;
  padding: 0.85rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.map-card:hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.map-card.is-live {
  border-color: var(--blue-border);
  box-shadow: inset 0 0 0 1px var(--blue-border);
}

.map-card.is-upcoming {
  opacity: 0.9;
}

.map-card.is-skipped {
  opacity: 0.5;
}

.map-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.map-order {
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

.map-card-name {
  display: grid;
  gap: 0.15rem;
  min-height: 2.4rem;
}

.map-card-name strong {
  font-size: 1.05rem;
}

.map-card-name small {
  font-size: 0.74rem;
}

.map-card-score {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.5rem;
  font-size: 1.9rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.map-card-score em {
  font-style: normal;
  font-size: 1.15rem;
  color: var(--muted);
}

.map-card-total {
  display: grid;
  gap: 0.35rem;
  padding-top: 0.55rem;
  border-top: 1px solid var(--line);
}

.ou-pair {
  display: flex;
  gap: 0.4rem;
}

.ou {
  flex: 1;
  padding: 0.22rem 0.4rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.85rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.ou-pair.small .ou {
  font-size: 0.78rem;
}

.ou.over {
  color: var(--green);
  background: var(--green-bg);
  border-color: var(--green-border);
}

.ou.under {
  color: var(--amber);
  background: var(--amber-bg);
  border-color: var(--amber-border);
}

.summary-list.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.2rem 1.2rem;
}

/* Homepage match cards reuse the schedule .match-row inside a rounded card. */
.card-rows {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
  box-shadow: var(--shadow);
}

/* ---- Round timeline (GOTV demo history) ---- */
.round-map {
  margin-bottom: 1rem;
}

.round-map-title {
  margin: 0 0 0.45rem;
  font-size: 0.95rem;
}

.round-timeline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.round-chip {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  padding: 0.25rem 0.35rem;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface-soft);
  font-variant-numeric: tabular-nums;
  font-size: 0.72rem;
  cursor: pointer;
}

/* Side colours: T = amber, CT = blue — the CS side conventions. */
.round-chip.side-t {
  border-color: var(--amber-border);
  background: var(--amber-bg);
  color: var(--amber);
}

.round-chip.side-ct {
  border-color: var(--blue-border);
  background: var(--blue-bg);
  color: var(--blue);
}

.round-chip-num {
  font-weight: 800;
  color: var(--text);
}

.round-chip-score {
  color: var(--muted);
  font-size: 0.66rem;
}

.round-chip.type-pistol {
  box-shadow: inset 0 -2px 0 var(--green);
}

/* Expandable player breakdown. */
.round-chip-detail {
  position: absolute;
  top: 100%;
  left: 50%;
  z-index: 5;
  transform: translateX(-50%);
}

.round-chip-detail summary {
  list-style: none;
  cursor: pointer;
}

.round-chip-detail summary::-webkit-details-marker {
  display: none;
}

.round-chip-detail[open] .round-players {
  position: absolute;
  top: 4px;
  left: 50%;
  transform: translateX(-50%);
  min-width: 180px;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface-panel);
  box-shadow: var(--shadow);
}

.round-players ul {
  margin: 0.35rem 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.76rem;
}

.round-players li {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

/* ---- Map veto (pick / ban / decider) ---- */
.veto-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.4rem;
}

.veto-step {
  display: grid;
  grid-template-columns: 28px 1fr auto auto;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--line);
  border-left-width: 3px;
  border-radius: 8px;
  background: var(--surface-soft);
  font-size: 0.92rem;
}

.veto-step .veto-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--line-strong);
  color: var(--muted);
  font-weight: 700;
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
}

.veto-step .veto-team {
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.veto-step .veto-action {
  color: var(--muted);
  font-size: 0.85rem;
  text-transform: lowercase;
}

.veto-step .veto-map {
  font-weight: 700;
  padding: 0.12rem 0.5rem;
  border-radius: 6px;
  font-variant-numeric: tabular-nums;
}

.veto-step.action-pick {
  border-left-color: var(--green);
}
.veto-step.action-pick .veto-map {
  color: var(--green);
  background: var(--green-bg);
}

.veto-step.action-ban {
  border-left-color: var(--red);
}
.veto-step.action-ban .veto-map {
  color: var(--red);
  background: var(--red-bg);
  text-decoration: line-through;
  text-decoration-color: var(--red-border);
}

.veto-step.action-leftover {
  border-left-color: var(--amber);
}
.veto-step.action-leftover .veto-map {
  color: var(--amber);
  background: var(--amber-bg);
}

@media (max-width: 560px) {
  .veto-step {
    grid-template-columns: 26px 1fr auto;
    grid-template-areas:
      "num team map"
      "num action map";
  }
  .veto-step .veto-num {
    grid-area: num;
  }
  .veto-step .veto-team {
    grid-area: team;
  }
  .veto-step .veto-action {
    grid-area: action;
  }
  .veto-step .veto-map {
    grid-area: map;
    align-self: center;
  }
}

/* ---- Prediction stats page ---- */
.stats-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.7rem;
  margin: 1rem 0;
}

.stats-filters label {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.78rem;
  color: var(--muted, #9aa6b2);
}

.stats-filters select,
.stats-filters input {
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(8, 15, 24, 0.5);
  color: var(--text, #e8eef4);
  min-width: 7rem;
}

.stats-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.7rem;
  margin: 1rem 0;
}

.stat-tile {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.9rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(8, 15, 24, 0.42);
}

.stat-tile span {
  font-size: 0.78rem;
  color: var(--muted, #9aa6b2);
}

.stat-tile strong {
  font-size: 1.5rem;
}

.pagination {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
}

.pagination a {
  padding: 0.35rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 8px;
}
