body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: #000;
    font-family: 'Arial', sans-serif;
    touch-action: none;
}
canvas {
    display: block;
    width: 100vw;
    height: 100vh;
}
#rotateDeviceWarning {
    display: none;
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: #000;
    color: white;
    z-index: 1000;
    justify-content: center;
    align-items: center;
    text-align: center;
    font-size: 24px;
}
@media screen and (orientation: portrait) {
    #rotateDeviceWarning {
        display: flex;
    }
    #loginScreen, #gameUI {
        display: none !important;
    }
}
#damageOverlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: red;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.1s ease-out;
    z-index: 50;
}
#loginScreen {
    position: absolute;
    width: 100%;
    height: 100%;
    background: url('https://i.imgur.com/7b1Vp6l.jpg') center/cover;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 100;
}
.login-box {
    background: rgba(0, 0, 0, 0.7);
    padding: 40px;
    border-radius: 15px;
    text-align: center;
    border: 3px solid #ff4c4c;
    box-shadow: 0px 0px 20px rgba(255, 76, 76, 0.5);
}
.login-box h1 {
    font-size: 45px;
    margin: 0 0 30px 0;
    color: #ff4c4c;
    letter-spacing: 3px;
    text-transform: uppercase;
    text-shadow: 3px 3px 6px #000;
}
.login-box button {
    padding: 15px 50px;
    font-size: 24px;
    font-weight: bold;
    background: #ff4c4c;
    color: white;
    border: 2px solid white;
    cursor: pointer;
    border-radius: 8px;
    text-transform: uppercase;
    box-shadow: 0px 5px 10px rgba(0,0,0,0.5);
}
.login-box button:active {
    transform: scale(0.95);
    background: #d63c3c;
}
#watermark {
    position: absolute;
    bottom: 10px;
    width: 100%;
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    letter-spacing: 1px;
    z-index: 101;
    text-shadow: 1px 1px 2px #000;
}
#topBar {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
    font-size: 18px;
    font-weight: bold;
    text-shadow: 2px 2px 4px #000;
    z-index: 10;
}
#topLeft {
    display: flex;
    align-items: center;
    gap: 15px;
}
#gameTitle {
    color: #ff4c4c;
    font-size: 22px;
    font-weight: 900;
    letter-spacing: 2px;
    text-shadow: 2px 2px 5px #000, 0px 0px 10px red;
}
#autoFireToggle {
    background-color: rgba(0, 255, 0, 0.6);
    color: white;
    border: 1px solid white;
    border-radius: 5px;
    padding: 5px 10px;
    margin-left: 15px;
    font-weight: bold;
    cursor: pointer;
    font-size: 16px;
}
#crosshair {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 30px;
    font-weight: bold;
    z-index: 10;
    pointer-events: none;
}
#leftJoystickZone {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50%;
    height: 100%;
    z-index: 5;
}
#rightLookZone {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 50%;
    height: 100%;
    z-index: 4;
}
#joystick {
    position: absolute;
    bottom: 40px;
    left: 40px; 
    width: 100px;
    height: 100px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: none;
}
#joystickKnob {
    position: absolute;
    top: 25px;
    left: 25px;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
}
#fireBtn {
    position: absolute;
    bottom: 40px;
    right: 40px; 
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: rgba(255, 0, 0, 0.6);
    color: white;
    font-weight: bold;
    border: 2px solid white;
    z-index: 10;
    font-size: 16px;
}
#fireBtn:active {
    background: rgba(255, 0, 0, 0.9);
}