/* ==========================================================================
   fumblescore — "Heat Grid" look
   Clean modern app look: one blue scale, deeper = more worth watching.
   Light is the primary look; in dark mode "hotter" means brighter.
   theme-color: light #f8f9fb · dark #0b1220
   Scoped under [data-look="heat-grid"] so it can coexist with the other
   looks (default = no data-look attribute = the classic cyberpunk HUD).

   Layout: app-style header (wordmark, updated stamp, toggle), giant
   headline + tagline, week pills and controls on one ruled row, verdict
   filter chips, and the week as ranked rating tiles — two large feature
   tiles, then a 4-up grid. Tile color = the rating ramp.
   ========================================================================== */

/* self-hosted fonts (OFL licensed; license texts in fonts/) */
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/space-grotesk-400-normal-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/space-grotesk-500-normal-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/space-grotesk-600-normal-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/space-grotesk-700-normal-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---- 1. TOKENS ---- */

[data-look="heat-grid"] {
  color-scheme: light;
  --bg: #f8f9fb;
  --grid: transparent;
  --scanline: transparent;
  --card: #ffffff;
  --ink: #0d1b2a;
  --muted: #4e5a6b;
  --faint: #66717f;
  --line: #dde2ea;
  --thead: #f3f5f8;
  --row-hover: rgba(30, 64, 175, 0.05);
  --code-bg: #eef1f5;
  --chip-bg: #ffffff;
  --chip-hover: #eef1f5;
  --neon: #13297a;
  --neon-soft: rgba(19, 41, 122, 0.25);
  --accent: #2a4bbf;
  --shadow: 0 1px 2px rgba(13, 27, 42, 0.06), 0 4px 16px rgba(13, 27, 42, 0.05);
  --pill-ink: #ffffff;
  --pill-glow: transparent;
  --caret: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234e5a6b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  /* ramp: intensity = depth of blue. 1 palest → 5 deepest navy */
  --r1-bg: #eef1f5; --r1-ink: #4e5a6b;
  --r2-bg: #dce5f6; --r2-ink: #1b2633;
  --r3-bg: #b7caf2; --r3-ink: #0d1b2a;
  --r4-bg: #2a4bbf; --r4-ink: #ffffff;
  --r5-bg: #13297a; --r5-ink: #ffffff;
  --font-display: "Space Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Space Grotesk", ui-monospace, "SF Mono", Menlo, monospace;
}

[data-look="heat-grid"][data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b1220;
  --grid: transparent;
  --scanline: transparent;
  --card: #111a2b;
  --ink: #e8edf5;
  --muted: #a3afc2;
  --faint: #8592a6;
  --line: #223049;
  --thead: #0f1726;
  --row-hover: rgba(143, 176, 255, 0.06);
  --code-bg: #162238;
  --chip-bg: #162238;
  --chip-hover: #1f2e4a;
  --neon: #8fb0ff;
  --neon-soft: rgba(143, 176, 255, 0.3);
  --accent: #c9d7ff;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  --pill-ink: #0b1220;
  --pill-glow: transparent;
  --caret: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a3afc2' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  /* dark ramp: intensity = brightness. 1 dimmest → 5 brightest */
  --r1-bg: #1a2438; --r1-ink: #a3afc2;
  --r2-bg: #24365c; --r2-ink: #e8edf5;
  --r3-bg: #3a5bc4; --r3-ink: #ffffff;
  --r4-bg: #7c9cff; --r4-ink: #0b1220;
  --r5-bg: #c9d7ff; --r5-ink: #0b1220;
}

/* ---- 2. LAYOUT OVERRIDES ---- */

[data-look="heat-grid"] body { font-family: var(--font-display); }

/* -- app header: wordmark + updated stamp, giant headline, tagline -- */

[data-look="heat-grid"] .topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 16px;
  padding: 2px 56px 6px 0; /* right space clears the floating toggle */
}
[data-look="heat-grid"] .brand-line {
  display: block;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink);
}
[data-look="heat-grid"] .topbar .meta {
  margin: 0;
  text-align: right;
  line-height: 1.5;
}
[data-look="heat-grid"] .topbar .meta a,
[data-look="heat-grid"] .container > .meta a { color: var(--muted); }

