@import url("https://fonts.googleapis.com/css2?family=Oswald:wght@500;600;700&family=Source+Serif+4:opsz,wght@8..60,400;8..60,500;8..60,600;8..60,700&display=swap");

:root {
  --display-font: "Oswald", system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif-font: "Source Serif 4", Georgia, "Times New Roman", serif;
  --ui-font: system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
  --surface: #fcfdfd;
  --page: #f3f6f6;
  --text-primary: #12161a;
  --text-secondary: #3d195b;
  --text-muted: #7b46a8;
  --accent-ink: #3d195b;
  --gridline: #e0e6e5;
  --baseline: #bac4c2;
  --border: rgba(13, 22, 20, 0.1);
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --series-3: #1baf7a;
  --series-4: #eda100;
  --good: #0ca30c;
  --pl-purple: #3d195b;
  --pl-green: #00ff85;
  --pl-gradient-start: #92ba19;
  --pl-gradient-end: #15a763;
  --pl-gradient: linear-gradient(135deg, var(--pl-gradient-start), var(--pl-gradient-end));
  --pos-gk: #92ba19;
  --pos-df: #68b432;
  --pos-mf: #3fad4a;
  --pos-fw: #15a763;
  --accent-primary: var(--pl-purple);
  --accent-secondary: var(--pl-green);
  --accent-text-on-primary: #ffffff;
  --shadow-sm: 0 1px 3px rgba(10, 18, 17, 0.07);
  --shadow-md: 0 10px 28px rgba(10, 18, 17, 0.1);
  --shadow-lift: 0 16px 36px rgba(10, 18, 17, 0.14);
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --surface: #1c1924;
    --page: #121018;
    --text-primary: #f3f1ea;
    --text-secondary: #d9cdeb;
    --text-muted: #b199d6;
    --accent-ink: #c6a6ef;
    --gridline: rgba(255, 255, 255, 0.1);
    --baseline: rgba(255, 255, 255, 0.28);
    --border: rgba(255, 255, 255, 0.12);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 10px 28px rgba(0, 0, 0, 0.45);
    --shadow-lift: 0 16px 36px rgba(0, 0, 0, 0.55);
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--text-primary);
  font-family: var(--ui-font);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: var(--pl-gradient-end);
  color: #ffffff;
}

a {
  text-underline-offset: 2px;
}

:focus-visible {
  outline: 2px solid var(--pl-gradient-end);
  outline-offset: 3px;
  border-radius: 2px;
}

.wrap {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 16px;
}

.brand-strip {
  height: 5px;
  background: linear-gradient(90deg, var(--pl-gradient-start), var(--pl-gradient-end));
}

.progress-rail {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  z-index: 60;
  background: transparent;
  pointer-events: none;
}

.progress-rail .fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--pl-purple), var(--pl-gradient-end));
  transition: width 0.08s linear;
}

.eyebrow {
  font-family: var(--display-font);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 14px;
}

.byline {
  color: var(--text-secondary);
  margin: 0 0 18px;
  font-size: 0.95rem;
  font-family: var(--serif-font);
  font-style: italic;
}

.summary {
  font-family: var(--serif-font);
  font-size: 1.14rem;
  line-height: 1.6;
  color: var(--text-secondary);
  max-width: 68ch;
}

.summary::first-letter {
  font-family: var(--serif-font);
  font-weight: 600;
  font-size: 3.6em;
  float: left;
  line-height: 0.82;
  padding: 0.04em 0.08em 0 0;
  color: var(--accent-ink);
}

nav.site-nav {
  display: flex;
  gap: 24px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

nav.site-nav .nav-inner {
  max-width: 860px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  gap: 24px;
  align-items: center;
}

nav.site-nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  font-family: var(--display-font);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  font-size: 0.82rem;
}

nav.site-nav a:hover {
  color: var(--accent-primary);
}

nav.site-nav a.current {
  color: var(--accent-primary);
  border-bottom: 2px solid var(--accent-primary);
  padding-bottom: 2px;
}

nav.site-nav.nav-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background 0.3s ease, border-color 0.3s ease, backdrop-filter 0.3s ease;
}

