/* ---- Self-hosted type — Scoreboard/Marquee world ----------------------
   JetBrains Mono (instrument/numeral face: headings, labels, all scores
   and stats) + Inter (body prose, proper-noun-heavy cells). Both latin-
   subset variable fonts, self-hosted under fonts/ (no runtime CDN, per
   project constraint — Turnstile is the one deliberate exception). */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("fonts/inter-latin-var.woff2") format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("fonts/jetbrains-mono-latin-var.woff2") format("woff2");
}

:root {
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Dark mode is the PRIMARY identity (mobile, short sessions, Sunday/
     Monday NFL glance-and-share) — the marquee at night. Light mode below
     is the secondary/accessible "daylight readout" variant, same geometry,
     different temperature. */
  --bg: #0a0d14;
  --panel: #12161f;
  --panel-tint: #0e1119;
  --border: #262e40;
  --text: #ece7da;
  --muted: #838b9e;
  /* Ghost tone — the "unlit" duplicate value behind whatever is struck
     forward. Deliberately low-contrast: it is decorative de-emphasis, the
     same role var(--border) already played for .diag/.bracket-team ghosts
     before this redesign, never the reading the user needs. */
  --ghost: #3a4358;
  --accent: #ffb454;
  --accent-text: #ffb454;
  --accent-contrast: #1a1006;
  --accent-glow: rgba(255, 180, 84, 0.22);
  --error: #ff7a7a;
  --negative: #c98890;
  --radius-control: 8px;
  --radius-card: 12px;
  --radius-pill: 20px;
  /* Elevation is gone as a card/shadow system — the new world is a flat
     plane read by mesh density and glow depth, not drop shadows. --shadow-*
     survive only for the modal (a real overlay, genuinely "lifted" above
     the page) and the scroll hint. */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 10px -2px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 12px 28px -6px rgba(0, 0, 0, 0.55);
  --space-section: 20px 24px;
  --space-section-sm: 16px;
  /* Mesh grille — the protective mesh in front of an instrument/cathode
     display, the one texture this world earns (it is the subject's own
     material, not decoration). CSS-only dot lattice, no image asset. */
  --mesh: radial-gradient(circle at 1px 1px, rgba(236, 231, 218, 0.05) 1px, transparent 0);
  --mesh-size: 5px 5px;
}

/* Light Mode — "daylight readout." Same instrument geometry, paper/ink
   temperature instead of night-glow. Accent darkens for daylight contrast
   (single value for both fill and text — it already clears 4.5:1 as text,
   unlike dark mode's headroom-driven split that isn't needed here either). */
:root[data-theme="light"] {
  --bg: #f6f2e7;
  --panel: #fffbf3;
  --panel-tint: #faf6ec;
  --border: #e4d8bc;
  --text: #211d14;
  --muted: #6b6455;
  --ghost: #c9bfa4;
  --accent: #a04a15;
  --accent-text: #a04a15;
  --accent-contrast: #fffbf5;
  --accent-glow: rgba(160, 74, 21, 0.16);
  --error: #b4232b;
  --negative: #8c4a4c;
  --mesh: radial-gradient(circle at 1px 1px, rgba(33, 29, 20, 0.05) 1px, transparent 0);
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f6f2e7;
    --panel: #fffbf3;
    --panel-tint: #faf6ec;
    --border: #e4d8bc;
    --text: #211d14;
    --muted: #6b6455;
    --ghost: #c9bfa4;
    --accent: #a04a15;
    --accent-text: #a04a15;
    --accent-contrast: #fffbf5;
    --accent-glow: rgba(160, 74, 21, 0.16);
    --error: #b4232b;
    --negative: #8c4a4c;
    --mesh: radial-gradient(circle at 1px 1px, rgba(33, 29, 20, 0.05) 1px, transparent 0);
  }
}

* { box-sizing: border-box; }

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

body {
  font-family: var(--font-body);
  background-color: var(--bg);
  background-image: var(--mesh);
  background-size: var(--mesh-size);
  color: var(--text);
  max-width: 900px;
  margin: 0 auto;
  padding: 32px 20px 80px;
}

/* Tabular figures everywhere numbers appear in body-font contexts (the
   handful of inline numbers inside otherwise-prose text) — cheap, correct,
   and one of the "browser surfaces" a built page is expected to theme. */
body { font-variant-numeric: tabular-nums; }

header { text-align: center; margin-bottom: 32px; position: relative; }
h1 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.subtitle { color: var(--muted); }

