/* ============================================
   CAPY INVADERS — Game Styles
   ============================================ */

body {
    background: linear-gradient(180deg, #0a0a1a 0%, #1a1a3a 40%, #2a1a4a 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ============================================
   GAME WRAPPER
   ============================================ */

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

/* ============================================
   HEADER / HUD
   ============================================ */

.game-header {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    margin-top: 40px;
    flex-wrap: wrap;
    justify-content: center;
}

.score-display {
    text-align: center;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-md);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    min-width: 80px;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.score-display.best {
    background: rgba(255, 140, 66, 0.2);
    border-color: rgba(255, 140, 66, 0.4);
}

.score-display.oranges-display {
    background: linear-gradient(135deg, rgba(255, 243, 224, 0.15), rgba(255, 224, 178, 0.15));
    border-color: rgba(255, 179, 71, 0.4);
}

.score-display.lives-display {
    background: rgba(196, 162, 101, 0.15);
    border-color: rgba(196, 162, 101, 0.4);
}

.score-label {
    display: block;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 600;
    margin-bottom: 2px;
}

.score-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.1;
}

.lives-display .score-value {
    font-size: 1rem;
    letter-spacing: 2px;
}

/* ============================================
   CANVAS WRAPPER
   ============================================ */

.game-canvas-wrapper {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow:
        0 0 0 3px rgba(100, 100, 200, 0.3),
        0 0 30px rgba(100, 100, 200, 0.2),
        0 10px 40px rgba(0, 0, 0, 0.5);
}

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

/* ============================================
   OVERLAY (start / win / lose screens)
   ============================================ */

.overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(5, 5, 20, 0.82);
    backdrop-filter: blur(6px);
    z-index: 10;
    transition: opacity 0.4s ease;
}

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

.overlay-content {
    text-align: center;
    color: white;
    padding: 36px 40px;
    max-width: 360px;
    animation: fadeInUp 0.4s ease forwards;
}

.overlay-content h2 {
    font-family: var(--font-display);
    font-size: 2.2rem;
    margin-bottom: 14px;
    text-shadow: 0 0 20px rgba(100, 200, 255, 0.5);
}

.overlay-content p {
    font-size: 1rem;
    margin-bottom: 8px;
    opacity: 0.9;
    line-height: 1.6;
}

.overlay-sub {
    font-size: 0.85rem !important;
    opacity: 0.65 !important;
    margin-bottom: 24px !important;
}

/* Win screen golden glow */
.overlay.win-overlay .overlay-content h2 {
    color: #FFD700;
    text-shadow: 0 0 30px rgba(255, 215, 0, 0.6);
}

/* Lose screen red tint */
.overlay.lose-overlay .overlay-content h2 {
    color: #FF6B6B;
    text-shadow: 0 0 30px rgba(255, 107, 107, 0.5);
}

/* ============================================
   CONTROLS HINT
   ============================================ */

.controls-hint {
    margin-top: 14px;
    padding: 8px 18px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.5);
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ============================================
   BUTTON OVERRIDES FOR DARK BG
   ============================================ */

.btn-primary {
    background: linear-gradient(135deg, var(--orange-accent), var(--orange-glow));
    color: white;
    box-shadow: 0 4px 20px rgba(255, 140, 66, 0.5);
    font-size: 1.05rem;
    padding: 14px 32px;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 28px rgba(255, 140, 66, 0.7);
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 520px) {
    .invaders-game {
        padding: 12px;
    }

    .game-header {
        gap: 8px;
    }

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

    .score-value {
        font-size: 1.2rem;
    }

    canvas {
        width: 100%;
        height: auto;
    }

    .overlay-content h2 {
        font-size: 1.7rem;
    }
}
