/* ====================================
   GRIDTV SPORTS - THEME SYSTEM
   ==================================== */

/* Default Dark Theme (Current) */
body[data-theme="default"] {
  /* Background colors */
  --bg-primary: #0a0e1a;
  --bg-secondary: #1a1f2e;
  --bg-tertiary: #2d3748;
  --bg-card: linear-gradient(135deg, #1a1f2e 0%, #2d3748 100%);
  
  /* Text colors */
  --text-primary: #e0e0e0;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  /* Border colors */
  --border-primary: #334155;
  --border-hover: #475569;
  
  /* Semantic/Accent colors */
  --accent-blue: #17a2b8;
  --accent-green: #22c55e;
  --accent-yellow: #fbbf24;
  --accent-red: #ef4444;
  --accent-purple: #a855f7;
  
  /* Shadow system */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
  
  /* Header & Layout */
  --header-bg: linear-gradient(135deg, #1e293b 0%, #334155 100%);
  --card-hover-scale: 1.05;
  
  /* ====================================
     CARD COLORS - Easy to customize!
     ==================================== */
  
  /* Regular Game Cards */
  --card-bg: linear-gradient(135deg, #1a1f2e 0%, #2d3748 100%);
  --card-border: #334155;
  --card-border-hover: #475569;
  --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  --card-shadow-hover: 0 6px 20px rgba(0, 0, 0, 0.6);
  
  /* Card Text */
  --card-team-name: #e0e0e0;
  --card-score: #e0e0e0;
  --card-status: #94a3b8;
  --card-time: #94a3b8;
  
  /* Card Winning State */
  --card-winning-name: #22c55e;
  --card-winning-score: #22c55e;
  --card-winning-glow: rgba(34, 197, 94, 0.3);
  
  /* Card Live State */
  --card-live-indicator: #ef4444;
  --card-live-text: #ef4444;
  --card-live-glow: rgba(239, 68, 68, 0.4);
  
  /* NFL Specific - Regular Cards */
  --card-down-distance: #fbbf24;
  --card-down-distance-bg: rgba(251, 191, 36, 0.1);
  --card-possession-indicator: #fbbf24;
  --card-yard-line: #3b82f6;
  --card-quarter-label: #94a3b8;
  --card-quarter-score: #e0e0e0;
  --card-timeouts: #64748b;
  
  /* Fullscreen Cards (Sports Bar Mode) */
  --fullscreen-card-bg: linear-gradient(135deg, #1a1f2e 0%, #2d3748 100%);
  --fullscreen-card-border: #334155;
  --fullscreen-card-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  
  /* Fullscreen Card Text */
  --fullscreen-team-name: #e0e0e0;
  --fullscreen-score: #e0e0e0;
  --fullscreen-status: #94a3b8;
  --fullscreen-vs: #64748b;
  --fullscreen-record: #94a3b8;
  
  /* Fullscreen Winning State */
  --fullscreen-winning-name: #22c55e;
  --fullscreen-winning-score: #22c55e;
  
  /* Fullscreen Special Elements */
  --fullscreen-possession: #fbbf24;
  --fullscreen-live: #ef4444;
  --fullscreen-timeout-bar: rgba(255, 255, 255, 0.9);
  --fullscreen-timeout-used: transparent;
  --fullscreen-timeout-border: rgba(255, 255, 255, 0.8);
  
  /* NFL Specific - Fullscreen */
  --fullscreen-down-distance: #fbbf24;
  --fullscreen-yard-line: #3b82f6;
  --fullscreen-quarter: #94a3b8;
  --fullscreen-timeouts: #64748b;
  
  /* MLB Specific - Regular Cards */
  --card-balls-strikes: #94a3b8;
  --card-outs: #ef4444;
  --card-runners-on: #22c55e;
  --card-inning-label: #94a3b8;
  --card-inning-score: #e0e0e0;
  --card-pitcher: #94a3b8;
  --card-batter: #94a3b8;
  
  /* MLB Specific - Fullscreen */
  --fullscreen-balls-strikes: #94a3b8;
  --fullscreen-outs: #ef4444;
  --fullscreen-runners-on: #22c55e;
  --fullscreen-inning: #94a3b8;
  --fullscreen-pitcher: #94a3b8;
  --fullscreen-batter: #94a3b8;
  
  /* NBA Specific - Regular Cards */
  --card-fouls: #fbbf24;
  --card-turnovers: #ef4444;
  --card-quarter-nba: #94a3b8;
  --card-assists: #17a2b8;
  --card-rebounds: #a855f7;
  --card-blocks: #64748b;
  --card-steals: #22c55e;
  
  /* NBA Specific - Fullscreen */
  --fullscreen-fouls: #fbbf24;
  --fullscreen-turnovers: #ef4444;
  --fullscreen-quarter-nba: #94a3b8;
  --fullscreen-assists: #17a2b8;
  --fullscreen-rebounds: #a855f7;
  --fullscreen-blocks: #64748b;
  --fullscreen-steals: #22c55e;
  
  /* NHL Specific - Regular Cards */
  --card-period-label: #94a3b8;
  --card-period-score: #e0e0e0;
  --card-shots: #17a2b8;
  --card-power-play: #fbbf24;
  --card-penalty: #ef4444;
  
  /* NHL Specific - Fullscreen */
  --fullscreen-period-label: #94a3b8;
  --fullscreen-shots: #17a2b8;
  --fullscreen-power-play: #fbbf24;
  --fullscreen-penalty: #ef4444;
  
  /* NHL Period Clock */
  --card-period-clock: #2d2f33;
  --fullscreen-period-clock: #2d2f33;
  
  /* Additional Game Elements */
  --card-refresh-indicator: #3b82f6;
  --card-auto-refresh-text: #94a3b8;
  --card-game-detail-label: #64748b;
  --card-game-detail-value: #e0e0e0;
  
  /* Button Hover Colors */
  --btn-back-hover: #0056b3;
  --btn-sports-bar-hover: #138496;
  --btn-refresh-hover: rgba(255, 255, 255, 0.1);
  --btn-modal-primary-hover: #0056b3;
  --btn-modal-cancel-hover: rgba(255, 255, 255, 0.1);
  
  /* League/Sport Card Hover Colors */
  --sport-card-border-hover: #17a2b8;
  --sport-card-shadow-hover: 0 8px 24px rgba(23, 162, 184, 0.4);
  --sport-card-bg-hover: linear-gradient(135deg, #1e293b 0%, #334155 100%);
}

/* Apple UI Theme */
body[data-theme="apple"] {
  /* Apple's neutral palette */
  --bg-primary: #ffffff; /* Athens Gray - main background */
  --bg-secondary: #e0e0e0; /* White - cards and elevated surfaces */
  --bg-tertiary: #ffffff; /* Light gray - nested elements */
  --bg-card: #ffffff;
  
  /* Apple's text hierarchy */
  --text-primary: #2c2c2e; /* Darker gray - primary text */
  --text-secondary: #3a3a3c; /* Medium gray - secondary text */
  --text-muted: #1e1e22; /* Light gray - muted text */
  
  /* Apple's border system */
  --border-primary: rgba(0, 0, 0, 0.1); /* Subtle borders */
  --border-hover: rgba(0, 0, 0, 0.2);
  
  /* Apple's semantic colors - minimal use */
  --accent-blue: #0066cc; /* Science Blue - primary actions only */
  --accent-green: #34c759; /* Success states */
  --accent-yellow: #ff9500; /* Warnings */
  --accent-red: #ff3b30; /* Destructive actions and live indicators */
  --accent-purple: #af52de; /* Supplementary */
  
  /* Apple's shadow system - very subtle */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.12);
  
  /* Apple-specific */
  --header-bg: rgba(255, 255, 255, 0.8);
  --card-hover-scale: 1.02;
  --neutral-button-bg: #e8e8ed; /* Neutral button background */
  --neutral-button-hover: #d1d1d6; /* Neutral button hover */
  
  /* ====================================
     CARD COLORS - Easy to customize!
     ==================================== */
  
  /* Regular Game Cards */
  --card-bg: #ffffff;
  --card-border: rgba(0, 0, 0, 0.1);
  --card-border-hover: rgba(0, 0, 0, 0.2);
  --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  --card-shadow-hover: 0 2px 8px rgba(0, 0, 0, 0.12);
  
  /* Card Text */
  --card-team-name: #2c2c2e;
  --card-score: #2c2c2e;
  --card-status: #202022;
  --card-time: #202022;
  
  /* Card Winning State */
  --card-winning-name: #34c759;
  --card-winning-score: #34c759;
  --card-winning-glow: rgba(52, 199, 89, 0.2);
  
  /* Card Live State */
  --card-live-indicator: #ff3b30;
  --card-live-text: #ff3b30;
  --card-live-glow: rgba(255, 59, 48, 0.25);
  
  /* NFL Specific - Regular Cards */
  --card-down-distance: #321cad;
  --card-down-distance-bg: rgba(255, 149, 0, 0);
  --card-possession-indicator: #0066cc;
  --card-yard-line: #0066cc;
  --card-quarter-label: #3a3a3c;
  --card-quarter-score: #2c2c2e;
  --card-timeouts: #6e6e73;
  
  /* Fullscreen Cards (Sports Bar Mode) */
  --fullscreen-card-bg: #ffffff;
  --fullscreen-card-border: rgba(0, 0, 0, 0.1);
  --fullscreen-card-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  
  /* Fullscreen Card Text */
  --fullscreen-team-name: #2c2c2e;
  --fullscreen-score: #2c2c2e;
  --fullscreen-status: #3a3a3c;
  --fullscreen-vs: #6e6e73;
  --fullscreen-record: #3a3a3c;
  
  /* Fullscreen Winning State */
  --fullscreen-winning-name: #34c759;
  --fullscreen-winning-score: #34c759;
  
  /* Fullscreen Special Elements */
  --fullscreen-possession: #ff9500;
  --fullscreen-live: #ff3b30;
  --fullscreen-timeout-bar: rgba(0, 0, 0, 0.8);
  --fullscreen-timeout-used: transparent;
  --fullscreen-timeout-border: rgba(0, 0, 0, 0.6);
  
  /* NFL Specific - Fullscreen */
  --fullscreen-down-distance: #ff9500;
  --fullscreen-yard-line: #0066cc;
  --fullscreen-quarter: #3a3a3c;
  --fullscreen-timeouts: #6e6e73;
  
  /* MLB Specific - Regular Cards */
  --card-balls-strikes: #3a3a3c;
  --card-outs: #ff3b30;
  --card-runners-on: #34c759;
  --card-inning-label: #3a3a3c;
  --card-inning-score: #2c2c2e;
  --card-pitcher: #3a3a3c;
  --card-batter: #3a3a3c;
  
  /* MLB Specific - Fullscreen */
  --fullscreen-balls-strikes: #3a3a3c;
  --fullscreen-outs: #ff3b30;
  --fullscreen-runners-on: #34c759;
  --fullscreen-inning: #3a3a3c;
  --fullscreen-pitcher: #3a3a3c;
  --fullscreen-batter: #3a3a3c;
  
  /* NBA Specific - Regular Cards */
  --card-fouls: #ff9500;
  --card-turnovers: #ff3b30;
  --card-quarter-nba: #3a3a3c;
  --card-assists: #0066cc;
  --card-rebounds: #af52de;
  --card-blocks: #6e6e73;
  --card-steals: #34c759;
  
  /* NBA Specific - Fullscreen */
  --fullscreen-fouls: #ff9500;
  --fullscreen-turnovers: #ff3b30;
  --fullscreen-quarter-nba: #3a3a3c;
  --fullscreen-assists: #0066cc;
  --fullscreen-rebounds: #af52de;
  --fullscreen-blocks: #6e6e73;
  --fullscreen-steals: #34c759;
  
  /* NHL Specific - Regular Cards */
  --card-period-label: #3a3a3c;
  --card-period-score: #2c2c2e;
  --card-shots: #0066cc;
  --card-power-play: #ff9500;
  --card-penalty: #ff3b30;
  
  /* NHL Specific - Fullscreen */
  --fullscreen-period-label: #3a3a3c;
  --fullscreen-shots: #0066cc;
  --fullscreen-power-play: #ff9500;
  --fullscreen-penalty: #ff3b30;
  
  /* NHL Period Clock */
  --card-period-clock: #3a3a3c;
  --fullscreen-period-clock: #3a3a3c;
  
  /* Additional Game Elements */
  --card-refresh-indicator: #0066cc;
  --card-auto-refresh-text: #3a3a3c;
  --card-game-detail-label: #6e6e73;
  --card-game-detail-value: #2c2c2e;
  
  /* Button Hover Colors */
  --btn-back-hover: #d1d1d6;
  --btn-sports-bar-hover: #0055b3;
  --btn-refresh-hover: #d1d1d6;
  --btn-modal-primary-hover: #0055b3;
  --btn-modal-cancel-hover: #d1d1d6;
  
  /* League/Sport Card Hover Colors */
  --sport-card-border-hover: #0066cc;
  --sport-card-shadow-hover: 0 4px 12px rgba(0, 102, 204, 0.15);
  --sport-card-bg-hover: #ffffff;
}

/* Base styles using CSS variables */
body {
  background: var(--bg-primary);
  color: var(--text-primary);
  transition: background 0.3s ease, color 0.3s ease;
}

/* Default Dark Theme Card Customization */
body[data-theme="default"] .team-name,
body[data-theme="default"] .team-info h3,
body[data-theme="default"] .team h3 {
  color: var(--card-team-name);
  font-weight: 600;
}

body[data-theme="default"] .score,
body[data-theme="default"] .team-score,
body[data-theme="default"] .score-display {
  color: var(--card-score);
  font-weight: 700;
}

/* Winning team emphasis in Default theme */
body[data-theme="default"] .team.winning .team-name,
body[data-theme="default"] .team.winning h3,
body[data-theme="default"] .team-info.winning h3 {
  color: var(--card-winning-name);
}

body[data-theme="default"] .team.winning .score,
body[data-theme="default"] .team.winning .team-score,
body[data-theme="default"] .team-score.winning {
  color: var(--card-winning-score);
  font-weight: 700;
}

/* Game status and time elements - Default theme */
body[data-theme="default"] .game-status,
body[data-theme="default"] .game-time,
body[data-theme="default"] .time-status,
body[data-theme="default"] .status-text {
  color: var(--card-status);
  font-weight: 500;
}

body[data-theme="default"] .status-live,
body[data-theme="default"] .live-indicator {
  color: var(--card-live-indicator);
  font-weight: 700;
}

/* NFL Specific - Regular Cards - Default theme */
body[data-theme="default"] .down-distance {
  color: var(--card-down-distance);
  background: var(--card-down-distance-bg);
}

body[data-theme="default"] .yard-line {
  color: var(--card-yard-line);
}

body[data-theme="default"] .possession-indicator {
  color: var(--card-possession-indicator);
}

/* MLB Specific - Regular Cards - Default theme */
body[data-theme="default"] .balls-strikes,
body[data-theme="default"] .count {
  color: var(--card-balls-strikes);
}

body[data-theme="default"] .outs {
  color: var(--card-outs);
}

body[data-theme="default"] .runners-on,
body[data-theme="default"] .bases {
  color: var(--card-runners-on);
}

/* NBA/NHL Specific - Regular Cards - Default theme */
body[data-theme="default"] .fouls {
  color: var(--card-fouls);
}

body[data-theme="default"] .turnovers {
  color: var(--card-turnovers);
}

/* Additional Game Elements - Default theme */
body[data-theme="default"] .refresh-indicator {
  color: var(--card-refresh-indicator);
}

body[data-theme="default"] .auto-refresh-info {
  color: var(--card-auto-refresh-text);
}

body[data-theme="default"] .game-detail-label {
  color: var(--card-game-detail-label);
}

body[data-theme="default"] .game-detail-value {
  color: var(--card-game-detail-value);
}

/* Period/Quarter/Inning elements - Default theme */
body[data-theme="default"] .quarter-label,
body[data-theme="default"] .period-label,
body[data-theme="default"] .inning-label {
  color: var(--text-secondary);
  font-weight: 600;
}

body[data-theme="default"] .quarter-score,
body[data-theme="default"] .period-score,
body[data-theme="default"] .inning-score {
  color: var(--text-primary);
  font-weight: 600;
}

body[data-theme="default"] .quarter-clock,
body[data-theme="default"] .period-time,
body[data-theme="default"] .game-clock {
  color: var(--card-period-clock);
  font-weight: 500;
}

/* Fullscreen (Sports Bar Mode) text colors - Default theme */
body[data-theme="default"] .fullscreen-team-name {
  color: var(--fullscreen-team-name);
  font-weight: 700;
}

body[data-theme="default"] .fullscreen-score {
  color: var(--fullscreen-score);
  font-weight: 700;
}

body[data-theme="default"] .fullscreen-team.winning .fullscreen-team-name,
body[data-theme="default"] .fullscreen-team.winning .fullscreen-score {
  color: var(--fullscreen-winning-name);
  font-weight: 700;
}

body[data-theme="default"] .fullscreen-quarter,
body[data-theme="default"] .fullscreen-period,
body[data-theme="default"] .fullscreen-inning {
  color: var(--fullscreen-status);
  font-weight: 600;
}

body[data-theme="default"] .fullscreen-vs {
  color: var(--fullscreen-vs);
  font-weight: 600;
}

body[data-theme="default"] .fullscreen-team-record {
  color: var(--fullscreen-record);
  font-weight: 500;
}

body[data-theme="default"] .fullscreen-down-distance,
body[data-theme="default"] .fullscreen-clock,
body[data-theme="default"] .fullscreen-time {
  color: var(--fullscreen-period-clock);
  font-weight: 500;
}

body[data-theme="default"] .fullscreen-possession {
  color: var(--fullscreen-possession);
}

body[data-theme="default"] .fullscreen-inning.live,
body[data-theme="default"] .fullscreen-status.live {
  color: var(--fullscreen-live);
  font-weight: 700;
}

/* NFL Specific - Fullscreen - Default theme */
body[data-theme="default"] .fullscreen-down-distance {
  color: var(--fullscreen-down-distance);
}

body[data-theme="default"] .fullscreen-yard-line {
  color: var(--fullscreen-yard-line);
}

/* MLB Specific - Fullscreen - Default theme */
body[data-theme="default"] .fullscreen-balls-strikes,
body[data-theme="default"] .fullscreen-count {
  color: var(--fullscreen-balls-strikes);
}

body[data-theme="default"] .fullscreen-outs {
  color: var(--fullscreen-outs);
}

body[data-theme="default"] .fullscreen-runners-on,
body[data-theme="default"] .fullscreen-bases {
  color: var(--fullscreen-runners-on);
}

/* NBA/NHL Specific - Fullscreen - Default theme */
body[data-theme="default"] .fullscreen-fouls {
  color: var(--fullscreen-fouls);
}

body[data-theme="default"] .fullscreen-turnovers {
  color: var(--fullscreen-turnovers);
}

/* Fullscreen timeout indicators - Default theme */
body[data-theme="default"] .timeout-bar {
  border: 2px solid var(--fullscreen-timeout-border);
  background: var(--fullscreen-timeout-bar);
}

body[data-theme="default"] .timeout-bar.used {
  background: var(--fullscreen-timeout-used);
}

/* Fullscreen cards background - Default theme */
body[data-theme="default"] .fullscreen-game-card {
  background: var(--fullscreen-card-bg);
  border: 1px solid var(--fullscreen-card-border);
  box-shadow: var(--fullscreen-card-shadow);
}

/* Fullscreen game selector - Default theme */
body[data-theme="default"] .fs-game-selector {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 2px solid var(--accent-blue);
  box-shadow: var(--shadow-md);
}

body[data-theme="default"] .fs-game-selector:focus {
  outline: none;
  border-color: var(--accent-green);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.3);
}

body[data-theme="default"] .fs-game-selector option {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

/* Button hover styles - Default theme */
body[data-theme="default"] .back-btn:hover {
  background: var(--btn-back-hover);
}

body[data-theme="default"] .sports-bar-btn:hover {
  background: var(--btn-sports-bar-hover);
}

body[data-theme="default"] .mixed-sports-btn:hover {
  background: var(--btn-sports-bar-hover);
}

body[data-theme="default"] .refresh-btn:hover {
  background: var(--btn-refresh-hover);
}

body[data-theme="default"] #enter-fullscreen:hover {
  background: var(--btn-modal-primary-hover);
}

body[data-theme="default"] #cancel-modal:hover {
  background: var(--btn-modal-cancel-hover);
}

/* Apple UI specific overrides */
body[data-theme="apple"] {
  background: linear-gradient(180deg, #f5f5f7 0%, #ffffff 100%);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Header theme adaptations */
body[data-theme="apple"] .header {
  background: var(--header-bg);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border-primary);
  box-shadow: var(--shadow-sm);
}

body[data-theme="apple"] .header h1 {
  /* Simplified gradient - less saturated, more Apple-like */
  background: linear-gradient(90deg, var(--accent-blue), #34c759, #ff9500, #ff3b30);
  background-size: 200% auto;
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 700;
  letter-spacing: -0.5px;
}

/* Sport card specific styling */
body[data-theme="apple"] .sport-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
}

body[data-theme="apple"] .sport-card::before {
  background: linear-gradient(135deg, transparent 0%, rgba(0, 0, 0, 0.02) 100%);
}

body[data-theme="apple"] .sport-card:hover {
  border-color: var(--accent-blue);
  box-shadow: 0 4px 12px rgba(0, 102, 204, 0.15);
}

/* Sport icons - neutral, let logos speak */
body[data-theme="apple"] .sport-icon {
  filter: grayscale(0%);
  opacity: 1;
}

body[data-theme="apple"] .sport-name {
  color: var(--text-primary);
  font-weight: 600;
}

/* Card theme adaptations */
body[data-theme="apple"] .sport-card,
body[data-theme="apple"] .game-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  box-shadow: var(--card-shadow);
}

body[data-theme="apple"] .sport-card:hover {
  background: var(--sport-card-bg-hover);
  border-color: var(--sport-card-border-hover);
  box-shadow: var(--sport-card-shadow-hover);
  transform: scale(var(--card-hover-scale)) translateY(-2px);
}

body[data-theme="apple"] .game-card:hover {
  border-color: var(--card-border-hover);
  box-shadow: var(--card-shadow-hover);
  transform: scale(var(--card-hover-scale)) translateY(-2px);
}

/* Default Dark Theme - Regular Cards */
body[data-theme="default"] .sport-card,
body[data-theme="default"] .game-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  box-shadow: var(--card-shadow);
}

body[data-theme="default"] .sport-card:hover {
  background: var(--sport-card-bg-hover);
  border-color: var(--sport-card-border-hover);
  box-shadow: var(--sport-card-shadow-hover);
  transform: scale(var(--card-hover-scale)) translateY(-2px);
}

body[data-theme="default"] .game-card:hover {
  border-color: var(--card-border-hover);
  box-shadow: var(--card-shadow-hover);
  transform: scale(var(--card-hover-scale)) translateY(-2px);
}

/* Remove colorful gradients - use clean backgrounds */
body[data-theme="apple"] .score-container {
  background: var(--bg-tertiary);
}

body[data-theme="apple"] .game-title {
  background: transparent;
  border-bottom: 1px solid var(--border-primary);
  color: var(--text-secondary);
}

body[data-theme="apple"] .game-status-row {
  background: transparent;
  border-top: 1px solid var(--border-primary);
}

/* Regular card team names and scores - customizable */
body[data-theme="apple"] .team-name,
body[data-theme="apple"] .team-info h3,
body[data-theme="apple"] .team h3 {
  color: var(--card-team-name);
  font-weight: 600;
}

body[data-theme="apple"] .score,
body[data-theme="apple"] .team-score,
body[data-theme="apple"] .score-display {
  color: var(--card-score);
  font-weight: 700;
}

/* Winning team emphasis */
body[data-theme="apple"] .team.winning .team-name,
body[data-theme="apple"] .team.winning h3,
body[data-theme="apple"] .team-info.winning h3 {
  color: var(--card-winning-name);
}

body[data-theme="apple"] .team.winning .score,
body[data-theme="apple"] .team.winning .team-score,
body[data-theme="apple"] .team-score.winning {
  color: var(--card-winning-score);
  font-weight: 700;
}

/* Game status and time elements - Apple theme */
body[data-theme="apple"] .game-status,
body[data-theme="apple"] .game-time,
body[data-theme="apple"] .time-status,
body[data-theme="apple"] .status-text {
  color: var(--card-status);
  font-weight: 500;
}

body[data-theme="apple"] .status-live,
body[data-theme="apple"] .live-indicator {
  color: var(--card-live-indicator);
  font-weight: 700;
}

/* NFL Specific - Regular Cards - Apple theme */
body[data-theme="apple"] .down-distance {
  color: var(--card-down-distance);
  background: var(--card-down-distance-bg);
}

body[data-theme="apple"] .yard-line {
  color: var(--card-yard-line);
}

body[data-theme="apple"] .possession-indicator {
  color: var(--card-possession-indicator);
}

/* MLB Specific - Regular Cards - Apple theme */
body[data-theme="apple"] .balls-strikes,
body[data-theme="apple"] .count {
  color: var(--card-balls-strikes);
}

body[data-theme="apple"] .outs {
  color: var(--card-outs);
}

body[data-theme="apple"] .runners-on,
body[data-theme="apple"] .bases {
  color: var(--card-runners-on);
}

/* NBA/NHL Specific - Regular Cards - Apple theme */
body[data-theme="apple"] .fouls {
  color: var(--card-fouls);
}

body[data-theme="apple"] .turnovers {
  color: var(--card-turnovers);
}

/* Additional Game Elements - Apple theme */
body[data-theme="apple"] .refresh-indicator {
  color: var(--card-refresh-indicator);
}

body[data-theme="apple"] .auto-refresh-info {
  color: var(--card-auto-refresh-text);
}

body[data-theme="apple"] .game-detail-label {
  color: var(--card-game-detail-label);
}

body[data-theme="apple"] .game-detail-value {
  color: var(--card-game-detail-value);
}

/* Period/Quarter/Inning elements - Apple theme */
body[data-theme="apple"] .quarter-label,
body[data-theme="apple"] .period-label,
body[data-theme="apple"] .inning-label {
  color: var(--text-secondary);
  font-weight: 600;
}

body[data-theme="apple"] .quarter-score,
body[data-theme="apple"] .period-score,
body[data-theme="apple"] .inning-score {
  color: var(--text-primary);
  font-weight: 600;
}

body[data-theme="apple"] .quarter-clock,
body[data-theme="apple"] .period-time,
body[data-theme="apple"] .game-clock {
  color: var(--card-period-clock);
  font-weight: 500;
}

/* Button theme adaptations */
body[data-theme="apple"] button {
  border-radius: 12px;
  font-weight: 600;
  letter-spacing: -0.3px;
}

/* Back button - neutral (not primary action) */
body[data-theme="apple"] .back-btn {
  background: var(--neutral-button-bg);
  color: var(--text-primary);
  box-shadow: none;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

body[data-theme="apple"] .back-btn:hover {
  background: var(--btn-back-hover);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

/* Sports Bar Mode button - primary action (Science Blue) */
body[data-theme="apple"] .sports-bar-btn {
  background: var(--accent-blue);
  color: white;
  box-shadow: 0 2px 6px rgba(0, 102, 204, 0.25);
  border: none;
}

body[data-theme="apple"] .sports-bar-btn:hover {
  background: var(--btn-sports-bar-hover);
  box-shadow: 0 4px 12px rgba(0, 102, 204, 0.35);
}

/* Mixed Sports button - primary action */
body[data-theme="apple"] .mixed-sports-btn {
  background: var(--accent-blue);
  border: none;
  box-shadow: 0 2px 8px rgba(0, 102, 204, 0.25);
}

body[data-theme="apple"] .mixed-sports-btn:hover {
  background: var(--btn-sports-bar-hover);
  box-shadow: 0 4px 16px rgba(0, 102, 204, 0.35);
}

/* Refresh button - neutral action */
body[data-theme="apple"] .refresh-btn {
  background: var(--neutral-button-bg);
  color: var(--text-primary);
  box-shadow: none;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

body[data-theme="apple"] .refresh-btn:hover {
  background: var(--btn-refresh-hover);
}

/* Modal buttons */
body[data-theme="apple"] #enter-fullscreen {
  background: var(--accent-blue);
  color: white;
  border: none;
}

body[data-theme="apple"] #cancel-modal {
  background: var(--neutral-button-bg);
  color: var(--text-primary);
  border: 1px solid rgba(0, 0, 0, 0.08);
}

body[data-theme="apple"] #enter-fullscreen:hover {
  background: var(--btn-modal-primary-hover);
}

body[data-theme="apple"] #cancel-modal:hover {
  background: var(--btn-modal-cancel-hover);
}

