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

body {
    background: #111111;
    color: #FFFFFF;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    height: 100vh;
    overflow: hidden;
}

/* ─── Loading ────────────────────────────────────────── */

#loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 60vh;
    gap: 2vh;
    color: #888;
    font-size: clamp(1rem, 1.5vw, 1.5rem);
}

.spinner {
    width: clamp(30px, 3vw, 50px);
    height: clamp(30px, 3vw, 50px);
    border: 3px solid #333;
    border-top: 3px solid var(--primary-color, #c8102e);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ─── No Games ───────────────────────────────────────── */

#no-games {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 60vh;
    font-size: clamp(1.2rem, 2.5vw, 2.5rem);
    color: #666;
}

.hidden {
    display: none !important;
}

/* ─── Split Container ────────────────────────────────── */

#split-container {
    display: flex;
    height: calc(100vh - var(--top-bar-height, 6vh));
    overflow: hidden;
}

/* ─── Persistent Top Bar ─────────────────────────────── */

#top-bar {
    position: relative;
    flex-shrink: 0;
    z-index: 10;
}

/* ─── LEFT PANEL: Live Scores ────────────────────────── */

.live-panel {
    width: 20%;
    background: #111;
    border-right: 4px solid var(--primary-color, #c8102e);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex-shrink: 0;
}

.live-panel-header {
    background: var(--primary-color, #c8102e);
    padding: 1.2vh 1vw;
    text-align: center;
    flex-shrink: 0;
}

.live-panel-header h2 {
    font-size: clamp(1rem, 1.4vw, 1.6rem);
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 4px;
    color: #fff;
}

.live-panel-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.live-panel-scroll::-webkit-scrollbar { width: 6px; }
.live-panel-scroll::-webkit-scrollbar-track { background: #1a1a1a; }
.live-panel-scroll::-webkit-scrollbar-thumb { background: var(--primary-color, #c8102e); border-radius: 3px; }

/* ─── Live Card ──────────────────────────────────────── */

.live-card {
    background: #222;
    border-radius: 8px;
    margin-bottom: 10px;
    overflow: hidden;
    border: 1px solid #333;
}

.live-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 12px;
    background: #1a1a1a;
}

.live-card-age {
    font-size: clamp(0.55rem, 0.7vw, 0.75rem);
    font-weight: 700;
    text-transform: uppercase;
    color: #aaa;
    letter-spacing: 1px;
}

.live-badge {
    font-size: clamp(0.5rem, 0.65vw, 0.7rem);
    font-weight: 900;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 2px;
    animation: pulse 1.5s ease-in-out infinite;
}

.live-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    background: #e53935;
    border-radius: 50%;
    margin-right: 5px;
    animation: pulse 1.5s ease-in-out infinite;
}

.live-card-body {
    padding: 8px 12px;
}

.live-matchup {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.live-team {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 6px;
}

.live-team img {
    width: 22px;
    height: 22px;
    object-fit: contain;
}

.live-team-name {
    font-size: clamp(0.65rem, 0.85vw, 0.9rem);
    font-weight: 700;
}

.live-team-name.hawks {
    color: var(--primary-color, #c8102e);
}

.live-team-name.opponent {
    color: #ccc;
}

.live-score-block {
    text-align: center;
    min-width: 70px;
}

.live-scores {
    font-size: clamp(1.1rem, 1.5vw, 1.8rem);
    font-weight: 900;
    letter-spacing: 2px;
}

.live-scores .hawks-score { color: var(--primary-color, #c8102e); }
.live-scores .dash { color: #666; margin: 0 3px; }
.live-scores .opp-score { color: #ccc; }

/* ─── RIGHT PANEL: Main Content ──────────────────────── */

.main-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

/* When no live panel, main panel is full width */
.main-panel.full-width {
    width: 100%;
}

.main-panel-top {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    flex-shrink: 0;
}

.top-left {
    position: absolute;
    left: 1.5vw;
    top: 50%;
    transform: translateY(-50%);
}

.top-right {
    position: absolute;
    right: 1.5vw;
    top: 50%;
    transform: translateY(-50%);
}

.age-group-header {
    background: var(--primary-color, #c8102e);
    padding: 1.2vh 3vw;
    text-align: center;
    flex: 1;
}

.age-group-header h2 {
    font-size: clamp(2rem, 3.5vw, 4rem);
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 6px;
    color: #fff;
}

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

.header-dropdown {
    appearance: none;
    -webkit-appearance: none;
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    padding: 0.4vh 1.8vw 0.4vh 0.6vw;
    font-size: clamp(0.5rem, 0.7vw, 0.7rem);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5' viewBox='0 0 8 5'%3E%3Cpath fill='rgba(255,255,255,0.3)' d='M0 0l4 5 4-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.4vw center;
    transition: all 0.2s ease;
}

.header-dropdown:hover {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.6);
    border-color: rgba(255, 255, 255, 0.15);
}

.header-dropdown:focus {
    outline: 1px solid rgba(204, 0, 0, 0.5);
}

.header-dropdown option {
    background: #222;
    color: #fff;
}

/* ─── Games Container ────────────────────────────────── */

#games-container {
    padding: 1.5vh 2vw;
    flex: 1;
    overflow: hidden;
}

/* ─── Section Header (age group title) — no longer used ─ */

.section-header {
    margin-bottom: 1.5vh;
    text-align: center;
}

.section-header h2 {
    font-size: clamp(2.5rem, 5vw, 5rem);
    font-weight: 800;
    color: #FFFFFF;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ─── Divisions Grid (columns) ───────────────────────── */

.divisions-grid {
    display: flex;
    gap: 1.5vw;
    height: calc(100% - 2vh);
    overflow: hidden;
    justify-content: center;
}

.divisions-grid.single-division {
    max-width: 50vw;
    margin: 0 auto;
}

.division-column {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.division-header {
    text-align: center;
    font-size: clamp(1.4rem, 2.2vw, 2.5rem);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #FFFFFF;
    padding: 0.8vh 0;
    margin-bottom: 1vh;
    border-bottom: 3px solid var(--primary-color, #c8102e);
}

.division-games {
    display: flex;
    flex-direction: column;
    gap: 1vh;
    overflow-y: auto;
}

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

.game-card {
    background: #1e1e1e;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #2a2a2a;
    border-left: 4px solid #333;
    border-right: 4px solid #333;
}

/* Names row */
.card-names-row {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 1vh 1vw 0;
    gap: 0.5vw;
    min-height: 3vh;
}

.card-names-row .team-name {
    flex: 1;
    text-align: center;
}

.names-spacer {
    min-width: 6vw;
}

/* Scores row */
.card-scores-row {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 1vw 1vh;
    gap: 0.5vw;
}

.card-scores-row .team-score {
    flex: 1;
    text-align: center;
}

.team-name {
    font-size: clamp(0.75rem, 1.1vw, 1.2rem);
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3vw;
    text-align: center;
    line-height: 1.2;
    word-break: break-word;
}

.team-name.hawks {
    color: var(--accent-color, #FF4444);
    justify-content: center;
}

.team-name.opponent {
    color: #BBBBBB;
    justify-content: center;
}

.team-logo {
    width: clamp(18px, 1.5vw, 24px);
    height: clamp(18px, 1.5vw, 24px);
    object-fit: contain;
    flex-shrink: 0;
}

.team-score {
    font-size: clamp(2.5rem, 4vw, 5rem);
    font-weight: 800;
    line-height: 1;
}

.team-score.hawks {
    color: #FFFFFF;
}

.team-score.opponent {
    color: #888888;
}

/* ─── Status Center (between scores) ─────────────────── */

.score-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 6vw;
}

.status-center-badge {
    font-size: clamp(1rem, 1.5vw, 1.6rem);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    display: flex;
    align-items: center;
    gap: 0.3vw;
}

.status-center-badge.live { color: #FFFFFF; }
.status-center-badge.upcoming { color: #FFB300; }
.status-center-badge.win { color: #00E676; }
.status-center-badge.loss { color: #FF5252; }
.status-center-badge.draw { color: #FFB300; }

/* Live pulse dot */
.pulse-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #FFFFFF;
    animation: pulse 1.5s ease-in-out infinite;
    display: inline-block;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.7); }
}

/* Card footer — venue + time */
.card-footer {
    padding: 0.5vh 1vw 0.7vh;
    text-align: center;
    font-size: clamp(0.55rem, 0.85vw, 0.85rem);
    color: #666;
    border-top: 1px solid #2a2a2a;
    word-break: break-word;
    line-height: 1.3;
}

/* ─── Win/Loss Card Accents (both sides) ─────────────── */

.game-card.win {
    border-left: 4px solid #00E676;
    border-right: 4px solid #00E676;
    background: rgba(0, 230, 118, 0.06);
}

.game-card.loss {
    border-left: 4px solid #FF5252;
    border-right: 4px solid #FF5252;
    background: rgba(255, 82, 82, 0.06);
}

.game-card.live {
    border-left: 4px solid #FFFFFF;
    border-right: 4px solid #FFFFFF;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.1);
}

/* ─── Scrollbar ──────────────────────────────────────── */

.division-games::-webkit-scrollbar { width: 4px; }
.division-games::-webkit-scrollbar-track { background: #111; }
.division-games::-webkit-scrollbar-thumb { background: #333; border-radius: 2px; }
