/* Estilos generales */
body {
  font-family: 'Arial', sans-serif;
  background-color: #1a1a2e;
  color: #fff;
  text-align: center;
  margin: 0;
  padding: 20px;
}

.pantalla {
  display: none;
}

.visible {
  display: block;
}

/* Personajes */
.personajes {
  display: flex;
  justify-content: space-around;
  margin: 30px auto;
  max-width: 800px;
}

.personaje, .enemigo {
  background-color: #16213e;
  padding: 20px;
  border-radius: 15px;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
}

.personaje img, .enemigo img {
  width: 180px;
  height: 180px;
  object-fit: cover;
  border-radius: 10px;
  transition: transform 0.3s;
}

/* Barras de salud */
.barra-salud {
  width: 250px;
  height: 25px;
  background-color: #333;
  border-radius: 12px;
  margin: 10px auto;
  overflow: hidden;
}

.vida-actual {
  height: 100%;
  background: linear-gradient(to right, #4CAF50, #2E7D32);
  transition: width 0.5s, background 0.3s;
}

.vida-actual.poca-vida {
  background: linear-gradient(to right, #FF9800, #EF6C00);
}

.vida-actual.muy-poca-vida {
  background: linear-gradient(to right, #F44336, #C62828);
}

/* Botones */
.acciones {
  margin: 30px auto;
  max-width: 600px;
}

.acciones button {
  margin: 10px;
  padding: 12px 25px;
  font-size: 16px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.2s;
  color: white;
}

/* Colores por tipo */
button[onclick*="Físico"], 
button[onclick*="Pesada"] {
  background: linear-gradient(to right, #e74c3c, #c0392b);
}

button[onclick*="Distancia"],
button[onclick*="Mallada"] {
  background: linear-gradient(to right, #3498db, #2980b9);
}

button[onclick*="Mágico"],
button[onclick*="Arcana"] {
  background: linear-gradient(to right, #9b59b6, #8e44ad);
}

/* Log */
#log {
  background-color: rgba(0, 0, 0, 0.7);
  border-radius: 10px;
  padding: 15px;
  max-width: 600px;
  margin: 20px auto;
  max-height: 200px;
  overflow-y: auto;
  text-align: left;
  font-family: 'Courier New', monospace;
}

/* Efectos */
@keyframes parpadeo {
  0% { opacity: 1; }
  50% { opacity: 0.3; }
  100% { opacity: 1; }
}

.recibir-dano {
  animation: parpadeo 0.3s 2;
}

/* Responsivo */
@media (max-width: 768px) {
  .personajes {
    flex-direction: column;
  }
}
/* Animaciones */
.animar-accion {
  animation: accion 0.5s ease-in-out;
}

@keyframes accion {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

.recibir-dano {
  animation: dano 0.5s ease-in-out;
}

@keyframes dano {
  0% { filter: brightness(1); }
  50% { filter: brightness(2) sepia(1) hue-rotate(300deg); }
  100% { filter: brightness(1); }
}

.defensa-exitosa {
  animation: defensaBuena 0.8s ease-out;
}

@keyframes defensaBuena {
  0% { box-shadow: 0 0 5px cyan; }
  50% { box-shadow: 0 0 20px lime, 0 0 10px white; }
  100% { box-shadow: 0 0 5px cyan; }
}

.defensa-fallida {
  animation: defensaMala 0.8s ease-out;
}

@keyframes defensaMala {
  0% { box-shadow: 0 0 5px red; }
  50% { box-shadow: 0 0 20px darkred, 0 0 10px orangered; }
  100% { box-shadow: 0 0 5px red; }
}