/* Score and status theme adaptations */
body[data-theme="apple"] .score-container {
  background: var(--bg-tertiary);
}

body[data-theme="apple"] .team-score.winning {
  color: var(--accent-green); /* Green for success/winning */
}

/* Fullscreen winning states */
body[data-theme="apple"] .fullscreen-team.winning .fullscreen-score,
body[data-theme="apple"] .fullscreen-team.winning .fullscreen-team-name {
  color: var(--accent-green);
}

body[data-theme="apple"] .fullscreen-game-card.winning-home,
body[data-theme="apple"] .fullscreen-game-card.winning-away {
  border-color: rgba(52, 199, 89, 0.3);
}

body[data-theme="apple"] .live-indicator {
  background: var(--accent-red); /* Red for live/active state */
  box-shadow: 0 2px 6px rgba(255, 59, 48, 0.25);
}

body[data-theme="apple"] .inning-display.live,
body[data-theme="apple"] .fullscreen-inning.live {
  color: var(--accent-red); /* Red for live state */
}

/* Sport icons - use Science Blue for consistency */
body[data-theme="apple"] .sport-icon {
  color: var(--accent-blue);
}

/* Neutral backgrounds for panels */
body[data-theme="apple"] .live-games-panel {
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  box-shadow: var(--shadow-sm);
}

