/*
 * Footy Predictor v14 APEX — Premium Sports Intelligence
 * Sora + Plus Jakarta Sans · Midnight Teal · Staggered Reveals · Responsive
 */

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[x-cloak] { display: none !important; }

:root {
  /* ── Color System (Dark Default) ── */
  --bg:          #070b14;
  --bg-raised:   #0d1221;
  --surface-0:   rgba(255,255,255,0.02);
  --surface-1:   rgba(255,255,255,0.04);
  --surface-2:   rgba(255,255,255,0.07);
  --surface-3:   rgba(255,255,255,0.11);
  --surface-4:   rgba(255,255,255,0.16);
  --border:      rgba(255,255,255,0.06);
  --border-h:    rgba(255,255,255,0.13);
  --border-glow: rgba(0,229,255,0.25);
  --text:        #e8edf5;
  --text-2:      #8b95a8;
  --text-3:      #4a5568;

  /* Primary — Electric Teal */
  --accent:      #00e5ff;
  --accent-dim:  rgba(0,229,255,0.08);
  --accent-med:  rgba(0,229,255,0.20);
  --accent-glow: rgba(0,229,255,0.35);

  /* Semantic */
  --green:       #00dc82;
  --green-dim:   rgba(0,220,130,0.10);
  --green-med:   rgba(0,220,130,0.22);
  --amber:       #ffb300;
  --amber-dim:   rgba(255,179,0,0.10);
  --amber-med:   rgba(255,179,0,0.22);
  --red:         #ff4757;
  --red-dim:     rgba(255,71,87,0.10);
  --red-med:     rgba(255,71,87,0.22);
  --cyan:        #00bcd4;
  --cyan-dim:    rgba(0,188,212,0.10);
  --blue:        #0ea5e9;
  --blue-dim:    rgba(14,165,233,0.10);

  /* Typography */
  --font:        'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-display:'Sora', var(--font);
  --mono:        'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;

  /* Radius */
  --r-xs:  4px;
  --r-sm:  8px;
  --r-md:  12px;
  --r-lg:  18px;
  --r-xl:  24px;
  --r-full: 9999px;

  /* Shadows */
  --shadow-sm:   0 1px 2px rgba(0,0,0,0.4);
  --shadow-md:   0 4px 16px rgba(0,0,0,0.5);
  --shadow-lg:   0 8px 32px rgba(0,0,0,0.6);
  --shadow-glow: 0 0 24px rgba(0,229,255,0.1);

  /* Animation */
  --ease:        cubic-bezier(0.4, 0, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-out:    cubic-bezier(0, 0, 0.2, 1);
  --dur:         0.2s;
  --dur-lg:      0.35s;
  --dur-xl:      0.5s;
}

/* ── Light Mode ── */
[data-theme="light"] {
  --bg:        #f0f2f6;
  --bg-raised: #ffffff;
  --surface-0: rgba(0,0,0,0.02);
  --surface-1: rgba(0,0,0,0.035);
  --surface-2: rgba(0,0,0,0.06);
  --surface-3: rgba(0,0,0,0.09);
  --surface-4: rgba(0,0,0,0.13);
  --border:    rgba(0,0,0,0.08);
  --border-h:  rgba(0,0,0,0.16);
  --border-glow: rgba(8,145,178,0.15);
  --text:      #1a202c;
  --text-2:    #4a5568;
  --text-3:    #a0aec0;
  --accent:    #0891b2;
  --accent-dim: rgba(8,145,178,0.08);
  --accent-med: rgba(8,145,178,0.18);
  --accent-glow: rgba(8,145,178,0.15);
  --green:  #059669;
  --green-dim: rgba(5,150,105,0.10);
  --green-med: rgba(5,150,105,0.22);
  --amber:  #d97706;
  --amber-dim: rgba(217,119,6,0.10);
  --amber-med: rgba(217,119,6,0.22);
  --red:    #dc2626;
  --red-dim: rgba(220,38,38,0.10);
  --red-med: rgba(220,38,38,0.22);
  --cyan:   #0891b2;
  --cyan-dim: rgba(8,145,178,0.10);
  --blue:   #0369a1;
  --blue-dim: rgba(3,105,161,0.10);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.1);
  --shadow-glow: 0 0 24px rgba(8,145,178,0.06);
}

[data-theme="light"] body::before { opacity: 0; }

/* ── Base ── */
html {
  font-size: 15px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color var(--dur-lg) var(--ease), color var(--dur-lg) var(--ease);
  position: relative;
}

/* Gradient mesh background */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(ellipse 80% 60% at 10% 20%, rgba(0,229,255,0.045) 0%, transparent 55%),
    radial-gradient(ellipse 60% 50% at 90% 80%, rgba(14,165,233,0.035) 0%, transparent 50%),
    radial-gradient(ellipse 70% 40% at 50% 50%, rgba(0,220,130,0.02) 0%, transparent 45%);
  pointer-events: none;
  transition: opacity var(--dur-lg) var(--ease);
}

/* ── Typography System ── */
h1, h2, h3, h4, h5, h6 { font-family: var(--font-display); }
h1 { font-size: 2.5rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; }
h2 { font-size: 1.75rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
h3 { font-size: 1.375rem; font-weight: 700; letter-spacing: -0.01em; line-height: 1.3; }
h4 { font-size: 1.2rem; font-weight: 600; line-height: 1.4; }
h5 { font-size: 1.1rem; font-weight: 600; line-height: 1.4; }
h6 { font-size: 1rem; font-weight: 600; line-height: 1.5; }

p { margin-bottom: 1rem; }
a { color: var(--accent); text-decoration: none; transition: color var(--dur) var(--ease); }
a:hover { color: #33ecff; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

code {
  font-family: var(--mono);
  font-size: 0.85em;
  padding: 0.2em 0.4em;
  background: var(--surface-2);
  border-radius: var(--r-xs);
}

/* ── Container ── */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

@media (max-width: 640px) {
  .container { padding: 0 1rem; }
}

/* ══════════════════════════════════════════
   NAV
   ══════════════════════════════════════════ */
.nav {
  background: var(--bg-raised);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(16px) saturate(180%);
  transition: border-color var(--dur) var(--ease);
}

/* Brand accent line */
.nav::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent) 20%, var(--accent) 80%, transparent);
  opacity: 0.3;
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 2rem;
}

