body {
    margin: 0;
    overflow: hidden;
    background-color: #000000;
    font-family: 'Courier New', Courier, monospace;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
}

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

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

#ui-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

#hud {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    display: flex;
    justify-content: space-between;
    color: #39ff14;
    font-weight: bold;
    font-size: 20px;
    text-shadow: 0 0 5px #39ff14;
    letter-spacing: 2px;
}

/* CRITICAL UI FIX: Zoom Container moved to absolute bottom with high z-index */
#zoom-container {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 15px;
    pointer-events: auto;
    z-index: 1000;
}

#zoom-hud {
    color: #39ff14;
    font-family: 'Courier New', monospace;
    font-size: 16px;
    font-weight: bold;
    text-shadow: 0 0 5px #39ff14;
    white-space: nowrap;
}

.zoom-btn {
    width: 44px;
    height: 44px;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid #39ff14;
    color: #39ff14;
    font-size: 24px;
    font-family: 'Courier New', monospace;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 0 5px #39ff14;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    line-height: 0;
    user-select: none;
    transition: all 0.1s;
}

.zoom-btn:active {
    background: rgba(57, 255, 20, 0.3);
    transform: scale(0.95);
}

.modal {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #000000;
    border: 2px solid #39ff14;
    padding: 30px;
    text-align: center;
    color: #39ff14;
    pointer-events: auto;
    min-width: 300px;
    box-shadow: 0 0 15px #39ff14;
    z-index: 10;
}

.modal.hidden {
    visibility: hidden;
    pointer-events: none;
}

.modal h1 {
    margin-top: 0;
    color: #ffffff;
    text-shadow: 0 0 5px #ffffff;
    font-size: 24px;
    margin-bottom: 20px;
    text-transform: uppercase;
}

.instructions {
    font-size: 14px;
    color: #39ff14;
    opacity: 0.8;
    line-height: 1.5;
}

#controls {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40%;
    display: flex;
    pointer-events: none;
}

#joystick-zone {
    flex: 1;
    position: relative;
    pointer-events: auto;
}

#thrust-zone {
    flex: 1;
    position: relative;
    pointer-events: auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

#joystick-base {
    width: 120px;
    height: 120px;
    border: 2px solid rgba(57, 255, 20, 0.3);
    border-radius: 50%;
    position: absolute;
    bottom: 40px;
    left: 40px;
    display: none;
}

#joystick-knob {
    width: 50px;
    height: 50px;
    background: rgba(57, 255, 20, 0.2);
    border: 1px solid #39ff14;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 10px #39ff14;
}

#thrust-btn {
    width: 56px;
    height: 56px;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid #39ff14;
    border-radius: 50%;
    position: absolute;
    bottom: 60px;
    right: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 20px;
    user-select: none;
    color: #39ff14;
    text-shadow: 0 0 5px #39ff14;
    box-shadow: 0 0 5px #39ff14, inset 0 0 5px #39ff14;
    transition: background 0.1s;
}

#thrust-btn:active {
    background: rgba(57, 255, 20, 0.3);
}