@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

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

:root {
  --orange: #f05a00;
  --orange-dark: #c74a00;
  --orange-glow: rgba(240, 90, 0, 0.18);
  --green: #4caf50;
  --green-dim: rgba(76, 175, 80, 0.12);
  --bg: #0d0d0d;
  --surface: #1a1a1a;
  --surface2: #222222;
  --border: #2e2e2e;
  --border2: #3a3a3a;
  --text: #f5f5f5;
  --text-dim: #aaa;
  --text-muted: #666;
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ── Nav ─────────────────────────────────────────── */
nav {
  background: #f05a00;
  border-bottom: 1px solid #c74a00;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 56px;
}

.nav-brand {
  font-size: 1.1rem;
  font-weight: 800;
  color: #fff !important;
  text-shadow: 0 1px 3px rgba(0,0,0,0.3);
  letter-spacing: -0.02em;
  margin-right: 12px;
  text-decoration: none !important;
  white-space: nowrap;
}

nav a {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  padding: 6px 12px;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}

nav a:hover {
  color: #fff;
  background: rgba(0, 0, 0, 0.15);
  text-decoration: none;
}

/* ── Layout ──────────────────────────────────────── */
main {
  max-width: 960px;
  margin: 36px auto;
  padding: 0 20px;
}

h1 {
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: 20px;
  color: #fff;
  letter-spacing: -0.02em;
}

h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

/* ── Rules ───────────────────────────────────────── */
.rules-box {
  background: var(--surface);
  border-left: 3px solid var(--orange);
  border-radius: 6px;
  padding: 12px 16px;
  margin-bottom: 28px;
}

.rules-box h3 {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 8px;
  font-weight: 600;
}

.rules-box ol { padding-left: 18px; }
.rules-box li { font-size: 0.875rem; color: #ccc; line-height: 1.7; }

/* ── Banners ─────────────────────────────────────── */
.banner {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 0.9rem;
  font-weight: 500;
}

.banner-next {
  background: var(--orange-glow);
  border: 1px solid rgba(223, 70, 1, 0.4);
  color: #ffb380;
}

.banner-open {
  background: var(--green-dim);
  border: 1px solid rgba(76, 175, 80, 0.4);
  color: #a5d6a7;
}

/* ── Game card ───────────────────────────────────── */
.game-info {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 28px;
}

.game-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
}

.status { font-weight: 700; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; padding: 2px 8px; border-radius: 4px; }
.status-scheduled { color: var(--text-muted); background: #1e1e1e; }
.status-live { color: var(--green); background: var(--green-dim); }
.status-final { color: var(--orange); background: var(--orange-glow); }

.pick-closed { color: #f44336; margin-top: 12px; font-size: 0.875rem; font-weight: 600; }
.no-game { color: #888; font-size: 1rem; margin-top: 8px; }

/* ── Scoreboard ──────────────────────────────────── */
.scoreboard {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px 32px;
  margin: 16px 0;
}

.score-team {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.team-name {
  font-size: 0.7rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}

.team-score {
  font-size: 2.8rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
  letter-spacing: -0.03em;
}

.score-divider { text-align: center; }
.inning-label { font-size: 0.75rem; color: var(--green); font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }

/* ── Lineup ──────────────────────────────────────── */
.lineup-section { margin: 16px 0 4px; }

.lineup-section h3 {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
  font-weight: 600;
}

.lineup-list {
  list-style: decimal;
  padding-left: 20px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 20px;
}

.lineup-list li { font-size: 0.875rem; color: #e0e0e0; line-height: 1.6; }
.pos { color: var(--text-muted); font-size: 0.75rem; margin-left: 4px; font-weight: 500; }
.bat-side { font-size: 0.7rem; font-weight: 700; margin-left: 6px; padding: 1px 5px; border-radius: 3px; background: var(--surface2); color: var(--text-muted); }
.bat-side-adv { background: rgba(76,175,80,0.15); color: #4caf50; }

/* ── Picks grid ──────────────────────────────────── */
.picks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}

/* User color palette */
.avatar-0 { background: #df4601; }
.avatar-1 { background: #1976d2; }
.avatar-2 { background: #7b1fa2; }
.avatar-3 { background: #00796b; }
.avatar-4 { background: #c62828; }
.avatar-5 { background: #f57c00; }
.avatar-6 { background: #2e7d32; }

.player-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  transition: border-color 0.15s;
}

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

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

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.player-card h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}

.picked-player {
  font-size: 0.9rem;
  padding: 8px 10px;
  background: var(--surface2);
  border-radius: 6px;
  border: 1px solid var(--border);
  color: var(--text);
}

.picked-player.clicked {
  background: rgba(76, 175, 80, 0.1);
  border: 1px solid rgba(76, 175, 80, 0.5);
  color: #a5d6a7;
}

.hr-badge {
  display: inline-block;
  margin-left: 8px;
  background: var(--green);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.game2-badge {
  display: inline-block;
  margin-left: 6px;
  background: var(--accent, #e87722);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

select {
  width: 100%;
  padding: 8px 10px;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border2);
  border-radius: 6px;
  margin-bottom: 8px;
  font-size: 0.875rem;
  font-family: inherit;
  transition: border-color 0.15s;
}

select:focus {
  outline: none;
  border-color: var(--orange);
}

button {
  width: 100%;
  padding: 9px;
  background: var(--orange);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-weight: 700;
  cursor: pointer;
  font-size: 0.875rem;
  font-family: inherit;
  letter-spacing: 0.01em;
  transition: background 0.15s;
}

button:hover { background: var(--orange-dark); }

.no-pick { color: var(--text-muted); font-size: 0.875rem; }

/* ── Leaderboard ─────────────────────────────────── */
.section-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 56px 0 36px;
}

.leaderboard-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 16px;
  letter-spacing: -0.01em;
}

.leaderboard {
  width: 100%;
  border-collapse: collapse;
}

.leaderboard th {
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  padding: 10px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.leaderboard td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

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

.leaderboard tr.rank-1 td { color: #ffd700; font-weight: 700; }
.leaderboard tr.rank-2 td { color: #c0c0c0; font-weight: 600; }
.leaderboard tr.rank-3 td { color: #cd7f32; font-weight: 600; }

.rank-medal { font-size: 1rem; margin-right: 2px; }

/* ── History ─────────────────────────────────────── */
.history-game {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 14px;
}

.history-header {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

.history-date {
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 500;
  background: var(--surface2);
  padding: 2px 8px;
  border-radius: 4px;
}

.history-matchup { font-weight: 700; font-size: 1rem; }

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

.history-table th {
  color: var(--text-muted);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  padding: 6px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.history-table td {
  padding: 9px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
}

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

/* ── Schedule ────────────────────────────────────── */
.schedule-record {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 14px;
  margin-bottom: 20px;
  font-size: 0.875rem;
  color: var(--text-dim);
}

.schedule-record strong { color: var(--text); font-weight: 700; font-size: 1rem; }

/* ── Mobile ──────────────────────────────────────── */
@media (max-width: 600px) {
  nav { padding: 0 16px; gap: 4px; }
  .nav-brand { font-size: 0.9rem; margin-right: 4px; }
  .nav-brand img { height: 26px !important; margin-right: 0 !important; }
  .nav-brand-text { display: none; }
  nav a { padding: 5px 7px; font-size: 0.8rem; }

  main { padding: 0 12px; margin: 20px auto; }
  h1 { font-size: 1.4rem; margin-bottom: 16px; }

  .picks-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .lineup-list { grid-template-columns: 1fr; }
  .scoreboard { gap: 16px; padding: 14px 16px; }
  .team-score { font-size: 2rem; }

  .leaderboard th, .leaderboard td { padding: 9px 10px; font-size: 0.8rem; }
  .game-info { padding: 16px; }
  .player-card { padding: 12px; }
}
