:root {
  --bg-primary: #070b14;
  --bg-secondary: #0f172a;
  --bg-card: rgba(15, 23, 42, 0.85);
  --bg-card-hover: rgba(30, 41, 59, 0.92);
  --bg-elevated: #1e293b;
  --border-subtle: rgba(148, 163, 184, 0.14);
  --border-bright: rgba(148, 163, 184, 0.28);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent-espn: #ef4444;
  --accent-rundown: #38bdf8;
  --accent-sharp: #10b981;
  --accent-gold: #f59e0b;
  --accent-purple: #8b5cf6;
  --positive: #22c55e;
  --negative: #ef4444;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-primary);
  background-image:
    radial-gradient(circle at 12% 0%, rgba(56, 189, 248, 0.08), transparent 38%),
    radial-gradient(circle at 88% 5%, rgba(16, 185, 129, 0.07), transparent 38%);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.45;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

/* Top Global Navigation */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(7, 11, 20, 0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.7rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.brand-badge {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 0.95rem;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #1e293b, #0f172a);
  border: 1px solid var(--border-bright);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.brand-title {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.brand-subtitle {
  font-size: 0.74rem;
  color: var(--text-secondary);
}

.nav-pages {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(15, 23, 42, 0.9);
  padding: 0.3rem;
  border-radius: 11px;
  border: 1px solid var(--border-subtle);
}

.nav-page-link {
  padding: 0.48rem 0.95rem;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.45rem;
  transition: all 0.18s ease;
}

.nav-page-link:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.nav-page-link.active-espn {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.22), rgba(239, 68, 68, 0.08));
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.45);
}

.nav-page-link.active-rundown {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.22), rgba(56, 189, 248, 0.08));
  color: #7dd3fc;
  border: 1px solid rgba(56, 189, 248, 0.45);
}

.nav-page-link.active-sharp {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.22), rgba(16, 185, 129, 0.08));
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.45);
}

.nav-page-link.active-hub {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.dot-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

/* Controls & Week Strip */
.controls-bar {
  background: rgba(15, 23, 42, 0.72);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.65rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.week-selector-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.ctrl-select, .ctrl-input, .ctrl-btn {
  background: #0f172a;
  color: var(--text-primary);
  border: 1px solid var(--border-bright);
  padding: 0.42rem 0.75rem;
  border-radius: 8px;
  font-size: 0.81rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.ctrl-btn:hover, .ctrl-select:hover {
  border-color: #64748b;
  background: #1e293b;
}

.ctrl-btn.primary {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  border-color: #3b82f6;
}

.week-pills {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  overflow-x: auto;
  max-width: 680px;
  padding-bottom: 2px;
}

.week-pill {
  padding: 0.32rem 0.58rem;
  border-radius: 6px;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-secondary);
  background: rgba(30, 41, 59, 0.55);
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
}

.week-pill:hover {
  color: var(--text-primary);
  background: rgba(51, 65, 85, 0.75);
}

.week-pill.active {
  color: #fff;
  background: #2563eb;
  border-color: #60a5fa;
}

/* Favorite Teams Bar */
.fav-strip {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.fav-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  font-size: 0.73rem;
  font-weight: 700;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: all 0.15s;
}

.fav-chip.pinned {
  background: rgba(245, 158, 11, 0.16);
  border-color: rgba(245, 158, 11, 0.55);
  color: #fde68a;
}

.fav-chip img {
  width: 16px;
  height: 16px;
  object-fit: contain;
}

/* Container & Layout */
.container {
  max-width: 1600px;
  margin: 0 auto;
  padding: 1.25rem 1.5rem 3rem;
}

/* Hero Banner for API Page */
.api-hero {
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
  border: 1px solid var(--border-bright);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.api-hero.espn-theme {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.14), rgba(15, 23, 42, 0.92));
  border-color: rgba(239, 68, 68, 0.35);
}

.api-hero.rundown-theme {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.14), rgba(15, 23, 42, 0.92));
  border-color: rgba(56, 189, 248, 0.35);
}

.api-hero.sharp-theme {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.14), rgba(15, 23, 42, 0.92));
  border-color: rgba(16, 185, 129, 0.35);
}

.hero-meta h1 {
  font-size: 1.35rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.hero-meta p {
  font-size: 0.84rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

.endpoint-pills {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin-top: 0.6rem;
}

.endpoint-pill {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.71rem;
  padding: 0.22rem 0.55rem;
  border-radius: 6px;
  background: rgba(7, 11, 20, 0.75);
  border: 1px solid var(--border-subtle);
  color: #cbd5e1;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 0.32rem 0.7rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.status-badge.live {
  background: rgba(34, 197, 94, 0.16);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.4);
}

.status-badge.hybrid {
  background: rgba(56, 189, 248, 0.16);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.4);
}

