* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Courier New', monospace;
    background: linear-gradient(135deg, #0f0820, #1a0f2e);
    color: white;
    overflow: hidden;
}

#game-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    width: 100vw;
}

#hud {
    position: absolute;
    top: 10px;
    width: 800px;
    display: flex;
    justify-content: space-between;
    z-index: 10;
    font-size: 18px;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

#gameCanvas {
    border: 2px solid #8a2be2;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(138, 43, 226, 0.5);
    background: linear-gradient(to bottom, #2a0845, #000000);
}

#menu-overlay,
#pause-overlay,
#game-over-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

#game-title {
    font-size: 48px;
    color: #ff6600;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.8);
    margin-bottom: 20px;
    animation: pulse 2s infinite;
}

#menu-text {
    font-size: 24px;
    color: #ffff00;
    animation: blink 1.5s infinite;
    margin-bottom: 30px;
}

#instructions {
    text-align: center;
    font-size: 16px;
    color: #cccccc;
}

#instructions p {
    margin: 5px 0;
}

#pause-overlay h2,
#game-over-overlay h2 {
    font-size: 36px;
    color: #ff0000;
    margin-bottom: 20px;
}

#pause-overlay p,
#game-over-overlay p {
    font-size: 18px;
    color: #ffffff;
    margin: 10px 0;
}

#mobile-controls {
    position: absolute;
    bottom: 20px;
    width: 100%;
    display: none;
    justify-content: space-between;
    padding: 0 30px;
    z-index: 50;
}

#joystick-area {
    position: relative;
    width: 80px;
    height: 80px;
}

#joystick-base {
    position: absolute;
    width: 60px;
    height: 60px;
    border: 3px solid #8a2be2;
    border-radius: 50%;
    background: rgba(138, 43, 226, 0.2);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

#joystick-stick {
    position: absolute;
    width: 20px;
    height: 20px;
    background: #8a2be2;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: transform 0.1s;
}

#fire-button {
    width: 60px;
    height: 60px;
    border: 3px solid #ff6600;
    border-radius: 50%;
    background: rgba(255, 102, 0, 0.8);
    color: white;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

#fire-button:active {
    background: rgba(255, 102, 0, 1);
    transform: scale(0.95);
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0.3; }
}

/* Responsive design */
@media (max-width: 900px) {
    #gameCanvas {
        width: 90vw;
        height: auto;
    }
    
    #hud {
        width: 90vw;
        font-size: 14px;
    }
    
    #game-title {
        font-size: 32px;
    }
    
    #menu-text {
        font-size: 18px;
    }
    
    #mobile-controls {
        display: flex !important;
    }
}

@media (max-width: 600px) {
    #game-title {
        font-size: 24px;
    }
    
    #menu-text {
        font-size: 16px;
    }
    
    #instructions {
        font-size: 12px;
    }
    
    #hud {
        font-size: 12px;
    }
}