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

body, html {
    width: 100%;
    height: 100%;
    background-color: #000;
    font-family: 'Courier New', Courier, monospace;
    overflow: hidden; /* Prevent scrolling */
}

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

#game-canvas {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none; /* Clicks pass through to HTML UI */
    background-color: transparent;
}

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

.screen {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    pointer-events: auto; /* Re-enable pointer events for UI */
}

.hidden {
    display: none !important;
}

/* Menu */
#menu-screen {
    background: url('res/img/start1.gif') no-repeat center center;
    background-size: cover;
    color: #0f0;
    text-shadow: 0 0 10px #000;
}

#menu-screen h1 {
    font-size: 4rem;
    margin-bottom: 2rem;
}

.difficulty-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

button {
    padding: 10px 20px;
    font-size: 1.5rem;
    font-family: inherit;
    background-color: #111;
    color: #0f0;
    border: 2px solid #0f0;
    cursor: pointer;
    transition: all 0.3s;
}

button:hover {
    background-color: #0f0;
    color: #000;
}

/* HUD */
#hud-screen {
    pointer-events: none;
    justify-content: space-between;
}
/* In mobile mode the HUD layer needs to receive touch for joystick (drawn on canvas) */
body.mobile-mode #hud-screen {
    pointer-events: none; /* touches handled by window-level listeners */
}

.top-bar {
    width: 100%;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.health-container {
    width: 250px;
    height: 25px;
    border: 3px solid #000;
    background-color: #333;
}

#health-bar {
    width: 100%;
    height: 100%;
    background-color: #2cba3b;
    transition: width 0.1s linear;
}

.timer-score-container {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 20px;
    text-align: center;
    color: #0f0;
    font-size: 1.5rem;
    font-weight: bold;
    text-shadow: 2px 2px 0px #000;
}

.manual {
    position: absolute;
    bottom: 40px;
    text-align: center;
    background-color: rgba(0,0,0,0.7);
    padding: 10px 20px;
    border-radius: 10px;
    border: 1px solid #0f0;
}

.rocket-count-container {
    display: flex;
    justify-content: flex-end;
}

#rocket-icons {
    display: flex;
    gap: 5px;
}

.rocket-icon {
    width: 20px;
    height: 40px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

#boss-health-container {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 250px;
    height: 25px;
    border: 3px solid #000;
    background-color: #333;
}

#boss-health-bar {
    width: 100%;
    height: 100%;
    background-color: #f00;
    transition: width 0.1s linear;
}

/* End Screen */
#end-screen {
    background-color: rgba(0, 0, 0, 0.85);
    color: #fff;
    text-shadow: 0 0 10px #fff;
}

#end-screen h1 {
    font-size: 4rem;
    margin-bottom: 1rem;
}

#end-score {
    font-size: 2rem;
    margin-bottom: 2rem;
}