.nav-brand {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text);
  white-space: nowrap;
  letter-spacing: -0.03em;
  transition: color var(--dur) var(--ease);
}

.nav-brand:hover { color: var(--accent); }

.nav-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1.5rem;
  flex: 1;
}

.last-updated {
  font-size: 0.8rem;
  color: var(--text-3);
  font-family: var(--mono);
  letter-spacing: -0.02em;
}

.nav-tabs {
  display: flex;
  gap: 0.15rem;
  align-items: center;
}

.nav-tab {
  padding: 0.45rem 0.9rem;
  background: transparent;
  border: none;
  color: var(--text-2);
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 0.88rem;
  cursor: pointer;
  border-radius: var(--r-sm);
  transition: color var(--dur) var(--ease), background-color var(--dur) var(--ease);
  position: relative;
  letter-spacing: -0.01em;
}

.nav-tab:hover {
  color: var(--text);
  background: var(--surface-2);
}

.nav-tab.active {
  color: var(--accent);
  background: var(--accent-dim);
}

.nav-tab.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 25%;
  right: 25%;
  height: 2px;
  background: var(--accent);
  border-radius: 1px;
}

.nav-tab:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Dropdown tab groups */
.nav-dropdown { position: relative; display: inline-block; }

.nav-dropdown-toggle {
  padding: 0.45rem 0.9rem;
  background: transparent;
  border: none;
  color: var(--text-2);
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 0.88rem;
  cursor: pointer;
  border-radius: var(--r-sm);
  transition: color var(--dur) var(--ease), background-color var(--dur) var(--ease);
  display: flex;
  align-items: center;
  gap: 0.3rem;
  letter-spacing: -0.01em;
}

.nav-dropdown-toggle:hover {
  color: var(--text);
  background: var(--surface-2);
}

.nav-dropdown-toggle.active {
  color: var(--accent);
  background: var(--accent-dim);
}

.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  background: var(--bg-raised);
  border: 1px solid var(--border-h);
  border-radius: var(--r-md);
  min-width: 200px;
  z-index: 200;
  display: none;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  padding: 0.35rem;
  backdrop-filter: blur(20px);
}

.nav-dropdown-menu.open { display: flex; }

.nav-dropdown-item {
  padding: 0.55rem 0.9rem;
  background: transparent;
  border: none;
  color: var(--text-2);
  text-align: left;
  cursor: pointer;
  font-size: 0.88rem;
  border-radius: var(--r-sm);
  transition: all var(--dur) var(--ease);
}

.nav-dropdown-item:hover {
  background: var(--surface-2);
  color: var(--text);
}

.nav-dropdown-item.active {
  background: var(--accent-dim);
  color: var(--accent);
  font-weight: 600;
}

/* Theme toggle */
.nav-theme-toggle {
  background: var(--surface-1);
  border: 1px solid var(--border);
  color: var(--text-2);
  width: 36px;
  height: 36px;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--dur) var(--ease);
}

.nav-theme-toggle:hover {
  background: var(--surface-2);
  border-color: var(--border-h);
  color: var(--text);
}

.nav-help {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-3);
  width: 36px;
  height: 36px;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
  transition: all var(--dur) var(--ease);
}

.nav-help:hover {
  background: var(--surface-2);
  border-color: var(--border-h);
  color: var(--text);
}

.toolbar-btn {
  padding: 0.45rem 0.9rem;
  background: var(--surface-1);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--r-sm);
  cursor: pointer;
  font-weight: 500;
  font-size: 0.85rem;
  transition: all var(--dur) var(--ease);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.toolbar-btn:hover {
  background: var(--surface-2);
  border-color: var(--border-h);
}

.toolbar-btn.active {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
}

.back-btn {
  padding: 0.45rem 0.9rem;
  background: var(--surface-1);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--r-sm);
  cursor: pointer;
  font-weight: 500;
  transition: all var(--dur) var(--ease);
}

.back-btn:hover {
  background: var(--surface-2);
  border-color: var(--border-h);
}

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

@media (max-width: 1024px) {
  .nav-inner { height: 56px; gap: 1rem; }
  .nav-tabs { gap: 0; }
  .nav-tab { padding: 0.4rem 0.65rem; font-size: 0.85rem; }
}

/* Mobile hamburger */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: var(--r-sm);
  transition: background var(--dur) var(--ease);
  line-height: 1;
}

.nav-toggle:hover { background: var(--surface-2); }

@media (max-width: 768px) {
  .nav-toggle { display: flex; align-items: center; }
  .nav-right {
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-raised);
    flex-direction: column;
    gap: 0;
    padding: 1rem;
    z-index: 200;
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform var(--dur-lg) var(--ease);
    border-top: 1px solid var(--border);
  }
  .nav-right.open { transform: translateX(0); }
  .nav-tabs { flex-direction: column; width: 100%; gap: 0.25rem; }
  .nav-tab, .nav-dropdown-toggle { width: 100%; text-align: left; padding: 0.75rem 1rem; font-size: 1rem; }
  .nav-dropdown { width: 100%; }
  .nav-dropdown-menu { position: static; box-shadow: none; border: none; margin: 0; padding-left: 1rem; background: transparent; }
  .nav-dropdown-menu.open { display: flex; }
  .nav-dropdown-item { padding: 0.6rem 1rem; }
  .last-updated { display: none; }
  .nav-theme-toggle, .nav-help { display: none; }
}

@media (max-width: 480px) {
  .nav-inner { height: 52px; }
  .nav-dropdown-menu {
    position: fixed;
    left: 0; right: 0; bottom: 0; top: auto;
    max-height: 50vh;
    overflow-y: auto;
    border-radius: var(--r-xl) var(--r-xl) 0 0;
    margin-top: 0;
    border-bottom: none;
    background: var(--bg-raised);
    border: 1px solid var(--border);
  }
}

