:root {
  --bg: #000;
  --surface: #0a0a0a;
  --surface-raised: #121212;
  --border: #222;
  --border-hover: #3e3e3e;
  --text: #ededed;
  --text-muted: #888;
  --green: #00e676;
  --green-alpha: rgba(0, 230, 118, 0.15);
  --blue: #0070f3;
  --red: #ff3b30;
  --gold: #f5a623;
  --font: 'Geist', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: 'Geist Mono', monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { background: var(--bg); color: var(--text); font-family: var(--font); padding-bottom: 60px; overflow-x: hidden; }
.shell { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
a { text-decoration: none; color: inherit; }

/* Ticker */
.ticker-wrap { width: 100%; overflow: hidden; background: var(--surface); border-bottom: 1px solid var(--border); padding: 8px 0; white-space: nowrap; }
.ticker-move { display: inline-block; animation: ticker 45s linear infinite; }
.ticker-move:hover { animation-play-state: paused; }
@keyframes ticker { 0% { transform: translateX(100vw); } 100% { transform: translateX(-100%); } }
.ticker-item { display: inline-flex; align-items: center; gap: 8px; margin-right: 32px; font-size: 13px; padding: 4px 12px; background: #111; border: 1px solid var(--border); border-radius: 4px; cursor: pointer; }
.ticker-news { border-color: #333; color: #ccc; }
.ticker-news strong { color: #fff; background: var(--red); padding: 2px 6px; border-radius: 4px; font-size: 10px; text-transform: uppercase; margin-right: 4px; }
.clock-live { color: var(--green); font-weight: 600; font-family: var(--mono); }

/* Header */
.app-header { display: flex; justify-content: space-between; align-items: center; padding: 20px 0; border-bottom: 1px solid var(--border); margin-bottom: 24px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.brand-name { font-size: 18px; font-weight: 600; }
.version-tag { font-size: 10px; font-family: var(--mono); background: #111; border: 1px solid var(--border); padding: 2px 6px; border-radius: 4px; color: var(--text-muted); }
.status-indicator { display: flex; align-items: center; gap: 8px; font-size: 12px; background: var(--surface); border: 1px solid var(--border); padding: 4px 12px; border-radius: 99px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-muted); transition: background 0.3s; }
.status-dot.online { background: var(--green); box-shadow: 0 0 8px var(--green); }
.status-dot.disconnected { background: var(--red); }
.ctrl-btn { background: var(--surface); border: 1px solid var(--border); color: var(--text); font-size: 12px; padding: 6px 12px; border-radius: 6px; cursor: pointer; transition: 0.2s; }
.ctrl-btn:hover { background: #1a1a1a; }

/* Grid Cards */
.section-title { font-size: 13px; text-transform: uppercase; color: var(--text-muted); margin-bottom: 14px; letter-spacing: 0.05em; }
.game-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; margin-bottom: 36px; }
.game-card { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 16px; cursor: pointer; position: relative; transition: border-color 0.2s, transform 0.15s; }
.game-card:hover { border-color: var(--border-hover); transform: translateY(-2px); }

@keyframes scoreFlash {
  0% { border-color: var(--green); box-shadow: 0 0 0 2px var(--green-alpha); }
  50% { border-color: var(--border-hover); box-shadow: 0 0 16px var(--green-alpha); }
  100% { border-color: var(--border); box-shadow: none; }
}
.game-card.score-updated { animation: scoreFlash 2s ease-out; }

.card-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.status-badge { font-family: var(--mono); font-size: 11px; color: var(--text-muted); }
.fav-toggle { background: transparent; border: none; color: var(--text-muted); cursor: pointer; font-size: 15px; padding: 2px 6px; }
.fav-toggle.active { color: var(--gold); }

.team-line { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; }
.team-details { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.team-logo { width: 22px; height: 22px; object-fit: contain; }
.team-score { font-family: var(--mono); font-size: 20px; font-weight: 700; }

/* Active Football / Possession Indicator */
.possession-pip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  background: #3d2314;
  border: 1px solid var(--gold);
  border-radius: 50%;
  font-size: 9px;
  box-shadow: 0 0 6px rgba(245, 166, 35, 0.4);
}

.card-footer {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
}

/* Green Live Scanning Line */
.live-scan-container {
  width: 100%;
  height: 2px;
  background: #1c1c1c;
  border-radius: 2px;
  overflow: hidden;
  margin-top: 10px;
  position: relative;
}
.live-scanner {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 30%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  border-radius: 2px;
  animation: scanBackAndForth 1.4s ease-in-out infinite alternate;
}
@keyframes scanBackAndForth {
  0% { left: 0; }
  100% { left: 70%; }
}

/* Drawer & Overlays */
.overlay { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(0,0,0,0.8); backdrop-filter: blur(4px); opacity: 0; pointer-events: none; transition: 0.3s; z-index: 99; }
.overlay.active { opacity: 1; pointer-events: all; }
.drawer { position: fixed; top: 0; right: -450px; width: 450px; height: 100vh; background: var(--surface); border-left: 1px solid var(--border); z-index: 100; transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1); display: flex; flex-direction: column; }
.drawer.open { right: 0; }
.drawer-header { padding: 20px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.drawer-body { padding: 20px; overflow-y: auto; flex: 1; }
.standings-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-bottom: 30px; }
.standings-table th { text-align: right; color: var(--text-muted); padding: 8px; border-bottom: 1px solid var(--border); font-size: 11px; }
.standings-table th:first-child { text-align: left; }
.standings-table td { text-align: right; padding: 10px 8px; border-bottom: 1px solid #111; font-family: var(--mono); }
.standings-table td:first-child { text-align: left; font-family: var(--font); display: flex; align-items: center; gap: 8px; }

/* --- GAMECAST FIXES --- */
.gc-header { display: flex; justify-content: center; align-items: center; gap: 40px; padding: 24px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; margin-bottom: 20px; }
.gc-team { display: flex; align-items: center; gap: 16px; width: 300px; }
.gc-team-right { flex-direction: row-reverse; text-align: right; }
.gc-logo-lg { width: 64px; height: 64px; object-fit: contain; }
.gc-score-lg { font-size: 56px; font-family: var(--mono); font-weight: 700; line-height: 1; transition: color 0.3s; }
.gc-score-updated { color: var(--green); }

.linescore { border-collapse: collapse; margin: 10px auto 0; font-size: 13px; text-align: center; }
.linescore th { color: var(--text-muted); padding: 4px 12px; border-bottom: 1px solid var(--border); }
.linescore td { font-family: var(--mono); font-weight: 600; padding: 4px 12px; }

/* 3-Column Layout */
.gc-body { display: grid; grid-template-columns: 320px 1fr 300px; gap: 20px; align-items: start; }
@media(max-width: 950px) { .gc-body { grid-template-columns: 1fr; } .gc-header { flex-direction: column; gap: 20px; } }

.gc-panel { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 20px; margin-bottom: 20px; }
.gc-panel-title { font-size: 13px; font-weight: 700; text-transform: uppercase; color: var(--text-muted); border-bottom: 1px solid var(--border); padding-bottom: 10px; margin-bottom: 16px; letter-spacing: 0.05em; }

/* Play-by-Play Scroller */
.pbp-container { max-height: 500px; overflow-y: auto; padding-right: 10px; }
.pbp-container::-webkit-scrollbar { width: 6px; }
.pbp-container::-webkit-scrollbar-thumb { background: #333; border-radius: 3px; }
.pbp-item { padding: 12px 0; border-bottom: 1px solid var(--border); display: flex; gap: 12px; font-size: 13px; }
.pbp-item:last-child { border-bottom: none; }
.pbp-down { font-family: var(--mono); font-weight: 600; color: var(--text-muted); width: 65px; flex-shrink: 0; text-align: right; }
.pbp-text { flex: 1; line-height: 1.5; }
.pbp-meta { color: var(--text-muted); font-size: 11px; margin-bottom: 4px; display: flex; align-items: center; gap: 6px; }
.pbp-scoring { border-left: 3px solid var(--gold); padding-left: 10px; background: rgba(245, 166, 35, 0.05); }

/* Player Leaders */
.leader-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.leader-player { display: flex; align-items: center; gap: 10px; width: 40%; }
.leader-player-right { flex-direction: row-reverse; text-align: right; }
.headshot { width: 40px; height: 40px; border-radius: 50%; background: #111; object-fit: cover; border: 1px solid var(--border); }
.leader-stat { text-align: center; font-size: 10px; color: var(--text-muted); font-weight: 600; width: 20%; text-transform: uppercase; }
.leader-stat-val { display: block; font-size: 16px; font-weight: 700; color: var(--text); font-family: var(--mono); margin-bottom: 2px; }