section h2,
.trophy-label,
.bracket-round-label,
th,
.jump-pill,
.segmented-btn,
.ai-kicker,
.narrative-title,
.stat-card-eyebrow,
.stat-card-narrative-title,
.grade-caption,
.todo-label,
.section-group-header {
  font-family: var(--font-display);
}

.lang-toggle {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  gap: 4px;
}
.lang-toggle button {
  padding: 5px 10px;
  font-size: 12px;
  font-family: var(--font-display);
  border-radius: var(--radius-control);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-weight: 600;
}
.lang-toggle button:hover { opacity: 1; color: var(--text); }
.lang-toggle button.active { background: var(--accent); color: var(--accent-contrast); border-color: var(--accent); }

#league-form {
  display: flex;
  gap: 8px;
  max-width: 560px;
  margin: 0 auto 8px;
}

#league-id {
  flex: 1;
  padding: 12px 14px;
  border-radius: var(--radius-control);
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  font-family: var(--font-display);
  font-size: 14px;
}
#league-id:hover:not(.invalid) { border-color: var(--accent); }
#league-id.invalid { border-color: var(--error); }
#league-id.invalid:focus { box-shadow: 0 0 0 3px rgba(255, 122, 122, 0.25); }
.field-error { color: var(--error); font-size: 13px; text-align: center; margin: -4px 0 8px; min-height: 18px; }

/* Focus ring — amber glow at 30% opacity, matches the cathode accent
   instead of the old green. Error state (invalid League ID) still uses the
   red ring above, the only place red appears, never "loss" in a stat. */
#league-id:focus-visible,
#my-team-select:focus-visible,
button:focus-visible,
.card-trigger-btn:focus-visible,
.card-trigger-row:focus-visible,
.card-trigger-cell:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(255, 180, 84, 0.3);
}

button {
  padding: 12px 20px;
  border-radius: var(--radius-control);
  border: none;
  background: var(--accent);
  color: var(--accent-contrast);
  font-family: var(--font-display);
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s ease;
}
button:hover { opacity: 0.9; }
button:active { opacity: 0.8; }
button:disabled { opacity: 0.5; cursor: not-allowed; }

.form-help { text-align: center; margin-top: 0; }
.form-help a { color: var(--accent-text); text-decoration: none; }
.form-help a:hover { text-decoration: underline; }

.link-btn {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-size: 13px;
  color: var(--accent-text);
  text-decoration: none;
  cursor: pointer;
}
.link-btn:hover { opacity: 1; text-decoration: underline; }

/* Same layout as #league-form — an alternate path to the same result, not a
   visually distinct sub-feature. */
#username-lookup-form { display: flex; gap: 8px; max-width: 560px; margin: 12px auto 8px; }
#username-lookup-form[hidden] { display: none; }
#sleeper-username {
  flex: 1;
  padding: 12px 14px;
  border-radius: var(--radius-control);
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  font-family: var(--font-display);
  font-size: 14px;
}
#sleeper-username:hover { border-color: var(--accent); }

#username-lookup-result { max-width: 560px; margin: 0 auto 16px; display: flex; flex-direction: column; gap: 6px; }
.league-result-btn {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-control);
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 500;
  text-align: left;
}
.league-result-btn:hover { border-color: var(--accent); opacity: 1; }
.league-result-season { color: var(--muted); font-size: 12px; font-family: var(--font-display); flex-shrink: 0; }

.turnstile-wrap { display: flex; justify-content: center; margin: 0 0 8px; }

#status { text-align: center; color: var(--muted); min-height: 20px; }

@keyframes skeleton-pulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}
.skeleton {
  background: var(--border);
  border-radius: var(--radius-control);
  animation: skeleton-pulse 1.4s ease-in-out infinite;
}

/* Sections: the "no card-box" material — a hairline top-rule (the readout's
   own frame edge) instead of a bordered, shadowed box. A very faint panel
   tint still separates one section's plane from the next on a 20-section
   page, because Operate mode's scanability outranks the challenger world's
   literal "no rules anywhere" — the discipline survives as restraint, not
   as an unreadable wall of undifferentiated content. */
section {
  background: var(--panel-tint);
  border: none;
  border-top: 1px solid var(--border);
  border-radius: 0;
  padding: var(--space-section);
  margin-bottom: 20px;
  box-shadow: none;
}

section h2 { margin-top: 0; font-size: 19px; font-weight: 700; letter-spacing: -0.01em; }
.hint { color: var(--muted); font-size: 13px; margin-top: -8px; }