nav.site-nav.nav-overlay a {
  color: rgba(255, 255, 255, 0.88);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

nav.site-nav.nav-overlay a:hover {
  color: #ffffff;
}

nav.site-nav.nav-overlay a.current {
  color: #ffffff;
  border-bottom-color: var(--pl-gradient-end);
}

nav.site-nav.nav-overlay.scrolled {
  background: var(--surface);
  border-bottom-color: var(--border);
  backdrop-filter: saturate(1.1);
}

nav.site-nav.nav-overlay.scrolled a {
  color: var(--text-muted);
  text-shadow: none;
}

nav.site-nav.nav-overlay.scrolled a:hover {
  color: var(--accent-primary);
}

nav.site-nav.nav-overlay.scrolled a.current {
  color: var(--accent-primary);
  border-bottom-color: var(--accent-primary);
}

/* hero */

.hero {
  position: relative;
  min-height: 92vh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  color: #ffffff;
  isolation: isolate;
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
}

.hero-img {
  width: 100%;
  height: 112%;
  object-fit: cover;
  object-position: center 28%;
  transform: scale(1.06);
  will-change: transform;
}

.hero-scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(9, 7, 13, 0.1) 0%, rgba(9, 7, 13, 0.38) 48%, rgba(7, 6, 11, 0.94) 100%),
    linear-gradient(100deg, rgba(7, 6, 11, 0.8) 0%, rgba(7, 6, 11, 0.2) 55%, rgba(7, 6, 11, 0.45) 100%);
}

.hero-content {
  position: relative;
  padding: 0 16px 70px;
  max-width: 860px;
}

.eyebrow-hero {
  color: #bfe98f;
}

.hero-title {
  font-family: var(--display-font);
  font-weight: 700;
  text-transform: uppercase;
  font-size: clamp(2.3rem, 6vw, 4.2rem);
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin: 0 0 16px;
  color: #ffffff;
  text-shadow: 0 6px 28px rgba(0, 0, 0, 0.5);
}

