/* --- Reset and basic --- */
* {
  box-sizing: border-box;
  user-select: none;
}
body {
  margin: 0;
  background: #111;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: white;
}
h1 {
  margin: 10px 0 0 0;
}

/* --- Game container --- */
#game {
  position: relative;
  width: 400px;
  height: 600px;
  background: linear-gradient(to top, #004080, #007acc);
  overflow: hidden;
  border: 3px solid #0ff;
  border-radius: 12px;
  touch-action: none;
}


/* --- Plane --- */


/* --- Bullets --- */
.bullet {
  width: 6px;
  height: 12px;
  background: yellow;
  position: absolute;
  border-radius: 3px;
}

/* --- Enemies --- */
.enemy {
  position: absolute;
  width: 40px;
  height: 40px;
  background: red;
  border-radius: 8px;
  box-shadow: 0 0 10px red;
}



/* --- Scoreboard --- */
#scoreboard {
  margin: 8px 0;
  font-size: 20px;
}

/* --- Control buttons container --- */
#controls {
  margin-top: 12px;
  display: flex;
  justify-content: center;
  gap: 20px;
}

/* --- Buttons --- */
button {
  width: 60px;
  height: 60px;
  border-radius: 12px;
  border: none;
  background: #0ff;
  color: #111;
  font-size: 24px;
  font-weight: bold;
  box-shadow: 0 0 10px #0ff;
  user-select: none;
  touch-action: manipulation;
}
button:active {
  background: #08a;
  color: white;
  box-shadow: 0 0 15px #08a inset;
}
#plane {
  position: absolute;
  bottom: 10px;
  left: 180px;
  width: 40px;
  height: 60px;
  background: transparent;
  cursor: pointer;
}

/* Body of plane */
#plane::before {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 12px;
  height: 40px;
  background: #0ff;
  border-radius: 6px;
}

/* Wings */
#plane::after {
  content: "";
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 12px;
  background: #0ff;
  border-radius: 6px 6px 0 0;
  clip-path: polygon(0 100%, 50% 0, 100% 100%);
}

/* Nose (triangle on top) */
#plane .nose {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-bottom: 15px solid #0ff;
  border-radius: 2px;
}

#retryBtn:active {
  background-color: #08a;
  color: white;
  box-shadow: 0 0 15px #08a inset;
}
#gameOver {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.7);
  display: none; /* initially */
  justify-content: center;
  align-items: center;
  flex-direction: column;
  z-index: 9999;
  pointer-events: auto; /* important */
}

#gameOver button {
  margin-top: 20px;
  font-size: 28px;
  padding: 10px 20px;
  cursor: pointer;
  pointer-events: auto;
}

#gameOver {
  pointer-events: auto !important;
}
#gameOver button {
  pointer-events: auto !important;
}


#gameOver.flex {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
}

#gameOver.active {
  display: flex; /* or block or flex, whatever suits your layout */
  flex-direction: column;
  align-items: center;
  justify-content: center;
}


#retryBtn {
  cursor: pointer;
  pointer-events: auto;
}

#game {
  border: 3px solid lime; /* bright green for visibility */
}
.enemy {
  border: 1px solid white;
  opacity: 0.8;
}