/* ══════════════════════════════════════════
   TOASTS
   ══════════════════════════════════════════ */
.error-toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--red-med);
  border: 1px solid var(--red);
  color: var(--text);
  padding: 0.875rem 1.25rem;
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  z-index: 1000;
  box-shadow: 0 8px 32px rgba(255,71,87,0.15);
  animation: slideInUp var(--dur-lg) var(--ease-spring);
  backdrop-filter: blur(12px);
}

.success-toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--green-med);
  border: 1px solid var(--green);
  color: var(--text);
  padding: 0.875rem 1.25rem;
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  z-index: 1000;
  box-shadow: 0 8px 32px rgba(0,220,130,0.15);
  animation: slideInUp var(--dur-lg) var(--ease-spring);
  backdrop-filter: blur(12px);
}

.toast-dismiss {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  font-size: 1.1rem;
  padding: 0 0.25rem;
  line-height: 1;
  opacity: 0.7;
  transition: opacity var(--dur) var(--ease);
}

.toast-dismiss:hover { opacity: 1; }

@media (max-width: 640px) {
  .error-toast, .success-toast {
    bottom: 1rem; right: 1rem; left: 1rem;
    padding: 0.75rem 1rem;
  }
}

/* ══════════════════════════════════════════
   MAIN CONTENT
   ══════════════════════════════════════════ */
.main-content {
  padding: 2rem 1.5rem;
  min-height: calc(100dvh - 64px);
}

@media (max-width: 768px) {
  .main-content { padding: 1.5rem 1rem; }
}

@media (max-width: 480px) {
  .main-content { padding: 1rem 0.75rem; }
}

/* ══════════════════════════════════════════
   GLASS CARDS
   ══════════════════════════════════════════ */
.glass {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  transition: all var(--dur) var(--ease);
}

.glass-hover:hover {
  background: var(--surface-2);
  border-color: var(--border-h);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md), var(--shadow-glow);
}

.glass-glow {
  border-color: var(--accent);
  box-shadow: var(--shadow-glow);
}

/* ══════════════════════════════════════════
   TAB CONTENT
   ══════════════════════════════════════════ */
.tab-content {
  animation: tabReveal var(--dur-lg) var(--ease-out);
}

