@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

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

body {
font-family: 'Press Start 2P', system-ui;
background: #000;
color: #f60;
overflow: hidden;
height: 100vh;
display: flex;
justify-content: center;
align-items: center;
}

#game-container {
position: relative;
width: 100%;
max-width: 800px;
display: flex;
flex-direction: column;
align-items: center;
}

#gameCanvas {
width: 100%;
height: auto;
aspect-ratio: 3 / 4;
background: #111;
display: block;
border: 2px solid #c30;
}

/* HUD */
#hud {
position: absolute;
top: 10px;
left: 10px;
font-size: 13px;
color: #c30;
text-shadow: 0 0 8px #c30;
z-index: 10;
pointer-events: none;
}

#high-score-display {
position: absolute;
top: 10px;
right: 70px;
font-size: 13px;
color: #f60;
text-shadow: 0 0 8px #fff;
z-index: 10;
pointer-events: none;
}

/* Screens */
#start-screen,
#game-over,
#wave-screen {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: auto;
aspect-ratio: 3 / 4;
background-color: rgba(0, 0, 0, 0.85);
display: flex;
justify-content: center;
align-items: center;
z-index: 20;
}

#start-screen {
background-image: url('assets/bg.jpg');
background-repeat: no-repeat;
background-position: center center;
background-size: auto 100%;
}

.title-content {
background: rgba(0, 0, 0, 0.75);
padding: 40px 40px;
border-radius: 16px;
text-align: center;
border: 2px solid #c30;
box-shadow: 0 0 30px rgba(0, 255, 255, 0.4);
}

#start-screen h1,
#game-over h1,
#wave-screen h1 {
font-size: 32px;
letter-spacing: 3px;
color: #c30;
text-shadow: 0 0 20px #c30;
margin-bottom: 15px;
}

#wave-screen h1 {
font-size: 56px;
animation: pulse 1s infinite alternate;
}

@keyframes pulse {
from { transform: scale(1); opacity: 0.8; }
to { transform: scale(1.08); opacity: 1; }
}

#start-screen p,
#game-over p {
font-size: 14px;
margin: 10px 0;
}

.controls {
font-size: 12px;
opacity: 0.85;
margin-bottom: 20px;
line-height: 1.6;
}

button {
font-family: 'Press Start 2P', system-ui;
background: #c30;
color: #fff;
border: 2px solid #b20;
padding: 14px 28px;
font-size: 14px;
cursor: pointer;
border-radius: 12px;
}

button:active {
transform: scale(0.95);
}

.hidden {
display: none !important;
}

/* Sound button */
#soundBtn {
position: absolute;
top: 10px;
right: 10px;
font-size: 11px;
padding: 7px 10px;
z-index: 15;
background: rgba(0, 0, 0, 0.7);
color: #c30;
border: 1px solid #c30;
}

/* Mobile Controls – below canvas */
#mobile-controls {
width: 100%;
max-width: 800px;
display: none;
justify-content: space-between;
padding: 16px 20px 22px;
background: #000;
gap: 3px;
}

.left-controls,
.right-controls {
display: flex;
gap: 2px;
}

.control-btn {
width: 68px;
height: 68px;
font-size: 26px;
background: rgba(0, 125, 0, 0.2);
border: 2px solid #070;
color: #fff;
border-radius: 8px;
display: flex;
align-items: center;
justify-content: center;
user-select: none;
-webkit-user-select: none;
}

.control-btn.fire {
width: 68px;
height: 68px;
font-size: 16px;
background: rgba(204, 51, 0, 0.3);
border-color: #f60;
color: #fff;
}

.control-btn:active {
background: rgba(204, 51, 0, 0.55);
transform: scale(0.92);
}

.control-btn.fire:active {
background: rgba(204, 51, 0, 0.6);
}

@media (hover: none) and (pointer: coarse), (max-width: 768px) {
#mobile-controls {
display: flex !important;
}
.controls {
display: none;
}
}

@media (max-width: 480px) {
#start-screen h1, #game-over h1 {
font-size: 28px;
}
#wave-screen h1 {
font-size: 40px;
}
.control-btn {
width: 58px;
height: 58px;
font-size: 22px;
}
.control-btn.fire {
width: 72px;
height: 72px;
}
}