/* Full-screen TV scoreboard display styles */

.scoreboard-display-root {
    width: 100vw;
    height: 100vh;
    background: #000;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.scoreboard-display {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: #000;
    color: #fff;
    padding: 2vw;
    box-sizing: border-box;
}

/* Waiting screen */
.scoreboard-waiting {
    text-align: center;
}

.waiting-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2vw;
}

.waiting-icon {
    width: 6vw;
    height: 6vw;
}

.waiting-logo-text {
    font-size: 6vw;
    letter-spacing: -1px;
}

.waiting-text {
    font-size: 2.5vw;
    color: #888;
    margin-top: 2vw;
}

/* Brand watermark — top-left corner */
.display-brand {
    position: absolute;
    top: 1vw;
    left: 1.2vw;
    display: flex;
    align-items: center;
    gap: 0.5vw;
    font-size: 1.4vw;
    opacity: 0.5;
    z-index: 5;
}

/* === Three-column layout: side panels + center === */
.display-columns {
    display: flex;
    width: 100%;
    height: 100%;
    align-items: stretch;
}

.display-side-panel {
    width: 15%;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 1vw 0.5vw;
    position: relative;
    overflow: hidden;
}

.display-center {
    width: 70%;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* Side panel card container */
.side-panel-card {
    width: 100%;
    max-width: 100%;
    animation: side-card-in 0.4s ease-out;
}

@keyframes side-card-in {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

/* Main scoreboard */
.scoreboard-main {
    display: flex;
    justify-content: space-around;
    align-items: center;
    width: 100%;
    flex: 1;
    max-height: 70vh;
}

.team {
    text-align: center;
    flex: 1;
}

.team-side-label {
    font-size: 1.6vw;
    font-weight: 600;
    letter-spacing: 3px;
    color: #555;
    text-transform: uppercase;
}

.team-name {
    font-size: 4vw;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #ccc;
}

.team-score {
    font-size: 14vw;
    font-weight: 800;
    line-height: 1;
    color: #fff;
    text-shadow:
        0 0 10px rgba(255, 255, 255, 0.4),
        0 0 30px rgba(100, 160, 255, 0.25),
        0 0 60px rgba(100, 160, 255, 0.15);
    transition: text-shadow 0.3s ease;
}

/* Score change pop animation */
.team-score.score-changed {
    animation: score-pop 0.7s cubic-bezier(0.17, 0.67, 0.35, 1.2);
}

@keyframes score-pop {
    0% {
        transform: scale(1);
        text-shadow: 0 0 10px rgba(255, 255, 255, 0.4), 0 0 30px rgba(100, 160, 255, 0.25);
    }
    15% {
        transform: scale(1.12);
        color: #fbbf24;
        text-shadow:
            0 0 20px rgba(251, 191, 36, 0.8),
            0 0 50px rgba(251, 191, 36, 0.5),
            0 0 80px rgba(251, 191, 36, 0.3);
    }
    40% {
        transform: scale(1.05);
        color: #fff;
        text-shadow:
            0 0 30px rgba(255, 255, 255, 0.6),
            0 0 60px rgba(100, 160, 255, 0.4);
    }
    100% {
        transform: scale(1);
        color: #fff;
        text-shadow:
            0 0 10px rgba(255, 255, 255, 0.4),
            0 0 30px rgba(100, 160, 255, 0.25),
            0 0 60px rgba(100, 160, 255, 0.15);
    }
}

/* Score decrease (undo) — red flash instead of gold */
.team-score.score-decreased {
    animation: score-decrease 0.5s ease-out;
}

@keyframes score-decrease {
    0% {
        transform: scale(1);
    }
    20% {
        transform: scale(0.92);
        color: #ff1744;
        text-shadow:
            0 0 20px rgba(255, 23, 68, 0.7),
            0 0 50px rgba(255, 23, 68, 0.4);
    }
    100% {
        transform: scale(1);
        color: #fff;
        text-shadow:
            0 0 10px rgba(255, 255, 255, 0.4),
            0 0 30px rgba(100, 160, 255, 0.25),
            0 0 60px rgba(100, 160, 255, 0.15);
    }
}

.center-info {
    text-align: center;
    flex: 0.6;
}

.period-label {
    font-size: 3vw;
    font-weight: 600;
    color: #ea580c;
}

.game-clock {
    font-size: 10vw;
    font-weight: 700;
    font-family: 'Roboto Mono', monospace;
    color: #ff1744;
    text-shadow: 0 0 15px rgba(255, 23, 68, 0.6), 0 0 40px rgba(255, 23, 68, 0.3);
}

.game-clock.clock-warning {
    animation: clock-pulse 0.5s ease-in-out infinite alternate;
}

@keyframes clock-pulse {
    from { opacity: 1; text-shadow: 0 0 15px rgba(255, 23, 68, 0.6), 0 0 40px rgba(255, 23, 68, 0.3); }
    to { opacity: 0.5; text-shadow: 0 0 25px rgba(255, 23, 68, 0.9), 0 0 60px rgba(255, 23, 68, 0.5); }
}

.set-wins {
    font-size: 2.5vw;
    color: #888;
    margin-top: 0.5vw;
}

.phase-label {
    font-size: 2.5vw;
    font-weight: 700;
    color: #ea580c;
    margin-top: 1vw;
    text-transform: uppercase;
}

.timeout-flash {
    animation: flash 0.8s ease-in-out infinite alternate;
}

@keyframes flash {
    from { opacity: 1; }
    to { opacity: 0.3; }
}

/* Info bar — structured bottom ticker */
.info-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 92%;
    padding: 1vw 2vw;
    background: linear-gradient(180deg, rgba(255,255,255,0.03) 0%, rgba(255,255,255,0.06) 100%);
    border-top: 1px solid #222;
    border-radius: 0.5vw;
    margin-top: auto;
}

.info-section {
    display: flex;
    align-items: center;
    gap: 1.2vw;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 0.5vw;
}

.info-label {
    font-size: 1.3vw;
    color: #666;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.info-value {
    font-size: 2vw;
    color: #ddd;
    font-weight: 700;
    font-family: 'Roboto Mono', monospace;
}

.info-divider {
    width: 1px;
    height: 2.5vw;
    background: #333;
}

.info-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3vw;
}

