/* VARIABLES Y RESET */
:root {
  --primary: #4361ee;
  --secondary: #3f37c9;
  --success: #4cc9f0;
  --danger: #f72585;
  --dark: #212529;
  --light: #f8f9fa;
  --gray: #6c757d;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
  background: linear-gradient(135deg, #1a2a6c, #b21f1f, #1a2a6c);
  color: var(--light);
  min-height: 100vh;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-size: 400% 400%;
  animation: gradientBG 15s ease infinite;
}

@keyframes gradientBG {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* LOGO */
.logo-row {
  display: flex;
  gap: 20px;
  align-items: center;
  justify-content: flex-start;
  position: relative;
  width: 100%;
  margin-bottom: 20px;
}

.logo {
  position: static;
  width: 100px;
  height: auto;
  z-index: 10;
  transition: transform 0.3s ease;
}

.logo:hover {
  transform: scale(1.05);
}

.logo img {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

/* CABECERA */
.stats-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: 900px;
  margin: 20px 0 40px;
  padding: 15px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

h1 {
  font-size: 2.2rem;
  text-align: center;
  margin: 0 20px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
  background: linear-gradient(to right, #ff7e5f, #feb47b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

#vidas, #puntuacion {
  font-size: 1.5rem;
  font-weight: bold;
  min-width: 150px;
  text-align: center;
  padding: 8px 15px;
  border-radius: 50px;
  background: rgba(0, 0, 0, 0.3);
}

#vidas {
  color: #ff6b6b;
}

#puntuacion {
  color: #4cc9f0;
}

/* TEMPORIZADOR */
#tiempo {
  position: fixed;      /* Cambia absolute por fixed */
  top: 20px;
  right: 20px;
  font-size: 2rem;
  font-weight: bold;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  padding: 10px 20px;
  border-radius: 50px;
  z-index: 100;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

/* CONTENEDOR PRINCIPAL */
.contenedor {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin: 20px 0 40px;
  flex-wrap: wrap;
  perspective: 1000px;
}

.persona {
  cursor: pointer;
  text-align: center;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  transform-style: preserve-3d;
  position: relative;
}

.persona:hover {
  transform: translateY(-10px) scale(1.03);
}

.persona img {
  width: 220px;
  height: 200px; /* antes 220px */
  object-fit: cover;
  object-position: top;
  border-radius: 15px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
  border: 3px solid rgba(255, 255, 255, 0.2);
  transition: all 0.3s ease;
}

.persona p {
  font-size: 1.4rem;
  font-weight: bold;
  margin-top: 15px;
  color: white;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.persona.selected-correct {
  border-color: transparent;
}

.persona.selected-correct img {
  border: 3px solid #4ade80;
  box-shadow: 0 0 25px rgba(74, 222, 128, 0.6);
}

.persona.selected-wrong {
  border-color: transparent;
}

.persona.selected-wrong img {
  border: 3px solid #f87171;
  box-shadow: 0 0 25px rgba(248, 113, 113, 0.6);
}

/* CONTROLES */
.controls {
  margin: 20px 0;
}

button {
  background: linear-gradient(45deg, #4361ee, #3a0ca3);
  color: white;
  border: none;
  padding: 15px 40px;
  font-size: 1.2rem;
  font-weight: bold;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
  position: relative;
  overflow: hidden;
}

button:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

button:active {
  transform: translateY(1px);
}

button::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(45deg, #3a0ca3, #4361ee);
  z-index: -1;
  transition: opacity 0.3s ease;
  opacity: 0;
}

button:hover::after {
  opacity: 1;
}

/* RESULTADO */
#resultado {
  font-size: 1.8rem;
  font-weight: bold;
  text-align: center;
  margin: 30px 0;
  min-height: 80px;
  padding: 20px;
  border-radius: 15px;
  width: 100%;
  max-width: 600px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

#resultado.correct {
  color: #4ade80;
  background: rgba(74, 222, 128, 0.1);
}

#resultado.wrong {
  color: #f87171;
  background: rgba(248, 113, 113, 0.1);
}

#resultado.game-over {
  font-size: 2.5rem;
  padding: 30px;
  color: #ffd166;
  background: rgba(139, 0, 0, 0.3);
}

#boton-reinicio {
  margin-top: 25px;
  background: linear-gradient(45deg, #ff9e00, #ff5400);
  padding: 12px 35px;
  font-size: 1.1rem;
}

#boton-reinicio:hover {
  transform: scale(1.05);
}