[data-look="heat-grid"] header {
  position: relative;
  text-align: left;
  padding-bottom: 10px;
}
[data-look="heat-grid"] header h1 {
  font-size: clamp(2.7rem, 7vw, 4.4rem);
  line-height: 1;
  letter-spacing: -0.03em;
  text-transform: none;
  color: var(--ink);
  text-shadow: none;
  margin: 6px 0 0;
}
[data-look="heat-grid"] a.masthead:hover h1 { animation: none; }
[data-look="heat-grid"] .tagline {
  display: block;
  max-width: 52ch;
  margin: 12px 0 0;
  font-size: 1.05rem;
  line-height: 1.55;
  color: var(--muted);
}
[data-look="heat-grid"] .theme-toggle {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 1;
  background-color: var(--card);
}
[data-look="heat-grid"] .meta { text-transform: none; letter-spacing: 0; font-size: 0.9rem; }

/* -- one ruled row: week pills left, season/sort/theme right -- */

[data-look="heat-grid"] .container {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 28px;
}
[data-look="heat-grid"] header { grid-column: 1 / -1; grid-row: 1; }
[data-look="heat-grid"] .weeks-nav-wrap {
  grid-column: 1;
  grid-row: 2;
  align-self: end;
}
[data-look="heat-grid"] .weeks-nav {
  gap: 6px;
  padding: 14px 0 12px;
}
[data-look="heat-grid"] .toolbar {
  grid-column: 2;
  grid-row: 2;
  align-self: end;
  margin: 0;
  padding: 0 0 12px;
  justify-content: flex-end;
}
[data-look="heat-grid"] .weeks-nav-wrap { border-bottom: 1px solid var(--line); }
[data-look="heat-grid"] .toolbar { border-bottom: 1px solid var(--line); }
[data-look="heat-grid"] #content,
[data-look="heat-grid"] .disclaimer,
[data-look="heat-grid"] .site-footer,
[data-look="heat-grid"] .container > .table-wrap,
[data-look="heat-grid"] .container > .meta { grid-column: 1 / -1; }

[data-look="heat-grid"] .week-chip {
  clip-path: none;
  flex-direction: row;
  align-items: baseline;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 16px;
  background: var(--chip-bg);
}
[data-look="heat-grid"] .week-chip:hover { border-color: var(--faint); }
[data-look="heat-grid"] .week-chip.active {
  background: var(--neon);
  border-color: var(--neon);
  color: var(--pill-ink);
}
[data-look="heat-grid"] .week-chip.active .wk-dates { color: inherit; opacity: 0.75; }
[data-look="heat-grid"] .wk-label { font-weight: 600; letter-spacing: 0; }
[data-look="heat-grid"] .wk-dates { font-size: 0.8rem; }

[data-look="heat-grid"] .week-title { display: none; }

[data-look="heat-grid"] .toolbar-controls { gap: 14px; }
[data-look="heat-grid"] .toolbar-controls .control {
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
}
[data-look="heat-grid"] .toolbar-controls label {
  font-size: 0.7rem;
  color: var(--muted);
}
[data-look="heat-grid"] .toolbar select,
[data-look="heat-grid"] .theme-toggle { border-radius: 10px; }
[data-look="heat-grid"] .toolbar select { width: auto; min-width: 96px; }
[data-look="heat-grid"] .toolbar #season { text-align: left; }
[data-look="heat-grid"] .theme-toggle svg { stroke: var(--ink); filter: none; }

/* -- week header + verdict filter chips -- */

[data-look="heat-grid"] .hg-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  padding: 22px 0 14px;
}
[data-look="heat-grid"] .hg-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  text-transform: capitalize;
  color: var(--ink);
}
[data-look="heat-grid"] .hg-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
[data-look="heat-grid"] .hg-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
[data-look="heat-grid"] .hg-chip:hover { border-color: var(--faint); }
[data-look="heat-grid"] .hg-chip.on {
  background: var(--neon);
  border-color: var(--neon);
  color: var(--pill-ink);
}
[data-look="heat-grid"] .hg-chip b { font-weight: 700; opacity: 0.6; }
[data-look="heat-grid"] .hg-chip:focus-visible {
  outline: 1px solid var(--neon);
  outline-offset: 1px;
}
[data-look="heat-grid"] .hg-swatch {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 4px;
}
[data-look="heat-grid"] .hg-swatch.r5 { background: var(--r5-bg); }
[data-look="heat-grid"] .hg-swatch.r3 { background: var(--r3-bg); }
[data-look="heat-grid"] .hg-swatch.r1 { background: var(--r1-bg); }

/* -- rating tiles: color = the ramp, deeper = better -- */

