@import url('https://fonts.googleapis.com/css2?family=Barlow:ital,wght@0,400;0,500;0,600;0,700;1,500&family=Barlow+Condensed:wght@500;600;700&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

:root {
  --bg: #ffffff;
  --paper: #ffffff;
  --row-alt: #e6ebf0;
  --surface: #dde4ea;
  --surface-line: #c9d3db;
  --ink: #171b20;
  --ink-soft: rgba(23, 27, 32, .64);
  --ink-faint: rgba(23, 27, 32, .42);
  --line: rgba(23, 27, 32, .14);
  --line-strong: rgba(23, 27, 32, .30);

  --accent: #35608c;
  --accent-deep: #16283a;
  --accent-soft: #dce8f2;
  --accent-2: #5980a6;
  --accent-3: #749dc4;
  --accent-4: #94bce3;
  --accent-5: #b5d9fd;

  --gold: #a1731f;
  --gold-deep: #6e4d13;
  --gold-soft: #f4e8d2;

  --font-display: "Barlow Condensed", system-ui, sans-serif;
  --font-body: "Barlow", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;

  --space-1: 4px;
  --space-2: 7px;
  --space-3: 10px;
  --space-4: 14px;
  --space-6: 20px;
  --space-8: 27px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
}

main {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 24px 64px;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin: 0 0 var(--space-2);
}
h2 { font-size: 30px; }
h3 { font-size: 21px; margin-top: var(--space-6); }

p { margin: 0 0 var(--space-3); }

a {
  color: var(--accent-deep);
  text-underline-offset: 3px;
}
a:hover { color: var(--accent); }

:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* — header / nav — */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
  padding: 14px 24px;
  max-width: 860px;
  margin: 0 auto;
  background: var(--paper);
}

.site-header__left {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  flex-wrap: wrap;
}

.site-logo {
  display: flex;
  align-items: center;
}
.site-logo svg {
  height: 76px;
  width: auto;
  display: block;
}

.tab-switch {
  display: flex;
  background: var(--surface);
  padding: 3px;
  gap: 2px;
}
.tab-switch__cell {
  padding: 8px 16px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 13.5px;
  color: var(--ink-soft);
  text-decoration: none;
}
.tab-switch__cell:hover:not(.active) { color: var(--ink); }
.tab-switch__cell.active {
  background: var(--accent-deep);
  color: #fff;
}

.season-switch {
  display: flex;
  gap: var(--space-3);
}
.season-switch__cell {
  padding: 4px 2px;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 12px;
  color: var(--ink-faint);
  text-decoration: none;
}
.season-switch__cell:hover:not(.active) { color: var(--ink-soft); }
.season-switch__cell.active {
  color: var(--accent);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* — banner / note callouts — */
.banner {
  background: var(--accent-soft);
  border-top: 3px solid var(--accent);
  padding: var(--space-4);
  margin: var(--space-6) 0;
  font-size: 0.94rem;
  color: var(--ink);
}
.banner strong { color: var(--accent-deep); }

.note {
  background: var(--accent-soft);
  border-top: 3px solid var(--accent);
  padding: var(--space-3) var(--space-4);
  font-size: 0.9rem;
  margin: 0 0 var(--space-2);
  color: var(--ink);
}
.note strong { color: var(--accent-deep); }
.note.gold { background: var(--gold-soft); border-top-color: var(--gold-deep); }
.note.gold strong { color: var(--gold-deep); }

/* — tables — */
table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--space-4) 0;
  font-size: 0.92rem;
}

th {
  text-align: left;
  padding: 11px 14px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--ink-soft);
  background: var(--surface);
  border-bottom: 2px solid var(--accent);
}

td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

tbody tr:nth-child(even) { background: var(--row-alt); }

/* rank cell + badges, shared by section.html and power-rating.html */
.rank-cell {
  width: 60px;
  text-align: center;
  border-left: 3px solid transparent;
}
tr.playoff-in .rank-cell { border-left-color: var(--accent); }
.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 30px;
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
}
.rank-badge.rank-1 { background: var(--accent-deep); }
.rank-badge.rank-2, .rank-badge.rank-3 { background: var(--accent); }
.rank-num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  color: var(--ink);
}
tr.playoff-out .rank-num { color: var(--ink-faint); }

.team-name {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 16.5px;
  color: var(--ink);
}
tr.playoff-out .team-name { color: var(--ink-soft); }

.num {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink-soft);
  text-align: right;
}
.num-faint {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink-faint);
  text-align: right;
}

.playoff-line td {
  background: var(--accent-deep);
  color: #fff;
  text-align: center;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 7px;
  border-bottom: none;
}

.flag {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 7px;
  background: var(--gold-soft);
  color: var(--gold-deep);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 10.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: 2px;
}

.unplayed-list {
  columns: 2;
  color: var(--ink-soft);
  font-size: 0.9rem;
  padding-left: 1.2em;
}
.unplayed-list li { margin-bottom: 4px; }

/* no-rank tables (non-public.html) */
.rankings.no-rank td:first-child {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 16.5px;
  color: var(--ink);
}
.rankings.no-rank td:nth-child(2) {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--ink-soft);
}
.rankings.no-rank td:nth-child(3),
.rankings.no-rank td:nth-child(4),
.rankings.no-rank td:nth-child(5) {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink-soft);
  text-align: right;
}

.classification-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 7px;
  vertical-align: 1px;
  background: var(--accent);
}
.classification-dot.non-public { background: var(--gold); }

/* — section-index table (UPR homepage) — */
.section-index td.empty { color: var(--ink-faint); }
.group-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
}
.section-cell {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.section-cell__label {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 15px;
  color: var(--accent-deep);
}
.section-cell__count {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 13px;
  color: var(--ink-soft);
}
.meter {
  display: block;
  height: 4px;
  width: 100%;
  background: var(--surface-line);
}
.meter__fill {
  display: block;
  height: 100%;
  background: var(--accent);
}

/* — power rating — */
.group-filter {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: var(--space-6) 0 var(--space-8);
}
.group-filter a {
  padding: 6px 12px;
  background: var(--surface);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 12.5px;
  color: var(--ink-soft);
}
.group-filter a:hover { color: var(--ink); }

/* — predictor table — */
.predictions .favored { font-family: var(--font-body); font-weight: 600; font-size: 15.5px; color: var(--ink); }
.predictions .underdog { font-family: var(--font-body); font-size: 14.5px; color: var(--ink-soft); }
.predictions .score { font-family: var(--font-mono); font-size: 14px; color: var(--ink); text-align: right; }
.predictions .total { font-family: var(--font-mono); font-size: 13px; color: var(--ink-faint); text-align: right; }
.margin-cell {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
}
.margin-cell .margin-value { font-family: var(--font-mono); font-size: 13px; color: var(--ink-soft); }
.margin-meter {
  display: inline-block;
  width: 56px;
  height: 5px;
  background: var(--surface-line);
}
.margin-meter__fill {
  display: block;
  height: 100%;
  background: var(--accent);
}

/* — back link — */
.back-link {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 13.5px;
  color: var(--accent-deep);
  text-decoration: none;
  margin-bottom: var(--space-4);
}
.back-link:hover { color: var(--accent); }

.site-footer {
  max-width: 860px;
  margin: var(--space-8) auto 0;
  padding: var(--space-4) 24px 40px;
  border-top: 1px solid var(--line);
}
.site-footer .gen {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.02em;
  color: var(--ink-faint);
  margin: 0 0 var(--space-2);
}
.site-footer .fine {
  font-family: var(--font-body);
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--ink-soft);
  margin: 0;
}
