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

/* === ESTRUCTURA GLOBAL === */
html, body {
  height: 100%;
}
body {
  display: flex;
  flex-direction: column;
  background: url("../img/fondo/fondoindex.gif") center/cover no-repeat;
  color: white;
  font-family: 'Segoe UI', sans-serif;
}
main {
  flex: 1;
}

/* === NAVBAR === */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
}

/* === PANTALLA INICIO === */
#pantallaInicio {
  text-align: center;
  background: rgba(0,0,0,0.6);
  padding: 2rem;
  border-radius: 1rem;
  box-shadow: 0 0 20px rgba(255,255,255,0.2);
}
#pantallaInicio h1 {
  font-size: 3rem;
  margin-bottom: 2rem;
  letter-spacing: 2px;
}
.btn-jugar {
  font-size: 1.5rem;
  padding: .75rem 2rem;
}

/* === SELECCIÓN DE PERSONAJE === */
.personajes {
  background: #575C65;
  height: 100vh;
  display: flex;
  align-items: center;
  padding: 2rem 4rem;
  gap: 2rem;
}
.personajes > div {
  background: #333;
  padding: 1rem;
  border-radius: 12px;
  flex: 1 1 0;
  max-width: 300px;
  cursor: pointer;
  transition: transform .3s;
}
.personajes > div:hover {
  transform: scale(1.05);
}
.personajes-img img {
  display: block;
  margin: 0 auto;
  max-width: 100%;
}
.personajes-estadisticas li {
  color: white;
  margin-bottom: .5rem;
}
.personajes-estadisticas li i {
  margin-right: 6px;
}

/* === COMBATE === */
#pantallaCombate {
  display: none;
}
#pantallaCombate.active {
  display: flex !important;
}
#imgHeroe, #imgEnemigo {
  display: block;
  margin: auto;
  max-height: 200px;
}

/* Slide‑in panels */
.slide-in-left, .slide-in-right {
  opacity: 0;
  transition: transform .6s ease-out, opacity .6s ease-out;
}
.slide-in-left {
  transform: translateX(-100%);
}
.slide-in-right {
  transform: translateX(100%);
}
.slide-in-left.visible, .slide-in-right.visible {
  transform: translateX(0);
  opacity: 1;
}

/* === POPUPS Y EFECTOS === */
.hit-blink {
  animation: blink .4s ease-in-out;
}
@keyframes blink {
  0%,100% { filter: brightness(1) }
  50%     { filter: brightness(3) }
}
.damage-popup,
.special-attack-popup,
.status-effect-popup {
  position: absolute;
  animation: float-up 1s forwards;
}
.damage-popup { font-size:1.5rem; color:#dc3545; }
.critical { color:#ffc107; font-size:2rem; text-shadow:0 0 5px rgba(255,193,7,.7); }
.special-attack-popup { font-size:1.2rem; color:#0dcaf0; animation-duration:1.5s; }
.status-effect-popup.text-info   { color:#0dcaf0; }
.status-effect-popup.text-warning{ color:#ffc107; }
@keyframes float-up {
  to { transform: translateY(-50px); opacity:0 }
}

/* Battle log */
#battleLog {
  background: rgba(0,0,0,.7);
  border: 1px solid #495057;
  border-radius: 5px;
  padding: 10px;
  max-height: 150px;
  overflow-y: auto;
}
#battleLog p {
  margin-bottom: 5px;
  font-size: .9rem;
}

/* === DIARIO / CONTENIDO FINAL === */
.diario-final {
  background: url("../img/hoja-textura.jpg") center/cover no-repeat;
  border: 8px solid #5e4b2c;
  border-radius: 8px;
  padding: 40px;
  color: #2e1c08;
  font-family: 'Comic Sans MS', cursive, serif;
  font-size: 18px;
  line-height: 1.8;
  max-width: 800px;
  margin: 30px auto;
  box-shadow: 0 0 30px rgba(0,0,0,.5);
}

/* === POSTER + CANVAS (Contraseña) === */
.poster {
  position: absolute; top:0; left:0;
  width: 100%; height:100%;
  background-size: cover;
  background-position: center;
  filter: blur(12px);
  transition: filter .6s ease;
  z-index: 1;
}
.canvas-wrap {
  position: absolute; top:0; left:0;
  z-index: 2;
  width: 100%; height:100%;
}
canvas {
  display: block;
  width: 100%; height:100%;
  pointer-events: none;
}

/* === CLAVES OBTENIDAS === */
.clave {
  font-size: 24px;
  font-weight: bold;
  padding: 10px;
  border-radius: 8px;
  margin: 5px auto;
  transition: all .3s ease;
  text-align: center;
}
.clave.obtenida {
  background-color: #28a745;
  color: #fff;
  box-shadow: 0 0 10px #28a745;
}
.clave.bloqueada {
  background-color: #444;
  color: #aaa;
  opacity: .5;
}


.fade-in {
  animation: fadeIn .6s ease-in;
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.9); }
  to   { opacity: 1; transform: scale(1); }
}
.personaje-seleccionado {
      border: 3px solid #0f0;
      box-shadow: 0 0 15px 5px rgba(0,255,0,0.5);
      transition: all .3s ease-in-out;
    }



