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

:root {
  --bg: #0d1117;
  --surface: #161b22;
  --border: #30363d;
  --text: #e6edf3;
  --text-dim: #8b949e;
  --accent: #58a6ff;
  --green: #3fb950;
  --red: #f85149;
  --gold: #d29922;
  --slot-empty: #21262d;
  --slot-filled: #238636;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

header {
  text-align: center;
  padding: 30px 0 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}

header h1 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

header h1 span {
  color: var(--accent);
}

.meta {
  color: var(--text-dim);
  font-size: 0.875rem;
  margin-top: 6px;
}

.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
}

.tab {
  padding: 8px 16px;
  cursor: pointer;
  color: var(--text-dim);
  border-bottom: 2px solid transparent;
  font-size: 0.875rem;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  font-family: inherit;
  transition: color 0.15s;
}

.tab:hover { color: var(--text); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* Board */
.board-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.board-table th,
.board-table td {
  padding: 6px 4px;
  text-align: center;
  border: 1px solid var(--border);
}

.board-table thead th {
  background: var(--surface);
  color: var(--text-dim);
  font-weight: 600;
  font-size: 0.75rem;
  position: sticky;
  top: 0;
  z-index: 10;
}

.board-table .team-cell {
  text-align: left;
  padding-left: 10px;
  font-weight: 600;
  white-space: nowrap;
  min-width: 120px;
}

.board-table .participant-cell {
  text-align: left;
  padding-left: 8px;
  color: var(--accent);
  min-width: 100px;
  font-size: 0.75rem;
}

.board-table .count-cell {
  font-weight: 700;
  min-width: 40px;
}

.slot {
  width: 22px;
  height: 22px;
  border-radius: 3px;
  display: inline-block;
}

.slot.empty {
  background: var(--slot-empty);
}

.slot.filled {
  background: var(--slot-filled);
}

.row-complete {
  background: rgba(35, 134, 54, 0.1);
}

.row-complete .team-cell {
  color: var(--gold);
}

/* Standings */
.standings-table {
  width: 100%;
  max-width: 700px;
  border-collapse: collapse;
}

.standings-table th,
.standings-table td {
  padding: 10px 14px;
  border: 1px solid var(--border);
  text-align: left;
}

.standings-table thead th {
  background: var(--surface);
  color: var(--text-dim);
  font-weight: 600;
  font-size: 0.8rem;
}

.standings-table .rank { width: 40px; text-align: center; }

.standings-table .filled-bar {
  background: var(--slot-empty);
  border-radius: 4px;
  height: 18px;
  position: relative;
  min-width: 120px;
}

.standings-table .filled-bar-inner {
  background: var(--slot-filled);
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s;
}

.standings-table .filled-count {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* Winner banner */
.winner-banner {
  background: linear-gradient(135deg, #d29922 0%, #e3b341 100%);
  color: #0d1117;
  padding: 16px 24px;
  border-radius: 8px;
  text-align: center;
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 20px;
}

/* Games */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}

.game-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
}

.game-card .teams {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.game-card .team-score {
  text-align: center;
}

.game-card .abbr {
  font-weight: 700;
  font-size: 1rem;
}

.game-card .score {
  font-size: 1.5rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.game-card .vs { color: var(--text-dim); font-size: 0.75rem; }

.game-card .status {
  text-align: center;
  margin-top: 8px;
  font-size: 0.75rem;
  color: var(--text-dim);
}

.game-card .status.final { color: var(--green); }
.game-card .status.live { color: var(--red); }

.no-data {
  color: var(--text-dim);
  text-align: center;
  padding: 40px;
}

.loading {
  text-align: center;
  padding: 40px;
  color: var(--text-dim);
}

@media (max-width: 768px) {
  .container { padding: 12px; }
  header h1 { font-size: 1.5rem; }
  .board-table { font-size: 0.7rem; }
  .board-table .team-cell { min-width: 80px; }
  .board-table .participant-cell { min-width: 70px; }
  .slot { width: 18px; height: 18px; }
}