.poss-arrow {
    font-size: 2.5vw;
    color: #ea580c;
    font-weight: 700;
    line-height: 1;
}

.info-event {
    font-size: 1.3vw;
    color: #666;
    text-align: center;
    max-width: 20vw;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.info-item.bonus-active .info-label,
.info-item.bonus-active .info-value {
    color: #ff1744;
}

.bonus-badge {
    font-size: 1vw;
    font-weight: 800;
    color: #000;
    background: #ff1744;
    padding: 0.1vw 0.5vw;
    border-radius: 0.3vw;
    letter-spacing: 1px;
}

.info-item-stacked {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3vw;
}

.info-item-stacked.bonus-active .info-label,
.info-item-stacked.bonus-active .info-value {
    color: #ff1744;
}

.bonus-badge-large {
    font-size: 1.3vw;
    font-weight: 800;
    color: #000;
    background: #ff1744;
    padding: 0.2vw 0.8vw;
    border-radius: 0.3vw;
    letter-spacing: 2px;
    animation: flash 0.8s ease-in-out infinite alternate;
}

.info-item.serving-active .info-value {
    color: #4caf50;
    font-size: 1.6vw;
}

/* Player Stat Card — adapts to side panel width */
.player-stat-card {
    width: 100%;
    background: rgba(30, 30, 40, 0.85);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1vw;
    padding: 1.5vw 1.2vw;
    color: #fff;
    box-sizing: border-box;
}

.stat-card-header {
    display: flex;
    align-items: center;
    gap: 0.8vw;
    margin-bottom: 1vw;
}

.stat-card-jersey {
    font-size: 3.5vw;
    font-weight: 800;
    color: #ea580c;
    font-family: 'Roboto Mono', monospace;
    line-height: 1;
    min-width: 4vw;
    text-align: center;
}

.stat-card-name {
    font-size: 1.5vw;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stat-card-photo {
    width: 6vw;
    height: 6vw;
    border-radius: 50%;
    overflow: hidden;
    margin: 0 auto 1vw;
    background: rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-card-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.stat-card-photo-fallback {
    font-size: 2.8vw;
    font-weight: 800;
    color: #ea580c;
    font-family: 'Roboto Mono', monospace;
}

.stat-card-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5vw;
    text-align: center;
}

.stat-card-stat-label {
    font-size: 1vw;
    color: #888;
    font-weight: 600;
    letter-spacing: 1px;
}

.stat-card-stat-value {
    font-size: 2vw;
    font-weight: 700;
    font-family: 'Roboto Mono', monospace;
    color: #fff;
}

.stat-card-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 0.8vw;
    gap: 0.5vw;
}

.stat-card-team {
    font-size: 1vw;
    color: #666;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1px;
    flex: 1;
}

.stat-card-qr {
    flex-shrink: 0;
}

.stat-card-qr img {
    width: 6vw;
    height: 6vw;
    min-width: 80px;
    min-height: 80px;
    border-radius: 4px;
    background: white;
    padding: 3px;
}

.stat-card-flash-banner {
    background: #ea580c;
    color: #fff;
    text-align: center;
    padding: 0.4vw 0.6vw;
    font-size: 1vw;
    font-weight: 700;
    border-radius: 0.6vw 0.6vw 0 0;
    margin: -1.5vw -1.2vw 0.8vw;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* Flash glow effect on side panel card */
.side-panel-flash .player-stat-card {
    border: 1px solid rgba(234, 88, 12, 0.5);
    box-shadow: 0 0 15px rgba(234, 88, 12, 0.3);
}

/* Halftime card area — within side panels */
.halftime-card-slot {
    animation: card-crossfade 0.6s ease-in-out;
}

@keyframes card-crossfade {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Halftime countdown */
.halftime-countdown {
    font-size: 4.5vw;
    font-weight: 700;
    font-family: 'Roboto Mono', monospace;
    color: #fbbf24;
}

.halftime-ready {
    font-size: 2vw;
    font-weight: 700;
    color: #ff1744;
    animation: flash 0.8s ease-in-out infinite alternate;
}

/* ========== STREAK EFFECTS ========== */

/* Team on fire — flames around score number (3+ consecutive made FGs) */
.team-score.team-on-fire {
    animation: team-fire-glow 0.8s ease-in-out infinite alternate;
    color: #fff;
}

@keyframes team-fire-glow {
    0% {
        text-shadow:
            0 0 10px rgba(255, 100, 0, 0.6),
            0 0 30px rgba(255, 60, 0, 0.5),
            0 0 60px rgba(255, 30, 0, 0.4),
            0 0 90px rgba(255, 0, 0, 0.3),
            0 -8px 40px rgba(255, 160, 0, 0.4),
            0 -16px 60px rgba(255, 120, 0, 0.2);
    }
    100% {
        text-shadow:
            0 0 15px rgba(255, 120, 0, 0.8),
            0 0 40px rgba(255, 80, 0, 0.6),
            0 0 70px rgba(255, 40, 0, 0.5),
            0 0 100px rgba(255, 0, 0, 0.4),
            0 -12px 50px rgba(255, 180, 0, 0.5),
            0 -24px 80px rgba(255, 140, 0, 0.3);
    }
}

/* Override score-pop/score-decreased when team is on fire — keep fire glow after pop */
.team-score.team-on-fire.score-changed {
    animation:
        score-pop 0.7s cubic-bezier(0.17, 0.67, 0.35, 1.2),
        team-fire-glow 0.8s ease-in-out infinite alternate;
}

/* Winner effect — pulsing gold glow on winning team at game end */
.team.team-winner {
    animation: winner-pulse 2s ease-in-out infinite;
}

.team.team-winner .team-name {
    color: #ffd700;
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
}

.team.team-winner .team-score {
    color: #ffd700;
    animation: winner-score-glow 1.5s ease-in-out infinite alternate;
}

.team.team-winner .team-side-label {
    color: #ffd700;
}

@keyframes winner-pulse {
    0%, 100% {
        filter: drop-shadow(0 0 0 transparent);
    }
    50% {
        filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.4));
    }
}

@keyframes winner-score-glow {
    0% {
        text-shadow:
            0 0 10px rgba(255, 215, 0, 0.5),
            0 0 30px rgba(255, 215, 0, 0.3),
            0 0 60px rgba(255, 215, 0, 0.15);
    }
    100% {
        text-shadow:
            0 0 20px rgba(255, 215, 0, 0.7),
            0 0 50px rgba(255, 215, 0, 0.5),
            0 0 80px rgba(255, 215, 0, 0.3),
            0 0 120px rgba(255, 215, 0, 0.15);
    }
}

/* Player stat card — heat check (2 consecutive FGs) */
.player-stat-card.player-heat-check {
    border: 1px solid rgba(255, 160, 0, 0.5);
    box-shadow: 0 0 12px rgba(255, 160, 0, 0.3);
}

.stat-card-heat-banner {
    background: linear-gradient(135deg, #ff6d00, #ff9800);
    color: #fff;
    text-align: center;
    padding: 0.4vw 0.6vw;
    font-size: 1.1vw;
    font-weight: 800;
    border-radius: 0.6vw 0.6vw 0 0;
    margin: -1.5vw -1.2vw 0.8vw;
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* Player stat card — on fire (3+ consecutive FGs) */
.player-stat-card.player-on-fire {
    border: 1px solid rgba(255, 60, 0, 0.7);
    animation:
        player-fire-border 0.6s ease-in-out infinite alternate,
        player-fire-pulse 1.2s ease-in-out infinite;
}

@keyframes player-fire-border {
    0% {
        box-shadow:
            0 0 8px rgba(255, 100, 0, 0.4),
            0 0 20px rgba(255, 60, 0, 0.3),
            0 0 40px rgba(255, 30, 0, 0.2),
            inset 0 0 10px rgba(255, 80, 0, 0.1);
    }
    100% {
        box-shadow:
            0 0 12px rgba(255, 120, 0, 0.6),
            0 0 30px rgba(255, 80, 0, 0.4),
            0 0 50px rgba(255, 40, 0, 0.3),
            inset 0 0 15px rgba(255, 100, 0, 0.15);
    }
}

@keyframes player-fire-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.04); }
}

.stat-card-fire-banner {
    background: linear-gradient(135deg, #d32f2f, #ff6d00, #fbbf24);
    background-size: 200% 100%;
    animation: fire-banner-shift 1.5s ease-in-out infinite;
    color: #fff;
    text-align: center;
    padding: 0.5vw 0.6vw;
    font-size: 1.2vw;
    font-weight: 900;
    border-radius: 0.6vw 0.6vw 0 0;
    margin: -1.5vw -1.2vw 0.8vw;
    letter-spacing: 3px;
    text-transform: uppercase;
    text-shadow: 0 0 8px rgba(255, 100, 0, 0.6);
}

@keyframes fire-banner-shift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}
