/*
  HTMTN product theme — light + dark sports-analytics
  Brand accent #1a4fdb · φ-friendly type/spacing (no marketing claim)
*/

:root {
  --phi: 1.6180339887;
  --phi-inv: 0.6180339887;

  --f: 16px;
  --text-xs: clamp(0.6875rem, 0.65rem + 0.15vw, 0.75rem);
  --text-sm: clamp(0.8125rem, 0.78rem + 0.15vw, 0.875rem);
  --text-base: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  --text-md: clamp(1.125rem, 1.05rem + 0.35vw, 1.25rem);
  --text-lg: clamp(1.375rem, 1.2rem + 0.7vw, 1.618rem);
  --text-xl: clamp(1.75rem, 1.4rem + 1.4vw, 2.25rem);

  --h0: calc(var(--f) * 1.5);
  --s-1: calc(var(--h0) * 0.25);
  --s-2: calc(var(--h0) * 0.5);
  --s-3: calc(var(--h0) * var(--phi-inv));
  --s-4: var(--h0);
  --s-5: calc(var(--h0) * var(--phi));

  --wrap: min(72rem, calc(100% - 2rem));
  --radius-sm: 0.4rem;
  --radius: 0.75rem;
  --radius-lg: 1.1rem;
  --radius-pill: 999px;

  /* Dark (default) */
  --bg: #0b1020;
  --bg2: #121a33;
  --card: #161f3d;
  --text: #eef2ff;
  --muted: #9aa6c8;
  --accent: #1a4fdb;
  --accent2: #5b8cff;
  --good: #3ecf8e;
  --warn: #f0b429;
  --border: rgba(255, 255, 255, 0.12);
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
  --header-bg: rgba(11, 16, 32, 0.82);
  --glow-a: rgba(26, 79, 219, 0.22);
  --glow-b: rgba(91, 140, 255, 0.12);
  --chart-panel: linear-gradient(180deg, rgba(22, 31, 61, 0.95), rgba(18, 26, 51, 0.98));
  --input-bg: var(--card);
  --tooltip-bg: rgba(11, 16, 32, 0.97);
  --logo-disc: #ffffff;
  --logo-ring: rgba(255, 255, 255, 0.45);
  --logo-label: rgba(238, 242, 255, 0.92);
  --seg-bg: rgba(0, 0, 0, 0.25);
  --conf-tile-bg: var(--bg);
  --link-hover: #ffffff;
  --chart-grid: rgba(255, 255, 255, 0.07);
  --chart-tick: #9aa6c8;
  --chart-title: #9aa6c8;
  --chart-border: rgba(255, 255, 255, 0.14);
  --theme-icon-sun: none;
  --theme-icon-moon: inline;
  --on-chip-bg: rgba(26, 79, 219, 0.38);
  --on-chip-text: #ffffff;
  --on-chip-border: var(--accent2);

  --font: "DM Sans", system-ui, -apple-system, sans-serif;
  --display: "Fraunces", Georgia, serif;

  --chart-h: min(68vh, 640px);
}

html[data-theme="light"] {
  --bg: #f4f6fb;
  --bg2: #ffffff;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #5b6b8c;
  --accent: #1a4fdb;
  --accent2: #1a4fdb;
  --good: #0d9f6e;
  --warn: #c98600;
  --border: rgba(15, 23, 42, 0.12);
  --shadow: 0 14px 40px rgba(15, 35, 80, 0.1);
  --header-bg: rgba(244, 246, 251, 0.9);
  --glow-a: rgba(26, 79, 219, 0.1);
  --glow-b: rgba(26, 79, 219, 0.06);
  --chart-panel: linear-gradient(180deg, #ffffff, #f7f9fc);
  --input-bg: #ffffff;
  --tooltip-bg: rgba(255, 255, 255, 0.98);
  --logo-disc: #ffffff;
  --logo-ring: rgba(15, 23, 42, 0.22);
  --logo-label: rgba(15, 23, 42, 0.88);
  --seg-bg: rgba(15, 23, 42, 0.05);
  --conf-tile-bg: #f8fafc;
  --link-hover: #0d2f99;
  --chart-grid: rgba(15, 23, 42, 0.08);
  --chart-tick: #5b6b8c;
  --chart-title: #3d4f73;
  --chart-border: rgba(15, 23, 42, 0.14);
  --theme-icon-sun: inline;
  --theme-icon-moon: none;
  --on-chip-bg: rgba(26, 79, 219, 0.12);
  --on-chip-text: #0f172a;
  --on-chip-border: #1a4fdb;
}

.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;
}

