/* ============================================
   Glick's Picks — Bold & Sporty Theme
   ============================================ */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

.stat-value.loading {
  color: transparent;
  background: linear-gradient(90deg, var(--bg-elevated, #fff) 25%, rgba(37,99,235,0.08) 50%, var(--bg-elevated, #fff) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 6px;
  display: inline-block;
  min-width: 4ch;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

:root {
  color-scheme: light;
  --bg: #f8f9fb;
  --bg-surface: #ffffff;
  --bg-surface-2: #f1f5f9;
  --bg-elevated: #e2e8f0;
  --bg-dark: #0f1923;
  --bg-dark-2: #162030;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-dim: rgba(37, 99, 235, 0.10);
  --accent-light: #dbeafe;
  --accent-2: #f97316;
  --accent-2-light: #fff7ed;
  --chip-border: rgba(15, 25, 35, 0.12);
  --chip-hover: rgba(37, 99, 235, 0.08);
  --green: #16a34a;
  --green-light: #dcfce7;
  --emerald: #059669;
  --emerald-light: #d1fae5;
  --yellow: #f59e0b;
  --text: #0f1923;
  --text-secondary: #64748b;
  --text-dim: #94a3b8;
  --muted: #64748b;
  --border: #e2e8f0;
  --danger: #dc2626;
  --danger-bg: rgba(220, 38, 38, 0.10);
  --font: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: 'JetBrains Mono', monospace;
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 40px rgba(0,0,0,0.08);
  /* Baseball palette */
  --field-green: #4a7c59;
  --field-green-light: rgba(74, 124, 89, 0.10);
  --dirt: #8b7355;
  --dirt-light: rgba(139, 115, 85, 0.10);
  --leather: #6b4226;
  --leather-light: rgba(107, 66, 38, 0.08);
  --chalk: #e8e4df;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  overflow-x: hidden;
}

a { color: var(--accent); text-decoration: none; }

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section-title {
  font-size: clamp(1.6rem, 4.5vw, 2.5rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 0.75rem;
}

.section-subtitle {
  font-size: clamp(1rem, 2vw, 1.15rem);
  color: var(--text-secondary);
  max-width: 540px;
}

/* --- Animations --- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* JS fallback: if JS fails to load, reveal elements are still visible */
html:not(.js) .reveal {
  opacity: 1;
  transform: none;
}

/* --- Accessibility: Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .hamburger span {
    transition: none;
  }

  .nav-links a,
  .cta-button,
  .theme-toggle {
    transition: none;
  }
}

/* --- Accessibility: Focus Visible --- */
a:focus-visible,
button:focus-visible,
.nav-links a:focus-visible,
.mobile-nav a:focus-visible,
.cta-button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
}

/* --- Header --- */
.header {
  background: var(--bg-dark);
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  height: 64px;
}

.brand {
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #ffffff;
}
.brand span { color: var(--accent); }

.nav-links {
  display: none;
  list-style: none;
  gap: 0.25rem;
}
.header-inner nav {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}
.nav-links a {
  font-size: 0.8rem;
  font-weight: 600;
  color: rgba(255,255,255,0.55);
  padding: 8px 16px;
  border-radius: 8px;
  transition: all 0.2s;
}
.nav-links a:hover {
  color: rgba(255,255,255,0.85);
  background: rgba(255,255,255,0.06);
}
.nav-links a.active {
  color: #ffffff;
  background: var(--accent);
}

.hamburger {
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 12px;
}
.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: rgba(255,255,255,0.7);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-nav {
  display: none;
  position: fixed;
  inset: 64px 0 0 0;
  background: var(--bg-dark);
  backdrop-filter: blur(20px);
  z-index: 99;
}
.mobile-nav.open {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2.5rem;
}
.mobile-nav a {
  font-size: 1.1rem;
  font-weight: 600;
  color: rgba(255,255,255,0.7);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.mobile-nav a:hover { color: #ffffff; }

/* --- Season Pill Toggle --- */
.season-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  border-radius: 28px;
  padding: 3px;
  background: rgba(255, 255, 255, 0.06);
  margin-bottom: 1.25rem;
}

.season-pill-btn {
  appearance: none;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.55);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 0.45rem 1.3rem;
  border-radius: 24px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  line-height: 1;
}

.season-pill-btn:hover:not(.active) {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.85);
}

.season-pill-btn.active {
  background: var(--accent);
  color: #fff;
}

/* Glow ring on pill when viewing archive season */
.backtest-mode .season-pill {
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.6);
  border-color: rgba(37, 99, 235, 0.6);
}

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

/* --- Backtest Date Picker --- */
.backtest-date-picker {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  margin-top: 1.25rem;
}

.backtest-date-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.55);
}

.backtest-date-trigger {
  font-family: var(--font);
  font-size: 0.86rem;
  font-weight: 600;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  min-width: 230px;
  text-align: left;
}

.backtest-date-trigger:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.backtest-calendar-popover {
  position: absolute;
  top: calc(100% + 0.45rem);
  left: 0;
  z-index: 40;
  width: min(340px, 94vw);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  padding: 0.8rem;
}