[data-look="heat-grid"] .tiles {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  padding-bottom: 8px;
}
[data-look="heat-grid"] .tile {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  border-radius: 16px;
  min-height: 148px;
}
[data-look="heat-grid"] .tile.feat {
  grid-column: span 2;
  min-height: 208px;
  padding: 22px;
}
[data-look="heat-grid"] .tile.r1 { background: var(--r1-bg); color: var(--r1-ink); }
[data-look="heat-grid"] .tile.r2 { background: var(--r2-bg); color: var(--r2-ink); }
[data-look="heat-grid"] .tile.r3 { background: var(--r3-bg); color: var(--r3-ink); }
[data-look="heat-grid"] .tile.r4 { background: var(--r4-bg); color: var(--r4-ink); }
[data-look="heat-grid"] .tile.r5 { background: var(--r5-bg); color: var(--r5-ink); }

[data-look="heat-grid"] .tile-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
[data-look="heat-grid"] .tile-rank { font-size: 0.8rem; font-weight: 600; opacity: 0.85; }
[data-look="heat-grid"] .tile.feat .tile-rank { font-size: 0.9rem; }
[data-look="heat-grid"] .tile-badge {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 4px 11px;
  border-radius: 999px;
  background: color-mix(in srgb, currentColor 16%, transparent);
  white-space: nowrap;
}
[data-look="heat-grid"] .tile-teams {
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.32;
}
[data-look="heat-grid"] .tile.feat .tile-teams { font-size: 1.5rem; }
[data-look="heat-grid"] .tile-teams .at {
  font-weight: 400;
  opacity: 0.65;
  font-size: 0.92em;
}
[data-look="heat-grid"] .tile-bottom {
  margin-top: auto;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
}
[data-look="heat-grid"] .tile-when {
  font-size: 0.84rem;
  opacity: 0.8;
  font-variant-numeric: tabular-nums;
}
[data-look="heat-grid"] .tile.feat .tile-when { font-size: 0.95rem; }
[data-look="heat-grid"] .tile-num {
  font-size: 1.9rem;
  font-weight: 700;
  line-height: 0.9;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
[data-look="heat-grid"] .tile.feat .tile-num { font-size: 4.2rem; }

[data-look="heat-grid"] .hg-empty {
  margin: 4px 0 12px;
  font-size: 0.95rem;
  color: var(--muted);
}

/* -- classic table (kept for any context where a table renders here) -- */

[data-look="heat-grid"] thead th { font-weight: 600; letter-spacing: 0.06em; }
[data-look="heat-grid"] .pill {
  clip-path: none;
  border-radius: 8px;
  font-weight: 700;
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
}
[data-look="heat-grid"] .pill.r1 { box-shadow: inset 0 0 0 1px var(--line); }

/* the "heat" — must-watch rows pick up a faint wash of their rating color
   (tinted on the <tr> so it also covers the stacked mobile cards; the base
   td:hover rule still shows on top. Browsers without :has() just skip it.) */
[data-look="heat-grid"] tbody tr:has(.pill.r4) { background: color-mix(in srgb, var(--r4-bg) 7%, transparent); }
[data-look="heat-grid"] tbody tr:has(.pill.r5) { background: color-mix(in srgb, var(--r5-bg) 11%, transparent); }

[data-look="heat-grid"] .disclaimer,
[data-look="heat-grid"] .site-footer { letter-spacing: 0; }

/* -- mid width: tiles go two-up, features span the row -- */
@media (max-width: 900px) {
  [data-look="heat-grid"] .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* -- phones -- */
@media (max-width: 560px) {
  [data-look="heat-grid"] .container { display: block; }
  [data-look="heat-grid"] .toolbar { justify-content: flex-start; }
  [data-look="heat-grid"] header h1 { font-size: clamp(2.4rem, 10vw, 3.2rem); }
  [data-look="heat-grid"] .hg-head { padding: 18px 0 12px; }
  [data-look="heat-grid"] .tiles { gap: 10px; }
  [data-look="heat-grid"] .tile { padding: 13px; min-height: 128px; border-radius: 14px; }
  [data-look="heat-grid"] .tile.feat { padding: 16px; min-height: 170px; }
  [data-look="heat-grid"] .tile.feat .tile-teams { font-size: 1.25rem; }
  [data-look="heat-grid"] .tile.feat .tile-num { font-size: 3rem; }
  [data-look="heat-grid"] .tile-num { font-size: 1.5rem; }
}