body[data-theme="apple"] .features {
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
}

/* Theme selector styling */
body[data-theme="apple"] .theme-select {
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

body[data-theme="apple"] .theme-select:hover {
  border-color: var(--border-hover);
}

body[data-theme="apple"] .theme-select:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 4px rgba(0, 102, 204, 0.1);
}

/* Text color adaptations */
body[data-theme="apple"] .panel-header,
body[data-theme="apple"] .game-title {
  color: var(--text-primary);
}

body[data-theme="apple"] .auto-refresh-info,
body[data-theme="apple"] .text-secondary {
  color: var(--text-secondary);
}

/* Fullscreen mode adaptations */
body[data-theme="apple"] .fullscreen-container {
  background: var(--bg-primary);
}

body[data-theme="apple"] .fullscreen-game-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  box-shadow: var(--shadow-sm);
}

body[data-theme="apple"] .fullscreen-controls {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border-primary);
}

/* Fullscreen (Sports Bar Mode) text colors - Apple theme */
body[data-theme="apple"] .fullscreen-team-name {
  color: var(--fullscreen-team-name);
  font-weight: 700;
}

body[data-theme="apple"] .fullscreen-score {
  color: var(--fullscreen-score);
  font-weight: 700;
}

body[data-theme="apple"] .fullscreen-team.winning .fullscreen-team-name,
body[data-theme="apple"] .fullscreen-team.winning .fullscreen-score {
  color: var(--fullscreen-winning-name);
  font-weight: 700;
}