kbd {
  font-family: var(--font);
  font-size: 0.85em;
  font-weight: 600;
  padding: 0.05em 0.35em;
  border-radius: 0.3em;
  border: 1px solid var(--border);
  background: var(--bg2);
  color: var(--muted);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
}

html[data-theme="light"] {
  color-scheme: light;
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font);
  font-size: var(--text-base);
  line-height: 1.55;
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 10% -10%, var(--glow-a), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, var(--glow-b), transparent 50%),
    var(--bg);
  transition: background-color 0.2s ease, color 0.2s ease;
}

img {
  max-width: 100%;
}

a {
  color: var(--accent2);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--link-hover);
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0.5rem;
  z-index: 100;
  padding: 0.5rem 0.75rem;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-sm);
}

.skip-link:focus {
  left: 0.5rem;
}

.wrap {
  width: var(--wrap);
  margin-inline: auto;
}

.wrap.narrow {
  max-width: 32rem;
  padding: var(--s-5) 0;
}

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

.small {
  font-size: var(--text-sm);
}

/* Header */

.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 40;
}

.theme-toggle {
  min-width: 2.5rem;
  padding-inline: 0.65rem;
}

.theme-toggle .icon-sun {
  display: var(--theme-icon-sun);
}

.theme-toggle .icon-moon {
  display: var(--theme-icon-moon);
}

.header-inner {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  padding: 0.75rem 0;
}

.brand {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  min-width: 0;
  flex: 1 1 auto;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius);
  background: linear-gradient(145deg, var(--accent), #0d2f99);
  font-weight: 700;
  font-size: var(--text-xs);
  letter-spacing: 0.04em;
  box-shadow: 0 8px 24px rgba(26, 79, 219, 0.35);
  flex-shrink: 0;
}

.brand h1 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(1.05rem, 0.95rem + 0.55vw, 1.35rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.tagline {
  margin: 0.1rem 0 0;
  font-size: var(--text-xs);
  color: var(--muted);
  line-height: 1.35;
}

.header-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.4rem;
  align-items: center;
  flex-shrink: 0;
}

.header-actions .btn {
  white-space: nowrap;
}

/* Division switcher (D1 / D2 / D3) */
.div-nav {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.15rem;
  border-radius: var(--radius-pill, 999px);
  border: 1px solid var(--border);
  background: var(--chip-bg, rgba(255, 255, 255, 0.04));
}

.div-nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.15rem;
  height: 1.85rem;
  padding: 0 0.55rem;
  border-radius: var(--radius-pill, 999px);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--muted);
  text-decoration: none;
  line-height: 1;
  transition: background 0.15s ease, color 0.15s ease;
}

.div-nav-link:hover,
.div-nav-link:focus-visible {
  color: var(--text);
  background: rgba(26, 79, 219, 0.12);
  outline: none;
}

.div-nav-link.is-current {
  color: #fff;
  background: var(--accent);
  box-shadow: 0 2px 8px rgba(26, 79, 219, 0.35);
}

html[data-theme="light"] .div-nav {
  background: rgba(15, 23, 42, 0.04);
}

html[data-theme="light"] .div-nav-link.is-current {
  color: #fff;
}

@media (max-width: 720px) {
  .div-nav {
    order: -1;
    margin-right: auto;
  }
}


/* Top filter toolbar */

.toolbar {
  margin: 0.85rem 0 0.75rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--chart-panel);
  box-shadow: var(--shadow);
  position: relative;
  z-index: 25;
  overflow: visible;
}

.toolbar-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.45rem 0.5rem;
}

.tb-field {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 7.25rem;
  flex: 0 1 auto;
}

.tb-field.tb-search {
  flex: 1 1 10rem;
  min-width: 9rem;
  max-width: 16rem;
}