@keyframes tabReveal {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ══════════════════════════════════════════
   LOADING STATES
   ══════════════════════════════════════════ */
.loading {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 400px;
}

.spinner {
  width: 44px;
  height: 44px;
  border: 3px solid var(--surface-2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Skeleton screens */
.skeleton,
.skeleton-line {
  background: linear-gradient(
    100deg,
    var(--surface-1) 30%,
    var(--surface-3) 50%,
    var(--surface-1) 70%
  );
  background-size: 250% 100%;
  animation: shimmer 1.8s ease-in-out infinite;
  border-radius: var(--r-sm);
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-line {
  height: 1rem;
  margin-bottom: 0.5rem;
}

.skeleton-card {
  padding: 1.5rem;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}

.skeleton-text {
  height: 1em;
  width: 80%;
  margin-bottom: 0.5rem;
}

.skeleton-text.short { width: 40%; }

/* ══════════════════════════════════════════
   EMPTY STATES
   ══════════════════════════════════════════ */
.empty, .empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-2);
}

.empty-icon, .empty-state-icon {
  font-size: 3.5rem;
  margin-bottom: 1rem;
  opacity: 0.5;
  filter: grayscale(40%);
}

.empty-state h3 {
  font-family: var(--font-display);
  color: var(--text);
  margin-bottom: 0.5rem;
  font-size: 1.2rem;
}

.empty-state p, .empty p {
  margin: 0.5rem 0;
  font-size: 0.9rem;
}

.empty code {
  background: var(--surface-2);
  padding: 0.25em 0.5em;
  border-radius: var(--r-xs);
}

/* ══════════════════════════════════════════
   MATCHES SECTION
   ══════════════════════════════════════════ */
.matches-toolbar {
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
}

.toolbar-left { flex: 1; }

.toolbar-title-wrap { margin-bottom: 1rem; }

.section-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 0.2rem;
  letter-spacing: -0.02em;
}

.subsection-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.toolbar-subtitle {
  font-size: 0.85rem;
  color: var(--text-3);
}

.toolbar-stats {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.toolbar-chip {
  padding: 0.3rem 0.7rem;
  background: var(--surface-2);
  border-radius: var(--r-full);
  font-size: 0.8rem;
  color: var(--text-2);
  font-family: var(--mono);
  letter-spacing: -0.02em;
}

.toolbar-chip-accent {
  background: var(--accent-dim);
  color: var(--accent);
}

.toolbar-controls {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}

.search-wrap {
  flex: 1;
  min-width: 180px;
  position: relative;
}

.search-input {
  width: 100%;
  padding: 0.5rem 0.9rem;
  background: var(--surface-0);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.9rem;
  transition: all var(--dur) var(--ease);
}

.search-input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface-1);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.toolbar-control {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.toolbar-control span {
  font-size: 0.72rem;
  color: var(--text-3);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.toolbar-control select {
  padding: 0.45rem 0.7rem;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all var(--dur) var(--ease);
}

.toolbar-control select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.toolbar-refresh {
  padding: 0.45rem 0.9rem;
  background: var(--accent-dim);
  border: 1px solid rgba(0,229,255,0.2);
  color: var(--accent);
  border-radius: var(--r-sm);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.85rem;
  transition: all var(--dur) var(--ease);
}

.toolbar-refresh:hover {
  background: var(--accent-med);
  transform: rotate(180deg);
}

.toolbar-refresh:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (max-width: 1024px) {
  .matches-toolbar { flex-direction: column; align-items: stretch; }
  .toolbar-controls { justify-content: space-between; }
}

@media (max-width: 640px) {
  .matches-toolbar { padding: 1rem; gap: 0.75rem; }
  .section-title { font-size: 1.2rem; }
  .toolbar-controls { flex-direction: column; }
  .search-wrap { min-width: auto; }
}

/* ══════════════════════════════════════════
   FILTER BAR
   ══════════════════════════════════════════ */
.filter-bar {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 1.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.filter-pill, .filter-btn {
  padding: 0.4rem 0.85rem;
  background: var(--surface-1);
  border: 1px solid var(--border);
  color: var(--text-2);
  border-radius: var(--r-full);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: -0.01em;
  transition: all var(--dur) var(--ease);
}

.filter-pill:hover, .filter-btn:hover {
  border-color: var(--border-h);
  background: var(--surface-2);
  color: var(--text);
}

.filter-pill.active, .filter-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #000;
  font-weight: 700;
  box-shadow: 0 0 12px var(--accent-dim);
}

.filter-pill:focus-visible, .filter-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.filter-count {
  margin-left: auto;
  font-size: 0.8rem;
  color: var(--text-3);
  font-family: var(--mono);
}

/* ══════════════════════════════════════════
   DATE HEADER
   ══════════════════════════════════════════ */
.date-header {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
  position: relative;
}

.date-header::before {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 48px;
  height: 2px;
  background: var(--accent);
  border-radius: 1px;
}

/* ══════════════════════════════════════════
   MATCH CARDS
   ══════════════════════════════════════════ */
.match-card {
  display: block;
  padding: 1.25rem 1.5rem;
  margin-bottom: 0.75rem;
  cursor: pointer;
  border-left: 3px solid transparent;
  animation: cardReveal 0.4s var(--ease-out) both;
}

.match-card:nth-child(1) { animation-delay: 0.02s; }
.match-card:nth-child(2) { animation-delay: 0.06s; }
.match-card:nth-child(3) { animation-delay: 0.10s; }
.match-card:nth-child(4) { animation-delay: 0.14s; }
.match-card:nth-child(5) { animation-delay: 0.18s; }
.match-card:nth-child(6) { animation-delay: 0.22s; }
.match-card:nth-child(7) { animation-delay: 0.26s; }
.match-card:nth-child(8) { animation-delay: 0.30s; }

@keyframes cardReveal {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.match-card:hover {
  border-left-color: var(--accent);
}

.match-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.85rem;
}

.match-teams-text {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 1rem;
}

.match-home, .match-away {
  color: var(--text);
}

.match-vs {
  color: var(--text-3);
  font-size: 0.78rem;
  font-weight: 400;
  margin: 0 0.15rem;
}

.match-meta {
  display: flex;
  gap: 0.65rem;
  align-items: center;
}

.match-time {
  font-size: 0.8rem;
  color: var(--text-3);
  font-family: var(--mono);
  letter-spacing: -0.02em;
}

@media (max-width: 480px) {
  .match-card {
    padding: 0.9rem;
    border-radius: 8px;
    border-left-width: 2px;
  }
  .match-top {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
  }
  .match-meta {
    width: 100%;
    justify-content: space-between;
  }
  .team-name, .match-home, .match-away {
    font-size: 0.85rem;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

/* ══════════════════════════════════════════
   BADGES
   ══════════════════════════════════════════ */
.badge {
  padding: 0.2rem 0.5rem;
  font-size: 0.68rem;
  font-weight: 700;
  border-radius: var(--r-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-family: var(--mono);
}

.badge-PL  { background: rgba(14,165,233,0.12); color: var(--blue); }
.badge-SA  { background: rgba(255,71,87,0.12);  color: var(--red); }
.badge-PD  { background: rgba(255,179,0,0.12);  color: var(--amber); }
.badge-BL1 { background: rgba(14,165,233,0.12); color: var(--blue); }
.badge-FL1 { background: rgba(0,229,255,0.12);  color: var(--accent); }
.badge-DED { background: rgba(255,179,0,0.12);  color: var(--amber); }
.badge-PPL { background: rgba(0,220,130,0.12);  color: var(--green); }
.badge-ELC { background: rgba(0,229,255,0.12);  color: var(--accent); }
.badge-TR1 { background: rgba(255,71,87,0.12);  color: var(--red); }
.badge-BEL { background: rgba(255,179,0,0.12);  color: var(--amber); }
.badge-SL  { background: rgba(14,165,233,0.12); color: var(--blue); }
.badge-A1  { background: rgba(255,71,87,0.12);  color: var(--red); }
.badge-GR1 { background: rgba(0,188,212,0.12);  color: var(--cyan); }
.badge-SWS { background: rgba(255,71,87,0.12);  color: var(--red); }
.badge-DK1 { background: rgba(255,71,87,0.12);  color: var(--red); }
.badge-SE1 { background: rgba(14,165,233,0.12); color: var(--blue); }
.badge-NO1 { background: rgba(0,188,212,0.12);  color: var(--cyan); }
.badge-PL1 { background: rgba(255,71,87,0.12);  color: var(--red); }
.badge-default { background: var(--surface-2); color: var(--text-2); }

/* ══════════════════════════════════════════
   PROBABILITY SECTION
   ══════════════════════════════════════════ */
.prob-section { margin-top: 0.85rem; }

.prob-bar {
  display: flex;
  height: 6px;
  border-radius: var(--r-full);
  overflow: hidden;
  background: var(--surface-2);
  margin-bottom: 0.65rem;
}

.prob-bar > div {
  transition: width var(--dur-xl) var(--ease);
}

.prob-bar .home { background: linear-gradient(to right, #0ea5e9, #0284c7); }
.prob-bar .draw { background: linear-gradient(to right, #ffb300, #e6a200); }
.prob-bar .away { background: linear-gradient(to right, #ff4757, #e6293a); }

.prob-labels {
  display: flex;
  gap: 0.85rem;
  font-size: 0.82rem;
}

.prob-label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--text-2);
}

.prob-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.prob-dot.home { background: #0ea5e9; }
.prob-dot.draw { background: #ffb300; }
.prob-dot.away { background: #ff4757; }

.prob-pct {
  font-weight: 700;
  font-family: var(--mono);
  font-size: 0.82rem;
}

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.85rem;
  gap: 0.75rem;
}

.verdict {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.35rem 0.7rem;
  border-radius: var(--r-sm);
  font-family: var(--font-display);
  letter-spacing: -0.01em;
}

.verdict-home { background: rgba(14,165,233,0.1); color: #0ea5e9; }
.verdict-draw { background: rgba(255,179,0,0.1); color: var(--amber); }
.verdict-away { background: rgba(255,71,87,0.1); color: var(--red); }

.card-mini-tag {
  padding: 0.2rem 0.45rem;
  border-radius: var(--r-xs);
  font-size: 0.72rem;
  font-weight: 700;
  font-family: var(--mono);
}

.mini-yes { background: var(--green-dim); color: var(--green); }
.mini-no  { background: var(--red-dim); color: var(--red); }

.conf-badge {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.6rem;
  border-radius: var(--r-sm);
  font-size: 0.75rem;
  font-weight: 700;
}

.conf-badge.conf-high   { background: var(--green-dim); color: var(--green); }
.conf-badge.conf-medium { background: var(--amber-dim); color: var(--amber); }
.conf-badge.conf-low    { background: var(--cyan-dim); color: var(--cyan); }

.conf-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

@media (max-width: 480px) {
  .prob-bar { height: 5px; border-radius: 3px; }
  .prob-labels { gap: 0.5rem; font-size: 0.72rem; }
}

/* ══════════════════════════════════════════
   PROBABILITY GAUGE (Detail)
   ══════════════════════════════════════════ */
.probability-gauge {
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 1.5rem;
  background: var(--surface-1);
  border-radius: var(--r-md);
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.gauge-circle {
  position: relative;
  width: 120px;
  height: 120px;
  flex-shrink: 0;
}

.gauge-svg { width: 100%; height: 100%; }

.gauge-svg circle:first-child { stroke: var(--surface-2); }
.gauge-svg circle:last-child {
  stroke: var(--accent);
  filter: drop-shadow(0 0 8px var(--accent-dim));
}

.gauge-text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.gauge-value {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -0.02em;
}

.gauge-label {
  font-size: 0.65rem;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}

.gauge-info { flex: 1; min-width: 200px; }

.gauge-outcome {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
}

.gauge-confidence {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
}

.confidence-bar {
  flex: 1;
  height: 5px;
  background: var(--surface-2);
  border-radius: var(--r-full);
  overflow: hidden;
}

.confidence-fill {
  height: 100%;
  background: var(--accent);
  border-radius: var(--r-full);
  transition: width var(--dur-lg) var(--ease);
}

@media (max-width: 480px) {
  .probability-gauge { flex-direction: column; align-items: center; text-align: center; }
  .gauge-info { min-width: auto; }
}

/* Score prediction grid */
.score-prediction-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.score-prediction-item {
  text-align: center;
  padding: 0.75rem;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  transition: all var(--dur) var(--ease);
}

.score-prediction-item:hover {
  background: var(--surface-2);
  border-color: var(--border-h);
}

.score-prediction-score {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.score-prediction-prob {
  font-size: 0.75rem;
  color: var(--text-2);
  font-family: var(--mono);
}

/* ══════════════════════════════════════════
   TABLES
   ══════════════════════════════════════════ */
.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
}

.table-wrapper table,
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface-0);
}

thead {
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}

.table-wrapper th,
th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--text-2);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  position: sticky;
  top: 0;
  background: var(--surface-2);
}

.table-wrapper td,
td {
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
}

tbody tr {
  transition: background-color var(--dur) var(--ease);
}

tbody tr:hover { background: var(--surface-1); }
tbody tr:last-child td { border-bottom: none; }

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

/* ══════════════════════════════════════════
   CARDS & SECTIONS
   ══════════════════════════════════════════ */
.card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 1.5rem;
  transition: all var(--dur) var(--ease);
}

.card:hover {
  border-color: var(--border-h);
}

.card-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--text);
  letter-spacing: -0.01em;
}

.card-content {
  font-size: 0.92rem;
  color: var(--text-2);
  line-height: 1.65;
}

.card-inner {
  padding: 0.75rem;
  background: var(--surface-1);
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
}

/* ══════════════════════════════════════════
   BUTTONS
   ══════════════════════════════════════════ */
button {
  cursor: pointer;
  font-family: var(--font);
  transition: all var(--dur) var(--ease);
  border: none;
  border-radius: var(--r-sm);
}

.btn {
  padding: 0.6rem 1.3rem;
  font-weight: 600;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  letter-spacing: -0.01em;
}

.btn-primary {
  background: var(--accent);
  color: #000;
  font-weight: 700;
}

.btn-primary:hover {
  background: #33ecff;
  transform: translateY(-2px);
  box-shadow: 0 4px 20px var(--accent-dim);
}

.btn-secondary {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--surface-3);
  border-color: var(--border-h);
}

.btn-small {
  padding: 0.35rem 0.75rem;
  font-size: 0.82rem;
}

button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ══════════════════════════════════════════
   MODALS
   ══════════════════════════════════════════ */
.modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  animation: fadeIn var(--dur-lg) var(--ease);
}

.modal-content {
  background: var(--bg-raised);
  border: 1px solid var(--border-h);
  border-radius: var(--r-lg);
  padding: 2rem;
  max-width: 600px;
  width: 90%;
  max-height: 90dvh;
  overflow-y: auto;
  animation: modalSlideUp var(--dur-lg) var(--ease-spring);
  box-shadow: var(--shadow-lg);
}

@keyframes modalSlideUp {
  from { transform: translateY(20px) scale(0.97); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.modal-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.modal-close {
  background: var(--surface-1);
  border: 1px solid var(--border);
  color: var(--text-2);
  font-size: 1.2rem;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-sm);
  transition: all var(--dur) var(--ease);
}

.modal-close:hover {
  background: var(--surface-2);
  color: var(--text);
}

/* Comparison modal */
.comparison-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.comparison-card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 1.5rem;
}

.comparison-card-header {
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1rem;
}

.comparison-card-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.comparison-card-meta { font-size: 0.82rem; color: var(--text-2); }

.comparison-probs {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.comparison-prob-item {
  text-align: center;
  padding: 0.5rem;
  background: var(--surface-2);
  border-radius: var(--r-sm);
}

.comparison-prob-outcome {
  font-size: 0.7rem;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

.comparison-prob-value {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent);
}

.comparison-stats {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.88rem;
}

.comparison-stat {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--surface-2);
}

.comparison-stat-label { color: var(--text-2); }
.comparison-stat-value { color: var(--text); font-weight: 600; }

/* ══════════════════════════════════════════
   INSIGHTS — VALUE BETS
   ══════════════════════════════════════════ */
.insights-header {
  margin-bottom: 1.5rem;
}

.bet-card {
  padding: 1.25rem;
  margin-bottom: 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  border-left: 3px solid var(--green);
}

.bet-left { flex: 1; }

.bet-match {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 0.4rem;
}

.bet-meta {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  font-size: 0.82rem;
  color: var(--text-2);
  flex-wrap: wrap;
}

.bet-type {
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
}

.bet-kelly {
  font-size: 0.82rem;
  color: var(--text-3);
  margin-top: 0.4rem;
  font-family: var(--mono);
}

.bet-right { text-align: right; }

.bet-odds {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
}

.bet-edge-tag {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--green);
  font-family: var(--mono);
}

/* ══════════════════════════════════════════
   INSIGHTS — BTTS & O/U
   ══════════════════════════════════════════ */
.btts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.btts-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
  gap: 0.5rem;
}

.btts-row:last-child { border-bottom: none; }

.btts-match {
  flex: 1;
  font-weight: 500;
}

.btts-prob {
  font-weight: 700;
  font-family: var(--mono);
  font-size: 0.85rem;
}

/* ══════════════════════════════════════════
   INSIGHTS — ACCUMULATORS
   ══════════════════════════════════════════ */
.acca-card {
  padding: 1.5rem;
  margin-bottom: 1rem;
  border-left: 3px solid var(--accent);
}

.acca-legs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 0.75rem;
}

.acca-leg {
  padding: 0.75rem;
  background: var(--surface-1);
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
}

.acca-leg-teams { font-weight: 600; margin-bottom: 0.2rem; }
.acca-leg-meta { font-size: 0.82rem; color: var(--text-2); margin-bottom: 0.4rem; }
.acca-leg-prob { font-size: 0.82rem; font-family: var(--mono); }

/* ══════════════════════════════════════════
   SECTION HEADER
   ══════════════════════════════════════════ */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ══════════════════════════════════════════
   MATCH DETAIL VIEW
   ══════════════════════════════════════════ */
.match-detail-header {
  padding: 2rem;
  margin-bottom: 2rem;
  border-left: 4px solid var(--accent);
  background: linear-gradient(135deg, var(--surface-1), var(--surface-0));
}

.match-detail-header h1 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  letter-spacing: -0.03em;
}

.match-detail-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.detail-section {
  padding: 2rem;
  margin-bottom: 1.5rem;
}

/* Outcome probabilities */
.outcome-probs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.outcome-probs-item { text-align: center; }

.outcome-probs-label {
  font-size: 0.78rem;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.outcome-probs-value {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.outcome-probs-value.home { color: var(--blue); }
.outcome-probs-value.draw { color: var(--amber); }
.outcome-probs-value.away { color: var(--red); }

.outcome-probs-team {
  font-size: 0.82rem;
  color: var(--text-3);
  margin-top: 0.35rem;
}

@media (max-width: 480px) {
  .outcome-probs { gap: 0.75rem; }
  .outcome-probs-value { font-size: 1.75rem; }
}

/* Outcome cards */
.outcome-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 1.5rem 0;
}

.outcome-card {
  text-align: center;
  padding: 1.25rem;
  border-radius: var(--r-md);
  background: var(--surface-1);
  border: 2px solid transparent;
  transition: all var(--dur) var(--ease);
}

.outcome-card.highest {
  border-color: var(--accent);
  background: var(--accent-dim);
  box-shadow: 0 0 16px var(--accent-dim);
}

.outcome-label {
  font-size: 0.72rem;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.outcome-value {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
}

.outcome-odds {
  font-size: 0.82rem;
  color: var(--text-2);
  margin-top: 0.25rem;
  font-family: var(--mono);
}

@media (max-width: 380px) {
  .outcome-grid { gap: 0.5rem; }
  .outcome-value { font-size: 1.5rem; }
  .outcome-card { padding: 0.75rem; }
}

/* Expert consensus */
.consensus-box {
  background: var(--surface-1);
  padding: 1.25rem;
  border-radius: var(--r-sm);
  margin-bottom: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.consensus-score {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -0.03em;
}

.consensus-score-label {
  font-size: 0.78rem;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.35rem;
  font-weight: 600;
}

.consensus-agree { color: var(--green); }
.consensus-mixed { color: var(--amber); }
.consensus-clash { color: var(--red); }

/* Expert grid */
.expert-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem;
}

.expert-chip {
  background: var(--surface-1);
  padding: 0.85rem;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  transition: all var(--dur) var(--ease);
}

.expert-chip:hover {
  background: var(--surface-2);
  border-color: var(--border-h);
}

.expert-chip-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.82rem;
  margin-bottom: 0.6rem;
  letter-spacing: -0.01em;
}

.expert-chip-probs {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.4rem;
  font-size: 0.82rem;
  text-align: center;
  font-family: var(--mono);
}

.expert-chip-prob-label {
  color: var(--text-3);
  font-size: 0.65rem;
  font-family: var(--font);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* H2H section */
.h2h-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.h2h-stat {
  text-align: center;
  padding: 1rem;
  background: var(--surface-1);
  border-radius: var(--r-sm);
}

.h2h-stat-value {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
}

.h2h-stat-label {
  font-size: 0.7rem;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.h2h-match-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
}

.h2h-date {
  color: var(--text-3);
  min-width: 6rem;
  font-family: var(--mono);
  font-size: 0.82rem;
}

.h2h-score {
  font-family: var(--font-display);
  font-weight: 700;
  min-width: 3rem;
  text-align: center;
}

/* Form comparison */
.form-comparison {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.form-team-score {
  font-size: 2rem;
  font-weight: 700;
  margin: 0.5rem 0;
}

.form-team-note {
  font-size: 0.85rem;
  color: var(--text-3);
  font-weight: 400;
}

/* xG comparison */
.xg-comparison {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  text-align: center;
}

.xg-team-label {
  font-size: 0.85rem;
  color: var(--text-2);
  margin-bottom: 0.5rem;
}

.xg-value {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
}

/* Model comparison */
.model-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 0.75rem;
}

.model-card-inner {
  background: var(--surface-1);
  padding: 1rem;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  transition: all var(--dur) var(--ease);
}

.model-card-inner:hover {
  border-color: var(--border-h);
}

.model-card-name {
  font-family: var(--font-display);
  font-weight: 600;
  margin-bottom: 0.6rem;
  font-size: 0.88rem;
}

.model-card-probs {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.4rem;
  font-size: 0.82rem;
  text-align: center;
  font-family: var(--mono);
}

.model-card-prob-label {
  color: var(--text-3);
  font-size: 0.65rem;
  font-family: var(--font);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Detail action bar */
.detail-action-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

/* ══════════════════════════════════════════
   STREAKS
   ══════════════════════════════════════════ */
.streaks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1rem;
}

.streak-title {
  font-family: var(--font-display);
  margin: 0 0 0.75rem;
}

.streak-title.winning  { color: var(--green); }
.streak-title.losing   { color: var(--red); }
.streak-title.unbeaten { color: var(--blue); }

.streak-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}

.streak-team { font-weight: 600; }

.streak-badge {
  padding: 0.15rem 0.6rem;
  border-radius: var(--r-full);
  font-weight: 700;
  font-size: 0.82rem;
  font-family: var(--mono);
}

.streak-badge.winning  { background: var(--green); color: #000; }
.streak-badge.losing   { background: var(--red); color: #fff; }
.streak-badge.unbeaten { background: var(--blue); color: #fff; }

/* ══════════════════════════════════════════
   SEASON SIMULATION
   ══════════════════════════════════════════ */
.sim-bar-cell {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sim-bar-track {
  flex: 1;
  background: var(--surface-2);
  border-radius: 3px;
  height: 6px;
  overflow: hidden;
}

.sim-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s var(--ease);
}

.sim-bar-fill.title      { background: var(--green); }
.sim-bar-fill.top4       { background: var(--blue); }
.sim-bar-fill.relegation { background: var(--red); }

.sim-bar-value {
  font-size: 0.78rem;
  min-width: 3rem;
  text-align: right;
  font-family: var(--mono);
}

/* ══════════════════════════════════════════
   STATS METRIC GRID
   ══════════════════════════════════════════ */
.stat-metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-metric-value {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.stat-metric-value.accent { color: var(--accent); }
.stat-metric-value.green  { color: var(--green); }
.stat-metric-value.cyan   { color: var(--cyan); }
.stat-metric-value.blue   { color: var(--blue); }
.stat-metric-value.amber  { color: var(--amber); }

/* ══════════════════════════════════════════
   v12 ANALYST COMPONENTS
   ══════════════════════════════════════════ */

/* Confidence Gauge (circular) */
.confidence-gauge {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 700;
  position: relative;
  background: conic-gradient(
    var(--gauge-color, var(--accent)) calc(var(--pct, 50) * 1%),
    var(--surface-2) 0
  );
  font-family: var(--mono);
}

.confidence-gauge::before {
  content: '';
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: var(--bg-raised);
}

.confidence-gauge span { position: relative; z-index: 1; }
.confidence-gauge.high   { --gauge-color: var(--green); }
.confidence-gauge.medium { --gauge-color: var(--amber); }
.confidence-gauge.low    { --gauge-color: var(--red); }

/* Upset Risk Badge */
.upset-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border-radius: var(--r-full);
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-family: var(--mono);
}

.upset-badge.low    { background: var(--green-dim); color: var(--green); }
.upset-badge.medium { background: var(--amber-dim); color: var(--amber); }
.upset-badge.high   { background: var(--red-dim); color: var(--red); animation: pulse-upset 2s ease-in-out infinite; }

@keyframes pulse-upset {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* Enhanced Match Card Extras */
.match-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.68rem;
  color: var(--text-2);
}

.match-meta-item .icon { font-size: 0.78rem; }
.match-meta-item .value { font-weight: 600; color: var(--text); }

/* Model Agreement Meter */
.agreement-meter { display: flex; gap: 2px; align-items: center; }
.agreement-meter .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--surface-3);
  transition: background var(--dur) var(--ease);
}
.agreement-meter .dot.active { background: var(--accent); }

/* Value Bet Indicator */
.value-indicator {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  border-radius: var(--r-xs);
  font-size: 0.62rem;
  font-weight: 600;
  font-family: var(--mono);
}
.value-indicator.positive { background: var(--green-dim); color: var(--green); }
.value-indicator.negative { background: var(--red-dim); color: var(--red); }

/* xG Sparkline */
.xg-sparkline { display: inline-block; width: 60px; height: 20px; vertical-align: middle; }

/* Data Freshness Indicator */
.freshness-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.freshness-dot.fresh   { background: var(--green); box-shadow: 0 0 6px var(--green-dim); }
.freshness-dot.stale   { background: var(--amber); }
.freshness-dot.offline { background: var(--red); }

/* Expert Breakdown Grid (compact) */
.expert-chip .name { color: var(--text-2); font-weight: 500; }
.expert-chip .prob { font-weight: 700; font-variant-numeric: tabular-nums; font-family: var(--mono); }

/* Upset Alert Card */
.upset-alert-card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all var(--dur) var(--ease);
}

.upset-alert-card:hover {
  background: var(--surface-2);
  border-color: var(--border-h);
}

.upset-alert-card.high-risk   { border-left: 3px solid var(--red); }
.upset-alert-card.medium-risk { border-left: 3px solid var(--amber); }

.upset-reasons { display: flex; flex-direction: column; gap: 4px; }
.upset-reason {
  font-size: 0.68rem;
  color: var(--text-2);
  padding-left: 12px;
  position: relative;
}
.upset-reason::before {
  content: '!';
  position: absolute;
  left: 0;
  color: var(--amber);
  font-weight: 700;
}

/* Status grid */
.status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1rem;
}

.skeleton-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1rem;
}