body[data-theme="apple"] .fullscreen-quarter,
body[data-theme="apple"] .fullscreen-period,
body[data-theme="apple"] .fullscreen-inning {
  color: var(--fullscreen-status);
  font-weight: 600;
}

body[data-theme="apple"] .fullscreen-vs {
  color: var(--fullscreen-vs);
  font-weight: 600;
}

body[data-theme="apple"] .fullscreen-team-record {
  color: var(--fullscreen-record);
  font-weight: 500;
}

body[data-theme="apple"] .fullscreen-down-distance,
body[data-theme="apple"] .fullscreen-clock,
body[data-theme="apple"] .fullscreen-time {
  color: var(--fullscreen-period-clock);
  font-weight: 500;
}

body[data-theme="apple"] .fullscreen-possession {
  color: var(--fullscreen-possession);
}

body[data-theme="apple"] .fullscreen-inning.live,
body[data-theme="apple"] .fullscreen-status.live {
  color: var(--fullscreen-live);
  font-weight: 700;
}

/* NFL Specific - Fullscreen - Apple theme */
body[data-theme="apple"] .fullscreen-down-distance {
  color: var(--fullscreen-down-distance);
}

body[data-theme="apple"] .fullscreen-yard-line {
  color: var(--fullscreen-yard-line);
}

