/* Base styles */
body {
    margin: 0;
    padding: 0;
    background: #0d0d0d;
    color: #00ffcc;
    font-family: 'Rajdhani', sans-serif;
    overflow: hidden;
}

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

#game-canvas {
    background: #000;
    display: block;
    touch-action: none;
}

#hud {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

#hud-top {
    height: 108px;
    background: linear-gradient(to bottom, #000000cc, #00000000);
    display: flex;
    align-items: center;
    padding: 0 20px;
    box-sizing: border-box;
}

#hud-bottom {
    height: calc(100% - 108px);
    display: flex;
    align-items: flex-end;
    padding: 20px;
    box-sizing: border-box;
}

.overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.82);
    display: none;
    justify-content: center;
    align-items: center;
    pointer-events: none;
    z-index: 5;
}

.overlay.visible {
    display: flex;
    pointer-events: auto;
}

.menu-panel {
    text-align: center;
    max-width: 420px;
    padding: 28px 24px;
}

.menu-title {
    margin: 0 0 8px;
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(28px, 5vw, 44px);
    letter-spacing: 0.06em;
    color: #00ffff;
}

.menu-title.danger {
    color: #ff4466;
}

.menu-sub {
    margin: 0 0 22px;
    color: #99dddd;
    font-size: 16px;
}

.menu-help {
    margin: 18px 0 0;
    color: #668888;
    font-size: 13px;
}

/* UI Elements */
.ui-button {
    display: block;
    width: min(280px, 70vw);
    margin: 10px auto;
    background: #00ffff44;
    border: 2px solid #00ffff;
    color: #00ffff;
    padding: 12px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-family: 'Orbitron', sans-serif;
    font-size: 18px;
    transition: 0.2s;
}

.ui-button:hover,
.ui-button:focus {
    background: #00ffff88;
    outline: none;
}

/* Mobile controls */
.mobile-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.virtual-stick {
    width: 120px;
    height: 120px;
    background: #00000088;
    border: 4px solid #00ffff;
    border-radius: 50%;
    position: relative;
}

.fire-button {
    width: 80px;
    height: 80px;
    background: #ff00ff88;
    border: 4px solid #ff00ff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    color: #ff00ff;
    cursor: pointer;
}

/* Game Over Screen */
.game-over {
    text-align: center;
    color: #ff0000;
}

/* Power-up Timers */
.powerup-timer {
    position: absolute;
    bottom: 20px;
    left: 20px;
    background: rgba(0, 0, 0, 0.7);
    padding: 8px 12px;
    border-radius: 5px;
    font-size: 14px;
    color: #00ffff;
}

/* HUD Elements */
.hud-element {
    position: absolute;
    color: #00ffff;
    font-family: 'Orbitron', sans-serif;
    font-size: 16px;
}

/* Keep canvas usable on small screens */
@media (max-width: 980px), (max-height: 640px) {
    #game-canvas {
        width: min(100vw, calc(100vh * 1.6));
        height: auto;
        max-height: 100vh;
    }
}