.tb-field .label,
.tb-dd > summary .label {
  margin-bottom: 0;
  line-height: 1.2;
}

.tb-field select,
.tb-field input[type="search"] {
  width: 100%;
  min-height: 2.2rem;
  padding: 0.35rem 0.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--text);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.2;
}

.tb-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.7rem;
  align-items: center;
  align-self: flex-end;
  padding-bottom: 0.4rem;
  min-height: 2.2rem;
}

.tb-toggles .toggle {
  font-size: 0.8rem;
  gap: 0.35rem;
  margin: 0;
}

.tb-clear {
  align-self: flex-end;
  margin-bottom: 0.15rem;
  flex-shrink: 0;
}

/* Dropdown controls — must not inherit legacy panel card styles */
.tb-dd {
  position: relative;
  min-width: 7.25rem;
  flex: 0 1 auto;
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
  overflow: visible !important;
  margin: 0;
}

.tb-dd > summary {
  position: relative;
  list-style: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  user-select: none;
  padding: 0;
  margin: 0;
}

.tb-dd > summary::-webkit-details-marker {
  display: none;
}

.tb-dd > summary::after {
  content: "";
  position: absolute;
  right: 0.55rem;
  bottom: 0.7rem;
  width: 0.35rem;
  height: 0.35rem;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  pointer-events: none;
  opacity: 0.85;
}

.tb-value {
  display: block;
  box-sizing: border-box;
  width: 100%;
  min-height: 2.2rem;
  padding: 0.4rem 1.45rem 0.4rem 0.55rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--text);
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 12rem;
}

.tb-dd[open] > summary .tb-value {
  border-color: var(--accent2);
  background: rgba(26, 79, 219, 0.12);
}

.tb-panel {
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  z-index: 50;
  min-width: min(22rem, 92vw);
  max-width: min(28rem, 94vw);
  padding: 0.75rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: var(--shadow);
}

/* Keep right-side dropdowns on-screen */
.tb-dd.dual .tb-panel,
#count-block .tb-panel {
  left: auto;
  right: 0;
}

.tb-panel-range {
  min-width: min(17rem, 90vw);
}

.tb-dd.dual .tb-panel {
  min-width: min(16rem, 90vw);
}

.tb-panel .sport-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.55rem;
}

.tb-panel .sport-chips {
  max-height: 12rem;
  overflow: auto;
}

.toolbar .filter-bar {
  margin-top: 0.55rem;
}

.toolbar .filter-bar .btn {
  display: none; /* clear lives on toolbar row */
}

.play-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.65rem;
  margin-top: 0.65rem;
  padding-top: 0.55rem;
  border-top: 1px solid var(--border);
}

/* Orange play control — stands out from ghost filters */
.btn.btn-play {
  --play: #f08a18;
  --play-deep: #d96f00;
  --play-glow: rgba(240, 138, 24, 0.45);
  background: linear-gradient(180deg, #ff9f2e 0%, var(--play) 55%, var(--play-deep) 100%);
  border: 1px solid #c45f00;
  color: #fff;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.25) inset,
    0 4px 14px var(--play-glow);
  gap: 0.4rem;
  padding-inline: 0.9rem;
}
.btn.btn-play:hover,
.btn.btn-play:focus-visible {
  background: linear-gradient(180deg, #ffb04a 0%, #ff961f 50%, #e87800 100%);
  border-color: #a84f00;
  color: #fff;
  outline: none;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.3) inset,
    0 6px 18px rgba(240, 138, 24, 0.55);
}
.btn.btn-play:active {
  transform: translateY(1px);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.15) inset,
    0 2px 8px var(--play-glow);
}
.btn.btn-play.is-playing {
  background: linear-gradient(180deg, #ff7a2e 0%, #e85d10 55%, #c44a00 100%);
  border-color: #9a3a00;
  animation: play-pulse 1.4s ease-in-out infinite;
}
@keyframes play-pulse {
  0%, 100% { box-shadow: 0 1px 0 rgba(255, 255, 255, 0.2) inset, 0 4px 14px var(--play-glow); }
  50% { box-shadow: 0 1px 0 rgba(255, 255, 255, 0.25) inset, 0 0 0 3px rgba(240, 138, 24, 0.35), 0 6px 20px rgba(240, 138, 24, 0.55); }
}
.play-year-banner {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: #f08a18;
}
.year-range-fill.is-playing-fill {
  transition: none;
}

@media (max-width: 860px) {
  .header-inner {
    flex-wrap: wrap;
  }
  .header-actions {
    width: 100%;
    justify-content: flex-end;
  }
}

@media (max-width: 720px) {
  .header-actions .btn:not(.theme-toggle) {
    flex: 1 1 auto;
    justify-content: center;
  }
  .tb-field {
    min-width: calc(50% - 0.35rem);
    flex: 1 1 calc(50% - 0.35rem);
  }
  .tb-field.tb-search {
    max-width: none;
    flex: 1 1 100%;
  }
  .tb-dd {
    min-width: calc(50% - 0.35rem);
    flex: 1 1 calc(50% - 0.35rem);
  }
  .tb-value {
    max-width: none;
  }
  .tb-toggles {
    width: 100%;
    padding-bottom: 0.15rem;
  }
  .tb-clear {
    width: 100%;
  }
  .tb-dd .tb-panel,
  .tb-dd.dual .tb-panel,
  #count-block .tb-panel {
    left: 0;
    right: 0;
    width: min(100vw - 2rem, 22rem);
    max-width: calc(100vw - 2rem);
  }
}