/* ANIMACIONES */
@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

.pulse {
  animation: pulse 0.5s infinite;
}

/* RESPONSIVE */
@media (max-width: 768px) {
  .stats-container {
    flex-direction: column;
    gap: 15px;
  }
  
  h1 {
    font-size: 1.8rem;
    order: -1;
    width: 100%;
  }
  
  .contenedor {
    gap: 25px;
  }
  
  .persona img {
    width: 160px;
    height: 160px;
  }
  
  #tiempo {
    top: 120px;
    right: 50%;
    transform: translateX(50%);
    font-size: 1.6rem;
  }
  
  .logo {
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
  }
}

@media (max-width: 480px) {
  .contenedor {
    flex-direction: column;
    align-items: center;
  }
  
  .persona img {
    width: 200px;
    height: 200px;
  }
  
  #tiempo {
    top: 160px;
  }
  
  h1 {
    font-size: 1.5rem;
  }
  
  #resultado {
    font-size: 1.4rem;
  }
  
  #resultado.game-over {
    font-size: 1.8rem;
  }
}

.footer {
  width: 100vw;
  max-width: 100%;
  background: rgba(31, 41, 55, 0.7);
  color: #f8f9fa;
  text-align: center;
  padding: 18px 0 12px 0;
  font-size: 1.1rem;
  font-weight: 500;
  letter-spacing: 0.5px;
  border-top: 1px solid rgba(255,255,255,0.08);
  position: fixed;
  left: 0;
  bottom: 0;
  z-index: 100;
  display: flex;
  justify-content: center;
  gap: 10px;
  backdrop-filter: blur(6px);
}

@media (max-width: 600px) {
  .footer {
    font-size: 0.95rem;
    padding: 12px 0 8px 0;
    flex-direction: column;
    gap: 3px;
  }
}

/* ...existing code... */

@media (max-width: 768px) {
  .stats-container {
    flex-direction: column;
    gap: 15px;
    padding: 10px;
    margin: 10px 0 20px;
  }

  h1 {
    font-size: 1.3rem;
    margin: 10px 0;
    width: 100%;
    text-align: center;
  }

  .contenedor {
    gap: 18px;
    margin: 10px 0 20px;
  }

  .persona img {
    width: 120px;
    height: 120px;
  }

  #tiempo {
    top: 10px;
    right: 10px;
    font-size: 1.1rem;
    padding: 7px 14px;
  }

  .logo {
    width: 60px;
  }

  #vidas, #puntuacion {
    font-size: 1.1rem;
    min-width: 90px;
    padding: 6px 10px;
  }

  button, #boton-reinicio {
    padding: 10px 18px;
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  .contenedor {
    flex-direction: column;
    align-items: center;
    gap: 12px;
  }

  .persona img {
    width: 90vw;
    max-width: 180px;
    height: 90vw;
    max-height: 180px;
  }

  #tiempo {
    top: 5px;
    right: 5px;
    font-size: 1rem;
    padding: 5px 10px;
  }

  h1 {
    font-size: 1.1rem;
    margin: 8px 0;
  }

  #resultado {
    font-size: 1.1rem;
    padding: 10px;
    min-height: 40px;
  }

  #resultado.game-over {
    font-size: 1.3rem;
    padding: 15px;
  }

  .logo-row {
    gap: 10px;
    margin-bottom: 10px;
  }

  .logo {
    width: 40px;
  }

  .footer {
    font-size: 0.85rem;
    padding: 8px 0 6px 0;
    flex-direction: column;
    gap: 2px;
  }
}

