:root {
    --bg: #111;
    --card: #1c1c1c;
    --card-border: #2a2a2a;
    --badge-bg: #2a2a2a;
    --text: #f0f0f0;
    --text-muted: #666;
    --green-bg: #14532d;
    --green-text: #86efac;
    --green-accent: #22c55e;
    --red: #ef4444;
    --gap: 1rem;
    --radius: 12px;
    --card-w: 290px;
}

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

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

/* ── Header ─────────────────────────────────────── */

header {
    padding: 1rem 1.25rem 0.25rem;
    text-align: center;
}

.header-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text);
}

/* ── Layout ─────────────────────────────────────── */

main {
    padding: 0.75rem 1.25rem 2rem;
    max-width: 1800px;
    margin-left: auto;
    margin-right: auto;
}

.section {
    margin-bottom: 2rem;
}

.section.hidden {
    display: none;
}

.section-heading {
    font-size: 0.7rem;
    font-weight: 700;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
    margin-bottom: 0.875rem;
    margin-top: 0.25rem;
}

.games-grid {
    display: flex;
    flex-wrap: wrap;
    gap: var(--gap);
    justify-content: center;
}

/* ── Game Card ──────────────────────────────────── */

.game-box {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 1rem 1rem 0.875rem;
    width: var(--card-w);
    flex-shrink: 0;
    border-top-width: 3px;
}

.game-box-live {
    border-top-color: var(--green-accent);
}

.game-box-intermission {
    border-top-color: #f59e0b;
}

/* ── Card Header (badges + live dot) ───────────── */

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    min-height: 1.25rem;
}

.badges {
    display: flex;
    gap: 0.3rem;
    align-items: center;
    flex-wrap: wrap;
}

.badge {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.2rem 0.45rem;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: var(--badge-bg);
    color: var(--text);
    white-space: nowrap;
}

.badge-live {
    background: var(--green-bg);
    color: var(--green-text);
}

.badge-muted {
    color: var(--text-muted);
}

.live-dot {
    width: 7px;
    height: 7px;
    background: var(--red);
    border-radius: 50%;
    flex-shrink: 0;
    animation: pulse 1.8s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.4; }
}

/* ── Team Rows ──────────────────────────────────── */

.team-row {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.55rem 0;
}

.team-row + .team-row {
    border-top: 1px solid var(--card-border);
}

.team-logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
    flex-shrink: 0;
}

.team-meta {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.team-name {
    font-size: 0.825rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.team-sog {
    font-size: 0.68rem;
    color: var(--text-muted);
}

.team-pp {
    font-size: 0.68rem;
    color: var(--red);
    font-weight: 600;
}

.team-score {
    font-size: 1.6rem;
    font-weight: 700;
    margin-left: auto;
    flex-shrink: 0;
    min-width: 1.75rem;
    text-align: right;
    letter-spacing: -0.02em;
}

.team-record {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-left: auto;
    flex-shrink: 0;
    white-space: nowrap;
}

/* ── Power Play Indicator ───────────────────────── */

.pp-indicator {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.5rem;
    padding: 0.35rem 0.5rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 6px;
}

.pp-label {
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--red);
    text-transform: uppercase;
    flex-shrink: 0;
}

.pp-team {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text);
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pp-clock {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--red);
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
}

/* ── Hype Meter ─────────────────────────────────── */

.hype-meter {
    margin-top: 0.75rem;
}

.hype-label {
    display: block;
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 0.3rem;
}

.gauge-track {
    height: 4px;
    background: var(--badge-bg);
    border-radius: 99px;
    overflow: hidden;
}

.gauge {
    height: 100%;
    border-radius: 99px;
    width: 0;
    transition: width 0.5s ease;
}

/* ── Desktop ────────────────────────────────────── */

@media (min-width: 900px) {
    :root {
        --card-w: 340px;
        --gap: 1.25rem;
    }

    main {
        padding: 1rem 2rem 2.5rem;
    }

    .header-title {
        font-size: 2.4rem;
    }

    .section-heading {
        font-size: 0.85rem;
    }

    .game-box {
        padding: 1.125rem 1.125rem 1rem;
    }

    .team-logo {
        width: 48px;
        height: 48px;
    }

    .badge {
        font-size: 0.75rem;
    }

    .team-name {
        font-size: 0.95rem;
    }

    .team-score {
        font-size: 1.9rem;
    }

    .hype-label {
        font-size: 0.7rem;
    }
}

@media (min-width: 1400px) {
    :root {
        --card-w: 400px;
        --gap: 1.5rem;
    }

    main {
        padding: 1.25rem 2.5rem 3rem;
    }

    .header-title {
        font-size: 2.8rem;
    }

    .section-heading {
        font-size: 0.95rem;
    }

    .game-box {
        padding: 1.25rem 1.25rem 1.125rem;
    }

    .team-logo {
        width: 56px;
        height: 56px;
    }

    .badge {
        font-size: 0.82rem;
    }

    .team-name {
        font-size: 1.05rem;
    }

    .team-score {
        font-size: 2.2rem;
    }

    .hype-label {
        font-size: 0.76rem;
    }
}

/* ── Mobile ─────────────────────────────────────── */

@media (max-width: 640px) {
    :root {
        --card-w: 100%;
    }

    .games-grid {
        flex-direction: column;
    }
}
