/* Copyright (c) 2024-2026 Jericho Crosby (Chalwk). All Rights Reserved. */

.panel {
    background: var(--light);
    border: 1px solid var(--gray-light);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-top: 2rem;
}

.panel-head h1 {
    color: var(--primary);
    margin-bottom: 0.5rem;
}

#game-settings {
    margin-bottom: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    justify-content: center;
    align-items: center;
}

#game-settings label {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
    color: var(--dark);
    font-weight: 500;
    font-size: 0.9rem;
    white-space: nowrap;
}

#game-settings select {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--gray-light);
    border-radius: var(--radius);
    background: white;
    color: var(--dark);
    font-family: var(--font-primary);
    min-width: 120px;
}

#game-container {
    position: relative;
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.85rem;
    background: var(--darker);
    border-radius: var(--radius);
    padding: 1rem 0.75rem;
}

/* score / status bar */
.game-stats {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    grid-template-areas: "p1 status p2";
    align-items: center;
    width: 100%;
    gap: 0.5rem 0.75rem;
    padding: 0.25rem 0.5rem;
}

.stat-block {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    line-height: 1.1;
}

.stat-block.player1 {
    grid-area: p1;
    align-items: flex-start;
}

.stat-block.player2 {
    grid-area: p2;
    align-items: flex-end;
}

.stat-block strong {
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.stat-block .score {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 1.6rem;
    line-height: 1;
}

.score-player-1 {
    color: #ef4444;
    text-shadow: 0 0 12px rgba(239, 68, 68, 0.5);
}

.score-player-2 {
    color: #4ade80;
    text-shadow: 0 0 12px rgba(74, 222, 128, 0.5);
}

.stat-block .badge {
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    color: #a78bfa;
    min-height: 0.9rem;
    text-shadow: 0 0 8px rgba(167, 139, 250, 0.6);
}

.status-block {
    grid-area: status;
    justify-self: center;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.1rem;
}

#status {
    font-weight: bold;
    font-size: 0.95rem;
    text-align: center;
    color: #fff;
    white-space: nowrap;
}

.rally {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 0.05em;
}

.win-message {
    color: var(--warning);
    font-size: 1.2rem;
    animation: celebrate 0.5s ease;
}

/* board */
.board-wrap {
    position: relative;
    display: flex;
    justify-content: center;
    width: 100%;
}

#game-board {
    width: 100%;
    max-width: 720px;
    height: auto;
    display: block;
    border-radius: var(--radius-sm);
    touch-action: none;
    -webkit-tap-highlight-color: transparent;
    background: #050810;
    cursor: crosshair;
    box-shadow: 0 0 40px rgba(6, 182, 212, 0.08) inset;
}

.controls-hint {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.55);
    text-align: center;
    letter-spacing: 0.03em;
    padding: 0 0.5rem;
}

.powerup-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.4rem 0.75rem;
    max-width: 540px;
}

.pu-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    padding: 0.2rem 0.55rem;
}

.pu-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    box-shadow: 0 0 8px currentColor;
}

/* game over overlay */
.game-over-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.75);
    border-radius: var(--radius);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
    text-align: center;
    padding: 1rem;
    z-index: 2;
}

.game-over-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.game-over-content {
    animation: celebrate 0.5s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.game-over-message {
    color: #fff;
    font-weight: 800;
    font-size: 1.6rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.game-over-score {
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 0.5rem;
}

@keyframes celebrate {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

@media (max-width: 768px) {
    #game-settings {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        gap: 0.75rem 1.25rem;
    }
}

@media (max-width: 480px) {
    #game-container {
        padding: 0.75rem 0.5rem;
    }

    #game-settings {
        gap: 0.5rem 0.75rem;
    }

    #game-settings select {
        min-width: 0;
        padding: 0.4rem 0.5rem;
        font-size: 0.85rem;
    }

    .stat-block .score {
        font-size: 1.3rem;
    }

    .controls-hint {
        font-size: 0.7rem;
    }

    .pu-chip {
        font-size: 0.6rem;
    }

    .game-over-message {
        font-size: 1.3rem;
    }
}

@media (max-width: 420px) {
    .game-stats {
        grid-template-columns: 1fr 1fr;
        grid-template-areas:
            "p1 p2"
            "status status";
    }

    .status-block {
        margin-top: 0.15rem;
    }
}