/**
 * SPACE SHOOTER - Retro Arcade Styling
 * PIX3L INVADERS
 */

.arcade-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow: hidden;
}

.arcade-hud {
    margin-bottom: 10px;
    padding: 10px 15px;
}

/* Arcade Screen */
.arcade-screen {
    position: relative;
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 0;
    padding: 10px;
    background: #000;
    border: 4px solid var(--border-color);
    border-radius: 4px;
    box-shadow: 
        0 0 0 2px var(--bg-dark),
        inset 0 0 50px rgba(0,0,0,0.8),
        0 0 30px rgba(233, 69, 96, 0.1);
}

#gameCanvas {
    display: block;
    max-width: 100%;
    max-height: calc(100vh - 200px);
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    background: #050510;
    box-shadow: 0 0 20px rgba(93, 139, 244, 0.1);
}

/* Game Overlays */
.game-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: rgba(13, 13, 26, 0.95);
    z-index: 10;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    backdrop-filter: blur(4px);
}

.game-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.arcade-logo {
    text-align: center;
    margin-bottom: 40px;
}

.arcade-title {
    font-family: var(--font-pixel);
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    color: var(--accent);
    text-shadow: 
        4px 4px 0 var(--secondary),
        0 0 30px rgba(233, 69, 96, 0.5);
    letter-spacing: 4px;
    line-height: 1.3;
}

.arcade-title.game-over {
    color: var(--primary);
    text-shadow: 
        4px 4px 0 #000,
        0 0 30px rgba(233, 69, 96, 0.8);
    animation: shake 0.5s ease-in-out;
}

.arcade-subtitle {
    font-family: var(--font-pixel);
    font-size: clamp(0.7rem, 2vw, 1rem);
    color: var(--accent-blue);
    margin-top: 10px;
    letter-spacing: 8px;
    text-shadow: 0 0 15px rgba(93, 139, 244, 0.5);
}

.arcade-menu {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
    width: 100%;
    max-width: 350px;
}

.arcade-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 15px 25px;
    background: var(--bg-medium);
    border: 3px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-secondary);
    font-family: var(--font-pixel);
    font-size: 0.65rem;
    cursor: pointer;
    transition: all 0.15s;
    box-shadow: 0 4px 0 var(--bg-dark);
}

.arcade-btn:hover {
    border-color: var(--accent);
    color: var(--text-primary);
    transform: translateY(-2px);
    box-shadow: 
        0 6px 0 var(--bg-dark),
        0 0 20px rgba(233, 69, 96, 0.2);
}

.arcade-btn.primary {
    background: var(--primary);
    border-color: var(--primary-dark);
    color: var(--text-primary);
    animation: pulse-glow 2s infinite;
}

.arcade-btn.primary:hover {
    background: var(--accent);
    box-shadow: 
        0 6px 0 var(--primary-dark),
        0 0 30px rgba(233, 69, 96, 0.4);
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 4px 0 var(--primary-dark), 0 0 15px rgba(233, 69, 96, 0.2); }
    50% { box-shadow: 0 4px 0 var(--primary-dark), 0 0 25px rgba(233, 69, 96, 0.5); }
}

.arcade-stats {
    text-align: center;
    margin-top: 10px;
}

.arcade-stats p {
    font-family: var(--font-pixel);
    font-size: 0.45rem;
    color: var(--text-dim);
    margin-bottom: 8px;
    line-height: 1.6;
}

.arcade-blink {
    margin-top: 30px;
    font-family: var(--font-pixel);
    font-size: 0.55rem;
    color: var(--accent-yellow);
}

/* Game Over Specific */
.final-score {
    text-align: center;
    margin-bottom: 20px;
}

