/* Estilos generales */
body, html {
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: #000;
  color: #fff;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Contenedor del juego */
#gameCanvas {
  display: none;
  width: 100%;
  height: 100%;
  background: #000;
}

#ui {
  position: absolute;
  top: 1em;
  left: 1em;
  font-size: 18px;
  font-weight: bold;
}

/* Superposiciones */
#walletOverlay,
#gameOverOverlay {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.92);
  display: flex; /* 👈 importante */
  align-items: center;
  justify-content: center;
  flex-direction: column;
  z-index: 200;
  padding: 20px;
  text-align: center;
  animation: fadeIn 0.4s ease-out;
  box-sizing: border-box;
}

/* Contenedor centrado */
#welcomeBox {
  max-width: 400px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Animación suave */
@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.96); }
  to   { opacity: 1; transform: scale(1); }
}

/* Logotipo */
#gameLogo {
  width: 40%;
  max-width: 300px;
  margin-bottom: 20px;
}

/* Cohete decorativo */
#rocketIntro {
  width: 100px;
  margin: 10px auto 20px;
  animation: floatRocket 3s ease-in-out infinite;
  display: block;
  filter: drop-shadow(0 0 8px #0ff) brightness(1.2);
  transform-origin: center;
}

@keyframes floatRocket {
  0% { transform: translateY(0px) rotate(-2deg); }
  50% { transform: translateY(-8px) rotate(2deg); }
  100% { transform: translateY(0px) rotate(-2deg); }
}

/* Entrada wallet */
#walletOverlay input {
  padding: 10px;
  font-size: 18px;
  width: 260px;
  margin-bottom: 15px;
  border: none;
  border-radius: 5px;
  text-align: center;
}

/* Botones generales */
#walletOverlay button,
#gameOverOverlay button {
  padding: 12px 28px;
  font-size: 18px;
  background: linear-gradient(135deg, #00bcd4, #2196f3);
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}
#walletOverlay button:hover,
#gameOverOverlay button:hover {
  background: linear-gradient(135deg, #2196f3, #00bcd4);
  transform: scale(1.05);
}

/* Game Over Buttons */
#gameOverButtons {
  display: flex;
  gap: 1em;
  margin-top: 15px;
}
#gameOverButtons button {
  background: linear-gradient(135deg, #f44336, #e91e63);
}
#gameOverButtons button:hover {
  background: linear-gradient(135deg, #e91e63, #f44336);
}

/* Leaderboard */
#leaderboard {
  margin-bottom: 20px;
  text-align: center;
  max-height: 280px;
  overflow-y: hidden;
  width: 100%;
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
  padding: 10px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  box-shadow: 0 0 10px #0ff3;
}

#leaderboard h3,
#leaderboardHeader h2 {
  margin: 0 0 12px;
  font-size: 22px;
  color: #ffd700;
  text-shadow: 0 0 6px #fff;
}

#leaderboard ol {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 16px;
}

#leaderboard li {
  margin: 4px 0;
  padding: 6px 12px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  color: #eee;
  text-align: left;
}

/* Trofeos vía CSS (opcional) */
#leaderboard li:nth-child(1)::before {
  content: "🥇 ";
}
#leaderboard li:nth-child(2)::before {
  content: "🥈 ";
}
#leaderboard li:nth-child(3)::before {
  content: "🥉 ";
}

/* Resaltar wallet del jugador */
#leaderboard li.your-wallet,
#fullLeaderList li.your-wallet {
  background: rgba(0, 255, 255, 0.2);
  font-weight: bold;
  color: #0ff;
}

/* Modal general */
.modal {
  display: none;
  position: fixed;
  z-index: 999;
  left: 0; top: 0;
  width: 100%; height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  justify-content: center;
  align-items: center;
  animation: fadeIn 0.4s ease-out;
}

/* Contenido del modal */
.modal-content {
  background-color: #111;
  padding: 20px;
  border-radius: 10px;
  max-height: 80vh;
  overflow-y: auto;
  max-width: 400px;
  width: 90%;
  color: #fff;
  position: relative;
  box-shadow: 0 0 20px #0ff5;
}

/* Botón de cerrar */
.close {
  position: absolute;
  right: 10px;
  top: 5px;
  font-size: 22px;
  cursor: pointer;
  color: #fff;
}

/* Botón de ver todos los jugadores */
#showAllBtn {
  margin-top: 10px;
  padding: 10px 20px;
  font-size: 15px;
  font-weight: 600;
  background: linear-gradient(135deg, #333, #555);
  border: 1px solid #666;
  color: white;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}
#showAllBtn:hover {
  background: linear-gradient(135deg, #555, #333);
  transform: scale(1.05);
}

/* Estilo título */
.leader-title {
  font-size: 24px;
  color: #ffd700;
  text-shadow: 1px 1px 3px #000;
  letter-spacing: 1px;
  margin-bottom: 0.2em;
  font-weight: bold;
}

/* Posición del jugador */
.player-rank-info {
  font-size: 14px;
  margin-top: 8px;
  color: #ccc;
}

#rocketIntro:hover {
  transform: translateY(-20px) rotate(-10deg) scale(1.05);
  filter: drop-shadow(0 0 12px #0ff) brightness(1.4);
  transition: transform 0.3s ease, filter 0.3s ease;
}

@keyframes takeoffRocket {
  0% { transform: translateY(0) rotate(0deg) scale(1); opacity: 1; }
  40% { transform: translateY(-100px) rotate(-10deg) scale(1.1); opacity: 1; }
  100% { transform: translateY(-600px) rotate(-20deg) scale(1.3); opacity: 0; }
}

#rocketIntro.takeoff {
  animation: takeoffRocket 1s ease forwards;
  filter: drop-shadow(0 0 16px #0ff) brightness(1.8);
}