/* Chart panel */

.chart-panel {
  background: var(--chart-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: var(--s-3);
  margin-top: 0;
  margin-bottom: var(--s-4);
}

.chart-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  margin-bottom: var(--s-2);
}

.chart-toolbar-left {
  min-width: 0;
  flex: 1;
}

.chart-toolbar-right {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

/* Segmented controls */

.metric-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 0.85rem;
  margin-bottom: var(--s-2);
}

.metric-row-label {
  margin: 0;
}

.seg {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  padding: 0.2rem;
  border-radius: var(--radius-pill);
  background: var(--seg-bg);
  border: 1px solid var(--border);
}

.seg-btn {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: var(--text-xs);
  font-weight: 600;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-pill);
  cursor: pointer;
  touch-action: manipulation;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.seg-btn:hover,
.seg-btn:focus-visible {
  color: var(--text);
  outline: none;
}

.seg-btn.is-on {
  background: rgba(26, 79, 219, 0.4);
  border-color: var(--accent2);
  color: #fff;
}



.chart-toolbar .stats {
  margin: 0;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text);
}

.chart-wrap {
  position: relative;
  height: var(--chart-h);
  min-height: 300px;
}

.chart-wrap canvas {
  width: 100% !important;
  height: 100% !important;
  cursor: grab;
  touch-action: none;
}

.chart-wrap canvas:active {
  cursor: grabbing;
}

.axis-hint {
  margin: var(--s-2) 0 0;
  font-size: var(--text-xs);
  text-align: center;
  line-height: 1.45;
}

/* Controls below chart */

.controls {
  padding: 0 0 var(--s-5);
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}

.control-row {
  display: grid;
  grid-template-columns: 1.6fr minmax(8rem, 0.7fr) auto;
  gap: var(--s-2);
  align-items: end;
}

.control-row-primary {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--s-3);
}

@media (max-width: 860px) {
  .control-row {
    grid-template-columns: 1fr 1fr;
  }
  .search-field {
    grid-column: 1 / -1;
  }
  .toggles {
    grid-column: 1 / -1;
  }
}

/* Active filter bar */

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.65rem;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius);
  border: 1px solid rgba(91, 140, 255, 0.28);
  background: rgba(26, 79, 219, 0.12);
}

.filter-bar[hidden] {
  display: none !important;
}

.filter-bar-label {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  flex: 1;
  min-width: 0;
}

.filter-chip {
  font-size: var(--text-xs);
  font-weight: 600;
  padding: 0.25rem 0.55rem;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
}

/* Conference block */

.conf-block {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--s-3);
}

.block-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.35rem 0.75rem;
  margin-bottom: 0.55rem;
}

/* Sport multi-select (details) */

.sport-panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0;
  overflow: hidden;
}

.sport-panel-summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: var(--s-3);
  user-select: none;
}