/* MLB Specific - Fullscreen - Apple theme */
body[data-theme="apple"] .fullscreen-balls-strikes,
body[data-theme="apple"] .fullscreen-count {
  color: var(--fullscreen-balls-strikes);
}

body[data-theme="apple"] .fullscreen-outs {
  color: var(--fullscreen-outs);
}

body[data-theme="apple"] .fullscreen-runners-on,
body[data-theme="apple"] .fullscreen-bases {
  color: var(--fullscreen-runners-on);
}

/* NBA/NHL Specific - Fullscreen - Apple theme */
body[data-theme="apple"] .fullscreen-fouls {
  color: var(--fullscreen-fouls);
}

body[data-theme="apple"] .fullscreen-turnovers {
  color: var(--fullscreen-turnovers);
}

/* Fullscreen timeout indicators - Apple theme */
body[data-theme="apple"] .timeout-bar {
  border: 2px solid var(--fullscreen-timeout-border);
  background: var(--fullscreen-timeout-bar);
}

body[data-theme="apple"] .timeout-bar.used {
  background: var(--fullscreen-timeout-used);
}

/* Fullscreen cards background - Apple theme */
body[data-theme="apple"] .fullscreen-game-card {
  background: var(--fullscreen-card-bg);
  border: 1px solid var(--fullscreen-card-border);
  box-shadow: var(--fullscreen-card-shadow);
}

