/* ============================================
   CAPYBARA STACK — Game Styles
   ============================================ */

body {
    background: linear-gradient(180deg, #FFE4B5 0%, #87CEEB 40%, #7EC8E3 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stack-game {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    width: 100%;
    max-width: 440px;
}

/* --- Header Scores --- */
.game-header {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
    margin-top: 40px;
}

.score-display {
    text-align: center;
    padding: 8px 20px;
    background: rgba(255, 255, 255, 0.85);
    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);
}

.score-label {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    font-weight: 600;
}

.score-value {
    display: block;
    font-size: 1.8rem;
    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.2);
}

canvas {
    display: block;
    background: linear-gradient(180deg, #87CEEB 0%, #B5E8D5 60%, #7EC8E3 100%);
    cursor: pointer;
    touch-action: none;
}

/* --- Overlay --- */
.overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(61, 43, 15, 0.7);
    backdrop-filter: blur(5px);
    z-index: 10;
    transition: opacity 0.4s ease;
}

.overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.overlay-content {
    text-align: center;
    color: white;
    padding: 30px;
}

.overlay-content h2 {
    font-family: var(--font-display);
    font-size: 2rem;
    margin-bottom: 12px;
}

.overlay-content p {
    font-size: 1rem;
    margin-bottom: 8px;
    opacity: 0.9;
}

.overlay-sub {
    font-size: 0.85rem !important;
    opacity: 0.7 !important;
    margin-bottom: 20px !important;
}

/* --- Controls Hint --- */
.controls-hint {
    margin-top: 16px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: var(--radius-md);
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* --- Responsive --- */
@media (max-width: 480px) {
    canvas {
        width: 100vw;
        max-width: 360px;
        height: auto;
        aspect-ratio: 2/3;
    }

    .game-header {
        margin-top: 50px;
    }
}