.hero-title span {
  background: linear-gradient(120deg, var(--pl-gradient-start), var(--pl-gradient-end));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-byline {
  color: #e7e0f2;
}

.hero-summary {
  color: #ece7f3;
  font-size: 1.12rem;
}

.hero-summary::first-letter {
  color: #d9c9f2;
}

.hero-scroll-cue {
  position: absolute;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  width: 28px;
  height: 44px;
  border: 2px solid rgba(255, 255, 255, 0.6);
  border-radius: 20px;
  z-index: 1;
}

.hero-scroll-cue span {
  position: absolute;
  top: 8px;
  left: 50%;
  width: 4px;
  height: 8px;
  background: #ffffff;
  border-radius: 2px;
  translate: -50% 0;
  animation: cueDrop 1.7s infinite;
}

@keyframes cueDrop {
  0% { opacity: 1; translate: -50% 0; }
  70% { opacity: 0; translate: -50% 14px; }
  100% { opacity: 0; translate: -50% 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-scroll-cue span { animation: none; opacity: 0.8; }
  .hero-img { transform: none !important; }
}

@media (max-width: 640px) {
  .hero {
    min-height: 78vh;
  }
  .hero-content {
    padding-bottom: 48px;
  }
}

.pl-badge {
  position: fixed;
  top: 14px;
  right: 20px;
  width: 118px;
  height: auto;
  z-index: 20;
  filter: drop-shadow(0 2px 6px rgba(11, 11, 11, 0.18));
}

@media (max-width: 640px) {
  .pl-badge {
    width: 70px;
    top: 10px;
    right: 12px;
  }
}

/* scroll reveal */

.reveal {
  opacity: 0;
  translate: 0 22px;
  transition: opacity 0.65s ease, translate 0.65s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.reveal.is-visible {
  opacity: 1;
  translate: 0 0;
}

.toc-rail {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 2px 14px;
  margin: 0 0 8px;
  scrollbar-width: thin;
}

.toc-rail a {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
  transition: border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.toc-rail a:hover {
  border-color: var(--pl-gradient-end);
  color: var(--accent-ink);
  transform: translateY(-1px);
}

.toc-rail a span {
  font-family: var(--display-font);
  color: var(--pl-gradient-end);
  font-weight: 700;
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin: 32px 0 44px;
}

.stat-tile {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px 16px 18px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.stat-tile::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--pl-gradient-start), var(--pl-gradient-end));
  opacity: 0.85;
}

.stat-tile:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.finding .stat-tile {
  background: var(--page);
}

.stat-tile .value {
  font-family: var(--display-font);
  font-size: 1.9rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.stat-tile .label {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-top: 7px;
  letter-spacing: 0.01em;
}

section.finding {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 30px 30px 34px;
  margin: 28px 0;
  box-shadow: var(--shadow-sm);
  scroll-margin-top: 24px;
  transition: box-shadow 0.2s ease;
}

section.finding:hover {
  box-shadow: var(--shadow-md);
}

section.finding h2 {
  font-family: var(--display-font);
  font-weight: 600;
  font-size: 1.62rem;
  line-height: 1.22;
  margin: 0 0 12px;
  padding-bottom: 12px;
  border-bottom: 3px solid var(--pl-gradient-end);
  display: inline-block;
}

section.finding .kicker {
  color: var(--text-muted);
  font-family: var(--display-font);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0 0 10px;
}

section.finding p {
  font-family: var(--serif-font);
  font-size: 1.03rem;
  line-height: 1.65;
  color: var(--text-secondary);
  max-width: 68ch;
}

section.finding {
  position: relative;
  overflow: hidden;
}

.finding-number {
  position: absolute;
  top: -4px;
  right: 22px;
  font-family: var(--serif-font);
  font-weight: 600;
  font-style: italic;
  font-size: 6.2rem;
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1.5px var(--pl-gradient-end);
  opacity: 0.16;
  pointer-events: none;
  user-select: none;
}

section.finding.theme-attack { border-left: 5px solid var(--pos-fw); }
section.finding.theme-mid { border-left: 5px solid var(--pos-mf); }
section.finding.theme-defense { border-left: 5px solid var(--pos-df); }
section.finding.theme-keeper { border-left: 5px solid var(--pos-gk); }
section.finding.theme-value { border-left: 5px solid var(--pl-purple); }

section.finding.theme-attack h2 { border-bottom-color: var(--pos-fw); }
section.finding.theme-mid h2 { border-bottom-color: var(--pos-mf); }
section.finding.theme-defense h2 { border-bottom-color: var(--pos-df); }
section.finding.theme-keeper h2 { border-bottom-color: var(--pos-gk); }
section.finding.theme-value h2 { border-bottom-color: var(--pl-purple); }

section.finding.theme-attack .finding-number { -webkit-text-stroke-color: var(--pos-fw); }
section.finding.theme-mid .finding-number { -webkit-text-stroke-color: var(--pos-mf); }
section.finding.theme-defense .finding-number { -webkit-text-stroke-color: var(--pos-df); }
section.finding.theme-keeper .finding-number { -webkit-text-stroke-color: var(--pos-gk); }
section.finding.theme-value .finding-number { -webkit-text-stroke-color: var(--pl-purple); }

.finding-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  align-items: start;
  margin-top: 18px;
}

.finding-split.reverse {
  direction: rtl;
}

.finding-split.reverse > * {
  direction: ltr;
}

.finding-split .chart-card {
  margin-top: 0;
  height: 320px;
}

@media (max-width: 760px) {
  .finding-split {
    grid-template-columns: 1fr;
  }
  .finding-split.reverse {
    direction: ltr;
  }
}

.pull-quote {
  font-family: var(--serif-font);
  font-weight: 600;
  font-style: italic;
  font-size: 1.22rem;
  line-height: 1.45;
  color: var(--accent-ink);
  border-left: 3px solid var(--pl-gradient-end);
  padding-left: 18px;
  margin: 20px 0;
  max-width: 60ch;
}

.callout-stat {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 28px;
  margin-top: 20px;
  padding: 26px;
  background: var(--page);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.callout-stat .big-number {
  font-family: var(--display-font);
  font-weight: 700;
  font-size: 4.4rem;
  line-height: 1;
  color: var(--accent-ink);
  white-space: nowrap;
}

.callout-stat .big-number-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 6px;
}

.callout-stat .sparkline-wrap {
  flex: 1;
  min-width: 220px;
  height: 90px;
}

.chart-card {
  position: relative;
  background: var(--page);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px 18px 10px;
  margin-top: 18px;
  overflow: hidden;
}

.chart-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--pl-gradient-start), var(--pl-gradient-end));
  opacity: 0.6;
}