/* Fullscreen game selector - Apple theme */
body[data-theme="apple"] .fs-game-selector {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 2px solid var(--accent-blue);
  box-shadow: var(--shadow-sm);
}

body[data-theme="apple"] .fs-game-selector:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.3);
}

body[data-theme="apple"] .fs-game-selector option {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

/* Modal adaptations */
body[data-theme="apple"] .modal {
  background: rgba(0, 0, 0, 0.4);
}

body[data-theme="apple"] .modal-content {
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

body[data-theme="apple"] .modal-content h2 {
  color: var(--text-primary);
  font-weight: 700;
}

/* Layout selection radio buttons */
body[data-theme="apple"] .layout-options label {
  background: var(--bg-tertiary);
  border: 2px solid var(--border-primary);
  color: var(--text-primary);
}

body[data-theme="apple"] .layout-options label:hover {
  background: var(--neutral-button-hover);
  border-color: var(--accent-blue);
}

body[data-theme="apple"] .layout-options label:has(input[type="radio"]:checked) {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
  color: white;
}

/* Grid preview */
body[data-theme="apple"] .grid-preview {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
}

/* Theme selector styling */
.theme-selector {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 30px;
  justify-content: center;
}

.theme-selector label {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-secondary);
}

.theme-select {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 2px solid var(--border-primary);
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  outline: none;
  min-width: 180px;
}

.theme-select:hover {
  border-color: var(--border-hover);
}

.theme-select:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 4px rgba(23, 162, 184, 0.15);
}

