* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none; /* Prevent default touch actions like scroll/zoom */
}

body, html {
    width: 100%;
    height: 100%;
    background-color: #08080A; /* Void Black */
    color: #FFFFFF;
    font-family: monospace;
    overflow: hidden;
}

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

canvas {
    background-color: #08080A;
    /* Responsive scaling keeping aspect ratio */
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    /* Sharp rendering */
    image-rendering: pixelated;
}

/* Mobile HUD - default hidden on desktop, media query reveals on smaller screens */
#mobile-hud {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; /* Let clicks pass through empty areas */
    z-index: 10;
}

.hud-btn {
    pointer-events: auto;
    background-color: rgba(22, 23, 27, 0.6); /* Semi-transparent dark grey */
    border: 2px solid #FF1E44; /* Crimson glow edge */
    color: #FF1E44;
    border-radius: 50%;
    font-size: 24px;
    font-weight: bold;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 0 10px rgba(255, 30, 68, 0.3);
    outline: none;
}

.hud-btn:active {
    background-color: rgba(255, 30, 68, 0.4);
    box-shadow: 0 0 20px rgba(255, 30, 68, 0.8);
}

#dpad {
    position: absolute;
    bottom: 20px;
    left: 20px;
    display: flex;
    gap: 10px;
}

#btn-left, #btn-right {
    width: 64px;
    height: 64px;
}

#action-cluster {
    position: absolute;
    bottom: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
}

#btn-jump {
    width: 76px;
    height: 76px;
}

#btn-strike {
    width: 60px;
    height: 60px;
    margin-right: 40px; /* Offset to sit nicely next to jump */
}

/* Hide touch controls on larger screens (desktop) */
@media (min-width: 1024px) {
    #mobile-hud {
        display: none;
    }
}

#ui-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 20;
}

.ui-text {
    font-size: 32px;
    color: #FFFFFF;
    text-shadow: 2px 2px 0px #FF1E44;
    text-align: center;
    margin-bottom: 20px;
}

.ui-subtext {
    font-size: 16px;
    color: #FF6B00; /* Industrial Ember */
    text-align: center;
}