/* One of ~20 same-shell sections needs to say "this one's the payoff" — a
   2px accent top rule, brighter than the ambient hairline, doubled the way
   the marquee doubles a standout value. */
.section-anchor { border-top: 2px solid var(--accent); box-shadow: 0 1px 0 var(--accent-glow); }

@media (prefers-reduced-motion: no-preference) {
  .reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.4s ease, transform 0.4s ease; }
  .reveal.in-view { opacity: 1; transform: none; }
}

.section-group-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 32px 4px 4px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}
.section-group-header::after { content: ""; flex: 1; height: 1px; background: var(--border); }

.jump-nav {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  gap: 6px;
  padding: 10px 0;
  margin: 0 0 8px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
}
.jump-nav::-webkit-scrollbar { display: none; }
.jump-pill {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 600;
  padding: 7px 13px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.jump-pill:hover { color: var(--text); border-color: var(--muted); opacity: 1; }
.jump-pill.active { background: var(--accent); border-color: var(--accent); color: var(--accent-contrast); }

.season-filter-bar { margin: 4px 4px 20px; }
.transaction-history-search { margin: 4px 0 16px; }

.segmented-filter {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}
.segmented-filter::-webkit-scrollbar { display: none; }
.segmented-btn {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  border: none;
  background: transparent;
  color: var(--muted);
  transition: background-color 0.15s ease, color 0.15s ease;
}
.segmented-btn:hover:not(.active) { color: var(--text); opacity: 1; }
.segmented-btn.active { background: var(--accent); color: var(--accent-contrast); }

select {
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
}
select:hover:not(:disabled) { border-color: var(--accent); }
select:disabled { opacity: 0.5; cursor: not-allowed; }

#about-section { max-width: 560px; margin-left: auto; margin-right: auto; }
#about-section p { color: var(--muted); font-size: 14px; line-height: 1.5; }
#about-section ul { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-direction: column; gap: 8px; }
#about-section li {
  font-size: 13px;
  line-height: 1.5;
  padding-left: 20px;
  position: relative;
}
#about-section li::before {
  content: "✓";
  color: var(--accent-text);
  position: absolute;
  left: 0;
  font-weight: 700;
}

/* Data tables read in the instrument face by default (numerals, codes,
   short labels — measurement, the sanctioned use of monospace); the one
   column that carries a proper noun (a manager/team name) resets to body
   prose so names stay in the reading voice, not the readout voice. */
table { width: 100%; border-collapse: collapse; margin-top: 8px; font-family: var(--font-display); }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); font-size: 13.5px; }
th { color: var(--muted); font-weight: 600; text-transform: uppercase; font-size: 10.5px; letter-spacing: 0.05em; }
td.name-cell, .row-label { font-family: var(--font-body); }

/* The lit row — struck forward against the table's other rows, amber glow
   instead of a flat green tint. */
.goat-row { background: transparent; color: var(--accent-text); font-weight: 700; text-shadow: 0 0 12px var(--accent-glow); }

table tr:hover:not(.goat-row):not(.is-me) { background: rgba(255, 180, 84, 0.06); }

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-scroll table { min-width: max-content; }

.mobile-stat-cards { display: none; }
.mobile-stat-card { border-top: 1px solid var(--border); border-radius: 0; padding: 12px 0; margin-bottom: 10px; }
.mobile-stat-card:last-child { margin-bottom: 0; }
.mobile-stat-card-name { font-family: var(--font-body); font-weight: 700; font-size: 14px; margin-bottom: 10px; }
.mobile-stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px 8px; font-family: var(--font-display); }
.mobile-stat { text-align: center; }
.mobile-stat-num { font-size: 16px; font-weight: 700; }
.mobile-stat-num.max { color: var(--accent-text); text-shadow: 0 0 10px var(--accent-glow); }
.mobile-stat-label { font-size: 9px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; margin-top: 2px; }
.mobile-stat-proj { font-size: 9px; color: var(--muted); margin-top: 1px; }

/* GOAT hero — the page's single headline stat, rendered as a struck-forward
   readout: no tinted card box, just the glow doing the work. */
.goat-hero {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 0;
  margin-bottom: 16px;
  background: transparent;
  border: none;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  box-shadow: none;
}
.goat-hero-emoji { font-size: 36px; line-height: 1; filter: grayscale(0.3); }
.goat-hero-name { font-family: var(--font-body); font-size: 20px; font-weight: 700; }
.goat-hero-rings { font-family: var(--font-display); font-size: 18px; margin: 2px 0; color: var(--accent-text); text-shadow: 0 0 10px var(--accent-glow); }
.goat-hero-stats { font-family: var(--font-display); color: var(--muted); font-size: 13px; }

