:root {
    --bg: #0a0e14;
    --surface: #141a23;
    --surface2: #1a2230;
    --border: #243044;
    --text: #e2e8f0;
    --text-muted: #7a8ba5;
    --accent: #3b82f6;
    --accent-dim: rgba(59,130,246,0.12);
    --green: #22c55e;
    --green-dim: rgba(34,197,94,0.10);
    --yellow: #eab308;
    --yellow-dim: rgba(234,179,8,0.10);
    --red: #ef4444;
    --red-dim: rgba(239,68,68,0.10);
    --gold: #f59e0b;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}
.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 1.5rem 1rem;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}
.header h1 {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, var(--accent), #818cf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.header .updated {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.3rem;
}

/* Section */
.section { margin-bottom: 2.5rem; }
.section-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.section-title .icon { font-size: 1.3rem; }
.section-title .badge {
    font-size: 0.7rem;
    font-weight: 600;
    background: var(--accent-dim);
    color: var(--accent);
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
}

/* Standings table */
.standings-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.85rem;
    background: var(--surface);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
}
.standings-table th {
    background: var(--surface2);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.6rem 0.5rem;
    text-align: center;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.standings-table th:nth-child(2) { text-align: left; }
.standings-table td {
    padding: 0.55rem 0.5rem;
    text-align: center;
    border-bottom: 1px solid var(--border);
    font-variant-numeric: tabular-nums;
}
.standings-table td:nth-child(2) { text-align: left; font-weight: 600; }
.standings-table tr:last-child td { border-bottom: none; }
.standings-table tr:hover td { background: var(--accent-dim); }
.standings-table .separator td {
    background: var(--border);
    padding: 0;
    height: 2px;
}
.standings-table .separator:hover td { background: var(--border); }

.team-cell {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.team-logo {
    width: 24px;
    height: 24px;
    object-fit: contain;
    flex-shrink: 0;
}
.team-name { white-space: nowrap; }
.rank-cell { width: 26px; font-weight: 700; color: var(--text-muted); }
.pts-current { font-weight: 700; font-size: 0.9rem; }
.pts-projected { font-weight: 800; font-size: 0.95rem; color: var(--accent); }
.playoff-pct { font-weight: 700; }
.pct-100 { color: var(--green); }
.pct-high { color: var(--accent); }
.pct-mid { color: var(--yellow); }
.pct-low { color: var(--red); }
.bye-tag {
    font-size: 0.65rem;
    font-weight: 700;
    background: var(--green-dim);
    color: var(--green);
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
}

/* Game cards */
.games-grid {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.date-divider {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--accent);
    padding: 0.75rem 0 0.25rem;
    text-transform: capitalize;
}
.date-divider:first-child { padding-top: 0; }

.game-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 0.75rem;
    transition: border-color 0.15s;
}
.game-card:hover { border-color: var(--accent); }

.game-team {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.game-team.home { justify-content: flex-end; text-align: right; }
.game-team.away { justify-content: flex-start; text-align: left; }
.game-team .name { font-weight: 600; font-size: 0.92rem; }
.game-team .name.is-winner { color: var(--green); }
.game-logo {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.game-center {
    text-align: center;
    min-width: 100px;
}
.game-time {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.2rem;
}
.game-odds {
    display: flex;
    justify-content: center;
    gap: 0.15rem;
    font-size: 0.72rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}
.odd-cell {
    padding: 0.15rem 0.35rem;
    border-radius: 4px;
    min-width: 38px;
    text-align: center;
}
.odd-cell.highlight {
    background: var(--accent-dim);
    color: var(--accent);
}
.odd-cell.draw-highlight {
    background: var(--yellow-dim);
    color: var(--yellow);
}

/* Bracket */
.bracket-champion {
    text-align: center;
    background: var(--surface);
    border: 2px solid var(--gold);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}
.champion-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--gold);
    margin-bottom: 0.5rem;
}
.champion-team {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
}
.champion-logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
}
.champion-name {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--gold);
}

