/* Pong Arena — neon theme layered on the shared style.css base. */

:root {
    --pong-accent: #22e0c8;
    --pong-accent-dim: rgba(34, 224, 200, 0.18);
}

html, body {
    margin: 0;
    height: 100%;
    background: #04120f;
    overflow: hidden;
}

.pong-panel {
    border: 1px solid var(--pong-accent-dim);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.55);
}

.pong-logo {
    font-size: 3rem;
    line-height: 1;
    margin-bottom: 8px;
    filter: drop-shadow(0 0 12px rgba(34, 224, 200, 0.6));
}

.overlay-card h1 {
    letter-spacing: 2px;
}

/* ── Lobby ─────────────────────────────────────────────────────────────── */
.name-input {
    width: 100%;
    box-sizing: border-box;
    padding: 12px 14px;
    margin-bottom: 14px;
    border-radius: 10px;
    border: 1px solid var(--pong-accent-dim);
    background: rgba(255, 255, 255, 0.05);
    color: #eafffb;
    font-size: 1rem;
    text-align: center;
}
.name-input:focus {
    outline: none;
    border-color: var(--pong-accent);
}

.player-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
    max-height: 40vh;
    overflow-y: auto;
}
.pong-player-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    font-size: 0.95rem;
}
.pong-player-swatch {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    flex: 0 0 auto;
    box-shadow: 0 0 8px currentColor;
}
.pong-player-name { flex: 1; text-align: left; }
.pong-host-tag {
    font-size: 0.7rem;
    color: var(--pong-accent);
    border: 1px solid var(--pong-accent-dim);
    border-radius: 5px;
    padding: 1px 6px;
}
.pong-spectator-tag {
    font-size: 0.7rem;
    color: #ffd166;
    border: 1px solid rgba(255, 209, 102, 0.3);
    border-radius: 5px;
    padding: 1px 6px;
}

.pong-rules {
    font-size: 0.82rem;
    color: var(--muted, #9fb4ae);
    line-height: 1.5;
    margin: 6px 0 16px;
}
.pong-rules em { color: var(--pong-accent); font-style: normal; }

.waiting-text {
    color: var(--muted, #9fb4ae);
    font-size: 0.85rem;
    margin-top: 10px;
}

.pong-back-link {
    display: inline-block;
    margin-top: 16px;
    color: var(--muted, #9fb4ae);
    text-decoration: none;
    font-size: 0.85rem;
}
.pong-back-link:hover { color: var(--pong-accent); }

/* ── Chat ──────────────────────────────────────────────────────────────── */
.pong-chat-area { margin-top: 14px; }
.pong-chat-messages {
    height: 90px;
    overflow-y: auto;
    text-align: left;
    font-size: 0.82rem;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 8px;
    padding: 8px;
    margin-bottom: 6px;
}
.pong-chat-msg { margin-bottom: 3px; }
.pong-chat-input {
    width: 100%;
    box-sizing: border-box;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid var(--pong-accent-dim);
    background: rgba(255, 255, 255, 0.05);
    color: #eafffb;
}

/* ── Game area ─────────────────────────────────────────────────────────── */
#gameArea {
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at 50% 45%, #0a2620 0%, #04120f 70%);
}
#gameCanvas { display: block; width: 100vw; height: 100vh; }

.pong-lives-bar {
    position: fixed;
    top: 12px;
    left: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    pointer-events: none;
    z-index: 5;
}
.pong-life-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 10px;
    border-radius: 7px;
    background: rgba(0, 0, 0, 0.4);
    font-size: 0.85rem;
    color: #eafffb;
}
.pong-life-row.pong-me { outline: 1px solid var(--pong-accent); }
.pong-life-row.pong-dead { opacity: 0.45; }
.pong-life-swatch {
    width: 12px; height: 12px; border-radius: 50%;
    box-shadow: 0 0 6px currentColor;
}
.pong-life-hearts { letter-spacing: 1px; }
.pong-life-out { color: #ff6b6b; font-size: 0.75rem; }

.pong-my-lives {
    position: fixed;
    top: 14px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 22px;
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.42);
    z-index: 6;
    pointer-events: none;
    transition: transform 0.08s ease;
}
.pong-my-lives .pong-my-label {
    font-size: 0.7rem;
    letter-spacing: 2px;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
}
.pong-my-lives .pong-my-hearts {
    font-size: 2.4rem;
    line-height: 1;
    letter-spacing: 4px;
    filter: drop-shadow(0 0 10px currentColor);
}
.pong-my-lives .pong-my-hearts .lost { opacity: 0.18; filter: none; }
.pong-my-lives.pong-hit { animation: pong-life-hit 0.45s ease; }
.pong-my-lives.pong-eliminated .pong-my-hearts {
    font-size: 1.4rem;
    color: #ff5c5c !important;
    letter-spacing: 2px;
}
@keyframes pong-life-hit {
    0%   { transform: translateX(-50%) scale(1); }
    25%  { transform: translateX(-50%) scale(1.35); }
    60%  { transform: translateX(-50%) scale(0.92); }
    100% { transform: translateX(-50%) scale(1); }
}

.pong-spectator-bar {
    position: fixed;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.55);
    color: #ffd166;
    padding: 6px 16px;
    border-radius: 8px;
    letter-spacing: 2px;
    font-size: 0.8rem;
    z-index: 6;
}

.pong-countdown {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 8rem;
    font-weight: 800;
    color: var(--pong-accent);
    text-shadow: 0 0 30px rgba(34, 224, 200, 0.7);
    z-index: 7;
    pointer-events: none;
}

/* ── Mobile controls ───────────────────────────────────────────────────── */
.pong-mobile-controls {
    position: fixed;
    bottom: 24px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 8;
}
.pong-mobile-btn {
    width: 84px;
    height: 84px;
    border-radius: 50%;
    border: 2px solid var(--pong-accent-dim);
    background: rgba(34, 224, 200, 0.12);
    color: var(--pong-accent);
    font-size: 2rem;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
}
.pong-mobile-btn:active { background: rgba(34, 224, 200, 0.3); }

/* ── Results / rankings ────────────────────────────────────────────────── */
.pong-score-panel { max-width: 640px; width: 92vw; }
.pong-winner-line {
    color: var(--pong-accent);
    font-size: 1.05rem;
    margin: -6px 0 14px;
}
.rankings-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}
.rankings-table th, .rankings-table td {
    padding: 6px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    text-align: left;
}
.rankings-table th { color: var(--pong-accent); }
.pong-rankings-empty { color: var(--muted, #9fb4ae); margin: 20px 0; }

/* Make the shared FunStats accent match the game. */
#resultsTable, #resultsAwards { --fs-accent: var(--pong-accent); }

.audio-controls {
    position: fixed;
    bottom: 10px;
    right: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(0, 0, 0, 0.5);
    padding: 6px 10px;
    border-radius: 10px;
    /* Above the shared .overlay (z-index 100) so the controls stay visible and
       clickable on the lobby / results screens, not dimmed behind them. */
    z-index: 200;
    font-size: 0.8rem;
}
.audio-controls button {
    background: none;
    border: 1px solid var(--pong-accent-dim);
    color: #eafffb;
    border-radius: 6px;
    padding: 4px 8px;
    cursor: pointer;
}
.volume-slider { width: 70px; accent-color: var(--pong-accent); }

@media (max-width: 640px) {
    .audio-controls { font-size: 0.7rem; padding: 4px 6px; }
    .volume-slider { width: 48px; }
    .pong-countdown { font-size: 5rem; }
}
