* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: #1a1a2e;
}

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

/* 2D UI canvas overlay */
#game-canvas {
    background-color: transparent;
    max-width: 100%;
    max-height: 100%;
    position: absolute;
    z-index: 10;
    pointer-events: auto;
}

/* Three.js 3D canvas sits behind the 2D UI canvas */
#game-container canvas:not(#game-canvas) {
    position: absolute;
    z-index: 1;
    pointer-events: none;
}

/* Fire toggle button */
#fire-btn {
    position: absolute;
    bottom: 20px;
    right: 20px;
    z-index: 100;
    padding: 15px 25px;
    font-size: 18px;
    font-weight: bold;
    background: linear-gradient(180deg, #ff6600 0%, #cc3300 100%);
    color: white;
    border: 3px solid #ffaa00;
    border-radius: 10px;
    cursor: pointer;
    text-shadow: 1px 1px 2px #000;
    box-shadow: 0 4px 8px rgba(0,0,0,0.5);
    transition: transform 0.1s, background 0.2s;
}

#fire-btn:hover {
    transform: scale(1.05);
    background: linear-gradient(180deg, #ff8800 0%, #dd4400 100%);
}

#fire-btn:active {
    transform: scale(0.95);
}

#fire-btn.fire-off {
    background: linear-gradient(180deg, #666 0%, #444 100%);
    border-color: #888;
}

/* Sound toggle button */
#sound-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    z-index: 100;
    padding: 10px 15px;
    font-size: 14px;
    font-weight: bold;
    background: linear-gradient(180deg, #4a90d9 0%, #357abd 100%);
    color: white;
    border: 2px solid #5aa0e9;
    border-radius: 8px;
    cursor: pointer;
    text-shadow: 1px 1px 2px #000;
    box-shadow: 0 3px 6px rgba(0,0,0,0.4);
    transition: transform 0.1s, background 0.2s;
}

#sound-btn:hover {
    transform: scale(1.05);
    background: linear-gradient(180deg, #5aa0e9 0%, #4a90d9 100%);
}

#sound-btn:active {
    transform: scale(0.95);
}

#sound-btn.sound-off {
    background: linear-gradient(180deg, #666 0%, #444 100%);
    border-color: #888;
}

/* Right side controls container */
#right-controls {
    position: absolute;
    bottom: 20px;
    right: 20px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
}

#right-controls #fire-btn {
    position: static;
}

/* Instructions panel */
#instructions {
    background: rgba(0, 0, 0, 0.6);
    padding: 10px 15px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-family: Arial, sans-serif;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
    text-align: right;
}

.instruction-item {
    margin: 4px 0;
    white-space: nowrap;
}

/* Mobile responsive - hide instructions and shrink controls on small screens */
@media (max-width: 600px) {
    #instructions {
        display: none;
    }

    #right-controls {
        bottom: 10px;
        right: 10px;
    }

    #right-controls #fire-btn {
        padding: 10px 15px;
        font-size: 14px;
    }

    #sound-btn {
        top: 10px;
        right: 10px;
        padding: 8px 12px;
        font-size: 12px;
    }
}

/* Very small screens - minimize further */
@media (max-width: 400px) {
    #right-controls #fire-btn {
        padding: 8px 12px;
        font-size: 12px;
    }

    #sound-btn {
        padding: 6px 10px;
        font-size: 11px;
    }
}

/* Hidden input for mobile keyboard support on name entry */
#nameInput {
    position: absolute;
    font-size: 16px; /* Prevents iOS zoom on focus */
    opacity: 0;
    pointer-events: none;
    z-index: 1000;
    /* Size will be set dynamically via JS to overlay the canvas input box */
    width: 180px;
    height: 40px;
    text-align: center;
    text-transform: uppercase;
}