.chart-card canvas {
  max-height: 320px;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 10px;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.swatch {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  display: inline-block;
}

.xi-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: flex-end;
  margin: 18px 0 4px;
}

.xi-controls .control {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 220px;
}

.xi-controls label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.xi-controls input[type="range"] {
  width: 100%;
  accent-color: var(--pl-gradient-end);
}

.pitch-card {
  position: relative;
  margin-top: 16px;
}

.pitch {
  position: relative;
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
  aspect-ratio: 68 / 100;
  background: linear-gradient(180deg, #1f7a4d, #1c6e46);
  border-radius: 10px;
  box-shadow: inset 0 0 0 1px var(--border), var(--shadow-md);
}

.pitch-lines,
.pitch-dots {
  border-radius: 10px;
}

.pitch-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.55;
}

.pitch-dots {
  position: absolute;
  inset: 0;
}

.player-dot {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  cursor: pointer;
}

.dot-circle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 700;
  color: #fff;
  background: var(--pl-purple);
  border: 2px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
  transition: transform 0.15s ease;
}

.player-dot:hover .dot-circle {
  transform: scale(1.12);
}

.player-dot.empty .dot-circle {
  background: rgba(255, 255, 255, 0.15);
  border-style: dashed;
  border-color: rgba(255, 255, 255, 0.5);
}

.dot-label {
  font-size: 0.6rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  letter-spacing: 0.03em;
}

.xi-tooltip {
  position: absolute;
  transform: translate(-50%, calc(-100% - 10px));
  background: var(--pl-purple);
  color: #fff;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.78rem;
  line-height: 1.4;
  white-space: pre-line;
  pointer-events: none;
  z-index: 10;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  max-width: 200px;
}

.globe-card {
  position: relative;
  display: flex;
  justify-content: center;
  padding: 8px;
  overflow: hidden;
  background: var(--page);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-top: 18px;
}

#globe-viz {
  width: 100%;
  max-width: 640px;
  height: 460px;
}

@media (max-width: 640px) {
  #globe-viz {
    height: 340px;
  }
}

.conclusion {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 5px solid var(--pl-gradient-end);
  border-radius: 10px;
  padding: 30px 30px 10px;
  margin-top: 8px;
}

.conclusion h2 {
  font-size: 1.5rem;
}

.about {
  padding: 42px 0 72px;
}

.about h2 {
  font-family: var(--display-font);
  font-weight: 600;
  font-size: 1.35rem;
}

.about dt {
  font-family: var(--display-font);
  font-weight: 600;
  font-size: 0.86rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 20px;
}

.about dd {
  font-family: var(--serif-font);
  margin: 6px 0 0;
  color: var(--text-secondary);
  max-width: 70ch;
  line-height: 1.6;
}

footer.site-footer {
  padding: 26px 0 60px;
  color: var(--text-muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--border);
  margin-top: 12px;
}

footer.site-footer a {
  color: var(--accent-ink);
}

/* dashboard */

.hero-compact {
  min-height: 48vh;
}

.hero-compact .hero-content {
  padding-bottom: 38px;
}

.hero-title-compact {
  font-size: clamp(1.8rem, 4.4vw, 2.7rem);
  margin-bottom: 12px;
}

.hero-summary-compact {
  font-size: 1.04rem;
  max-width: 62ch;
  margin: 0;
}

.hero-summary-compact::first-letter {
  all: unset;
}

.hero-content .club-badge {
  margin-top: 16px;
}

@media (max-width: 640px) {
  .hero-compact {
    min-height: 42vh;
  }
}

.controls-bar {
  position: sticky;
  top: 0;
  background: var(--page);
  padding: 14px 0;
  border-bottom: 3px solid var(--accent-primary);
  z-index: 5;
  transition: border-color 0.25s ease;
}

