/* ========================
   ESTILOS ESPECÍFICOS PARA SPACEWAR PRO
========================= */

/* Contenedor del juego */
.game-wrapper {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 20px;
  width: 100%;
}

@media (min-width: 1024px) {
  .game-wrapper {
    flex-direction: row;
  }
}

.game-container {
  position: relative;
  background: rgba(10, 10, 25, 0.9);
  padding: 15px;
  border-radius: 15px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(0, 150, 255, 0.2);
  overflow: hidden;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 500px;
}

.game-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #0066ff, #00ccff);
  z-index: 2;
}

canvas {
  background: linear-gradient(180deg, #000010 0%, #0a0a2a 50%, #000010 100%);
  display: block;
  box-shadow: inset 0 0 50px rgba(0, 50, 100, 0.5);
  width: 100%;
  max-width: 800px;
  height: 500px;
  border-radius: 8px;
}

/* Paneles laterales */
.side-panel {
  background: rgba(15, 15, 35, 0.8);
  border-radius: 15px;
  padding: 20px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(0, 150, 255, 0.2);
  min-width: 250px;
  display: none;
}

@media (min-width: 1024px) {
  .side-panel {
    display: block;
  }
}

.panel-section {
  margin-bottom: 25px;
  padding-bottom: 15px;
  border-bottom: 1px solid rgba(0, 150, 255, 0.2);
}

.panel-section:last-child {
  margin-bottom: 0;
  border-bottom: none;
}

.panel-section h3 {
  color: #00ccff;
  margin-bottom: 15px;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Tipos de enemigos */
.enemy-types, .powerup-types {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.enemy-type, .powerup-type {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  transition: background 0.3s;
}

.enemy-type:hover, .powerup-type:hover {
  background: rgba(255, 255, 255, 0.1);
}

.enemy-icon, .powerup-icon {
  width: 30px;
  height: 30px;
  border-radius: 4px;
}

.enemy-icon.basic {
  background: linear-gradient(135deg, #ff5555, #ff8888);
  border: 2px solid #ff5555;
}

.enemy-icon.fast {
  background: linear-gradient(135deg, #ffaa00, #ffcc44);
  border: 2px solid #ffaa00;
}

.enemy-icon.tank {
  background: linear-gradient(135deg, #aa55ff, #cc88ff);
  border: 2px solid #aa55ff;
}

.enemy-icon.boss {
  background: linear-gradient(135deg, #ff0000, #ff5555);
  border: 2px solid #ff0000;
}

.enemy-points {
  margin-left: auto;
  color: #00ffcc;
  font-weight: bold;
}

.powerup-icon.shield {
  background: linear-gradient(135deg, #0066ff, #00aaff);
  border: 2px solid #0066ff;
  border-radius: 50%;
}

.powerup-icon.rapid {
  background: linear-gradient(135deg, #ffaa00, #ffdd00);
  border: 2px solid #ffaa00;
  border-radius: 50%;
}

.powerup-icon.life {
  background: linear-gradient(135deg, #00cc66, #00ff99);
  border: 2px solid #00cc66;
  border-radius: 50%;
}

.powerup-icon.bomb {
  background: linear-gradient(135deg, #ff0066, #ff5599);
  border: 2px solid #ff0066;
  border-radius: 50%;
}

.controls-summary .controls-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.9rem;
  color: #b0b0e0;
}

.controls-list div {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Overlays del juego */
.game-over-overlay,
.level-complete-overlay,
.pause-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s, visibility 0.5s;
  z-index: 10;
}

.game-over-overlay {
  background: rgba(200, 0, 0, 0.85);
}

.level-complete-overlay {
  background: rgba(0, 150, 100, 0.85);
}

.pause-overlay {
  background: rgba(0, 50, 100, 0.85);
}

.game-over-overlay.active,
.level-complete-overlay.active,
.pause-overlay.active {
  opacity: 1;
  visibility: visible;
}

.game-over-content,
.level-complete-content,
.pause-content {
  text-align: center;
  background: rgba(0, 0, 0, 0.7);
  padding: 30px;
  border-radius: 15px;
  max-width: 400px;
  width: 90%;
  animation: pulse 1.5s infinite alternate;
}

.game-over-content i {
  font-size: 3.5rem;
  color: #ff5555;
  margin-bottom: 20px;
}

.level-complete-content i {
  font-size: 3.5rem;
  color: #00ffcc;
  margin-bottom: 20px;
}

.pause-content i {
  font-size: 3.5rem;
  color: #0066ff;
  margin-bottom: 20px;
}

.game-over-content h2,
.level-complete-content h2,
.pause-content h2 {
  font-size: 2rem;
  margin-bottom: 15px;
  color: white;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.final-score {
  font-size: 1.3rem;
  color: #ffcc00;
  margin-bottom: 20px;
  font-weight: bold;
}

.high-score {
  font-size: 1.1rem;
  color: #00ffcc;
  margin-bottom: 20px;
  padding: 10px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 8px;
}

.bonus-points {
  font-size: 1.2rem;
  color: #ffcc00;
  margin-top: 15px;
  font-weight: bold;
}

/* Panel de acciones */
.actions-panel {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 15px;
  margin-bottom: 20px;
}

#shield-btn, #bomb-btn {
  position: relative;
}

#shield-charge, #bomb-count {
  background: rgba(0, 0, 0, 0.3);
  padding: 2px 8px;
  border-radius: 10px;
  margin-left: 5px;
  font-size: 0.9em;
  min-width: 60px;
  display: inline-block;
  text-align: center;
}

#bomb-btn.active, #shield-btn.active {
  background: rgba(0, 102, 255, 0.3);
  border-color: #0066ff;
  box-shadow: 0 0 15px rgba(0, 102, 255, 0.5);
}

/* Controles móviles */
.mobile-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
  width: 100%;
  max-width: 400px;
  display: none;
}

@media (max-width: 768px) {
  .mobile-controls {
    display: flex;
  }
}

.mobile-controls-left,
.mobile-controls-right {
  display: flex;
  gap: 15px;
}

.mobile-btn {
  width: 60px;
  height: 60px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  color: white;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
  transition: all 0.2s;
  cursor: pointer;
}

.mobile-btn:active {
  transform: scale(0.9);
}

.move-left, .move-right {
  background: rgba(0, 100, 255, 0.3);
  border: 2px solid #0066ff;
}

.shoot-btn {
  background: rgba(255, 50, 50, 0.3);
  border: 2px solid #ff3333;
}

.bomb-btn-mobile {
  background: rgba(255, 0, 100, 0.3);
  border: 2px solid #ff0066;
}

.shield-btn-mobile {
  background: rgba(0, 102, 255, 0.3);
  border: 2px solid #0066ff;
}

/* Animaciones */
@keyframes pulse {
  from { transform: scale(0.95); }
  to { transform: scale(1.05); }
}

@keyframes explosion {
  0% { transform: scale(0); opacity: 1; }
  50% { transform: scale(1.5); opacity: 0.7; }
  100% { transform: scale(2); opacity: 0; }
}

@keyframes shield-pulse {
  0% { box-shadow: 0 0 5px #0066ff; }
  50% { box-shadow: 0 0 20px #0066ff; }
  100% { box-shadow: 0 0 5px #0066ff; }
}

@keyframes powerup-float {
  0% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
  100% { transform: translateY(0); }
}

/* Barra de progreso de nivel */
.level-progress {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  height: 10px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 5px;
  overflow: hidden;
  z-index: 5;
}

.level-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #0066ff, #00ccff);
  width: 0%;
  transition: width 0.3s;
  border-radius: 5px;
}

/* Indicador de combo */
.combo-indicator {
  position: absolute;
  top: 25px;
  left: 10px;
  color: #ffcc00;
  font-weight: bold;
  font-size: 1.2rem;
  text-shadow: 0 0 10px rgba(255, 204, 0, 0.8);
  opacity: 0;
  transition: opacity 0.3s;
}

/* Indicadores de cooldown */
.cooldown-indicator {
  position: absolute;
  bottom: 20px;
  background: rgba(0, 0, 0, 0.7);
  padding: 8px 15px;
  border-radius: 10px;
  color: white;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 20;
  border-left: 4px solid;
}

.cooldown-indicator.bomb {
  left: 20px;
  border-left-color: #ff0066;
}

.cooldown-indicator.shield {
  right: 20px;
  border-left-color: #0066ff;
}

.cooldown-indicator .icon {
  font-size: 1.2rem;
}

.cooldown-indicator.ready {
  color: #00ffcc;
}

.cooldown-indicator .cooldown-text {
  font-weight: bold;
}

/* Estilos para botones con cooldown */
.btn:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

/* Animación para cuando se activa un escudo o bomba */
@keyframes powerup-activate {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

.powerup-activated {
  animation: powerup-activate 0.5s ease;
}

/* Efecto de escudo activo */
.shield-active {
  animation: shield-pulse 1s infinite;
}

/* Responsive para indicadores de cooldown */
@media (max-width: 768px) {
  .cooldown-indicator {
    bottom: 10px;
    padding: 6px 10px;
    font-size: 0.8rem;
  }
  
  .cooldown-indicator.bomb {
    left: 10px;
  }
  
  .cooldown-indicator.shield {
    right: 10px;
  }
}

/* Modo móvil para panel de acciones */
@media (max-width: 480px) {
  .actions-panel {
    gap: 10px;
  }
  
  .btn {
    padding: 8px 12px;
    font-size: 0.9rem;
  }
  
  #bomb-count, #shield-charge {
    min-width: 50px;
    font-size: 0.8em;
  }
}