table.matrix th, table.matrix td { text-align: center; white-space: nowrap; }
table.matrix .row-label { text-align: left; color: var(--text); text-transform: none; font-size: 13px; }
table.matrix td.diag { color: var(--ghost); }

td.depth-max { color: var(--accent-text); font-weight: 700; text-shadow: 0 0 10px var(--accent-glow); }

/* ---- Week recap ------------------------------------------------------ */
.week-callout {
  background: transparent;
  border: none;
  border-left: 2px solid var(--accent);
  border-radius: 0;
  padding: 10px 14px;
  margin-bottom: 8px;
  font-size: 14px;
  line-height: 1.5;
}
.week-results {
  margin: 14px 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.matchup-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  font-family: var(--font-display);
}
.matchup-row:last-child { border-bottom: none; }
.matchup-team { flex: 1; font-family: var(--font-body); }
.matchup-team:last-child { text-align: right; }
.matchup-team.won { color: var(--accent-text); font-weight: 700; text-shadow: 0 0 10px var(--accent-glow); }
.matchup-team.is-me { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; }
.matchup-vs { color: var(--ghost); font-size: 11px; text-transform: uppercase; flex: 0; font-family: var(--font-display); }

/* Narrative cards — the one place prose is the point, so they stay in body
   font throughout including the title, and keep a real (if flatter) panel
   so a paragraph of text has somewhere legible to sit. */
#narratives-section {
  background: var(--panel-tint);
  border-top: 2px solid var(--accent);
}
.narrative-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  margin-top: 12px;
}
.narrative-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 18px;
  box-shadow: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  font-family: var(--font-body);
}
.narrative-card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-glow);
}
.narrative-icon { font-size: 26px; margin-bottom: 6px; filter: grayscale(0.2); }
.narrative-title {
  color: var(--accent-text);
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 6px;
}
.narrative-headline { font-size: 17px; font-weight: 700; margin-bottom: 6px; line-height: 1.3; }
.narrative-detail { color: var(--muted); font-size: 13px; line-height: 1.5; }

.card-trigger-row, .card-trigger-cell { cursor: pointer; transition: background-color 0.15s ease, color 0.15s ease; }
.card-trigger-row:hover { background: rgba(255, 180, 84, 0.12); }
td.card-trigger-cell:hover { background: rgba(255, 180, 84, 0.16); color: var(--accent-text); }
.card-hint-tap { text-align: center; margin: 0 0 12px; }

.coachmark {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--accent);
  color: var(--accent-contrast);
  border-radius: var(--radius-pill);
  padding: 8px 8px 8px 16px;
  margin-bottom: 12px;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-body);
}
.coachmark[hidden] { display: none; }
.coachmark button {
  background: rgba(26, 16, 6, 0.18);
  color: inherit;
  width: 22px;
  height: 22px;
  padding: 0;
  border-radius: 50%;
  font-size: 12px;
  line-height: 1;
  flex-shrink: 0;
}
.coachmark button:hover { opacity: 1; background: rgba(26, 16, 6, 0.3); }

.scroll-hint {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  background: var(--accent);
  color: var(--accent-contrast);
  border-radius: var(--radius-pill);
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-body);
  box-shadow: var(--shadow-lg);
  z-index: 5;
  cursor: pointer;
  animation: scroll-hint-bounce 1.4s ease-in-out infinite;
}
.scroll-hint[hidden] { display: none; }

@keyframes scroll-hint-bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-6px); }
}

.season-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.season-header h3 { margin: 16px 0 0; font-family: var(--font-display); }
.season-header-actions { display: flex; gap: 8px; }

.card-trigger-btn,
.ai-analyze-btn,
.ta-analyze-btn,
.roast-btn {
  padding: 6px 12px;
  font-size: 12px;
  font-family: var(--font-display);
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: transparent;
}
.card-trigger-btn { font-weight: 600; color: var(--text); }
.card-trigger-btn:hover { border-color: var(--accent); color: var(--accent-text); opacity: 1; }
.narrative-card { position: relative; }
.narrative-card .card-trigger-btn { margin-top: 12px; }

/* ---- Share card modal — the one genuine "lifted" surface left; a modal
   is interruption by definition, so it earns real elevation. --------- */