.sport-panel-summary::-webkit-details-marker {
  display: none;
}

.sport-panel-summary .label {
  display: block;
}

.sport-count {
  display: block;
  margin: 0.15rem 0 0;
  font-weight: 600;
  color: var(--accent2);
  text-transform: none;
  letter-spacing: 0;
  font-size: var(--text-sm);
}

.summary-hint {
  opacity: 0.7;
}

.sport-panel[open] .summary-hint {
  display: none;
}

.sport-panel-body {
  padding: 0 var(--s-3) var(--s-3);
  border-top: 1px solid var(--border);
  padding-top: var(--s-2);
}

.sport-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: var(--s-2);
}

.btn.sm {
  padding: 0.4rem 0.7rem;
  font-size: var(--text-xs);
}

.sport-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  max-height: 11rem;
  overflow-y: auto;
  padding-bottom: 0.15rem;
  -webkit-overflow-scrolling: touch;
}

.sport-help {
  margin: 0.55rem 0 0;
}

.sport-chip {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--bg2);
  color: var(--text);
  font: inherit;
  font-size: var(--text-xs);
  font-weight: 600;
  padding: 0.4rem 0.65rem 0.4rem 0.45rem;
  border-radius: var(--radius-pill);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  white-space: nowrap;
  touch-action: manipulation;
}

.sport-chip:hover,
.sport-chip:focus-visible {
  border-color: var(--accent2);
  outline: none;
}

.sport-chip.is-on {
  background: var(--on-chip-bg);
  border-color: var(--on-chip-border);
  color: var(--on-chip-text);
}

.sport-chip .sport-label {
  color: inherit;
  font-weight: 600;
}

.sport-chip.shake {
  animation: chip-shake 0.3s ease;
}

@keyframes chip-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-3px); }
  75% { transform: translateX(3px); }
}

.sport-check {
  display: inline-grid;
  place-items: center;
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.65rem;
  line-height: 1;
  color: inherit;
  flex-shrink: 0;
}

.sport-chip.is-on .sport-check {
  background: var(--accent);
  color: #fff;
}

.tip-breakdown {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.5rem;
  font-size: var(--text-xs);
}

.tip-breakdown td {
  padding: 0.15rem 0;
  vertical-align: top;
}

.tip-breakdown td.num {
  text-align: right;
  font-weight: 600;
  padding-left: 0.75rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.label {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

input[type="search"],
select {
  width: 100%;
  padding: 0.65rem 0.8rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--text);
  font: inherit;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

html[data-theme="light"] input[type="search"],
html[data-theme="light"] select {
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.02);
}

input[type="search"]:focus,
select:focus {
  border-color: var(--accent2);
  box-shadow: 0 0 0 3px rgba(26, 79, 219, 0.35);
}

.toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  align-items: center;
  padding-bottom: 0.35rem;
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: var(--text-sm);
  cursor: pointer;
  user-select: none;
}

.toggle input {
  width: 1.05rem;
  height: 1.05rem;
  accent-color: var(--accent);
}

/* Legend */

/* Year slider */

.year-panel {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--s-3);
}

.year-panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.55rem;
}

.year-value {
  font-family: var(--display);
  font-size: var(--text-md);
  color: var(--accent2);
  font-variant-numeric: tabular-nums;
}

/* Dual-thumb range */
.year-range {
  position: relative;
  height: 2.25rem;
  display: flex;
  align-items: center;
  touch-action: none;
  cursor: pointer;
  /* Hit area for track clicks (JS moves nearer thumb) */
  z-index: 1;
}

.year-range-track {
  position: absolute;
  left: 0;
  right: 0;
  height: 0.4rem;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.12);
  pointer-events: none;
}

.year-range-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  pointer-events: none;
}

.year-thumb {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  margin: 0;
  padding: 0;
  height: 2.25rem;
  background: transparent;
  /* Allow the stacked range inputs to receive events; track underlay is none */
  pointer-events: auto;
  -webkit-appearance: none;
  appearance: none;
  outline: none;
}

.year-thumb::-webkit-slider-runnable-track {
  height: 0.4rem;
  background: transparent;
  border: none;
}

