:root {
  --color-bg: #0a0a0a;
  --color-surface: #161616;
  --color-fg: #e8e8e8;
  --color-fg-muted: #9a9a9a;
  --color-border: #c0c0c0;
  --color-accent-up: #3fb950;
  --color-accent-down: #f85149;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-fg);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--color-border);
}

header .logo {
  height: 2.4rem;
  width: auto;
  display: block;
}

header h1 {
  font-size: 1.1rem;
  margin: 0;
}

.site-intro {
  color: var(--color-fg-muted);
  font-size: 0.9rem;
  padding: 0.75rem 1.25rem 0;
  max-width: 42rem;
}

html {
  scroll-behavior: smooth;
}

.section-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  gap: 1rem;
  padding: 0.5rem 1.25rem;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-surface);
  font-size: 0.85rem;
}

.section-nav a {
  color: var(--color-fg-muted);
  text-decoration: none;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid transparent;
}

.section-nav a:hover {
  color: var(--color-fg);
}

.section-nav a.active {
  color: var(--color-fg);
  border-bottom-color: var(--color-border);
}

.nav-icon {
  display: inline-block;
  margin-right: 0.3rem;
}

main details {
  scroll-margin-top: 3rem;
  margin-bottom: 1rem;
}

main summary {
  cursor: pointer;
  font-size: 1.3rem;
  font-weight: 600;
  padding: 0.5rem 0;
  /* Pins the section you're scrolled into just below the sticky nav bar,
     still clickable to collapse/expand from there. Releases naturally once
     you scroll past that <details> element's bottom into the next
     section — no JS needed, each section's summary sticks independently
     within its own containing block. */
  position: sticky;
  top: 3rem;
  z-index: 5;
  background: var(--color-bg);
}

main details[open] summary {
  margin-bottom: 0.5rem;
}

main {
  padding: 1rem 1.25rem;
  max-width: 60rem;
  margin: 0 auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  text-align: left;
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid var(--color-surface);
}

th {
  color: var(--color-fg-muted);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.rank-divider td {
  border-bottom: 2px solid var(--color-border);
}

.game-of-week td {
  background: var(--color-surface);
  font-weight: 600;
}

.movement-up {
  color: var(--color-accent-up);
}

.movement-down {
  color: var(--color-accent-down);
}

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

a {
  color: inherit;
}

.team-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 700;
  margin-right: 0.4rem;
  vertical-align: middle;
  flex-shrink: 0;
}

.team-badge--lg {
  width: 2.4rem;
  height: 2.4rem;
  font-size: 1rem;
  margin-right: 0.6rem;
}

.team-rank {
  color: var(--color-fg-muted);
  font-weight: normal;
  margin-right: 0.3rem;
}

.team-record {
  color: var(--color-fg-muted);
  font-size: 1.1rem;
  font-weight: normal;
  margin-left: 0.6rem;
}

.prediction-favored,
.prediction-underdog {
  color: var(--color-fg-muted);
  font-size: 0.85rem;
}

.prediction-correct {
  color: var(--color-accent-up);
  font-size: 0.85rem;
}

.prediction-upset {
  color: var(--color-accent-down);
  font-size: 0.85rem;
}

.prediction-tossup {
  color: var(--color-fg-muted);
  font-size: 0.85rem;
  font-style: italic;
}

.factor-help {
  color: var(--color-fg-muted);
  font-size: 0.8rem;
  font-weight: normal;
  margin-top: 0.15rem;
  max-width: 24rem;
}

.factor-calc-cell {
  border-bottom: 1px solid var(--color-surface);
  padding-top: 0;
}

.factor-calc summary {
  cursor: pointer;
  color: var(--color-fg-muted);
  font-size: 0.8rem;
}

.factor-calc ul {
  margin: 0.4rem 0 0.2rem;
  padding-left: 1.2rem;
  font-size: 0.8rem;
  color: var(--color-fg-muted);
}

.factor-calc li {
  margin-bottom: 0.15rem;
}

.bar-track {
  background: var(--color-surface);
  border-radius: 3px;
  height: 0.6rem;
  width: 100%;
}

.bar-fill {
  background: var(--color-border);
  height: 100%;
  border-radius: 3px;
}

select {
  background: var(--color-surface);
  color: var(--color-fg);
  border: 1px solid var(--color-border);
  padding: 0.3rem 0.5rem;
  border-radius: 4px;
}