.card-modal {
  position: fixed;
  inset: 0;
  background: rgba(4, 5, 8, 0.86);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
}
.card-modal[hidden] { display: none; }
.card-modal-inner {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 24px;
  max-width: 400px;
  width: 100%;
  position: relative;
  text-align: center;
  box-shadow: var(--shadow-lg);
}
.card-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 50%;
  background: var(--border);
  color: var(--text);
  font-size: 14px;
  line-height: 1;
}
.card-canvas-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}
.card-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}
.card-actions button { flex: 1; }
#card-share { background: var(--border); color: var(--text); }
#card-hint { min-height: 18px; margin: 10px 0 0; font-family: var(--font-body); }

/* The card itself — the brand asset. Always dark, always the marquee, now
   for a reason rather than an exception: dark IS the primary identity, so
   the card matches the mode the whole redesign is built around. */
.stat-card {
  --bg: #0a0d14;
  --panel: #12161f;
  --border: #262e40;
  --text: #ece7da;
  --muted: #838b9e;
  --ghost: #3a4358;
  --accent: #ffb454;
  width: 320px;
  height: 320px;
  border-radius: var(--radius-card);
  background-color: var(--bg);
  background-image:
    radial-gradient(120% 90% at 50% 0%, rgba(255, 180, 84, 0.08) 0%, transparent 62%),
    radial-gradient(circle at 1px 1px, rgba(236, 231, 218, 0.06) 1px, transparent 0);
  background-size: auto, 5px 5px;
  border: 1px solid var(--border);
  border-top: 2px solid var(--accent);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  color: var(--text);
  font-family: var(--font-body);
}
.stat-card-eyebrow {
  font-family: var(--font-display);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 14px;
  text-align: center;
}
.stat-card-emoji { font-size: 44px; line-height: 1; margin-bottom: 8px; filter: grayscale(0.3); }
.stat-card-name { font-size: 22px; font-weight: 700; text-align: center; }
.stat-card-rings { font-family: var(--font-display); font-size: 20px; margin: 6px 0 16px; }
.stat-card-stat-row { display: flex; gap: 18px; font-family: var(--font-display); }
.stat-card-stat { display: flex; flex-direction: column; align-items: center; }
.stat-card-num { font-size: 18px; font-weight: 700; }
.stat-card-label { font-family: var(--font-body); font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; margin-top: 2px; }

.stat-card-vs { display: flex; align-items: center; gap: 10px; }
.stat-card-vs-name { font-family: var(--font-body); font-size: 17px; font-weight: 700; max-width: 110px; text-align: center; }
.stat-card-vs-versus { font-family: var(--font-display); color: var(--accent); font-size: 12px; font-weight: 700; }
.stat-card-record { font-family: var(--font-display); font-size: 40px; font-weight: 800; margin: 18px 0 6px; color: var(--accent); text-shadow: 0 0 16px rgba(255, 180, 84, 0.3); }
.stat-card-caption { font-family: var(--font-body); color: var(--muted); font-size: 12px; }

.stat-card-season { font-family: var(--font-display); font-size: 30px; font-weight: 800; margin-top: 4px; }
.stat-card-ranklist { width: 100%; margin-top: 16px; font-family: var(--font-display); }
.stat-card-rank-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
}
.stat-card-rank-row:last-child { border-bottom: none; }

.stat-card-week-block { text-align: center; margin-bottom: 16px; }
.stat-card-week-block:last-child { margin-bottom: 0; }
.stat-card-week-score { font-family: var(--font-display); font-size: 15px; font-weight: 700; margin: 4px 0; }

.stat-card-narrative-title {
  font-family: var(--font-display);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 8px;
}
.stat-card-narrative-headline { font-size: 19px; font-weight: 700; text-align: center; line-height: 1.3; margin-bottom: 10px; }
.stat-card-narrative-detail { color: var(--muted); font-size: 13px; text-align: center; line-height: 1.5; }

.stat-card-footer {
  position: absolute;
  bottom: 16px;
  font-family: var(--font-display);
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.03em;
}
.stat-card { position: relative; }

/* ---- AI-card shell — Roast My Team, Who Won This Trade, Trade Analyzer.
   Same always-dark brand-asset rule as .stat-card. */