.final-score p {
    font-family: var(--font-pixel);
    font-size: 0.6rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.final-score .score-number {
    font-size: 1.2rem;
    color: var(--accent);
    text-shadow: 0 0 15px rgba(233, 69, 96, 0.5);
}

/* In-Game HUD */
.in-game-hud {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    display: flex;
    justify-content: space-between;
    pointer-events: none;
    z-index: 5;
    opacity: 0;
    transition: opacity 0.3s;
}

.in-game-hud.visible {
    opacity: 1;
}

.hud-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.hud-label {
    font-family: var(--font-pixel);
    font-size: 0.4rem;
    color: var(--text-dim);
}

.hud-value {
    font-family: var(--font-pixel);
    font-size: 0.55rem;
    color: var(--accent-green);
    text-shadow: 0 0 10px rgba(78, 204, 163, 0.3);
}

/* Boss Health Bar */
.boss-bar {
    position: absolute;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 10px;
    width: 60%;
    max-width: 400px;
    z-index: 5;
    opacity: 0;
    transition: opacity 0.5s;
}

.boss-bar.visible {
    opacity: 1;
}

.boss-bar.hidden {
    display: none;
}

.boss-label {
    font-family: var(--font-pixel);
    font-size: 0.5rem;
    color: var(--primary);
    text-shadow: 0 0 10px rgba(233, 69, 96, 0.5);
    white-space: nowrap;
}

.boss-health-container {
    flex: 1;
    height: 16px;
    background: var(--bg-dark);
    border: 2px solid var(--primary);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.boss-health-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    transition: width 0.3s;
    width: 100%;
}

.boss-health-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        90deg,
        transparent,
        transparent 10px,
        rgba(0,0,0,0.2) 10px,
        rgba(0,0,0,0.2) 11px
    );
}

/* Wave Announcement */
.wave-announcement {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: var(--font-pixel);
    font-size: 1.5rem;
    color: var(--accent-yellow);
    text-shadow: 
        4px 4px 0 #000,
        0 0 30px rgba(249, 212, 35, 0.5);
    z-index: 6;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
    text-align: center;
    white-space: nowrap;
}

.wave-announcement.show {
    opacity: 1;
    animation: wave-pop 1.5s ease-out forwards;
}

@keyframes wave-pop {
    0% { transform: translate(-50%, -50%) scale(0.5); opacity: 0; }
    20% { transform: translate(-50%, -50%) scale(1.2); opacity: 1; }
    80% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 0; }
}

/* Mobile Controls */
.mobile-controls {
    position: absolute;
    bottom: 10px;
    left: 10px;
    right: 10px;
    display: none;
    justify-content: space-between;
    align-items: center;
    z-index: 8;
    pointer-events: all;
}

.mobile-btn {
    width: 60px;
    height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(26, 26, 46, 0.8);
    border: 2px solid var(--border-color);
    border-radius: 50%;
    color: var(--text-secondary);
    font-size: 1.5rem;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
    cursor: pointer;
}

.mobile-btn:active {
    background: var(--secondary);
    border-color: var(--accent);
    color: var(--text-primary);
}

#shootBtn {
    width: 70px;
    height: 70px;
    background: rgba(233, 69, 96, 0.3);
    border-color: var(--accent);
    color: var(--accent);
}

#shootBtn:active {
    background: rgba(233, 69, 96, 0.6);
}

/* Screen Shake */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-10px); }
    40% { transform: translateX(10px); }
    60% { transform: translateX(-5px); }
    80% { transform: translateX(5px); }
}

/* Glitch Effect */
@keyframes glitch {
    0% { transform: translate(0); }
    20% { transform: translate(-2px, 2px); }
    40% { transform: translate(-2px, -2px); }
    60% { transform: translate(2px, 2px); }
    80% { transform: translate(2px, -2px); }
    100% { transform: translate(0); }
}

.glitch-active {
    animation: glitch 0.2s infinite;
}

/* Footer */
.arcade-footer {
    margin-top: 0;
    padding: 10px;
}

/* Responsive */
@media (max-width: 768px) {
    .arcade-screen {
        padding: 5px;
    }
    
    #gameCanvas {
        max-height: calc(100vh - 150px);
    }
    
    .mobile-controls {
        display: flex;
    }
    
    .in-game-hud {
        top: 5px;
        left: 5px;
        right: 5px;
    }
    
    .hud-label {
        font-size: 0.3rem;
    }
    
    .hud-value {
        font-size: 0.4rem;
    }
    
    .boss-bar {
        width: 80%;
        bottom: 80px;
    }
}

@media (max-width: 480px) {
    .arcade-title {
        font-size: 1.2rem;
    }
    
    .arcade-subtitle {
        font-size: 0.6rem;
        letter-spacing: 4px;
    }
    
    .arcade-btn {
        font-size: 0.55rem;
        padding: 12px 20px;
    }
    
    .arcade-stats p {
        font-size: 0.4rem;
    }
}
