body.scoreboard-mode {
    background-color: #000;
    margin: 0;
    padding: 0;
    overflow: hidden;
    font-family: 'Inter', sans-serif;
    color: #fff;
    user-select: none;
}

.scoreboard-wrapper {
    display: flex;
    height: 100vh;
    width: 100vw;
}

.side {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 2vw;
    position: relative;
}

.side.green { background-color: #1e392a; border-right: 4px solid #000; }
.side.yellow { background-color: #4a4a16; }
.side.red { background-color: #4a1616; border-right: 4px solid #000; }
.side.blue { background-color: #16264a; }

.competitor-name {
    font-size: 4vw;
    font-weight: 800;
    text-align: center;
    text-transform: uppercase;
    margin-bottom: 2vh;
    background: rgba(0,0,0,0.5);
    padding: 1vh 2vw;
    border-radius: 12px;
}

.main-score {
    font-size: 18vw;
    font-weight: 800;
    text-align: center;
    line-height: 1;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    text-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.sub-scores {
    display: flex;
    justify-content: space-between;
    background: rgba(0,0,0,0.4);
    padding: 2vh 2vw;
    border-radius: 16px;
    gap: 2vw;
}

.sub-score-box {
    text-align: center;
    flex: 1;
}

.sub-score-label {
    font-size: 1.5vw;
    font-weight: 600;
    color: rgba(255,255,255,0.7);
    text-transform: uppercase;
}

.sub-score-value {
    font-size: 6vw;
    font-weight: 800;
}

.sub-score-box.adv .sub-score-value { color: #f1c40f; }
.sub-score-box.pen .sub-score-value { color: #e74c3c; }

/* Timer Center Column */
.timer-container {
    width: 22vw;
    flex-shrink: 0;
    background: #000;
    border-left: 3px solid #222;
    border-right: 3px solid #222;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1vh;
    cursor: pointer;
    z-index: 10;
}

.timer {
    font-size: 7vw;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    color: #fff;
    letter-spacing: 0.02em;
}

.timer.paused { color: #e74c3c; animation: blink 2s infinite; }

.match-status {
    font-weight: 600;
    color: #666;
    font-size: 1.1vw;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    text-align: center;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Controls Panel */
.controls-panel {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    padding: 10px 20px;
    border-radius: 12px;
    display: flex;
    gap: 20px;
    z-index: 100;
    transition: opacity 0.3s;
}

body:hover .controls-panel { opacity: 1; }
body:not(:hover) .controls-panel { opacity: 0; }

.controls-panel select, .controls-panel button {
    background: #000;
    color: #fff;
    border: 1px solid #333;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
}

@media (max-width: 768px) {
    .scoreboard-wrapper { flex-direction: column; height: 100vh; overflow: hidden; }

    .side { 
        padding: 12px; 
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: center;
        min-height: 0;
    }
    .side.green, .side.red {
        border-right: none;
        border-bottom: 2px solid #000;
    }

    .competitor-name { 
        font-size: 1.2rem; 
        margin-bottom: 8px; 
        padding: 6px;
    }
    .main-score { 
        font-size: 18vh; 
        line-height: 0.9;
    }
    .sub-scores {
        padding: 8px;
        gap: 8px;
        margin-top: 4px;
    }
    .sub-score-label { font-size: 0.7rem; }
    .sub-score-value { font-size: 1.8rem; }

    .timer-container {
        width: 100%;
        height: 60px;
        flex-direction: row;
        justify-content: center;
        gap: 20px;
        border: none;
        border-top: 1px solid #222;
        border-bottom: 1px solid #222;
        order: -1;
        padding: 0 16px;
    }

    .timer { font-size: 2rem; }
    .match-status { font-size: 0.8rem; }

    .controls-panel {
        position: fixed;
        bottom: 10px;
        left: 50%;
        transform: translateX(-50%);
        flex-wrap: wrap;
        justify-content: center;
        padding: 6px 12px;
        gap: 8px;
        width: 95%;
        background: rgba(0,0,0,0.8);
        border: 1px solid rgba(255,255,255,0.1);
    }

    .controls-panel select, .controls-panel button {
        font-size: 0.8rem;
        padding: 5px 10px;
    }
}

@media (max-width: 480px) {
    .competitor-name { font-size: 1rem; }
    .main-score { font-size: 20vh; }
    .sub-score-value { font-size: 1.5rem; }
    .sub-score-label { font-size: 0.6rem; }
    
    .timer { font-size: 1.8rem; }
}

/* Landscape Mode Tweak */
@media (max-height: 500px) and (orientation: landscape) {
    .scoreboard-wrapper { flex-direction: row; }
    .timer-container { 
        width: 120px; 
        height: 100%; 
        flex-direction: column; 
        order: 0;
        border-top: none;
        border-bottom: none;
        border-left: 1px solid #222;
        border-right: 1px solid #222;
    }
    .main-score { font-size: 25vh; }
    .timer { font-size: 2.5rem; }
    .competitor-name { font-size: 0.9rem; padding: 4px; }
}

/* ─── SHARED EXTRAS ───────────────────────────────────────────────────────── */
.side.red { background-color: #3a0a0a; border-right: 4px solid #000; }
.side.blue { background-color: #0a0a3a; }

.corner-label {
    font-size: clamp(0.7rem, 1.2vw, 1.1rem);
    font-weight: 700; text-align: center; letter-spacing: 0.12em;
    opacity: 0.6; text-transform: uppercase; margin-bottom: 1vh;
}

.score-hint {
    font-size: clamp(0.6rem, 0.9vw, 0.85rem);
    color: #444; margin-top: 1vh; text-align: center;
}

.team-name-lg {
    font-size: clamp(1rem, 3vw, 2.5rem);
    font-weight: 800; text-transform: uppercase;
    text-align: center; margin-bottom: 2vh; cursor: pointer;
}

.action-btn {
    background: rgba(255,92,53,0.12);
    border: 1px solid rgba(255,92,53,0.35);
    color: #ff5c35; border-radius: 8px;
    padding: 8px 14px; font-size: clamp(0.65rem, 0.8vw, 0.85rem);
    cursor: pointer; font-family: 'Inter', sans-serif;
    transition: background 0.2s; margin-top: 8px;
}
.action-btn:hover { background: rgba(255,92,53,0.25); }

.period-badge, .round-badge { text-align: center; }
.period-label, .round-label {
    font-size: clamp(0.6rem, 1vw, 0.9rem);
    font-weight: 700; color: #888; letter-spacing: 0.1em;
    display: block; text-transform: uppercase;
}
.period-num, .round-number {
    font-size: clamp(3rem, 7vw, 6rem);
    font-weight: 900; line-height: 1; color: #fff;
}
.period-total, .round-total {
    font-size: clamp(0.7rem, 1.2vw, 1rem); color: #555;
}

/* ─── ROUNDS MODE ────────────────────────────────────────────────────────── */
.mode-rounds { display: flex; width: 100vw; height: 100vh; }

.rounds-side {
    flex: 1; display: flex; flex-direction: column;
    align-items: center; justify-content: center; padding: 2vw; cursor: pointer;
}
.rounds-side.red-corner { background: linear-gradient(160deg, #1a0505 0%, #3a0a0a 100%); border-right: 3px solid #000; }
.rounds-side.blue-corner { background: linear-gradient(160deg, #05051a 0%, #0a0a3a 100%); }

.rounds-center {
    width: 26vw; flex-shrink: 0; background: #000;
    border-left: 3px solid #1a1a1a; border-right: 3px solid #1a1a1a;
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; gap: 1.5vh; padding: 2vw;
}
.round-number { color: #ff5c35; }

/* ─── FOOTBALL MODE ──────────────────────────────────────────────────────── */
.mode-football {
    width: 100vw; height: 100vh; display: flex;
    align-items: center; justify-content: space-between;
    background: #050505; padding: 0 2vw;
}
.football-team {
    flex: 1; text-align: center; cursor: pointer;
    padding: 3vh 1vw; border-radius: 16px;
    background: rgba(255,255,255,0.02); border: 1px solid rgba(255,255,255,0.05);
    transition: background 0.2s; user-select: none;
}
.football-team:hover { background: rgba(255,255,255,0.06); }
.football-score {
    font-size: clamp(5rem, 20vw, 14rem);
    font-weight: 900; line-height: 1;
    text-shadow: 0 10px 40px rgba(0,0,0,0.5);
}
.football-center {
    flex-shrink: 0; width: 18vw; text-align: center;
    display: flex; flex-direction: column; align-items: center; gap: 1.5vh;
}
.football-colon {
    font-size: clamp(3rem, 12vw, 9rem);
    font-weight: 900; color: #2a2a2a; line-height: 1; margin-bottom: 1vh;
}
.football-meta { display: flex; flex-direction: column; align-items: center; gap: 0.6vh; cursor: pointer; }
.football-timer {
    font-size: clamp(1.5rem, 4vw, 3.5rem);
    font-weight: 800; color: #00e5ff; font-variant-numeric: tabular-nums;
}
.football-timer.paused { color: #e74c3c; animation: blink 2s infinite; }
.football-period {
    font-size: clamp(0.7rem, 1.1vw, 1rem);
    font-weight: 600; color: #888; text-transform: uppercase; letter-spacing: 0.08em;
}

/* ─── BASKETBALL MODE ────────────────────────────────────────────────────── */
.mode-basketball { display: flex; width: 100vw; height: 100vh; background: #030308; }

.bball-side {
    flex: 1; display: flex; flex-direction: column;
    align-items: center; justify-content: center; padding: 2vw; cursor: pointer;
}
.bball-center {
    width: 24vw; flex-shrink: 0; background: #000;
    border-left: 2px solid #111; border-right: 2px solid #111;
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; gap: 1.5vh; padding: 2vw;
}
.period-num.amber { color: #f39c12; }

.fouls-row {
    display: flex; align-items: center; gap: 1vw;
    background: rgba(255,255,255,0.05); padding: 1vh 2vw;
    border-radius: 10px; margin-top: 2vh; cursor: default;
}
.foul-label { font-size: clamp(0.7rem, 1.2vw, 1rem); color: #888; }
.foul-count { font-size: clamp(1.5rem, 3vw, 2.5rem); font-weight: 800; color: #e74c3c; }
.foul-btn {
    background: rgba(231,76,60,0.12); border: 1px solid rgba(231,76,60,0.35);
    color: #e74c3c; border-radius: 6px; padding: 4px 10px;
    font-size: clamp(0.65rem, 0.9vw, 0.85rem); cursor: pointer;
    font-family: 'Inter', sans-serif; transition: background 0.2s;
}
.foul-btn:hover { background: rgba(231,76,60,0.25); }
.mode-basketball .period-num { color: #f39c12; }

/* ─── VOLLEYBALL MODE ────────────────────────────────────────────────────── */
.mode-volleyball {
    width: 100vw; height: 100vh; display: flex;
    flex-direction: column; background: #030303;
}
.vball-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 2vh 4vw; background: rgba(255,255,255,0.02);
    border-bottom: 1px solid #181818; flex-shrink: 0;
}
.vball-team-name {
    font-size: clamp(1rem, 2.5vw, 2.2rem);
    font-weight: 800; text-transform: uppercase; cursor: pointer;
}
.vball-sets-score {
    font-size: clamp(2rem, 6vw, 5rem);
    font-weight: 900; color: #f0b429; letter-spacing: 0.1em;
}
.vball-sets-sep { margin: 0 1vw; color: #333; }
.vball-main { flex: 1; display: flex; align-items: stretch; overflow: hidden; }
.vball-side {
    flex: 1; display: flex; align-items: center; justify-content: center;
    cursor: pointer; font-size: clamp(5rem, 22vw, 16rem); font-weight: 900;
    user-select: none;
}
.vball-side:hover { background: rgba(255,255,255,0.03); }
.vball-side:first-child { border-right: 2px solid #181818; }
.vball-center {
    width: 20vw; flex-shrink: 0; background: #000;
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; gap: 2vh;
    border-left: 1px solid #181818; border-right: 1px solid #181818;
}
.vball-cur-label {
    font-size: clamp(0.65rem, 1vw, 0.9rem);
    color: #555; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em;
}
.vball-history {
    padding: 1.5vh 4vw; background: rgba(255,255,255,0.02);
    border-top: 1px solid #181818; display: flex; gap: 3vw;
    justify-content: center; flex-shrink: 0;
}
.set-history-item { text-align: center; }
.set-num { font-size: clamp(0.6rem, 0.85vw, 0.8rem); color: #555; margin-bottom: 0.3vh; }
.set-result { font-size: clamp(0.85rem, 1.5vw, 1.3rem); font-weight: 700; color: #888; }
.set-result.win1 { color: #27ae60; }
.set-result.win2 { color: #f0b429; }

/* ─── HOCKEY MODE ────────────────────────────────────────────────────────── */
.mode-hockey { display: flex; width: 100vw; height: 100vh; background: #020508; }

.hockey-side {
    flex: 1; display: flex; flex-direction: column;
    align-items: center; justify-content: center; padding: 2vw;
    cursor: pointer; background: rgba(0,50,100,0.04);
}
.hockey-side:hover { background: rgba(0,80,160,0.08); }
.hockey-score {
    font-size: clamp(5rem, 20vw, 14rem);
    font-weight: 900; line-height: 1;
    text-shadow: 0 10px 40px rgba(0,80,200,0.3);
}
.hockey-center {
    width: 24vw; flex-shrink: 0; background: #000;
    border-left: 2px solid #0a1525; border-right: 2px solid #0a1525;
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; gap: 1.5vh; padding: 2vw;
}
.mode-hockey .period-num { color: #a8d8ea; }

/* ─── TENNIS MODE ────────────────────────────────────────────────────────── */
.mode-tennis {
    width: 100vw; height: 100vh; display: flex;
    align-items: center; justify-content: center; background: #020202;
}
.tennis-board {
    width: 82vw; max-width: 1100px;
    background: #0a0a0a; border: 1px solid #1a1a1a;
    border-radius: 20px; padding: 3vw; font-family: 'Inter', sans-serif;
}
.tennis-sets-label-row {
    display: flex; align-items: center;
    padding: 1vh 2vw; color: #555;
    font-size: clamp(0.6rem, 0.9vw, 0.85rem); font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.08em; border-bottom: 1px solid #1a1a1a;
}
.tennis-col-name { flex: 1; text-align: left; }
.tennis-col-games { width: 10vw; text-align: center; }
.tennis-col-pts { width: 14vw; text-align: center; }
.tennis-set-score-col { width: 8vw; text-align: center; }

.tennis-player-row {
    display: flex; align-items: center;
    padding: 2.5vh 2vw; border-bottom: 1px solid #111;
    transition: background 0.2s;
}
.tennis-player-row.serving { background: rgba(240,180,41,0.05); }
.tennis-player-row:last-of-type { border-bottom: none; }

.tennis-player-name {
    flex: 1; font-size: clamp(1rem, 2.5vw, 2rem);
    font-weight: 700; color: #f5f5f7; cursor: pointer; text-align: left;
}
.tennis-set-score {
    width: 8vw; text-align: center;
    font-size: clamp(1rem, 2vw, 1.7rem); font-weight: 700; color: #666;
}
.tennis-set-score.tennis-win { color: #f5f5f7; }
.tennis-games-cur {
    width: 10vw; text-align: center;
    font-size: clamp(1.5rem, 3vw, 2.8rem); font-weight: 800; color: #888;
}
.tennis-pts-cur {
    width: 14vw; text-align: center;
    font-size: clamp(1.8rem, 4.5vw, 4rem);
    font-weight: 900; color: #f0b429; cursor: pointer;
    border-radius: 12px; transition: background 0.2s; padding: 0.5vh;
}
.tennis-pts-cur:hover { background: rgba(255,255,255,0.06); }
.tennis-footer {
    display: flex; align-items: center; justify-content: space-between;
    padding: 2vh 2vw; margin-top: 1vh; border-top: 1px solid #1a1a1a;
}
.tennis-total-sets {
    font-size: clamp(1rem, 2vw, 1.6rem); color: #888; font-weight: 600;
}
.tennis-total-sets strong { color: #fff; font-size: 1.2em; }

/* ─── RACKET MODE ────────────────────────────────────────────────────────── */
.mode-racket { display: flex; width: 100vw; height: 100vh; }
.racket-games-box {
    text-align: center; margin-top: 2vh;
    background: rgba(0,0,0,0.4); padding: 1vh 2vw; border-radius: 12px;
}
.racket-games-label {
    font-size: clamp(0.65rem, 1vw, 0.9rem);
    color: #666; display: block; text-transform: uppercase; letter-spacing: 0.08em;
}
.racket-games-val { font-size: clamp(2rem, 4vw, 3.5rem); font-weight: 800; color: #f0b429; }
.racket-match-score { font-size: clamp(2rem, 6vw, 5rem); font-weight: 900; color: #f0b429; }
.racket-match-label {
    font-size: clamp(0.65rem, 1vw, 0.9rem);
    color: #555; text-transform: uppercase; letter-spacing: 0.08em;
}

/* ─── MOBILE ─────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .mode-rounds, .mode-basketball, .mode-hockey { flex-direction: column; }
    .rounds-center, .bball-center, .hockey-center {
        width: 100%; height: auto; flex-direction: row;
        flex-wrap: wrap; justify-content: center; padding: 2vw;
        border: none; border-top: 2px solid #1a1a1a; border-bottom: 2px solid #1a1a1a;
    }
    .mode-football { flex-direction: column; padding: 2vw; }
    .football-center { width: 100%; flex-direction: row; justify-content: center; }
    .football-score { font-size: 28vw; }
    .mode-volleyball .vball-header { padding: 2vw 3vw; }
    .vball-team-name { font-size: 5vw; }
    .mode-tennis .tennis-board { width: 95vw; padding: 3vw; }
    .tennis-player-name { font-size: 4vw; }
    .tennis-pts-cur { font-size: 8vw; }
    .period-num, .round-number { font-size: 10vw; }
    .fouls-row { gap: 2vw; padding: 1vh 3vw; }
    .hockey-score { font-size: 28vw; }
}