/* KPI Summary Strip */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0.9rem;
  margin-bottom: 1.25rem;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.95rem 1.15rem;
}

.kpi-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

.kpi-value {
  font-size: 1.45rem;
  font-weight: 800;
  margin-top: 0.25rem;
}

.kpi-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

/* Section Tabs */
.section-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.2rem;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 0.65rem;
  overflow-x: auto;
}

.section-tab {
  padding: 0.52rem 1rem;
  border-radius: 9px;
  font-size: 0.83rem;
  font-weight: 700;
  color: var(--text-secondary);
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}

.section-tab:hover {
  color: var(--text-primary);
  border-color: var(--border-bright);
}

.section-tab.active {
  background: #1e293b;
  color: #fff;
  border-color: #38bdf8;
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.25);
}

/* Scoreboard & Game Cards Grid */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1rem;
}

.game-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem;
  transition: all 0.18s ease;
  cursor: pointer;
  position: relative;
}

.game-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-bright);
  transform: translateY(-2px);
}

.game-card.pinned-game {
  border-color: rgba(245, 158, 11, 0.65);
  box-shadow: 0 0 18px rgba(245, 158, 11, 0.1);
}

.game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.74rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.game-status-live {
  color: #ef4444;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ef4444;
  animation: pulse 1.4s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
  70% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.team-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.42rem 0;
}

.team-info {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

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

.team-name-line {
  font-weight: 700;
  font-size: 0.94rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.team-record {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
}

.team-score {
  font-size: 1.3rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.game-odds-strip {
  margin-top: 0.75rem;
  padding-top: 0.65rem;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.4rem;
  font-size: 0.73rem;
}

.odd-pill {
  background: rgba(7, 11, 20, 0.65);
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 6px;
  padding: 0.32rem 0.45rem;
  text-align: center;
}

.odd-pill-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.odd-pill-val {
  font-weight: 700;
  color: #e2e8f0;
  margin-top: 1px;
}

/* Tables */
.table-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 1.25rem;
}

.table-card-header {
  padding: 0.95rem 1.2rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.table-card-title {
  font-size: 0.98rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

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

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

table.data-table th {
  text-align: left;
  padding: 0.7rem 0.9rem;
  font-size: 0.71rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  background: rgba(7, 11, 20, 0.6);
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

table.data-table td {
  padding: 0.68rem 0.9rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

table.data-table tr:hover td {
  background: rgba(30, 41, 59, 0.55);
}

.player-cell {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.player-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  background: #1e293b;
  border: 1px solid var(--border-bright);
}

.pos-badge {
  font-size: 0.67rem;
  font-weight: 800;
  padding: 0.14rem 0.42rem;
  border-radius: 4px;
  background: rgba(56, 189, 248, 0.15);
  color: #7dd3fc;
}

.pos-QB { background: rgba(239, 68, 68, 0.18); color: #fca5a5; }
.pos-RB { background: rgba(34, 197, 94, 0.18); color: #86efac; }
.pos-WR { background: rgba(56, 189, 248, 0.18); color: #7dd3fc; }
.pos-TE { background: rgba(245, 158, 11, 0.18); color: #fde68a; }
.pos-DEF, .pos-K { background: rgba(139, 92, 246, 0.18); color: #c4b5fd; }

.ev-badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  font-weight: 800;
  font-size: 0.76rem;
  background: rgba(34, 197, 94, 0.18);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.4);
}

.best-line-cell {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: 6px;
  padding: 0.22rem 0.48rem;
  font-weight: 700;
  color: #6ee7b7;
}

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

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(3, 7, 18, 0.8);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.modal-backdrop.open {
  display: flex;
}

.modal-panel {
  background: #0f172a;
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 920px;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65);
}

.modal-header {
  padding: 1.1rem 1.4rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  background: #0f172a;
  z-index: 5;
}

.modal-body {
  padding: 1.35rem;
}

.stat-comp-row {
  margin-bottom: 0.85rem;
}

.stat-comp-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
}

.stat-comp-bar {
  height: 8px;
  background: #1e293b;
  border-radius: 999px;
  overflow: hidden;
  display: flex;
}

.filter-pills {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.filter-pill {
  padding: 0.32rem 0.7rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  background: rgba(30, 41, 59, 0.75);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
}

.filter-pill.active {
  background: #2563eb;
  color: #fff;
  border-color: #60a5fa;
}
