* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: #111;
    height: 100vh;
    font-family: 'Press Start 2P', cursive;
    color: white;
    overflow: hidden;
    touch-action: none;
}

#game-container {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

#header {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 10;
}

#health-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

#health-bar {
    width: 150px;
    height: 20px;
    background-color: #333;
    border: 2px solid #000;
    overflow: hidden;
}

#health-fill {
    height: 100%;
    width: 100%;
    background-color: #55ff55;
    transition: width 0.3s;
}

#health-text {
    font-size: 10px;
    color: white;
}

#stats {
    display: flex;
    gap: 15px;
    font-size: 10px;
}

#game-canvas {
    border: 4px solid #333;
    background-color: #111;
    max-width: 100%;
    max-height: 100%;
}

#controls-panel {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background-color: #222;
    padding: 15px;
    border: 2px solid #444;
    border-radius: 5px;
}

#controls-panel h3 {
    color: #ff5555;
    margin-bottom: 15px;
    font-size: 14px;
}

.control-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.key {
    width: 40px;
    height: 40px;
    background-color: #333;
    border: 2px solid #555;
    border-radius: 5px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 10px;
}

.key.mouse {
    width: 80px;
}

#game-over, #start-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    z-index: 20;
}

#game-over h2, #start-screen h1 {
    color: #ff5555;
    margin-bottom: 20px;
    text-shadow: 3px 3px 0 #000;
    font-size: 24px;
}

#game-over p {
    margin-bottom: 20px;
    font-size: 14px;
}

button {
    padding: 12px 24px;
    background-color: #ff5555;
    color: white;
    border: none;
    border-radius: 5px;
    font-family: 'Press Start 2P', cursive;
    cursor: pointer;
    font-size: 12px;
    margin-top: 20px;
    transition: all 0.2s;
}

button:hover {
    background-color: #ff3333;
    transform: scale(1.05);
}

.hidden {
    display: none !important;
}

/* Mobile Controls */
#mobile-controls {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
}

.joystick-container {
    position: absolute;
    bottom: 60px;
    width: 100px;
    height: 100px;
    pointer-events: auto;
}

#move-joystick-container {
    left: 30px;
}

#aim-joystick-container {
    right: 30px;
}

.joystick-base {
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.5);
}

.joystick-thumb {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.7);
    border-radius: 50%;
    pointer-events: none;
}

#dash-button {
    position: absolute;
    bottom: 30px;
    right: 30px;
    width: 80px;
    height: 40px;
    background-color: rgba(85, 85, 255, 0.7);
    border-radius: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 12px;
    pointer-events: auto;
    border: 2px solid rgba(255, 255, 255, 0.5);
}

/* Hide desktop controls on mobile */
@media (max-width: 768px) {
    #controls-panel {
        display: none;
    }
    #mobile-controls {
        display: block;
    }
    
    #header {
        top: 5px;
        left: 5px;
    }
    
    #health-bar {
        width: 120px;
        height: 16px;
    }
    
    #health-text, #stats {
        font-size: 8px;
    }
}
