html { box-sizing: border-box; }
*, *::before, *::after { box-sizing: inherit; }
:root {
  --bg: #f0ede6;
  --surface: #ffffff;
  --surface-alt: #faf9f7;
  --border: #d8d4cc;
  --border-light: #e8e4dc;
  --text: #1a1916;
  --text-muted: #6b6860;
  --text-faint: #9e9b93;
  --accent: #1a3a2a;
  --accent-mid: #2d5c42;
  --gold: #9a7009;
  --gold-light: #fdf6e3;
  --gold-border: #d4b040;
  --gold-header: #7a5200;
  --win: #1a3a2a;
  --loss: #8a8680;
  --live-pill: #7dffb3;
  --sub-yes: #1a7a40;
  --sub-no: #b83030;
  --round-link-bg: #ffffff;
  --round-link-hover: #e8f0eb;
  --mono: 'DM Mono', monospace;
  --sans: 'DM Sans', sans-serif;
  /* Stats (and similar) page title band: explicit tokens so it never picks up --surface or body text */
  --stats-header-bg: #1a3a2a;
  --stats-header-text: #f8f7f4;
  --stats-header-muted: rgba(248, 247, 244, 0.82);
  --stats-header-link: rgba(248, 247, 244, 0.95);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1a14;
    --surface: #1a2820;
    --surface-alt: #162219;
    --border: #2a4035;
    --border-light: #213328;
    --text: #e8e4dc;
    --text-muted: #94a89e;
    --text-faint: #5a7060;
    --accent: #0d2018;
    --accent-mid: #3a7a56;
    --gold: #c8980a;
    --gold-light: #1c1600;
    --gold-border: #5a4400;
    --gold-header: #4a3000;
    --win: #5aaa7a;
    --loss: #6a6860;
    --live-pill: #3ddf83;
    --sub-yes: #3aaa60;
    --sub-no: #cc4444;
    --round-link-bg: #1a2820;
    --round-link-hover: #213328;
    --stats-header-bg: #1e3d2f;
    --stats-header-text: #f2f6f3;
    --stats-header-muted: rgba(242, 246, 243, 0.85);
    --stats-header-link: #ffffff;
  }
}
body { font-family: var(--sans); background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.55; min-height: 100vh; }

/* Bootstrap .jumbotron defaults to #e9ecef; tie it to theme surfaces so dark mode works */
.ddhp-container .jumbotron {
  background-color: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 4px;
}
.ddhp-container .jumbotron h1,
.ddhp-container .jumbotron h2,
.ddhp-container .jumbotron h3 {
  color: inherit;
}

/* Do not use `nav.ddhp-nav a { color: inherit }` — it beats .nav-brand / .nav-links and pulls in body --text (dark on green). */
.ddhp-container a, footer.ddhp-footer a { color: inherit; text-decoration: none; }
.ddhp-container a:hover, footer.ddhp-footer a:hover { text-decoration: underline; }