.backtest-calendar-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.55rem;
}

.backtest-calendar-month-label {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text);
  flex: 1;
  text-align: center;
}

.calendar-nav-btn {
  width: 28px;
  height: 28px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-surface);
  color: var(--text);
  font-size: 1rem;
  cursor: pointer;
  line-height: 1;
}

.calendar-nav-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.backtest-calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.25rem;
  margin-bottom: 0.35rem;
}

.backtest-calendar-weekdays span {
  text-align: center;
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
}

.backtest-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.25rem;
}

.calendar-day {
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-surface);
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.74rem;
  min-height: 34px;
  cursor: pointer;
}

.calendar-day.has-picks {
  color: #ffffff;
  border-color: rgba(37, 99, 235, 0.44);
}

.calendar-day.no-picks {
  opacity: 0.33;
  cursor: default;
}

.calendar-day.filler {
  border: 0;
  background: transparent;
}

.calendar-day.selected {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.calendar-day:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.backtest-calendar-legend {
  margin-top: 0.6rem;
  margin-bottom: 0;
  font-size: 0.72rem;
  color: var(--text-secondary);
}

@media (max-width: 640px) {
  .backtest-date-picker {
    flex-direction: column;
    align-items: stretch;
    gap: 0.4rem;
  }

  .backtest-date-trigger {
    min-width: 0;
    width: 100%;
  }

  .backtest-calendar-popover {
    left: 50%;
    transform: translateX(-50%);
  }

  .books-filter-bar-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }
}

/* Backtest Banner */
.backtest-banner {
  position: fixed;
  top: 60px;
  left: 0;
  right: 0;
  z-index: 99;
  background: var(--accent);
  color: #ffffff;
  text-align: center;
  padding: 0.4rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.03em;
}

/* Extra top padding when backtest banner is visible */
body.backtest-mode .page-hero {
  padding-top: calc(7rem + 2rem);
}

body.backtest-mode .hero {
  padding-top: calc(3.5rem + 2rem);
}

body.backtest-mode .mobile-nav {
  top: calc(60px + 2rem);
}

/* --- Hero --- */
.hero {
  background-color: var(--bg-dark);
  background-image:
    linear-gradient(
      rgba(27, 42, 74, 0.72),
      rgba(27, 42, 74, 0.84)
    ),
    url('../images/hero-bg.jpg');
  background-size: cover;
  background-position: center 40%;
  padding: 3.5rem 0 5.5rem;
  color: white;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 300px; height: 300px;
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 4px;
  transform: translate(-50%, -50%) rotate(45deg);
  pointer-events: none;
}
.hero::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0; right: 0;
  height: 60px;
  background: var(--bg);
  clip-path: ellipse(55% 100% at 50% 100%);
}
.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
}
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent-2);
  margin-bottom: 1.25rem;
}
.hero-headline {
  font-size: 3.25rem;
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
}
.hero-sub {
  font-size: 1.05rem;
  color: rgba(255,255,255,0.55);
  max-width: 500px;
  margin: 0 auto 2.25rem;
  line-height: 1.65;
}
.hero-cta {
  display: inline-flex;
  gap: 0.75rem;
}
.cta-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 12px 28px;
  border-radius: 10px;
  font-family: var(--font);
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.2s;
}
.cta-button.primary {
  background: var(--accent);
  color: white;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
}
.cta-button.primary:hover { box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4); transform: translateY(-1px); }
.cta-button.secondary {
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.8);
  border: 1px solid rgba(255,255,255,0.12);
}
.cta-button.secondary:hover { background: rgba(255,255,255,0.12); color: white; }

/* --- Stat Cards --- */
.stat-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-top: -3.25rem;
  position: relative;
  z-index: 2;
  margin-bottom: 0.75rem;
}
.backtest-note {
  text-align: center;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  opacity: 0.5;
  margin-bottom: 3rem;
}
.stat-card {
  background: var(--bg-surface);
  border-radius: 16px;
  padding: 1.75rem 1.5rem;
  box-shadow: var(--shadow-lg);
  text-align: center;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s;
}
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 40px rgba(107, 66, 38, 0.06), 0 4px 8px rgba(0, 0, 0, 0.04);
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  border-radius: 16px 16px 0 0;
}
.stat-card.blue::before { background: var(--accent); }
.stat-card.green::before { background: var(--green); }
.stat-card.emerald::before { background: var(--emerald); }
.stat-card.orange::before { background: var(--accent-2); }
.stat-accent {
  width: 10px; height: 10px;
  border-radius: 2px;
  transform: rotate(45deg);
  margin: 0 auto 12px;
}
.stat-accent.blue { background: var(--accent-light); border: 2px solid var(--accent); }
.stat-accent.green { background: var(--green-light); border: 2px solid var(--green); }
.stat-accent.emerald { background: var(--emerald-light); border: 2px solid var(--emerald); }
.stat-accent.orange { background: var(--accent-2-light); border: 2px solid var(--accent-2); }
.stat-value {
  font-family: var(--mono);
  font-size: 2.1rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.1;
  letter-spacing: -0.01em;
}
.stat-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-top: 6px;
}
.stat-detail {
  font-size: 0.7rem;
  color: var(--text-dim);
  margin-top: 4px;
}

