/* === SCORE PANEL === */
.score-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: var(--space-3);
    padding: var(--space-4);
    padding-top: calc(var(--space-4) + 0.25rem);
    background-color: var(--bg-root);
    border-bottom: 2px solid var(--border);
    position: relative;
    box-sizing: border-box;
    width: 100%;
    overflow: hidden;
}

/* Round badge — sits centered on top edge between the two score cards */
.round-badge {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translate(-50%, -1px);
    display: flex;
    align-items: baseline;
    gap: var(--space-1);
    padding: var(--space-2) var(--space-4);
    background-color: var(--bg-elevated);
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 8px 8px;
    z-index: 31;
}

.round-badge-label {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
}

.round-badge-number {
    font-family: 'Orbitron', sans-serif;
    font-size: 1rem;
    font-weight: 900;
    color: var(--gold);
}

.round-badge.my-turn {
    border-color: #2dd4bf;
    box-shadow: 0 2px 8px rgba(45, 212, 191, 0.25);
}

.score-card {
    position: relative;
    box-sizing: border-box;
    background-color: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: var(--space-3);
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.score-card-p1 {
    border-left: 3px solid var(--player-1);
}

.score-card-p2 {
    border-left: 3px solid var(--player-2);
}

/* Shared active-player pulse animation. Each variant below sets its
   own --active-glow + --active-glow-strong CSS variables so the
   keyframe interpolates between the two intensities. ~2s cycle reads
   as a slow breath — obvious enough to spot at a glance, not so
   aggressive it distracts during scoring. */
@keyframes bb-active-pulse {
    0%, 100% { box-shadow: 0 0 8px var(--active-glow, rgba(255, 255, 255, 0.3)); }
    50%      { box-shadow: 0 0 18px var(--active-glow-strong, rgba(255, 255, 255, 0.55)); }
}

.score-card-p1.active-player {
    border: 2px solid var(--player-1);
    --active-glow: rgba(59, 130, 246, 0.35);
    --active-glow-strong: rgba(59, 130, 246, 0.65);
    animation: bb-active-pulse 2s ease-in-out infinite;
}

.score-card-p2.active-player {
    border: 2px solid var(--player-2);
    --active-glow: rgba(239, 68, 68, 0.35);
    --active-glow-strong: rgba(239, 68, 68, 0.65);
    animation: bb-active-pulse 2s ease-in-out infinite;
}

/* Multiplayer extension (slots 3 + 4) — match the locked palette
   from battle.css (P1 red / P2 blue / P3 green / P4 yellow). The
   per-slot left-border + active-player glow scale the same way the
   2P cards do so the host can always see whose turn it is. */
.score-card-p3 { border-left: 3px solid #4a4; }
.score-card-p4 { border-left: 3px solid #db4; }
.score-card-p3.active-player {
    border: 2px solid #4a4;
    --active-glow: rgba(68, 170, 68, 0.4);
    --active-glow-strong: rgba(68, 170, 68, 0.7);
    animation: bb-active-pulse 2s ease-in-out infinite;
}
.score-card-p4.active-player {
    border: 2px solid #db4;
    --active-glow: rgba(221, 187, 68, 0.4);
    --active-glow-strong: rgba(221, 187, 68, 0.7);
    animation: bb-active-pulse 2s ease-in-out infinite;
}

/* MP active-player overrides for slots 1 + 2. The legacy 2P CSS uses
   --player-1=blue and --player-2=red, but the MP locked palette is
   P1=red, P2=blue. Cards in the MP scoreboard carry .mp-slot-color-N
   so we can target only those and leave the legacy 2P card colors
   alone (HH 2P standard still uses the blue-P1 / red-P2 convention). */
.mp-slot-color-1.score-card.active-player {
    border: 2px solid #d44;
    --active-glow: rgba(212, 68, 68, 0.4);
    --active-glow-strong: rgba(212, 68, 68, 0.7);
    animation: bb-active-pulse 2s ease-in-out infinite;
}
.mp-slot-color-2.score-card.active-player {
    border: 2px solid #46c;
    --active-glow: rgba(68, 102, 204, 0.4);
    --active-glow-strong: rgba(68, 102, 204, 0.7);
    animation: bb-active-pulse 2s ease-in-out infinite;
}

/* Honor reduced-motion preferences — fall back to the static stronger
   glow rather than animating. */
@media (prefers-reduced-motion: reduce) {
    .score-card.active-player {
        animation: none !important;
        box-shadow: 0 0 12px var(--active-glow-strong, rgba(255, 255, 255, 0.55));
    }
}