body[data-theme="apple"] .theme-select {
  background: var(--bg-secondary);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
}

body[data-theme="apple"] .theme-select:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.1);
}

.theme-select option {
  background: var(--bg-secondary);
  color: var(--text-primary);
  padding: 10px;
}

/* Smooth transitions for theme switching */
* {
  transition: background-color 0.3s ease, 
              border-color 0.3s ease, 
              color 0.3s ease,
              box-shadow 0.3s ease;
}

/* Exclude animations from theme transitions */
*:not(.live-dot):not(.live-indicator):not(.fullscreen-refresh-indicator) {
  transition: background-color 0.3s ease, 
              border-color 0.3s ease, 
              color 0.3s ease,
              box-shadow 0.3s ease;
}

/* ====================================
   RESPONSIVE FIXES FOR MOBILE
   ==================================== */

@media screen and (max-width: 768px) {
  /* Prevent horizontal scroll on mobile */
  body {
    overflow-x: hidden;
    max-width: 100vw;
  }

  /* Theme selector responsive */
  .theme-selector {
    flex-direction: column;
    gap: 8px;
    margin-top: 20px;
  }

  .theme-select {
    width: 100%;
    min-width: auto;
  }
}

@media screen and (max-width: 600px) {
  /* Extra small screens */
  .theme-selector label {
    font-size: 14px;
  }

  .theme-select {
    font-size: 13px;
    padding: 8px 12px;
  }
}
