/* =================================================================================
 * COSMIC SERENITY — In-game online HUD + Match Results (online multiplayer)
 * ---------------------------------------------------------------------------------
 * Loaded AFTER multiplayer-ui.css. Phase 5 of the online-MP redesign. Colour and
 * type now come from keystone-multiplayer.css (#online-multiplayer-container); the
 * layout values here are what OnlineMultiplayerMode measures. No backdrop blur.
 *
 * SAFE-BY-DESIGN:
 *  - Re-points the existing `--round-start-accent-rgb` HUD accent var to cosmic teal
 *    (it was already 79,209,197 — a teal — used in ~21 places).
 *  - Recolours HUD/results CHROME only (panels, scoreboard frame, kill-feed, chat,
 *    buttons). Player boards / garbage meters / minimaps are deliberately untouched
 *    (gameplay-critical readability).
 *  - The lobby (`#lobby-waiting-room`) keeps its own id-scoped styling (id > class),
 *    so these `.online-game-area` rules don't disturb it.
 * ============================================================================== */

/* Unify the HUD accent to the exact cosmic teal */
.online-game-area {
    --round-start-accent-rgb: 94, 234, 212;
}

/* ---- In-game scoreboard chrome -------------------------------------------- */
.online-game-area .scoreboard-header,
.online-game-area .scoreboard-columns-header {
    border-bottom-color: rgba(94, 234, 212, 0.20);
}

.online-game-area .scoreboard-goal {
    color: rgba(211, 219, 245, 0.55);
}

/* ---- PHASE A: solid, legible HUD panels over ANY theme background ---------- *
 * The HUD floats over live theme art (bright skies etc.), so panels must be
 * opaque enough to read. (Phase 5's translucent kill-feed/chat washed out over
 * bright themes — this restores legibility.) */
.online-game-area .online-scoreboard,
.online-game-area .online-kill-feed,
.online-game-area .online-chat {
    background:
        radial-gradient(120% 80% at 0% 0%, rgba(94, 234, 212, 0.06), transparent 56%),
        rgba(9, 11, 22, 0.90);
    border: 1px solid rgba(94, 234, 212, 0.20);
    border-radius: 14px;
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.40);
}

.online-game-area .scoreboard-title {
    color: #eef3ff;
}

.online-game-area .kill-feed-header {
    color: #5eead4;
    border-bottom: 1px solid rgba(94, 234, 212, 0.14);
}

.online-game-area .kill-feed-item {
    background: rgba(94, 234, 212, 0.06);
    border: 1px solid rgba(94, 234, 212, 0.10);
    color: rgba(232, 237, 255, 0.86);
}

.online-game-area .chat-messages .system-message {
    color: rgba(94, 234, 212, 0.90);
}

/* Teal chat Send (was purple) + accent input focus */
.online-game-area .chat-send-btn {
    background: linear-gradient(135deg, #5eead4, #7fdcff);
    border: none;
    color: #08201c;
    font-weight: 700;
}

.online-game-area .chat-send-btn:hover {
    box-shadow: 0 0 16px rgba(94, 234, 212, 0.40);
}

.online-game-area .chat-input:focus,
.online-game-area #match-chat-input:focus {
    outline: none;
    border-color: rgba(94, 234, 212, 0.85);
    box-shadow: 0 0 0 3px rgba(94, 234, 212, 0.18);
}

/* PHASE B (scoreboard rows: columns, You tag, status tiles) moved to the scoreboard
 * section of keystone-multiplayer.css with the scoreboard's rebuild. */

/* =================================================================================
 * PHASE C — Opponent boards + spectator controls
 * ============================================================================== */

/* Watch-controls bar → cosmic glass (was indigo + bright green) */
.online-game-area .watch-controls {
    background: rgba(9, 11, 22, 0.88);
    border: 1px solid rgba(94, 234, 212, 0.20);
    border-radius: 12px;
}

.online-game-area .watch-btn {
    background: rgba(12, 15, 30, 0.70);
    border: 1px solid rgba(var(--cs-soft-rgb), 0.20);
    color: #eef3ff;
}

.online-game-area .watch-btn:hover {
    box-shadow: 0 3px 10px rgba(94, 234, 212, 0.30);
}

.online-game-area .watch-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px rgba(94, 234, 212, 0.9), 0 0 0 5px rgba(94, 234, 212, 0.18);
}

/* Auto-Watch "on" → teal accent */
.online-game-area .watch-btn.watch-toggle.is-active {
    background: linear-gradient(135deg, #5eead4, #2fd6c4);
    border-color: rgba(94, 234, 212, 0.70);
    color: #08201c;
    box-shadow: 0 3px 12px rgba(94, 234, 212, 0.35);
}

/* Select button states */
.online-game-area .watch-btn.watch-select-btn:hover {
    border-color: rgba(94, 234, 212, 0.50);
    background: rgba(94, 234, 212, 0.10);
    box-shadow: 0 3px 10px rgba(94, 234, 212, 0.30);
}

.online-game-area .watch-btn.watch-select-btn.is-active {
    border-color: rgba(94, 234, 212, 0.80);
    box-shadow: 0 4px 14px rgba(94, 234, 212, 0.30);
}

/* Mode pills: AUTO = teal, MANUAL = gold */
.online-game-area .watch-mode-indicator {
    color: #5eead4;
    border-color: rgba(94, 234, 212, 0.60);
    background: rgba(94, 234, 212, 0.14);
}

.online-game-area .watch-mode-indicator.is-manual {
    color: #fcd17a;
    border-color: rgba(252, 209, 122, 0.60);
    background: rgba(252, 209, 122, 0.14);
}

.online-game-area .watching-label {
    color: rgba(211, 219, 245, 0.60);
}

.online-game-area .watching-count {
    color: #5eead4;
}

/* Opponent board labels → readable name + teal frag count */
.online-game-area .opponent-name {
    color: #eef3ff;
}

.online-game-area .opponent-frags {
    color: #5eead4;
}

/* Eliminated opponent → unmistakably out */
.online-game-area .online-main-board.eliminated {
    opacity: 0.42;
    filter: grayscale(0.7);
}

/* ---- Pre-D fixes: opponent-column backing ----------------------------------- *
 * Ground the opponent boards with a subtle dark backing so they read over bright
 * theme art. */

.online-game-area .watch-grid {
    background: rgba(9, 11, 22, 0.42);
    border: 1px solid rgba(94, 234, 212, 0.10);
    border-radius: 12px;
    padding: 6px;
}

/* =================================================================================
 * PHASE D — board chrome clarity: label the NEXT-piece queue
 * (The bottom 5-icon stat row appears to be a testLobby mock artifact — not
 * restyled/labelled until its real meaning is confirmed.)
 * ============================================================================== */