.year-thumb::-moz-range-track {
  height: 0.4rem;
  background: transparent;
  border: none;
}

.year-thumb::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  pointer-events: auto;
  width: 1.45rem;
  height: 1.45rem;
  border-radius: 50%;
  border: 2px solid #fff;
  background: var(--accent);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
  cursor: grab;
  margin-top: calc((0.4rem - 1.45rem) / 2);
  position: relative;
  z-index: 2;
  /* Enlarge hit target without changing visible size much */
  touch-action: none;
}

.year-thumb::-moz-range-thumb {
  pointer-events: auto;
  width: 1.45rem;
  height: 1.45rem;
  border-radius: 50%;
  border: 2px solid #fff;
  background: var(--accent);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
  cursor: grab;
  position: relative;
  z-index: 2;
}

.year-thumb:active::-webkit-slider-thumb,
.year-thumb:active::-moz-range-thumb {
  cursor: grabbing;
  background: var(--accent2);
  transform: scale(1.08);
}

/* Stack: JS raises the active end; defaults below */
.year-thumb-from {
  z-index: 4;
}

.year-thumb-to {
  z-index: 5;
}

.year-ends {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.35rem;
}

.year-ends #year-help {
  flex: 1;
  text-align: center;
}

@media (max-width: 480px) {
  .year-ends {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }
  .year-ends #year-help {
    order: -1;
  }
}

/* Conference logo tiles: logo on top, name under */

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 0.65rem;
  position: relative;
  z-index: 2;
  pointer-events: auto;
}

.conf-tile {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid var(--border);
  background: var(--conf-tile-bg);
  color: var(--text);
  font: inherit;
  padding: 0.5rem 0.4rem 0.4rem;
  border-radius: var(--radius);
  cursor: pointer;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 0.3rem;
  min-width: 4.25rem;
  max-width: 5.25rem;
  transition: background 0.15s, border-color 0.15s, opacity 0.15s, box-shadow 0.15s, transform 0.1s;
  pointer-events: auto;
  touch-action: manipulation;
  user-select: none;
}

.conf-tile:hover,
.conf-tile:focus-visible {
  border-color: var(--accent2);
  outline: none;
  box-shadow: 0 0 0 2px rgba(26, 79, 219, 0.28);
  transform: translateY(-1px);
}

.conf-tile.is-active {
  background: rgba(26, 79, 219, 0.28);
  border-color: var(--accent2);
  box-shadow: 0 0 0 2px rgba(91, 140, 255, 0.35);
}

.conf-tile.legend-all.is-active {
  background: rgba(62, 207, 142, 0.16);
  border-color: var(--good);
  box-shadow: 0 0 0 2px rgba(62, 207, 142, 0.28);
}

.conf-tile.is-dim {
  opacity: 0.4;
}

.conf-logo-wrap {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.55rem;
  background: #fff;
  display: grid;
  place-items: center;
  overflow: hidden;
  box-shadow:
    0 0 0 1px var(--border),
    0 1px 3px rgba(0, 0, 0, 0.08);
  flex-shrink: 0;
}

html[data-theme="light"] .conf-logo-wrap {
  box-shadow:
    0 0 0 1px rgba(15, 23, 42, 0.1),
    0 1px 4px rgba(15, 23, 42, 0.08);
}

.conf-logo {
  width: 2.15rem;
  height: 2.15rem;
  object-fit: contain;
  display: block;
}

.conf-logo.is-broken {
  display: none;
}

.conf-logo-fallback {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--conf-color, #1a4fdb);
  text-transform: uppercase;
}