.ai-card {
  --bg: #0a0d14;
  --panel: #12161f;
  --border: #232a38;
  --text: #ece7da;
  --muted: #838b9e;
  --accent: #ffb454;
  --accent-glow: rgba(255, 180, 84, 0.24);
  width: 320px;
  height: 569px;
  border-radius: var(--radius-card);
  background-color: var(--bg);
  background-image:
    radial-gradient(120% 90% at 50% 0%, rgba(255, 180, 84, 0.07) 0%, transparent 62%),
    radial-gradient(circle at 1px 1px, rgba(236, 231, 218, 0.05) 1px, transparent 0);
  background-size: auto, 5px 5px;
  border: 1px solid var(--border);
  position: relative;
  color: var(--text);
  font-family: var(--font-body);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.ai-card.ai-card--warn { --accent: #c9a34e; --accent-glow: rgba(201, 163, 78, 0.2); }
.ai-card.ai-card--neutral { --accent: #9a9ea6; --accent-glow: rgba(154, 158, 166, 0.16); }
.ai-card.ai-card--bad { --accent: #ff7a7a; --accent-glow: rgba(255, 122, 122, 0.22); }

.ai-card .safe-top { height: 60px; flex-shrink: 0; }
.ai-card .safe-bottom { height: 52px; flex-shrink: 0; }
.ai-body { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 0 24px; text-align: center; min-height: 0; }

.ai-kicker,
.ai-text,
.ai-card-name,
.vs-name,
.vs-players,
.todo-item-text {
  overflow-wrap: break-word;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ai-kicker { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.09em; color: var(--accent); -webkit-line-clamp: 1; line-clamp: 1; }
.ai-hypo-tag {
  margin-top: 6px;
  font-family: var(--font-display);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 3px 10px;
}
.ai-divider { width: 34px; height: 2px; background: var(--border); border-radius: 2px; margin: 16px 0; flex-shrink: 0; }
.ai-text { font-size: 13.5px; line-height: 1.6; color: #c7cad1; max-width: 258px; -webkit-line-clamp: 6; line-clamp: 6; }
.ai-footer { font-family: var(--font-display); text-align: center; font-size: 10px; letter-spacing: 0.03em; color: #5b6068; padding-bottom: 4px; }

.ai-card-name { font-size: 18px; font-weight: 700; margin-top: 8px; -webkit-line-clamp: 1; line-clamp: 1; }
.grade-ring {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  margin: 16px 0 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(60% 60% at 50% 40%, var(--accent-glow), transparent 70%);
  border: 1.5px solid var(--accent);
}
.grade-letter { font-family: var(--font-display); font-size: 46px; font-weight: 800; color: var(--accent); line-height: 1; text-shadow: 0 0 16px var(--accent-glow); }
.grade-caption { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 4px; }
.todo-box {
  margin-top: 16px;
  width: 100%;
  max-width: 258px;
  text-align: left;
  background: rgba(236, 231, 218, 0.03);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 11px 13px;
  flex-shrink: 0;
}
.todo-label { font-family: var(--font-display); font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 6px; }
.todo-item { font-size: 12px; line-height: 1.5; color: #d8dae0; display: flex; gap: 7px; }
.todo-item::before { content: "→"; color: var(--accent); flex-shrink: 0; }
.todo-item-text { -webkit-line-clamp: 1; line-clamp: 1; }
.todo-item + .todo-item { margin-top: 4px; }

.vs-row { display: flex; align-items: flex-start; justify-content: center; gap: 14px; width: 100%; margin-top: 14px; }
.vs-side { flex: 1; min-width: 0; }
.vs-name { font-size: 13.5px; font-weight: 700; margin-bottom: 4px; -webkit-line-clamp: 1; line-clamp: 1; }
.vs-players { font-size: 11.5px; color: #9a9ea6; line-height: 1.4; min-height: 32px; -webkit-line-clamp: 2; line-clamp: 2; }
.vs-value { font-family: var(--font-display); font-size: 15px; font-weight: 800; margin-top: 6px; color: #d8dae0; }
.vs-side.winner .vs-value { color: var(--accent); text-shadow: 0 0 12px var(--accent-glow); }
.vs-crown { font-size: 13px; margin-bottom: 2px; min-height: 15px; }
.vs-mid { font-family: var(--font-display); font-size: 11px; font-weight: 700; color: #4a4f59; padding-top: 22px; flex-shrink: 0; }

.verdict-pill {
  display: inline-block;
  margin-top: 14px;
  padding: 6px 16px;
  border-radius: var(--radius-pill);
  font-family: var(--font-display);
  font-size: 12.5px;
  font-weight: 700;
  border: 1.5px solid var(--accent);
  color: var(--accent);
  background: var(--accent-glow);
  flex-shrink: 0;
}

.card-share-btn { display: block; margin-top: 10px; }

/* ---- "Mi equipo" selector + highlighting --------------------------- */
#my-team-section {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
#my-team-section label { font-weight: 600; }
#my-team-section .hint { margin: 0; flex-basis: 100%; }

.points-report-controls { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-size: 13px; color: var(--muted); }
#points-report-scope { padding: 6px 10px; font-size: 13px; }
.pp-cell { display: flex; flex-direction: column; align-items: center; gap: 1px; }
.pp-actual { font-weight: 700; }
.pp-actual.power-up { color: var(--accent-text); text-shadow: 0 0 8px var(--accent-glow); }
.pp-actual.power-down { color: var(--negative); }
.pp-projected { font-size: 11px; color: var(--ghost); }

tr.is-me { background: rgba(255, 180, 84, 0.12); }
tr.is-me td:first-child, tr.is-me th.row-label { box-shadow: inset 3px 0 0 var(--accent); }
th.is-me { color: var(--accent-text); }
.goat-hero.is-me { border-top-color: var(--accent); box-shadow: inset 0 1px 0 var(--accent), inset 0 -1px 0 var(--accent); }

.narrative-card.mentions-me {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-glow);
}

/* ---- Trophy Case ------------------------------------------------------ */
.trophy-card { display: flex; flex-direction: column; gap: 10px; max-width: 360px; }
.trophy-slot { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.trophy-label { font-size: 11px; color: var(--muted); flex-shrink: 0; }
.trophy-name { font-family: var(--font-body); font-weight: 600; text-align: right; }
.trophy-extra { font-family: var(--font-display); font-size: 11px; }

/* ---- Playoff Bracket --------------------------------------------------- */
.bracket { display: flex; gap: 20px; overflow-x: auto; padding-bottom: 4px; }
.bracket-round { display: flex; flex-direction: column; gap: 14px; min-width: 160px; }
.bracket-round-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); margin-top: 0; }
.bracket-match {
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  overflow: hidden;
}
.bracket-team { padding: 8px 10px; font-family: var(--font-body); font-size: 13px; border-bottom: 1px solid var(--border); }
.bracket-team:last-child { border-bottom: none; }
.bracket-team.won { background: transparent; color: var(--accent-text); font-weight: 700; text-shadow: 0 0 8px var(--accent-glow); }

/* ---- Power Rankings ---------------------------------------------------- */
.power-up { color: var(--accent-text); font-weight: 700; text-shadow: 0 0 8px var(--accent-glow); }
.power-down { color: var(--negative); font-weight: 700; }
.power-flat { color: var(--ghost); }

/* ---- Season Trend ------------------------------------------------------- */
.trend-list { display: flex; flex-direction: column; gap: 10px; }
.trend-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.trend-name { font-family: var(--font-body); font-size: 13px; flex-shrink: 0; }
.sparkline { width: 160px; height: 32px; flex-shrink: 0; }
.sparkline polyline { fill: none; stroke: var(--accent); stroke-width: 2; }
.sparkline circle { fill: var(--accent); }

/* ---- Transaction History ------------------------------------------------ */
.transaction-row { padding: 12px 0; border-bottom: 1px solid var(--border); }
.transaction-row:last-child { border-bottom: none; }
.transaction-meta { margin-bottom: 6px; }
.waiver-move, .draft-pick { font-family: var(--font-body); font-size: 14px; line-height: 1.4; }
.trade-sides { display: flex; align-items: center; gap: 12px; }
.trade-side { flex: 1; font-family: var(--font-body); font-size: 14px; line-height: 1.4; }
.trade-vs { font-family: var(--font-display); color: var(--ghost); font-size: 12px; flex-shrink: 0; }

.trade-ai { margin-top: 10px; }
.ai-analyze-btn,
.ta-analyze-btn {
  font-weight: 700;
  color: var(--muted);
}
.ai-analyze-btn:hover:not(:disabled),
.ta-analyze-btn:hover:not(:disabled) { color: var(--accent-text); border-color: var(--accent); opacity: 1; }
.ai-analyze-btn:disabled,
.ta-analyze-btn:disabled { cursor: default; opacity: 0.6; }
.ai-result {
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: var(--radius-control);
  background: var(--panel);
  border: 1px solid var(--border);
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.5;
}
.ai-result p { margin: 0; }

@media (max-width: 480px) {
  .trade-sides { flex-direction: column; align-items: flex-start; gap: 6px; }
  .trade-vs { display: none; }
}

/* ---- Trade Analyzer ------------------------------------------------------ */
.ta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 12px; }
.ta-side select { width: 100%; margin-bottom: 10px; }
.player-checklist {
  max-height: 320px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  padding: 8px 10px;
}
.player-checklist-group h4 { font-family: var(--font-display); margin: 10px 0 4px; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.player-checklist-group:first-child h4 { margin-top: 0; }
.player-checklist-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 5px 2px;
  font-size: 13px;
  cursor: pointer;
  font-family: var(--font-body);
}
.player-checklist-row:hover { color: var(--accent-text); }
.player-checklist-name { font-weight: 600; }
.player-checklist-meta { font-family: var(--font-display); color: var(--muted); font-size: 12px; }

.ta-totals {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin: 14px 0;
  padding: 10px 12px;
  border-radius: var(--radius-control);
  background: var(--panel);
  border: 1px solid var(--border);
  font-family: var(--font-display);
  font-size: 13px;
}
.ta-actions { margin: 10px 0; }

.verdict-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 8px;
  border: 1px solid var(--border);
}
.verdict-badge.verdict-steal_for_you,
.verdict-badge.verdict-win_for_you { color: var(--accent-text); border-color: var(--accent-text); }
.verdict-badge.verdict-fair { color: var(--muted); }
.verdict-badge.verdict-win_for_them,
.verdict-badge.verdict-steal_for_them { color: var(--negative); border-color: var(--negative); }

/* ---- Roast My Team ----------------------------------------------------- */
.roast-actions { margin: 10px 0; }
.roast-btn { font-weight: 700; color: var(--muted); }
.roast-btn:hover:not(:disabled) { color: var(--accent-text); border-color: var(--accent); opacity: 1; }
.roast-btn:disabled { cursor: default; opacity: 0.6; }
.roast-result {
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: var(--radius-control);
  background: var(--panel);
  border: 1px solid var(--border);
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.5;
}
.roast-result p { margin: 0; }
.roast-result ul { margin: 4px 0 0; padding-left: 18px; }
.roast-result li { margin-bottom: 4px; }
.roast-suggestions-title { margin: 12px 0 4px; font-weight: 600; }

.grade-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 8px;
  border: 1px solid var(--border);
}
.grade-badge.grade-A,
.grade-badge.grade-B { color: var(--accent-text); border-color: var(--accent-text); }
.grade-badge.grade-C { color: var(--muted); }
.grade-badge.grade-D,
.grade-badge.grade-F { color: var(--negative); border-color: var(--negative); }

@media (max-width: 480px) {
  .ta-grid { grid-template-columns: 1fr; }
}

/* ---- Trade Suggester ---------------------------------------------------- */
.trade-suggest-pickers { margin-top: 12px; }
.trade-suggest-pickers select { width: 100%; }
.trade-suggest-package {
  margin: 8px 0;
  padding: 8px 10px;
  border-radius: var(--radius-control);
  background: var(--bg);
  border: 1px solid var(--border);
  font-family: var(--font-body);
}

.recommendation-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 8px;
  border: 1px solid var(--border);
}
.recommendation-badge.recommendation-propose { color: var(--accent-text); border-color: var(--accent-text); }
.recommendation-badge.recommendation-pass { color: var(--muted); }

/* ---- Site footer -------------------------------------------------------- */
.site-footer {
  max-width: 560px;
  margin: 48px auto 0;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}
.site-footer p { margin: 4px 0; }
.site-footer a { color: var(--accent-text); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }

/* ---- Privacy Policy page (privacy.html) --------------------------------- */
.legal-page { max-width: 640px; margin: 0 auto; }
.legal-page h2 { margin-bottom: 4px; }
.legal-page section { margin-top: 28px; }
.legal-page h3 { font-family: var(--font-display); font-size: 15px; margin-bottom: 6px; }
.legal-page p { font-family: var(--font-body); font-size: 14px; line-height: 1.6; margin: 0 0 8px; }
.legal-page li { font-family: var(--font-body); font-size: 14px; line-height: 1.6; }
.legal-page ul { padding-left: 20px; display: flex; flex-direction: column; gap: 8px; margin: 0; }
.legal-page a { color: var(--accent-text); }

/* ---- Browser surfaces — themed, not left to defaults -------------------- */
::selection { background: var(--accent); color: var(--accent-contrast); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: var(--ghost); }

@media (max-width: 480px) {
  body { padding: 20px 12px 60px; }
  #league-form, #username-lookup-form { flex-direction: column; max-width: 100%; }
  section { padding: var(--space-section-sm); }
  h1 { font-size: 22px; }
  .stat-card { width: 280px; height: 280px; padding: 20px; }
  .lang-toggle { position: static; justify-content: center; margin-bottom: 12px; }
  .table-scroll.has-mobile-cards { display: none; }
  .mobile-stat-cards { display: block; }
}