nav.ddhp-nav { background: var(--accent); padding: 0 28px; display: flex; align-items: center; justify-content: space-between; height: 64px; }
nav.ddhp-nav a { text-decoration: none; }
.nav-brand { font-family: var(--sans); font-size: 22px; font-weight: 500; color: #fff; letter-spacing: -0.01em; }
.nav-brand:hover { color: #fff; text-decoration: none; }
.nav-links { display: flex; gap: 24px; list-style: none; margin: 0; padding: 0; align-items: center; }
.nav-links a { font-size: 14px; color: rgba(255,255,255,0.65); }
.nav-links a:hover { color: #fff; text-decoration: none; }

.hero {
  background: var(--accent);
  border-bottom: 3px solid #0d2318;
  padding: 20px 28px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 20px;
}
.hero-text { text-align: center; }
.hero-season { font-family: var(--mono); font-size: 13px; letter-spacing: 0.1em; color: rgba(255,255,255,0.5); margin-bottom: 4px; }
.hero-round { font-family: var(--mono); font-size: 26px; font-weight: 500; color: #fff; letter-spacing: 0.02em; }
.pixel-art { image-rendering: pixelated; image-rendering: crisp-edges; display: block; }
.hero-football { width: 80px; height: 96px; display: flex; align-items: center; justify-content: center; font-size: 52px; line-height: 1; }

.ddhp-container { max-width: 1200px; margin: 0 auto; padding: 28px 24px 64px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
.full-col { grid-column: 1 / -1; }
@media (max-width: 800px) { .two-col { grid-template-columns: 1fr; } .full-col { grid-column: 1; } }

.section-label { font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 8px; font-weight: 500; }

.block-header { background: var(--accent); padding: 9px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.block-header a, .block-header span { font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em; color: rgba(255,255,255,0.88); text-transform: uppercase; }
.block-header a:hover { text-decoration: underline; }

.block-header.in-progress { background: #1e4a30; }
.block-header.in-progress::after {
  content: 'live';
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--live-pill);
  border: 1px solid rgba(125,255,179,0.4);
  border-radius: 3px;
  padding: 2px 7px;
  margin-left: auto;
}

.results-block { background: var(--surface); border: 1px solid var(--border); border-radius: 4px; margin-bottom: 20px; overflow: hidden; }
.results-block .fixture:nth-child(even) { background: var(--surface-alt); }
.fixture { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 9px 16px; border-bottom: 1px solid var(--border-light); gap: 10px; }
.results-block .fixture:last-child { border-bottom: none; }
.team-name { font-family: var(--mono); font-size: 13px; }
.team-name.right { text-align: right; }
.score-pair { display: flex; align-items: center; gap: 7px; justify-content: center; }
.score { font-family: var(--mono); font-size: 16px; font-weight: 500; min-width: 36px; text-align: center; }
.score.win { color: var(--win); }
.score.loss { color: var(--loss); }
.score-sep { font-family: var(--mono); font-size: 11px; color: var(--text-faint); }

.ladder-block { background: var(--surface); border: 1px solid var(--border); border-radius: 4px; margin-bottom: 20px; overflow: hidden; }
table.ladder { width: 100%; border-collapse: collapse; }
table.ladder th { font-family: var(--mono); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); font-weight: 500; padding: 7px 16px; text-align: right; border-bottom: 1px solid var(--border-light); background: var(--surface-alt); }
table.ladder th.left { text-align: left; }
table.ladder td { padding: 8px 16px; text-align: right; border-bottom: 1px solid var(--border-light); font-family: var(--mono); font-size: 13px; color: var(--text-muted); }
table.ladder td.pos-cell { font-size: 11px; color: var(--text-faint); text-align: right; width: 28px; padding-right: 6px; }
table.ladder td.trophy-cell { font-size: 11px; letter-spacing: -2px; text-align: left; padding-left: 0; min-width: 52px; }
table.ladder td.team-cell { text-align: left; font-family: var(--mono); font-size: 13px; color: var(--text); }
table.ladder td.team-cell a { color: var(--text); }
table.ladder td.team-cell a:hover { text-decoration: underline; }
table.ladder tr:last-child td { border-bottom: none; }
table.ladder tbody tr:nth-child(even) td { background: var(--surface-alt); }
.pct-win { color: var(--win); font-weight: 500; }
.pct-loss { color: var(--loss); }

.submissions-block { background: var(--surface); border: 1px solid var(--border); border-radius: 4px; overflow: hidden; }
.submissions-grid { display: grid; grid-template-columns: repeat(2, 1fr); }
.submission-item { display: flex; align-items: center; justify-content: space-between; padding: 9px 16px; border-bottom: 1px solid var(--border-light); border-right: 1px solid var(--border-light); font-family: var(--mono); font-size: 12px; }
.submission-item:nth-child(2n) { border-right: none; }
.submission-item:nth-last-child(-n+2) { border-bottom: none; }
.sub-yes { color: var(--sub-yes); font-size: 22px; line-height: 1; }
.sub-no { color: var(--sub-no); font-size: 22px; line-height: 1; }

.round-report-block { background: var(--surface); border: 1px solid var(--border); border-radius: 4px; padding: 14px 16px; margin-bottom: 20px; }
.round-report-text { font-family: var(--mono); font-size: 13px; line-height: 1.55; color: var(--text-muted); margin: 0; white-space: pre-wrap; }

.skm-block { background: var(--gold-light); border: 1px solid var(--gold-border); border-radius: 4px; overflow: hidden; }
.skm-header { background: var(--gold-header); padding: 9px 16px; display: flex; align-items: center; justify-content: space-between; }
.skm-title { font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em; color: rgba(255,255,255,0.92); text-transform: uppercase; }
.skm-after { font-family: var(--mono); font-size: 11px; color: rgba(255,255,255,0.5); }
.skm-row { display: flex; align-items: center; padding: 9px 16px; border-bottom: 1px solid var(--gold-border); gap: 12px; }
.skm-row:last-child { border-bottom: none; }
.skm-body .skm-row:nth-child(even) { background: var(--gold-light); }
.skm-rank { font-family: var(--mono); font-size: 12px; color: var(--gold); width: 20px; text-align: right; flex-shrink: 0; }
.skm-player { font-family: var(--mono); font-size: 13px; flex: 1.5; color: var(--text); }
.skm-team { font-family: var(--mono); font-size: 12px; color: var(--text-muted); flex: 1; }
.skm-votes { font-family: var(--mono); font-size: 15px; font-weight: 500; color: var(--gold); min-width: 40px; text-align: right; }
.skm-votes-unit { font-size: 10px; color: var(--gold); opacity: 0.6; margin-left: 2px; }

.round-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; flex-wrap: wrap; gap: 12px; }
.round-link { font-family: var(--mono); font-size: 12px; color: var(--text-muted); border: 1px solid var(--border); padding: 6px 14px; border-radius: 3px; background: var(--round-link-bg); display: inline-block; }
.round-link:hover { color: var(--text); text-decoration: none; background: var(--round-link-hover); }

footer.ddhp-footer { padding: 20px 28px; border-top: 1px solid var(--border); margin-top: 8px; font-family: var(--mono); font-size: 11px; color: var(--text-faint); }

/* Detailed round results + Stats: themed tables (inherits dark mode via :root) */
.stats-detail-page { margin-bottom: 2rem; }
.stats-page-title {
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--text);
  margin: 0 0 16px;
}
.stats-table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
}

/* Higher specificity + background-color avoids shorthand conflicts */
.ddhp-container .stats-page-header {
  background-color: var(--stats-header-bg);
  color: var(--stats-header-text);
  padding: 20px 24px;
  border-radius: 4px;
  margin-bottom: 24px;
  border: 1px solid var(--border);
}
.ddhp-container .stats-page-header h1 {
  font-family: var(--sans);
  font-size: 1.75rem;
  font-weight: 500;
  margin: 0 0 6px;
  letter-spacing: -0.02em;
  color: var(--stats-header-text);
}
.ddhp-container .stats-page-header .stats-page-season {
  font-family: var(--mono);
  font-size: 14px;
  margin: 0 0 12px;
  font-weight: 400;
  color: var(--stats-header-muted);
}
.ddhp-container .stats-page-header .stats-page-actions {
  margin: 0;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--stats-header-text);
}
.ddhp-container .stats-page-header .stats-page-actions a {
  color: var(--stats-header-link);
  text-decoration: underline;
}
.ddhp-container .stats-page-header .stats-page-actions a:hover {
  color: var(--stats-header-text);
  text-decoration: underline;
}

.stats-layout { margin-bottom: 2rem; }
.stats-layout .stats-table-scroll {
  margin-top: 0;
}

table.stats {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text);
  border-collapse: collapse;
  border-spacing: 0;
  width: 100%;
  background: var(--surface);
}
table.stats td,
table.stats th {
  border: 1px solid var(--border);
  padding: 6px 8px;
  vertical-align: middle;
}
table.stats th {
  background: var(--surface-alt);
  color: var(--text-muted);
  font-weight: 500;
  font-size: 11px;
}
table.stats th.roundHeader {
  font-family: var(--mono);
  text-align: center;
}
table.stats tr.rounds th {
  font-size: 10px;
  letter-spacing: 0.04em;
}
table.stats .first,
table.stats th.first {
  border-left: 2px solid var(--accent-mid);
}
.ddhp-container table.stats th a {
  color: var(--accent-mid);
  text-decoration: underline;
}
.ddhp-container table.stats th a:hover {
  color: var(--text);
}

/* Detailed round only: team score row + column headers per fixture (Stats has no th in tbody) */
.stats-detail-page table.stats tbody > tr:first-child th {
  background: var(--accent);
  color: rgba(255, 255, 255, 0.95);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  border-color: var(--border);
}
.stats-detail-page table.stats tbody > tr:nth-child(2) th {
  background: var(--surface-alt);
  color: var(--text-muted);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.stats-detail-page table.stats tbody tr:nth-child(n+3):nth-child(odd) td {
  background: var(--surface-alt);
}
.stats-detail-page table.stats tbody tr:nth-child(n+3) td {
  color: var(--text-muted);
}
.stats-detail-page table.stats tbody tr:nth-child(n+3) td:nth-child(2),
.stats-detail-page table.stats tbody tr:nth-child(n+3) td:nth-child(9) {
  color: var(--text);
}

/* Stats grid: zebra by data row */
table.stats > tbody > tr:nth-child(even) {
  background: var(--surface-alt);
}
table.stats > tbody > tr:nth-child(even) td {
  background: transparent;
}
table.stats > tbody > tr:hover td {
  background: var(--round-link-hover);
}

table.stats td.numbers,
table.stats th.numbers {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
