/* Reset básico */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  height: 100vh;
  background: black;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: 'Arial', sans-serif;
}

/* Estrelas de fundo */
.stars {
  position: absolute;
  width: 100%;
  height: 100%;
  background: transparent;
  pointer-events: none;
}

.star {
  position: absolute;
  background: white;
  border-radius: 50%;
  opacity: 0.8;
  animation: twinkle 3s infinite alternate;
}

@keyframes twinkle {
  0% { opacity: 0.3; }
  50% { opacity: 1; }
  100% { opacity: 0.3; }
}

button {
  position: fixed;
  top: 20px;
  left: 20px; 
  padding: 10px 16px;
  border-radius: 6px;
  border: 2px solid #4ea8de;
  background: transparent;
  color: white;
  font-weight: bold;
  cursor: pointer;
  font-size: 14px;
  transition: transform 0.2s ease, box-shadow 0.3s ease, background 0.3s ease;
}

button:hover {
  background: #4ea8de;
  transform: scale(1.05);
  box-shadow: 0 0 10px #4ea8de;
}

.game {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.ship {
  position: absolute;
  width: 60px;
  height: 80px;
  pointer-events: auto;
  z-index: 5; /* garante que fique acima do fundo */
}

/* Corpo da nave */
.ship::before {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 30px;
  height: 60px;
  background: linear-gradient(to bottom, #bde0fe, #219ebc);
  border-radius: 50% 50% 20% 20%;
  box-shadow: 0 0 15px #4ea8de;
}

/* Asas */
.ship::after {
  content: "";
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 70px;
  height: 30px;
  background: linear-gradient(to right, #023047, #219ebc, #023047);
  border-radius: 20px;
}

/* Fogo do motor */
.ship .engine {
  position: absolute;
  bottom: -15px;
  left: 50%;
  transform: translateX(-50%);
  width: 15px;
  height: 20px;
  background: radial-gradient(circle, #ffff00, #ff8800, transparent);
  border-radius: 50%;
  animation: fire 0.2s infinite alternate;
}

@keyframes fire {
  from {
    height: 15px;
    opacity: 0.7;
  }
  to {
    height: 25px;
    opacity: 1;
  }
}

.bullet {
  position: absolute;
  width: 4px;
  height: 12px;
  background: #ffeb3b;
  box-shadow: 0 0 10px #ffeb3b;
}

.meteor {
  position: absolute;
  width: 40px;
  height: 40px;
  background: radial-gradient(circle at 30% 30%, #aaa, #555, #222);
  border-radius: 50%;
}

.explosion {
  position: absolute;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(
    circle,
    #ffffff 0%,
    #ffe066 25%,
    #ff9933 45%,
    #ff3300 65%,
    transparent 70%
  );
  animation: explode 0.4s ease-out forwards;
}

@keyframes explode {
  from {
    transform: scale(0.3);
    opacity: 1;
  }
  to {
    transform: scale(1.8);
    opacity: 0;
  }
}

.score {
  position: fixed;
  top: 20px;
  right: 20px;
  color: #ffffff;
  font-size: 18px;
  font-weight: bold;
  letter-spacing: 1px;
  text-shadow: 0 0 8px #4ea8de;
  z-index: 10;
}

.victory-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 999;
}

.victory-box {
  background: linear-gradient(135deg, #0f2027, #203a43, #2c5364);
  border: 2px solid #4ea8de;
  border-radius: 12px;
  padding: 30px 40px;
  text-align: center;
  color: white;
  box-shadow: 0 0 25px #4ea8de;
  animation: pop 0.4s ease-out;
}

.victory-box h1 {
  margin-bottom: 15px;
  color: #ffeb3b;
}

.victory-box button {
  position: static;
  margin-top: 20px;
}

@keyframes pop {
  from {
    transform: scale(0.6);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.meteor.small {
  filter: brightness(1.3);
}

.meteor.boss {
  width: 120px;
  height: 120px;
  background: radial-gradient(circle at 30% 30%, #ffb703, #fb8500, #8d4f00);
  box-shadow: 0 0 30px #ffb703;
  border: 3px solid #fff3;
}

/* ========================
   ADAPTAÇÃO MOBILE
======================== */
@media (max-width: 768px) {
  .ship {
    width: 40px;
    height: 60px;
  }

  .ship::before {
    width: 20px;
    height: 40px;
  }

  .ship::after {
    width: 50px;
    height: 20px;
  }

  .bullet {
    width: 3px;
    height: 10px;
  }

  .meteor {
    width: 25px;
    height: 25px;
  }

  .meteor.boss {
    width: 80px;
    height: 80px;
  }

  .score {
    top: 10px;
    right: 10px;
    font-size: 14px;
  }

  button {
    padding: 8px 12px;
    font-size: 12px;
  }
}