/* ══════════════════════════════════════════
   ANIMATIONS
   ══════════════════════════════════════════ */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInUp {
  from { transform: translateY(100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes scaleIn {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

@keyframes slideInLeft {
  from { transform: translateX(-20px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes slideInRight {
  from { transform: translateX(20px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.fade-in       { animation: fadeIn var(--dur-lg) var(--ease); }
.scale-in      { animation: scaleIn var(--dur-lg) var(--ease-spring); }
.slide-in-left { animation: slideInLeft var(--dur-lg) var(--ease); }
.slide-in-right{ animation: slideInRight var(--dur-lg) var(--ease); }

/* ══════════════════════════════════════════
   UTILITY CLASSES
   ══════════════════════════════════════════ */
.text-1 { color: var(--text); }
.text-2 { color: var(--text-2); }
.text-3 { color: var(--text-3); }
.text-sm { font-size: 0.82rem; }
.text-xs { font-size: 0.72rem; }
.text-muted { color: var(--text-2); }
.text-center { text-align: center; }
.text-right { text-align: right; }
.font-mono { font-family: var(--mono); }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }

.inline-code {
  font-family: var(--mono);
  font-size: 0.85em;
  background: var(--surface-2);
  padding: 0.15em 0.4em;
  border-radius: var(--r-xs);
  color: var(--cyan);
}

.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }

.gap-sm { gap: 0.5rem; }
.gap-md { gap: 1rem; }
.gap-lg { gap: 1.5rem; }

.mt-sm { margin-top: 0.5rem; }
.mt-md { margin-top: 1rem; }
.mt-lg { margin-top: 1.5rem; }
.mb-sm { margin-bottom: 0.5rem; }
.mb-md { margin-bottom: 1rem; }
.mb-lg { margin-bottom: 1.5rem; }
.ml-sm { margin-left: 0.5rem; }

.p-sm { padding: 0.75rem; }
.p-md { padding: 1.5rem; }

.hidden { display: none !important; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border-width: 0;
}

/* Auto grid */
.auto-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
}

/* ══════════════════════════════════════════
   ACCESSIBILITY
   ══════════════════════════════════════════ */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--accent);
  color: #000;
  padding: 0.5rem 1rem;
  z-index: 100;
  text-decoration: none;
  border-radius: var(--r-sm);
  font-weight: 700;
}

.skip-link:focus { top: 0; outline: 2px solid var(--accent); outline-offset: 2px; }

.match-card:focus-visible,
.filter-pill:focus-visible,
.nav-tab:focus-visible,
.nav-dropdown-item:focus-visible,
.btn:focus-visible,
select:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

[data-theme="light"] .match-card:focus-visible,
[data-theme="light"] .filter-pill:focus-visible,
[data-theme="light"] .nav-tab:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  background: var(--surface-2);
}

/* Touch targets */
button, [role="button"], .filter-pill, .nav-tab, select, input {
  min-height: 44px;
  min-width: 44px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* High contrast */
@media (prefers-contrast: more) {
  :root {
    --border: rgba(255,255,255,0.2);
    --border-h: rgba(255,255,255,0.3);
  }
}

/* ══════════════════════════════════════════
   PRINT
   ══════════════════════════════════════════ */
@media print {
  .nav, .error-toast, .toolbar-controls, .filter-bar, .match-card .card-footer { display: none; }
  body { background: white; color: black; }
  body::before { display: none; }
  .container { max-width: 100%; }
  a { color: #0066cc; text-decoration: underline; }
  .glass { border: 1px solid #999; background: white; }
  table { border: 1px solid #999; page-break-inside: avoid; border-collapse: collapse; }
  thead { background: #f5f5f5; page-break-after: avoid; }
  tr { page-break-inside: avoid; }
  tbody tr { background: white; border-bottom: 1px solid #999; }
  .match-card { page-break-inside: avoid; border: 1px solid #999; margin-bottom: 1rem; }
  .prob-bar { display: none; }
  .prob-value { display: block; font-weight: 600; color: black; }
  h1, h2, h3 { page-break-after: avoid; }
}

/* ══════════════════════════════════════════
   SCROLLBAR
   ══════════════════════════════════════════ */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: var(--r-full); }
::-webkit-scrollbar-thumb:hover { background: var(--surface-4); }

/* ══════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════ */
@media (max-width: 480px) {
  html { font-size: 14px; }
  .tab-nav {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .tab-nav::-webkit-scrollbar { display: none; }
  .container { padding: 0.5rem; }
  .toolbar { flex-wrap: wrap; gap: 0.5rem; }
  .confidence-gauge { width: 36px; height: 36px; font-size: 0.6rem; }
  .expert-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}

@media (max-width: 640px) {
  .match-meta { gap: 6px; }
}

/* Footer */
.app-footer {
  text-align: center;
  padding: 2rem;
  color: var(--text-3);
  font-size: 0.78rem;
  border-top: 1px solid var(--border);
  margin-top: 3rem;
  font-family: var(--mono);
  letter-spacing: -0.02em;
}

.app-footer a { color: var(--text-2); }
.app-footer a:hover { color: var(--accent); }
