body {
    margin: 0;
    overflow: hidden;
    font-family: Arial, sans-serif;
    color: white;
}

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

#game-canvas {
    display: block;
    width: 100%;
    height: 100%;
    background-color: #000;
}

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

#crosshair, #score-display, #health-display, #weapon-display {
    pointer-events: auto; /* Allow UI text interaction */
}

#crosshair {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2em;
    font-weight: bold;
    color: rgba(255, 255, 255, 0.8);
}

#score-display {
    align-self: flex-start;
    font-size: 1.5em;
    background-color: rgba(0, 0, 0, 0.5);
    padding: 5px 10px;
    border-radius: 5px;
}

#health-display {
    align-self: flex-end;
    font-size: 1.5em;
    background-color: rgba(0, 0, 0, 0.5);
    padding: 5px 10px;
    border-radius: 5px;
    margin-left: auto;
}

#weapon-display {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.5em;
    background-color: rgba(0, 0, 0, 0.5);
    padding: 5px 10px;
    border-radius: 5px;
}

#loading-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 2em;
    z-index: 100;
}

/* --- MOBILE CONTROLS --- */
#mobile-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 35%;

    /* Show for testing */
    display: flex;

    justify-content: space-between;
    align-items: flex-end;
    pointer-events: none;
    padding: 20px;
    box-sizing: border-box;
}

/* --- MOVEMENT PAD (arrow key layout) --- */
#movement-pad {
    display: grid;
    grid-template-areas:
        ". up ."
        "left down right";
    grid-template-columns: 60px 60px 60px;
    grid-template-rows: 60px 60px;
    gap: 10px;
    pointer-events: auto;
    justify-content: center;
    align-items: center;
}

/* Map the buttons into the grid */
#move-forward { grid-area: up; }
#move-left { grid-area: left; }
#move-backward { grid-area: down; }
#move-right { grid-area: right; }


/* --- SINGLE FIRE BUTTON --- */
#fire-button {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: none;
    background-color: rgba(255, 0, 0, 0.6);
    color: white;
    font-size: 1.5em;
    font-weight: bold;
    pointer-events: auto;
}
