body {
    margin: 0;
    overflow: hidden;
    background-color: #050505;
    color: #00ff00;
    font-family: 'Courier New', Courier, monospace;
}

#game-container {
    position: relative;
    width: 100vw;
    height: 100vh;
}

canvas {
    display: block;
    width: 100%;
    height: 100%;
}

#ui-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-sizing: border-box;
}

#top-ui {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#score-board {
    font-size: 24px;
    font-weight: bold;
    text-shadow: 0 0 5px #00ff00;
}

#health-bar-container {
    position: relative;
    width: 100%;
    max-width: 300px;
    height: 30px;
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid #00ff00;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
    overflow: hidden;
}

#health-bar-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, #00ff00, #00cc00);
    box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.3);
    transition: width 0.3s ease;
}

#health-bar-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 16px;
    font-weight: bold;
    text-shadow: 0 0 5px #000, 0 0 3px #000;
    z-index: 1;
}

#message-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    background: rgba(0, 0, 0, 0.8);
    padding: 40px;
    border: 2px solid #00ff00;
    box-shadow: 0 0 20px #00ff00;
}

#message-overlay.hidden {
    display: none;
}

h1 {
    font-size: 48px;
    margin: 0 0 20px 0;
    text-transform: uppercase;
}

p {
    font-size: 24px;
    margin: 0;
    animation: blink 1s infinite;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

/* Mobile Controls */
#mobile-controls {
    position: absolute;
    bottom: 10%;
    left: 0;
    width: 100%;
    height: 170px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding: 20px;
    padding-bottom: max(20px, env(safe-area-inset-bottom));
    box-sizing: border-box;
    pointer-events: none;
    z-index: 100;
}

#mobile-controls.hidden {
    display: none;
}

#joystick-area {
    width: 120px;
    height: 120px;
    background: rgba(0, 255, 0, 0.1);
    border: 2px solid rgba(0, 255, 0, 0.5);
    border-radius: 50%;
    position: relative;
    pointer-events: auto;
    touch-action: none;
}

#joystick-knob {
    width: 50px;
    height: 50px;
    background: rgba(0, 255, 0, 0.8);
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 10px #00ff00;
}

#fire-btn {
    width: 100px;
    height: 100px;
    background: rgba(255, 0, 0, 0.2);
    border: 2px solid #ff0000;
    border-radius: 50%;
    color: #ff0000;
    font-family: 'Courier New', Courier, monospace;
    font-weight: bold;
    font-size: 20px;
    pointer-events: auto;
    touch-action: none;
    user-select: none;
}

#fire-btn:active {
    background: rgba(255, 0, 0, 0.5);
    box-shadow: 0 0 15px #ff0000;
}

@media (hover: hover) and (pointer: fine) {
    /* Hide mobile controls on desktop by default */
}

/* Settings Menu */
#settings-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.95);
    padding: 30px;
    border: 2px solid #00ff00;
    box-shadow: 0 0 20px #00ff00;
    min-width: 300px;
    max-width: 90%;
    pointer-events: auto;
}

#settings-overlay.hidden {
    display: none;
}

#settings-overlay h2 {
    font-size: 32px;
    margin: 0 0 20px 0;
    text-transform: uppercase;
    text-align: center;
    color: #00ff00;
}

.setting-item {
    margin: 20px 0;
}

.setting-item label {
    display: block;
    font-size: 18px;
    margin-bottom: 10px;
    color: #00ff00;
}

.slider-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 10px 0;
}

.slider-label {
    font-size: 14px;
    color: #00cc00;
    min-width: 40px;
}

#sensitivity-slider {
    flex: 1;
    height: 6px;
    background: rgba(0, 255, 0, 0.2);
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
}

#sensitivity-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: #00ff00;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 5px #00ff00;
}

#sensitivity-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #00ff00;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 5px #00ff00;
    border: none;
}

.slider-value {
    text-align: center;
    font-size: 20px;
    color: #00ff00;
    margin: 10px 0;
}

.menu-button {
    background: rgba(0, 255, 0, 0.2);
    border: 2px solid #00ff00;
    color: #00ff00;
    font-family: 'Courier New', Courier, monospace;
    font-size: 18px;
    font-weight: bold;
    padding: 12px 24px;
    margin: 10px 5px;
    cursor: pointer;
    text-transform: uppercase;
    transition: all 0.3s;
    pointer-events: auto;
}

.menu-button:hover {
    background: rgba(0, 255, 0, 0.4);
    box-shadow: 0 0 10px #00ff00;
}

.menu-button:active {
    background: rgba(0, 255, 0, 0.6);
}