/* --- Section shared --- */
.section { padding: 3rem 0; }
.section-heading {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.4rem;
  text-align: center;
}
.section-sub {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 2rem;
  text-align: center;
}

/* --- How It Works --- */
.steps-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
}
.step {
  background: var(--bg-surface);
  border-radius: 16px;
  padding: 1.75rem;
  box-shadow: var(--shadow);
  border: 2px solid transparent;
  transition: border-color 0.2s;
}
.step:hover { border-color: var(--accent); }
.step-num {
  width: 32px; height: 32px;
  background: var(--bg-dark);
  color: white;
  border-radius: 4px;
  transform: rotate(45deg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.8rem;
  margin-bottom: 1rem;
}
.step-num span {
  transform: rotate(-45deg);
}
.step h3 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}
.step p {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.65;
}

/* --- Markets --- */
.market-pills {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: center;
}
.market-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  border-radius: 50px;
  background: var(--bg-surface);
  box-shadow: var(--shadow);
  font-size: 0.82rem;
  font-weight: 600;
  border: 2px solid transparent;
  transition: all 0.2s;
}
.market-pill:hover { border-color: var(--accent); }
.market-pill .wr {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.78rem;
  color: var(--green);
}
.market-pill .type-dot {
  width: 8px; height: 8px;
}
.type-dot.pitcher { background: var(--accent); border-radius: 1px; transform: rotate(45deg); }
.type-dot.batter { background: var(--accent-2); border-radius: 50%; }

/* --- CTA Section --- */
.cta-section {
  text-align: center;
  padding: 3.5rem 0 4.5rem;
}
.cta-section .section-heading { margin-bottom: 0.75rem; }
.cta-section .section-sub { margin-bottom: 1.75rem; }
.cta-section .cta-button.secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.cta-section .cta-button.secondary:hover {
  background: var(--bg-surface-2);
  color: var(--text);
}

/* --- Homepage mobile --- */
@media (max-width: 768px) {
  .stat-cards { grid-template-columns: repeat(2, 1fr); }
  .steps-row { grid-template-columns: repeat(2, 1fr); }
  .hero-headline { font-size: 2.25rem; }
  .page-hero { padding: 5.5rem 0 2rem; }
}
@media (max-width: 480px) {
  .stat-cards { grid-template-columns: 1fr; gap: 0.75rem; }
  .steps-row { grid-template-columns: 1fr; }
  .hero-headline { font-size: 1.75rem; }
  .hero-cta { flex-direction: column; gap: 0.5rem; }
  .market-pills { gap: 0.5rem; }
  .page-hero { padding: 4.5rem 0 1.5rem; }
}

/* --- Footer --- */
.footer {
  background: var(--bg-dark);
  color: rgba(255,255,255,0.45);
  padding: 2.5rem 0;
  text-align: center;
  position: relative;
}
.footer::before {
  content: '';
  position: absolute;
  top: 0; left: 5%; right: 5%;
  height: 2px;
  background: linear-gradient(90deg,
    transparent,
    rgba(232, 228, 223, 0.15) 15%,
    rgba(232, 228, 223, 0.15) 85%,
    transparent
  );
}
[data-theme="dark"] .footer::before {
  background: linear-gradient(90deg,
    transparent,
    rgba(232, 228, 223, 0.06) 15%,
    rgba(232, 228, 223, 0.06) 85%,
    transparent
  );
}
.footer-brand {
  font-size: 0.88rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 0.5rem;
}
.footer-brand span { color: var(--accent); opacity: 0.7; }
.brand span::before,
.footer-brand span::before {
  content: '';
  display: inline-block;
  width: 6px; height: 6px;
  background: currentColor;
  border-radius: 1px;
  transform: rotate(45deg);
  margin-right: 4px;
  vertical-align: middle;
  opacity: 0.7;
}
.footer-contact a { color: var(--accent); }
.discord-invite {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 0.5rem;
  color: var(--text-dim);
  font-size: 0.78rem;
  text-decoration: none;
  transition: color 0.2s;
}
.discord-invite:hover { color: #5865F2; }
.discord-invite svg { width: 16px; height: 16px; fill: currentColor; }
.footer-disclaimer {
  font-size: 0.68rem;
  max-width: 600px;
  margin: 1rem auto 0;
  line-height: 1.7;
  color: rgba(255,255,255,0.3);
}

/* ============================================
   Desktop (1024px+)
   ============================================ */
@media (min-width: 1024px) {
  body.backtest-mode .hero { padding-top: calc(3.5rem + 2rem); }
}

/* ============================================
   Picks & Results Pages
   ============================================ */

/* --- Page Hero (lighter than home hero) --- */
.page-hero {
  padding: 7rem 0 2.5rem;
  text-align: center;
  background: var(--bg-dark);
  color: #ffffff;
}

.page-title {
  font-size: clamp(2rem, 6vw, 3rem);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 0.5rem;
  color: #ffffff;
}

.page-subtitle {
  font-size: clamp(0.9rem, 2vw, 1.05rem);
  color: rgba(255, 255, 255, 0.7);
}

/* --- Picks Section --- */
.picks-section {
  padding: 1rem 0 4rem;
}

.books-filter-bar {
  background: var(--bg-surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.85rem 0.9rem;
  margin-bottom: 0.5rem;
  box-shadow: var(--shadow);
}

.books-filter-bar-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 0.55rem;
}

.picks-sidebar-title {
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin: 0;
}

.books-filter-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.book-filter-option {
  display: inline-grid;
  grid-template-columns: 14px 8px auto auto;
  align-items: center;
  gap: 0.52rem;
  font-size: 0.82rem;
  color: var(--text);
  padding: 0.48rem 0.72rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-surface);
  cursor: pointer;
  transition: border-color 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease;
}

