/* ============================================
   CAPY PONG — Game Styles
   ============================================ */

body {
    background: linear-gradient(180deg, #4A8B3F 0%, #5A9E50 40%, #7DB86A 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.pong-game {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    width: 100%;
    max-width: 540px;
}

/* ---- Header ---- */
.game-header {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 24px;
    padding: 12px 0;
    margin-top: 40px;
    margin-bottom: 16px;
    width: 100%;
}

.score-display {
    text-align: center;
    padding: 8px 20px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-md);
    box-shadow: 0 2px 10px var(--card-shadow);
    min-width: 80px;
}

.score-display.best {
    background: linear-gradient(135deg, #FFF3E0, #FFE0B2);
    border: 2px solid var(--orange-accent);
}

.score-label {
    display: block;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    font-weight: 600;
}

.score-value {
    display: block;
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--capy-dark);
}

/* ---- Canvas Wrapper ---- */
.game-canvas-wrapper {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow:
        0 0 0 4px rgba(255, 255, 255, 0.4),
        0 10px 40px rgba(0, 0, 0, 0.3);
}

canvas {
    display: block;
    cursor: none;
    touch-action: none;
}

/* ---- Overlay ---- */
.overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(61, 43, 15, 0.78);
    backdrop-filter: blur(6px);
    z-index: 10;
    transition: opacity 0.35s ease;
}

.overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.overlay-content {
    text-align: center;
    color: white;
    padding: 36px 40px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-xl);
    border: 1px solid rgba(255, 255, 255, 0.25);
    max-width: 340px;
    width: 100%;
}

.overlay-content h2 {
    font-size: 2rem;
    font-weight: 900;
    margin-bottom: 12px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.overlay-content p {
    font-size: 0.95rem;
    line-height: 1.55;
    margin-bottom: 24px;
    opacity: 0.92;
}

.overlay-content .sub-message {
    font-size: 0.82rem;
    opacity: 0.75;
    margin-bottom: 20px;
}

/* ---- Controls hint ---- */
.controls-hint {
    margin-top: 16px;
    padding: 8px 20px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: var(--radius-md);
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-align: center;
}

/* ---- Responsive ---- */
@media (max-width: 520px) {
    canvas {
        width: 100vw;
        max-width: 100%;
        height: auto;
        aspect-ratio: 480 / 520;
    }

    .game-header {
        gap: 12px;
    }

    .score-display {
        padding: 6px 12px;
        min-width: 64px;
    }
}