/* Top 3 championship display */
.top3-teams {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin: 1rem 0;
}
.top3-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    padding: 0.8rem 0.6rem;
    background: var(--surface2);
    border-radius: 8px;
    min-width: 110px;
}
.top3-medal {
    font-size: 1.5rem;
    line-height: 1;
}
.top3-team {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
}
.top3-logo {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px;
    max-width: 32px;
    min-height: 32px;
    max-height: 32px;
    object-fit: contain;
}
.top3-name {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text);
}
.top3-prob {
    font-size: 1rem;
    font-weight: 800;
    color: var(--gold);
}

.bracket-mode {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 0.4rem;
}
.bracket-rounds {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}
.bracket-round {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
}
.round-header {
    background: var(--surface2);
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 700;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
}
.round-bo {
    font-size: 0.68rem;
    font-weight: 500;
    color: var(--text-muted);
}
.bracket-series {
    display: flex;
    flex-direction: column;
}
.series-row {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid var(--border);
}
.series-row:last-child { border-bottom: none; }
.series-team {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    font-weight: 600;
}
.series-team.left { justify-content: flex-end; text-align: right; }
.series-team.right { justify-content: flex-start; text-align: left; }
.series-team .s-logo {
    width: 24px;
    height: 24px;
    object-fit: contain;
    flex-shrink: 0;
}
.series-team.is-winner .s-name { color: var(--green); }
.series-team.is-loser .s-name { color: var(--text-muted); }
.series-score {
    text-align: center;
    font-weight: 800;
    font-size: 1rem;
    min-width: 60px;
    font-variant-numeric: tabular-nums;
}
.series-score .predicted-score {
    font-size: 0.65rem;
    font-weight: 500;
    color: var(--text-muted);
    display: block;
}
.series-status {
    display: inline-block;
    font-size: 0.6rem;
    font-weight: 600;
    padding: 0.1rem 0.3rem;
    border-radius: 4px;
    margin-left: 0.3rem;
    vertical-align: middle;
}
.status-completed {
    background: var(--green-dim);
    color: var(--green);
}
.status-in_progress {
    background: var(--yellow-dim);
    color: var(--yellow);
}
.status-predicted {
    background: var(--accent-dim);
    color: var(--accent);
}

/* Footer */
.footer {
    text-align: center;
    padding: 1.5rem 0;
    border-top: 1px solid var(--border);
    font-size: 0.75rem;
    color: var(--text-muted);
}
.footer a { color: var(--accent); text-decoration: none; }
.footer a:hover { text-decoration: underline; }

/* Loading */
.loading {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}
.spinner {
    display: inline-block;
    width: 24px; height: 24px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 0.5rem;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Responsive */
@media (max-width: 640px) {
    .container { padding: 1rem 0.6rem; }
    .header h1 { font-size: 1.4rem; }
    .game-card {
        grid-template-columns: 1fr;
        gap: 0.3rem;
        padding: 0.6rem 0.75rem;
    }
    .game-team.home { justify-content: flex-start; text-align: left; }
    .game-team.home .name { order: 2; }
    .game-team.home .game-logo { order: 1; }
    .game-center {
        order: -1;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    .game-time { margin-bottom: 0; }
    .standings-table { font-size: 0.78rem; }
    .standings-table th, .standings-table td { padding: 0.4rem 0.3rem; }
    .team-logo { width: 20px; height: 20px; }
    .game-logo { width: 26px; height: 26px; }
    .hide-mobile { display: none; }
    .series-team .s-name { font-size: 0.78rem; }
    .series-team .s-logo { width: 20px; height: 20px; }
    .series-score { font-size: 0.9rem; min-width: 50px; }
    .champion-logo { width: 32px; height: 32px; }
    .champion-name { font-size: 1.1rem; }
}