.book-filter-option input {
  width: 13px;
  height: 13px;
  accent-color: var(--accent);
}

.book-filter-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.book-filter-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.book-filter-count {
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--text-dim);
}

.book-filter-option:hover {
  background: var(--chip-hover);
  border-color: var(--accent);
}

.book-filter-option:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.book-filter-option.is-selected {
  background: var(--accent-dim);
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.18);
}

.books-filter-summary {
  margin: 0;
  font-size: 0.74rem;
  color: var(--text-secondary);
}

/* --- Pick Cards Grid --- */
.picks-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-bottom: 2rem;
}

.pick-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: var(--shadow);
  transition: border-color 0.3s, box-shadow 0.2s ease;
}

.pick-card--batter {
  border-left-color: var(--accent-2);
}

.pick-card:hover {
  box-shadow: 0 4px 12px rgba(107, 66, 38, 0.06), 0 2px 4px rgba(27, 42, 74, 0.04);
  transform: translateY(-1px);
}


.pick-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 0.75rem;
}

.pick-card-header-info {
  flex: 1;
  min-width: 0;
}

.player-headshot {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(27, 42, 74, 0.10);
  flex-shrink: 0;
}

a > .player-headshot,
a > .player-initials {
  transition: opacity 0.15s;
}

a:hover > .player-headshot,
a:hover > .player-initials {
  opacity: 0.8;
}

.player-initials {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent);
  color: #ffffff;
  font-weight: 600;
  font-size: 18px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.02em;
}