.club-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--accent-primary);
  color: var(--accent-text-on-primary);
  font-size: 0.82rem;
  font-weight: 600;
  transition: background 0.25s ease;
}

.club-badge .swatch2 {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-secondary);
  display: inline-block;
}

.club-badge .crest {
  width: 22px;
  height: 22px;
  object-fit: contain;
  display: none;
}

.club-badge.has-crest .crest {
  display: inline-block;
}

.club-badge.has-crest .swatch2 {
  display: none;
}

.club-badge[hidden] {
  display: none;
}

.controls-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  align-items: end;
}

.control {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.control label {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
}

select, button {
  font-family: inherit;
  font-size: 0.88rem;
  padding: 8px 10px;
  border-radius: 7px;
  border: 1px solid var(--baseline);
  background: var(--surface);
  color: var(--text-primary);
}

button.reset {
  background: var(--accent-primary);
  color: var(--accent-text-on-primary);
  border: none;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.25s ease;
}

button.reset:hover {
  opacity: 0.9;
}

main.dashboard-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px 80px;
}

.summary-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin: 24px 0;
}

.chart-panels {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  gap: 16px;
  margin: 24px 0;
}

.panel-controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.panel-controls select {
  flex: 1;
  min-width: 130px;
}

.table-tabs {
  display: flex;
  gap: 6px;
  margin: 10px 0 4px;
}

.table-tab {
  background: var(--surface);
  border: 1px solid var(--baseline);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
}

.table-tab:hover {
  border-color: var(--accent-primary);
}

.table-tab.active {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: var(--accent-text-on-primary);
}

.table-subtitle {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin: 0 0 4px;
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  margin-top: 12px;
}

table.data-table th,
table.data-table td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--gridline);
  font-variant-numeric: tabular-nums;
}

table.data-table th {
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.03em;
}

.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  overflow-x: auto;
  max-height: 420px;
  overflow-y: auto;
}

.table-wrap::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.table-wrap::-webkit-scrollbar-thumb {
  background: var(--baseline);
  border-radius: 999px;
}

.game-section {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.game-section h2 {
  font-family: var(--display-font);
  font-weight: 600;
  font-size: 1.2rem;
  margin-bottom: 6px;
}

.game-section > p {
  font-family: var(--serif-font);
  color: var(--text-secondary);
  max-width: 68ch;
  margin: 0 0 16px;
}

.game-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  max-width: 640px;
  box-shadow: var(--shadow-sm);
}

.game-question h3 {
  font-size: 0.95rem;
  margin: 0 0 4px;
}

.game-question h3 span {
  font-weight: 400;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.game-question {
  margin-bottom: 18px;
}

.game-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.game-options button {
  border: 1px solid var(--baseline);
  background: var(--page);
  color: var(--text-secondary);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 0.82rem;
  cursor: pointer;
}

.game-options button:hover {
  border-color: var(--accent-primary);
}

.game-options button.selected {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: var(--accent-text-on-primary);
  font-weight: 600;
}

#game-submit {
  margin-top: 4px;
}

.game-result {
  max-width: 640px;
  margin-top: 20px;
}

.result-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 5px solid var(--pl-gradient-end);
  border-radius: 10px;
  padding: 20px;
  display: flex;
  gap: 18px;
  align-items: flex-start;
  box-shadow: var(--shadow-sm);
}

.result-crest {
  position: relative;
  width: 104px;
  height: 104px;
  flex-shrink: 0;
}

.result-crest svg {
  border-radius: 50%;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.22);
}

.result-crest-badge {
  position: absolute;
  right: -4px;
  bottom: -4px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.result-crest-badge img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 3px;
  box-sizing: border-box;
}

.result-info h3 {
  margin: 0 0 2px;
  font-size: 1.2rem;
}

.result-info > p {
  margin: 0 0 10px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.result-info ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 6px 16px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.result-info li strong {
  color: var(--text-primary);
}

.game-result-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.loading {
  color: var(--text-muted);
  padding: 40px 0;
}

@media (max-width: 600px) {
  .chart-panels {
    grid-template-columns: 1fr;
  }
}
