:root {
    --primary-color: #3b82f6;
    --text-color: #ffffff;
    --ui-bg: rgba(0, 0, 0, 0.7);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
    -webkit-user-select: none;
}

body {
    overflow: hidden;
    background-color: #87CEEB; /* Sky blue fallback */
    background: linear-gradient(to bottom, #87CEEB 0%, #E0F7FA 100%);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-color);
    width: 100vw;
    height: 100vh;
}

#game-canvas {
    display: block;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    touch-action: none; /* prevent scroll/zoom on canvas only */
}

#ui-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none; /* Let clicks pass through to canvas */
}

/* Enable pointer events for buttons/interactions */
#start-screen, #game-over-screen, button {
    pointer-events: auto;
}

@media (max-width: 520px) {
    #hud {
        flex-wrap: wrap;
        align-items: flex-start;
    }
    .hud-left {
        flex-wrap: wrap;
        row-gap: 6px;
    }
    .health {
        justify-items: start;
        align-items: start;
    }
}

#hud {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: calc(16px + env(safe-area-inset-top)) 16px 16px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    font-size: clamp(16px, 2.4vw, 24px);
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.hud-left,
.hud-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.combo-container {
    opacity: 0.98;
    font-weight: 800;
}

.multiplier {
    display: inline-block;
    margin-left: 4px;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(255, 213, 74, 0.18);
    border: 1px solid rgba(255, 213, 74, 0.3);
}

.health {
    display: grid;
    gap: 6px;
    align-items: end;
    justify-items: end;
}

.health-label {
    font-size: 0.85em;
    opacity: 0.9;
}

.healthbar {
    width: min(260px, 40vw);
    height: 14px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.18);
    overflow: hidden;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.1);
}

.healthbar-fill {
    height: 100%;
    width: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #22c55e, #a3e635);
    transition: width 120ms linear;
}

.health-text {
    font-size: 0.85em;
    opacity: 0.95;
}

.highscore-container {
    opacity: 0.95;
    font-weight: 700;
}

/* (sound button removed in arcade HUD pass) */

.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
    transition: opacity 0.3s ease;
    padding: 24px;
}

.hidden {
    display: none !important;
}

h1 {
    font-size: 48px;
    margin-bottom: 20px;
    color: #ffd700;
    text-shadow: 2px 2px 0 #000;
    text-align: center;
}

p {
    font-size: clamp(16px, 2.6vw, 24px);
    margin-bottom: 30px;
    text-align: center;
    max-width: 28ch;
}

.hint {
    font-size: clamp(13px, 2.2vw, 16px);
    opacity: 0.9;
    margin-bottom: 18px;
}

button {
    padding: 15px 40px;
    font-size: 24px;
    font-weight: bold;
    color: white;
    background: linear-gradient(45deg, #ff6b6b, #ff8e53);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    transition: transform 0.1s, box-shadow 0.1s;
}

button:active {
    transform: scale(0.95);
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

/* Override primary button styling for small icon buttons (HUD) - removed */