.conf-logo-all {
  background: linear-gradient(145deg, var(--accent), #0d2f99);
}

.conf-all-mark {
  color: #fff;
  font-size: 1.1rem;
  line-height: 1;
}

.conf-name {
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.15;
  text-align: center;
  color: var(--muted);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conf-tile.is-active .conf-name {
  color: #fff;
}

@media (max-width: 560px) {
  .conf-tile {
    min-width: 3.75rem;
    max-width: 4.5rem;
    padding: 0.4rem 0.3rem 0.35rem;
  }
  .conf-logo-wrap {
    width: 2.15rem;
    height: 2.15rem;
  }
  .conf-logo {
    width: 1.85rem;
    height: 1.85rem;
  }
}

/* Tooltip */

.tooltip {
  position: absolute;
  z-index: 60; /* above sticky .site-header (40) */
  min-width: 12rem;
  max-width: min(20rem, 90vw);
  max-height: min(70vh, 32rem);
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--tooltip-bg);
  color: var(--text);
  box-shadow: var(--shadow);
  pointer-events: none;
  font-size: var(--text-sm);
  line-height: 1.45;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.tooltip-fixed {
  flex: 0 0 auto;
  padding-bottom: 0.35rem;
}

.tooltip-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  margin: 0 -0.15rem;
  padding: 0 0.15rem;
  scrollbar-width: thin;
}

.tooltip-logo {
  background: #fff !important;
  box-shadow: 0 0 0 1px var(--border);
}

.tooltip[data-interactive="true"] {
  pointer-events: auto;
}

.tooltip[data-interactive="true"] .tooltip-scroll {
  pointer-events: auto;
}

.tooltip-close {
  position: absolute;
  top: 0.35rem;
  right: 0.4rem;
  width: 1.6rem;
  height: 1.6rem;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}

.tooltip-close:hover {
  background: rgba(255, 255, 255, 0.16);
}

.tooltip-head {
  display: flex;
  gap: 0.65rem;
  align-items: center;
  margin-bottom: 0.45rem;
}

.tooltip-logo {
  width: 2rem;
  height: 2rem;
  object-fit: contain;
  border-radius: 50%;
  background: #fff;
  padding: 2px;
}

.tooltip h3 {
  margin: 0;
  font-size: var(--text-md);
  font-family: var(--display);
  line-height: 1.2;
}

.tooltip dl {
  margin: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.15rem 0.75rem;
}

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

.tooltip dd {
  margin: 0;
  font-weight: 600;
}

.tooltip .years {
  margin-top: 0.45rem;
  color: var(--muted);
  font-size: var(--text-xs);
  line-height: 1.4;
}

.tooltip a {
  display: inline-block;
  margin-top: 0.55rem;
  font-weight: 600;
}

/* Buttons */

.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 0.9rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 600;
  font-size: var(--text-sm);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}

.btn:hover {
  background: #245ce8;
  color: #fff;
}

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

.btn:focus-visible {
  outline: 2px solid var(--accent2);
  outline-offset: 2px;
}

.btn.ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}

.btn.ghost:hover {
  border-color: var(--accent2);
  background: rgba(26, 79, 219, 0.15);
}

.btn.ghost.is-on,
.btn.ghost[aria-pressed="true"] {
  border-color: var(--accent2);
  background: rgba(26, 79, 219, 0.28);
  color: #fff;
}

