/* ==========================================
   SalmasFlix — Games · Shared Scoreboard
   Extracted from games.css in Phase 7.9 (2026-04-24, Wave 6).
   Originally scattered around lines 688-813 + the mobile-responsive
   block at 1223-1247 of the monolith.

   The unified scoreboard system. Every online game (TTT, C4, RPS,
   Chess, Quiz, H&S, Memory Match, GTD, WYR) uses this set of classes
   to render the two "player cards + VS pill" strip above its board.

   The container classes are named `.ttt-scores` / `.ttt-scores-vertical`
   for historical reasons (TTT shipped first) but they're used by every
   game — verified in JS via `ttt-scores`/`score-card` grep across all
   games/*.js files.

   Kept in shared games.css (NOT extracted here):
   - `.ttt-turn` (turn indicator chip, also used by memorymatch)
   - `.game-clock`, `.game-clock-shared` (shared timer display; chess
     adds its own per-side rules in games-chess.css)
   - `.score-you-badge` (YOU badge on score card — lives here, Wave 6)
   ========================================== */

@layer features {


/* Score Display — Unified across all 5 games */
.ttt-scores {
    display: flex;
    justify-content: center;
    align-items: stretch;
    gap: clamp(8px, 2vw, 16px);
    margin-top: 8px;
    margin-bottom: clamp(2px, 0.5dvh, 6px);
    flex-shrink: 0;
}

/* Vertical-card scoreboard (cards side-by-side, content stacked vertically inside each) */
.ttt-scores-vertical .score-card {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 2px;
    flex: 0 0 auto;
    width: clamp(90px, 22vw, 120px);
    max-width: 120px;
    padding: clamp(6px, 1dvh, 10px) clamp(6px, 1.5vw, 12px);
    min-height: 133px;
}

.ttt-scores-vertical .score-info {
    align-items: center;
}

.ttt-scores-vertical .score-card.score-card-active {
    border-color: rgba(var(--primary-rgb),0.6);
    box-shadow: 0 0 16px rgba(var(--primary-rgb),0.35), 0 0 30px rgba(var(--primary-rgb),0.15);
}

/* Timer only visible on active card (skip shared clocks in .score-vs) */
.ttt-scores-vertical .score-card .game-clock {
    display: none;
}

.ttt-scores-vertical .score-card.score-card-active .game-clock {
    display: inline-block;
}

.score-card {
    position: relative;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: clamp(6px, 1.5vw, 10px);
    padding: clamp(6px, 1dvh, 10px) clamp(8px, 2vw, 14px);
    background: linear-gradient(135deg, rgba(var(--secondary-dark-rgb),0.15), rgba(20, 15, 40, 0.6));
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 12px;
    border: 1.5px solid rgba(var(--secondary-dark-rgb),0.3);
    box-shadow: 0 0 10px rgba(var(--secondary-dark-rgb),0.15);
    transition: background 0.3s ease, background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, color 0.3s ease, filter 0.3s ease, opacity 0.3s ease, transform 0.3s ease;
    flex: 1;
    max-width: 180px;
}

.score-card.active,
.score-card.score-card-active {
    border-color: rgba(var(--primary-rgb),0.6);
    box-shadow: 0 0 16px rgba(var(--primary-rgb),0.35), 0 0 30px rgba(var(--primary-rgb),0.15);
}

.score-avatar {
    width: clamp(32px, 5dvh, 44px);
    height: clamp(32px, 5dvh, 44px);
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(var(--secondary-rgb),0.4);
    flex-shrink: 0;
}

.score-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.score-name {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    font-size: clamp(0.65rem, 1.4dvh, 0.8rem);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.score-value {
    font-size: clamp(1.1rem, 2.5dvh, 1.5rem);
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
}

.score-vs {
    font-size: clamp(0.7rem, 1.5dvh, 0.9rem);
    font-weight: 700;
    color: rgba(255, 255, 255, 0.25);
    flex-shrink: 0;
    align-self: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

/* Round label above VS */
.vs-round {
    font-size: clamp(0.55rem, 1.2dvh, 0.72rem);
    font-weight: 600;
    color: rgba(255, 255, 255, 0.45);
    margin-bottom: 2px;
    white-space: nowrap;
}

/* Shared clock below VS */
.game-clock-shared {
    display: block;
    margin-top: 2px;
    min-width: 36px;
    min-height: 1.2em;
}

/* YOU Badge on Score Card */
.score-you-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    color: #fff;
    font-size: 0.6rem;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 10px;
    letter-spacing: 1px;
    box-shadow: 0 2px 8px rgba(46, 204, 113, 0.4);
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .ttt-scores {
        gap: var(--spacing-sm);
        margin-bottom: clamp(2px, 1dvh, var(--spacing-md));
    }

    .score-card {
        padding: clamp(4px, 0.8dvh, var(--spacing-sm));
        min-width: 70px;
    }

    .score-avatar {
        width: clamp(28px, 5dvh, 45px);
        height: clamp(28px, 5dvh, 45px);
    }

    .score-value {
        font-size: clamp(1rem, 2.5dvh, 1.5rem);
    }
}


} /* end @layer features */