.pick-card-player {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.pick-card-player a {
  color: inherit;
  text-decoration: none;
}

.pick-card-player a:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.pick-card-opponent {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 0.15rem;
}

.pick-card-matchup {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  margin: 0.15rem 0 0.85rem;
}

.matchup-team {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.team-logo-wrap {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.team-logo {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

/* Game log player cell */
.game-log-player {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
}

.game-log-player a {
  color: inherit;
  text-decoration: none;
}

.game-log-player a:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}
.game-log-team-logo {
  width: 18px;
  height: 18px;
  object-fit: contain;
  flex-shrink: 0;
}
.game-log-pos {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 0.1em 0.35em;
  border-radius: 3px;
  text-transform: uppercase;
  flex-shrink: 0;
}
.game-log-pos--sp {
  background: rgba(37, 99, 235, 0.15);
  color: #93c5fd;
}
.game-log-pos--bat {
  background: rgba(249, 115, 22, 0.15);
  color: #fdba74;
}

.team-logo-fallback {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-surface-2);
  color: var(--text-secondary);
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
}

.matchup-team-code {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.matchup-vs {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
}


.pick-card-body {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

.pick-call-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
}

.pick-call-label {
  font-size: 0.55rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.pick-direction {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
}

.pick-direction.over {
  color: var(--accent);
  background: var(--accent-light);
}

.pick-direction.under {
  color: var(--green);
  background: var(--green-light);
}

.pick-sizing {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  color: var(--text-secondary);
  background: var(--bg-offset);
  margin-left: 0.35rem;
}

.pick-line {
  font-family: var(--mono);
  font-size: 1.1rem;
  font-weight: 700;
}

.pick-card-market {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.pick-card-book {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 0.25rem;
}

.book-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.pick-card-price {
  font-family: var(--mono);
  font-weight: 500;
}

.pick-card-books {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 0.25rem;
}

.pick-book-entry {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pick-book-best {
  font-weight: 700;
  color: var(--text-secondary);
}

.pick-book-altline {
  font-family: var(--mono);
  font-size: 0.7rem;
  opacity: 0.7;
}

/* --- Empty State --- */
.picks-empty {
  text-align: center;
  padding: 4rem 1.5rem;
}

.picks-empty-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.picks-empty h3 {
  font-size: 1.2rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.picks-empty p {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* --- Disclaimer --- */
.picks-disclaimer {
  font-size: 0.75rem;
  color: var(--text-dim);
  text-align: center;
  max-width: 540px;
  margin: 2rem auto 0;
  line-height: 1.6;
}

/* --- Results Section --- */
.results-section {
  padding: 0 0 4rem;
}

/* --- Summary Card --- */
.summary-card {
  background: var(--bg-surface);
  border-radius: 16px;
  padding: 2rem 1.5rem 1.25rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow);
}

.summary-headline {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.summary-stat {
  text-align: center;
  position: relative;
  padding: 1.25rem 1rem;
  border-radius: 12px;
  background: var(--bg-surface-2);
  overflow: hidden;
}

.summary-stat::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  border-radius: 12px 12px 0 0;
  background: var(--accent);
}

.summary-stat:nth-child(1)::before { background: var(--accent); }
.summary-stat:nth-child(2)::before { background: var(--green); }
.summary-stat:nth-child(3)::before { background: var(--emerald); }
.summary-stat:nth-child(4)::before { background: var(--accent-2); }

.summary-stat-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
}

.summary-stat-value {
  font-family: var(--mono);
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 700;
  color: var(--text);
  line-height: 1.1;
}

.summary-stat-value.positive { color: var(--accent); }
.summary-stat-value.negative { color: var(--danger); }

/* Keep long record values on one line */
.summary-stat-value#stat-record {
  font-size: clamp(1.1rem, 3vw, 1.6rem);
  letter-spacing: -0.03em;
  white-space: nowrap;
}

.summary-context {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.summary-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.summary-meta-label {
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.78rem;
}

.summary-meta strong {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.85rem;
}

.summary-meta strong.positive { color: var(--accent); }
.summary-meta strong.negative { color: var(--danger); }

/* --- Detail Breakdowns --- */
.results-details {
  margin-top: 1.5rem;
}

/* --- Chart --- */
.results-chart-wrapper {
  background: var(--bg-surface);
  border-radius: 16px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow);
}

.results-chart-wrapper h3 {
  font-size: 1rem;
  font-weight: 800;
  margin-bottom: 1rem;
}

.results-chart-wrapper canvas {
  max-height: 400px;
  width: 100%;
}

/* --- Tables --- */
.results-table-wrapper,
.stats-breakdown {
  background: var(--bg-surface);
  border-radius: 16px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow);
}

.results-table-wrapper h3,
.results-section-heading {
  font-size: 1rem;
  font-weight: 800;
  margin-bottom: 1rem;
}

.results-table-scroll {
  overflow-x: auto;
}

.results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  min-width: 500px;
}

.results-table th {
  text-align: left;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  padding: 0.75rem 0.75rem;
  border-bottom: 2px solid var(--dirt);
  background: var(--bg-surface-2);
}
[data-theme="dark"] .results-table th {
  border-bottom-color: rgba(122, 101, 72, 0.4);
}

.results-table td {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  white-space: nowrap;
}
[data-theme="dark"] .results-table td {
  border-bottom-color: rgba(255, 255, 255, 0.04);
}

/* Numeric columns in monospace */
.results-table td:nth-child(n+2) {
  font-family: var(--mono);
  font-size: 0.8rem;
}

/* First column stays in body font */
.results-table td:first-child {
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 600;
}

.results-table tbody tr:hover {
  background: rgba(37, 99, 235, 0.05);
}

.results-table tbody tr:last-child td {
  border-bottom: none;
}

.result-badge {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

.result-badge.win {
  color: var(--green);
  background: var(--green-light);
}

.result-badge.loss {
  color: var(--danger);
  background: var(--danger-bg);
}

.result-badge.push {
  color: var(--text-dim);
  background: rgba(71, 85, 105, 0.10);
}

.result-badge.pending {
  color: var(--accent);
  background: rgba(99, 102, 241, 0.10);
}

.pnl-positive { color: var(--green); font-family: var(--mono); font-weight: 600; }
.pnl-negative { color: var(--danger); font-family: var(--mono); font-weight: 600; }

/* --- Responsive: Picks & Results --- */
@media (min-width: 768px) {
  .picks-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .summary-headline {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (min-width: 1440px) {
  .picks-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ============================================
   2026-02 UX/Product Accessibility Pass
   ============================================ */

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

.brand,
.nav-links a,
.mobile-nav a,
.cta-button,
.backtest-date-trigger,
.calendar-nav-btn,
.results-table th a,
.results-table td a {
  text-decoration: none;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -40px;
  z-index: 200;
  background: var(--bg-surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.45rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
}

.skip-link:focus {
  top: 0.75rem;
}

.status-meta {
  margin-top: 0.5rem;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.55);
}

.update-cta {
  margin-top: 1rem;
  text-align: center;
}

.results-chart-summary {
  margin-top: -0.3rem;
  margin-bottom: 0.8rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.results-table caption {
  caption-side: top;
  text-align: left;
  margin-bottom: 0.5rem;
  font-size: 0.78rem;
  color: var(--text-secondary);
}


.pick-call-label {
  font-size: 0.72rem;
  color: var(--text-secondary);
  font-weight: 700;
}

.picks-disclaimer {
  color: var(--text-secondary);
}

@media (min-width: 768px) {
  .nav-links {
    display: flex;
  }

  .hamburger {
    display: none;
  }

  .mobile-nav {
    display: none;
  }
}

/* --- Season pill mobile --- */
@media (max-width: 480px) {
  .season-pill-btn {
    font-size: 0.8rem;
    padding: 0.4rem 1rem;
  }
}

/* --- Record stat mobile fix (#25) --- */
@media (max-width: 480px) {
  .stat-value.mono,
  .results-stat-value {
    font-size: clamp(1.1rem, 3.5vw, 2rem);
  }
}

/* --- Chart mobile padding fix --- */
@media (max-width: 640px) {
  .results-chart-wrapper {
    padding: 1rem 0.5rem;
  }
}

/* --- Loading skeleton animation (#30) --- */
.loading-skeleton {
  background: linear-gradient(90deg, var(--bg-surface) 25%, rgba(37, 99, 235, 0.05) 50%, var(--bg-surface) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 6px;
  min-height: 220px;
}

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

/* --- Picks controls (#31) --- */
.picks-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.picks-controls-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

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

.picks-controls-left select {
  font-family: var(--font);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.4rem 0.6rem;
  cursor: pointer;
}

.picks-controls-left select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.picks-controls-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

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

.market-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.market-filter-chip {
  display: inline-grid;
  grid-template-columns: 14px auto auto;
  align-items: center;
  gap: 0.52rem;
  font-size: 0.82rem;
  color: var(--text);
  padding: 0.48rem 0.72rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-surface);
  cursor: pointer;
  transition: border-color 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease;
}

.market-filter-chip input {
  width: 13px;
  height: 13px;
  accent-color: var(--accent);
}

.market-filter-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.market-filter-count {
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--text-dim);
}

.market-filter-chip:hover {
  background: var(--chip-hover);
  border-color: var(--accent);
}

.market-filter-chip:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.market-filter-chip.active {
  background: var(--accent-dim);
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.18);
}


.btn {
  display: inline-block;
  font-family: var(--font);
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 0.7rem 1.5rem;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}

.btn-primary {
  background: var(--accent);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--accent-hover);
  color: #ffffff;
}

.btn-secondary {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}

.btn-secondary:hover {
  background: var(--accent-dim);
}

/* --- Star tier & direction stats tables (#34) --- */
/* Card styles for .stats-breakdown now live in the Tables section above */

/* --- Backtest outcome badge on pick cards (#35) --- */
.pick-outcome {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
}

.pick-outcome.win {
  background: var(--green-light);
  color: var(--green);
}

.pick-outcome.loss {
  background: var(--danger-bg);
  color: var(--danger);
}

.pick-outcome.push {
  background: rgba(106, 115, 132, 0.12);
  color: var(--text-dim);
}

/* --- Best bets section (#36) --- */
.best-bets-section {
  margin-bottom: 1.5rem;
}

.best-bets-heading {
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* --- Time Slate Grouping --- */
.time-slate-header {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.5rem 0 0.75rem;
  padding: 0;
}

.time-slate-header:first-child {
  margin-top: 0;
}

.time-slate-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.time-slate-header::after {
  content: '';
  flex: 1;
  height: 2px;
  background: repeating-linear-gradient(
    90deg,
    var(--dirt) 0px, var(--dirt) 8px,
    transparent 8px, transparent 14px
  );
  opacity: 0.35;
}
[data-theme="dark"] .time-slate-header::after {
  opacity: 0.25;
}

/* --- Game Slate Grouping --- */
.game-slate-group {
  margin-bottom: 2rem;
  grid-column: 1 / -1;
}

.game-slate-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.6rem 1rem;
  margin-bottom: 1rem;
  background: var(--bg-surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.game-slate-header .matchup-team {
  gap: 0.5rem;
}

.game-slate-header .matchup-team-code {
  font-size: 0.82rem;
  color: var(--text);
}

.game-slate-header .matchup-vs {
  font-size: 0.7rem;
}

.game-slate-header .team-logo {
  width: 26px;
  height: 26px;
}

.game-slate-header .team-logo-fallback {
  width: 26px;
  height: 26px;
  font-size: 0.55rem;
}

/* --- Game Placeholder (no picks yet) --- */
.game-placeholder {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-style: italic;
  border: 2px dashed var(--border);
  border-radius: 12px;
  background: transparent;
  min-height: 80px;
}

.game-slate-pitchers {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  margin-bottom: 0.5rem;
}

.game-score {
  font-family: var(--mono);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  min-width: 1.2em;
  text-align: center;
}

/* --- Calendar close button (#37) --- */
.calendar-close-btn {
  background: none;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  color: var(--text-dim);
  padding: 4px 8px;
}

.calendar-close-btn:hover {
  color: var(--text);
}

/* (Drawdown/streak stats now rendered inline in .summary-context) */


/* ============================================
   Additional Visual Polish
   ============================================ */

/* --- Pick card footer (outcome badge) --- */
.pick-card-footer {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.78rem;
}

.pick-outcome-actual {
  color: var(--text-secondary);
  font-size: 0.78rem;
}

.pick-outcome-pnl {
  font-family: var(--mono);
  font-size: 0.82rem;
  font-weight: 600;
}

/* --- Pick card role label --- */
.pick-card-role {
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.3em;
}

.pick-card-role-logo {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.pick-card-role-team {
  font-weight: 600;
  color: var(--text);
}

.pick-card-role-sep {
  opacity: 0.4;
}

/* --- Show All button in recent picks --- */
.show-all-btn {
  display: inline-block;
  font-family: var(--font);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid rgba(37, 99, 235, 0.25);
  border-radius: 6px;
  padding: 0.5rem 1.25rem;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  margin: 0.5rem 0;
}

.show-all-btn:hover {
  background: rgba(37, 99, 235, 0.15);
  border-color: rgba(37, 99, 235, 0.4);
}

/* --- Summary card mobile tweaks --- */
@media (max-width: 480px) {
  .summary-stat-value {
    font-size: clamp(1.1rem, 3.5vw, 1.75rem);
  }

  .summary-stat {
    padding: 1rem 0.75rem;
  }

  .summary-card {
    padding: 1.25rem 0.75rem 1rem;
  }
}

/* --- Tighter table min-width for small tables --- */
.stats-breakdown .results-table {
  min-width: 0;
}

/* --- Mobile: scroll hint for overflowing tables --- */
@media (max-width: 640px) {
  .results-table-scroll {
    position: relative;
  }
  .results-table-scroll::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 32px;
    background: linear-gradient(to right, transparent, var(--bg-surface));
    pointer-events: none;
    border-radius: 0 10px 10px 0;
    opacity: 1;
    transition: opacity 0.2s;
  }
  .results-table-scroll.scrolled-end::after {
    opacity: 0;
  }
}

/* ============================================
   Dark Mode
   ============================================ */
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f1923;
  --bg-surface: #162030;
  --bg-surface-2: #1e293b;
  --bg-elevated: #334155;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --accent-dim: rgba(59, 130, 246, 0.15);
  --accent-light: rgba(59, 130, 246, 0.15);
  --accent-2: #fb923c;
  --accent-2-light: rgba(251, 146, 60, 0.12);
  --chip-border: rgba(255, 255, 255, 0.12);
  --chip-hover: rgba(59, 130, 246, 0.12);
  --green: #22c55e;
  --green-light: rgba(34, 197, 94, 0.12);
  --emerald: #10b981;
  --emerald-light: rgba(16, 185, 129, 0.12);
  --text: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-dim: #64748b;
  --muted: #94a3b8;
  --border: rgba(255, 255, 255, 0.08);
  --danger: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.12);
  --shadow: 0 1px 3px rgba(0,0,0,0.2), 0 1px 2px rgba(0,0,0,0.15);
  --shadow-lg: 0 10px 40px rgba(0,0,0,0.3);
  /* Baseball palette (dark) */
  --field-green: #3d6b4a;
  --field-green-light: rgba(61, 107, 74, 0.12);
  --dirt: #7a6548;
  --dirt-light: rgba(122, 101, 72, 0.12);
  --leather: #5a3820;
  --leather-light: rgba(90, 56, 32, 0.10);
  --chalk: rgba(232, 228, 223, 0.08);
}

/* --- Dark mode: hero photo overlay darker --- */
[data-theme="dark"] .hero {
  background-image:
    linear-gradient(
      rgba(15, 20, 35, 0.80),
      rgba(15, 20, 35, 0.90)
    ),
    url('../images/hero-bg.jpg');
}

/* --- Dark mode: hero curve matches dark bg --- */
[data-theme="dark"] .hero::after {
  background: var(--bg);
}

/* --- Dark mode: box shadows --- */
[data-theme="dark"] .backtest-calendar-popover {
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .pick-card {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2), 0 1px 2px rgba(0, 0, 0, 0.15);
}

[data-theme="dark"] .pick-card:hover {
  box-shadow: 0 4px 12px rgba(107, 66, 38, 0.08), 0 2px 4px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .step,
[data-theme="dark"] .stat-card,
[data-theme="dark"] .summary-card,
[data-theme="dark"] .results-chart-wrapper,
[data-theme="dark"] .results-table-wrapper,
[data-theme="dark"] .stats-breakdown {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* --- Dark mode: card borders (shadows less visible on dark bg) --- */
[data-theme="dark"] .stat-card,
[data-theme="dark"] .summary-card,
[data-theme="dark"] .results-chart-wrapper,
[data-theme="dark"] .results-table-wrapper,
[data-theme="dark"] .stats-breakdown,

[data-theme="dark"] .step,
[data-theme="dark"] .market-pill {
  border-color: var(--border);
}

[data-theme="dark"] .books-filter-bar {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

/* --- Dark mode: hardcoded white backgrounds --- */
[data-theme="dark"] .book-filter-option,
[data-theme="dark"] .market-filter-chip {
  background: var(--bg-surface);
}

/* --- Dark mode: UNDER direction uses green --- */
[data-theme="dark"] .pick-direction.under {
  color: var(--green);
  background: var(--green-light);
}

[data-theme="dark"] .result-badge.loss {
  color: var(--danger);
  background: var(--danger-bg);
}


/* --- Dark mode: loading skeleton --- */
[data-theme="dark"] .loading-skeleton {
  background: linear-gradient(90deg, var(--bg-surface) 25%, rgba(59, 130, 246, 0.08) 50%, var(--bg-surface) 75%);
  background-size: 200% 100%;
}

/* --- Dark mode: table row hover --- */
[data-theme="dark"] .results-table tbody tr:hover {
  background: rgba(59, 130, 246, 0.08);
}

/* --- Dark mode: push badge --- */
[data-theme="dark"] .result-badge.push {
  background: rgba(122, 130, 144, 0.15);
}

[data-theme="dark"] .pick-outcome.push {
  background: rgba(122, 130, 144, 0.15);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0;
}

/* --- Header Discord Icon --- */
.header-discord {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  color: var(--text-dim);
  transition: color 0.2s;
}
.header-discord:hover { color: #5865F2; }

/* --- Theme Toggle Button --- */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(255,255,255,0.55);
  padding: 0;
  border-radius: 6px;
  transition: color 0.2s;
}

.theme-toggle:hover {
  color: rgba(255,255,255,0.85);
}

/* Light mode: show moon, hide sun */
.theme-icon-sun {
  display: none;
}

/* Dark mode: show sun, hide moon */
[data-theme="dark"] .theme-icon-moon {
  display: none;
}

[data-theme="dark"] .theme-icon-sun {
  display: block;
}

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

/* Injury Badge (picks page) */
.injury-badge {
  display: inline-block;
  padding: 0.1rem 0.4rem;
  margin-left: 0.5rem;
  border-radius: 4px;
  background: var(--danger);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  vertical-align: middle;
  cursor: help;
}

/* ============================================
   Live Game Tracking
   ============================================ */

/* --- LIVE / FINAL / DELAY / PPD badges on game slate header --- */
.live-badge,
.final-badge,
.delay-badge,
.postponed-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  padding: 2px 8px;
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1;
}

.live-badge {
  background: var(--danger);
  color: #fff;
}

.live-badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
  animation: live-pulse 1.5s ease-in-out infinite;
}

@keyframes live-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.final-badge {
  background: var(--text-dim);
  color: #fff;
}

.delay-badge,
.postponed-badge {
  background: var(--yellow);
  color: #1a1a1a;
}

/* --- Live inning indicator --- */
.live-inning {
  margin-left: 0.25rem;
  font-family: var(--mono);
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--text-secondary);
  font-style: italic;
}

/* --- Live stat row on pick cards --- */
.pick-card-live {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px dashed var(--border);
  font-family: var(--mono);
  font-size: 0.82rem;
}

.live-stat-current {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
}

.live-stat-label {
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 500;
}

.live-stat-separator {
  color: var(--text-dim);
}

.live-stat-line {
  color: var(--text-dim);
  font-weight: 500;
}

.live-stat-pending {
  color: var(--text-dim);
  font-size: 0.82rem;
}

/* --- Progress bar --- */
.live-progress-bar {
  flex: 1;
  height: 4px;
  min-width: 40px;
  border-radius: 2px;
  background: var(--border);
  overflow: hidden;
}

.live-progress-fill {
  height: 100%;
  border-radius: 2px;
  background: var(--accent);
  transition: width 0.5s ease, background-color 0.3s ease;
}

.live-progress-fill.approaching       { background: var(--yellow); }
.live-progress-fill.approaching-good  { background: var(--green); }
.live-progress-fill.approaching-bad   { background: var(--accent-2); }
.live-progress-fill.hit               { background: var(--green); }
.live-progress-fill.exceeded          { background: var(--danger); }

/* --- Reduced motion --- */
@media (prefers-reduced-motion: reduce) {
  .live-badge-dot { animation: none; opacity: 1; }
  .live-progress-fill { transition: none; }
}

.pick-card-notice {
  padding: 0.5rem 0.75rem;
  margin-top: 0.5rem;
  border-radius: 6px;
  background: var(--surface-alt, #f5f0e8);
  color: var(--text-secondary, #6b7280);
  font-size: 0.72rem;
  line-height: 1.4;
  border-left: 3px solid var(--accent, #d4a843);
}

[data-theme="dark"] .pick-card-notice {
  background: rgba(212, 168, 67, 0.08);
  color: var(--text-secondary, #9ca3af);
}

.market-category-badge {
  display: inline-block;
  padding: 0.1rem 0.4rem;
  margin-left: 0.5rem;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 600;
  vertical-align: middle;
  letter-spacing: 0.02em;
}

.market-category--pitcher {
  background: var(--surface-alt, #e8edf5);
  color: var(--text-secondary, #4b5563);
}

.market-category--batter {
  background: #fef3c7;
  color: #92400e;
}

[data-theme="dark"] .market-category--pitcher {
  background: rgba(99, 130, 191, 0.15);
  color: #93a3c0;
}

[data-theme="dark"] .market-category--batter {
  background: rgba(251, 191, 36, 0.15);
  color: #fbbf24;
}