.btn.icon {
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

/* Footer */

.site-footer {
  border-top: 1px solid var(--border);
  padding: var(--s-4) 0 var(--s-5);
}

.footer-inner {
  text-align: center;
}

.footer-inner p {
  margin: 0.25rem 0;
}

/* Drawer */

.drawer {
  border: none;
  padding: 0;
  max-width: min(32rem, 100vw - 1.5rem);
  width: 100%;
  border-radius: var(--radius-lg);
  background: var(--card);
  color: var(--text);
  box-shadow: var(--shadow);
}

.drawer::backdrop {
  background: rgba(4, 8, 20, 0.72);
  backdrop-filter: blur(4px);
}

.drawer-inner {
  margin: 0;
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: var(--s-3) var(--s-4);
  border-bottom: 1px solid var(--border);
}

.drawer-header h2 {
  margin: 0;
  font-family: var(--display);
  font-size: var(--text-md);
}

.drawer-body {
  padding: var(--s-3) var(--s-4) var(--s-4);
  max-height: min(70vh, 32rem);
  overflow: auto;
}

.drawer-body h3 {
  margin: 1.1rem 0 0.4rem;
  font-size: var(--text-base);
  color: var(--accent2);
}

.drawer-body h3:first-child {
  margin-top: 0;
}

.drawer-body p {
  margin: 0 0 0.65rem;
  color: var(--muted);
  font-size: var(--text-sm);
}

html[data-theme="light"] .drawer-body h3 {
  color: var(--accent);
}

html[data-theme="light"] .year-range-track {
  background: rgba(15, 23, 42, 0.1);
}

html[data-theme="light"] .year-thumb::-webkit-slider-thumb,
html[data-theme="light"] .year-thumb::-moz-range-thumb {
  border-color: #fff;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.25);
}

/* Selected / on states: pale blue wash + dark text (never white-on-wash) */
html[data-theme="light"] .sport-chip {
  background: var(--bg2);
  color: var(--text);
}

html[data-theme="light"] .sport-chip.is-on {
  background: var(--on-chip-bg);
  border-color: var(--on-chip-border);
  color: var(--on-chip-text);
}

html[data-theme="light"] .sport-chip.is-on .sport-label {
  color: var(--on-chip-text);
}

html[data-theme="light"] .sport-chip:not(.is-on) .sport-label {
  color: var(--text);
}

html[data-theme="light"] .sport-check {
  background: rgba(15, 23, 42, 0.08);
  color: var(--text);
}

html[data-theme="light"] .sport-chip.is-on .sport-check {
  background: var(--accent);
  color: #fff;
}

html[data-theme="light"] .seg-btn.is-on {
  background: rgba(26, 79, 219, 0.14);
  border-color: var(--accent);
  color: var(--text);
}

html[data-theme="light"] .conf-tile.is-active {
  background: rgba(26, 79, 219, 0.12);
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(26, 79, 219, 0.2);
}

html[data-theme="light"] .conf-tile.is-active .conf-name {
  color: var(--text);
}

html[data-theme="light"] .conf-tile.legend-all.is-active {
  background: rgba(13, 159, 110, 0.12);
  border-color: var(--good);
  box-shadow: 0 0 0 2px rgba(13, 159, 110, 0.22);
}

html[data-theme="light"] .filter-bar {
  background: rgba(26, 79, 219, 0.08);
  border-color: rgba(26, 79, 219, 0.22);
}

html[data-theme="light"] .filter-chip {
  background: rgba(15, 23, 42, 0.06);
  color: var(--text);
}

html[data-theme="light"] .btn.ghost {
  background: var(--bg2);
  color: var(--text);
}

html[data-theme="light"] .btn.ghost:hover {
  background: rgba(26, 79, 219, 0.08);
  color: var(--text);
}

html[data-theme="light"] .btn.ghost.is-on,
html[data-theme="light"] .btn.ghost[aria-pressed="true"] {
  background: rgba(26, 79, 219, 0.12);
  border-color: var(--accent);
  color: var(--text);
}

html[data-theme="light"] .tb-dd[open] > summary .tb-value {
  background: rgba(26, 79, 219, 0.08);
  color: var(--text);
}

html[data-theme="light"] .tooltip-close {
  background: rgba(15, 23, 42, 0.06);
  color: var(--text);
}

html[data-theme="light"] .tooltip-close:hover {
  background: rgba(15, 23, 42, 0.12);
}

html[data-theme="light"] .drawer::backdrop {
  background: rgba(15, 23, 42, 0.45);
}

/* Soft-dim toolbar dropdowns when Rates only (sports not on axes) */
.is-muted-panel {
  opacity: 0.55;
  transition: opacity 0.2s ease;
}

.is-muted-panel:hover,
.is-muted-panel:focus-within,
.tb-dd.is-muted-panel[open] {
  opacity: 1;
}

.metric-row .seg {
  max-width: 100%;
}

.drawer-body code {
  font-size: 0.9em;
  background: var(--bg);
  padding: 0.1em 0.35em;
  border-radius: 0.3em;
}

/* 404 */

.page-404 {
  display: grid;
  place-items: center;
}

@media (max-width: 560px) {
  :root {
    --chart-h: min(52vh, 420px);
  }

  .brand h1 {
    font-size: var(--text-md);
  }

  .chart-panel {
    padding: var(--s-2);
    margin-inline: 0;
  }

  .chart-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .chart-toolbar-right {
    justify-content: stretch;
  }

  .chart-toolbar-right .btn {
    flex: 1;
  }
}

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


/* theme light-contrast 2026-07-21 */
