/* --- FUENTES --- */
@import url("https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;800&display=swap");

/* --- VARIABLES GLOBALES (TEMA DARK PREMIUM) --- */
:root {
  --bg-color: #020617; /* Negro azulado profundo */
  --card-bg: #1e293b; /* Gris azulado para tarjetas */
  --primary: #8b5cf6; /* Violeta vibrante */
  --accent: #f472b6; /* Rosa pastel para detalles */
  --text-main: #f8fafc; /* Blanco casi puro */
  --text-muted: #94a3b8; /* Gris claro */
  --shadow-soft: 0 10px 40px -10px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 20px rgba(139, 92, 246, 0.3);
}

/* --- RESET BÁSICO --- */
* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

/* --- ESTILOS GENERALES --- */
body {
  background-color: var(--bg-color);
  color: var(--text-main);
  font-family: "Outfit", sans-serif;
  margin: 0;
  padding: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* --- BARRA DE PROGRESO --- */
.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 5px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  width: 0%;
  transition: width 0.4s ease-out;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(139, 92, 246, 0.5);
}

/* --- NAVBAR Y LOGO --- */
.navbar {
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.logo-img {
  height: 70px;
  width: auto;
  display: block;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  filter: drop-shadow(0 0 10px rgba(139, 92, 246, 0.3));
}

.logo-img:hover {
  transform: scale(1.1);
}

/* --- CONTENEDOR DEL JUEGO --- */
#game-container {
  flex-grow: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 15px;
  position: relative;
  width: 100%;
  max-width: 100%;
}

/* --- PANTALLAS (TRANSICIONES BASE) --- */
.screen {
  position: absolute;
  width: 100%;

  /* ANCHO CORREGIDO PARA PC */
  max-width: 800px;

  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  opacity: 0;
  pointer-events: none;

  /* Animación base (salto suave) */
  transform: translateY(15px) scale(0.98);
  /* Tiempo de transición para efectos suaves */
  transition: all 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}

.screen.active {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0) scale(1);
  position: relative;
}

/* --- TIPOGRAFÍA --- */
h1 {
  font-size: 2rem;
  margin-bottom: 0.8rem;
  font-weight: 800;
  color: #fff;
  /* Brillo en lugar de gradiente para no romper emojis */
  text-shadow: 0 0 20px rgba(167, 139, 250, 0.6);
  line-height: 1.1;
}

h2 {
  font-size: 1.5rem;
  color: var(--text-main);
  margin-bottom: 1.2rem;
  line-height: 1.3;
}

p {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.5;
  margin-bottom: 1.5rem;
}

/* --- ESTILOS DE LA HOME (PORTADA) --- */
.hero {
  text-align: center;
  padding: 2rem 1rem;
  max-width: 800px;
  margin: 0 auto;
}

.hero h1 {
  font-size: 2.5rem;
}

/* --- GALERÍA DE TESTS --- */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  max-width: 1200px;
  margin: 0 auto 4rem auto;
  padding: 0 1.5rem;
  width: 100%;
}

/* --- IMÁGENES --- */
.cover-img,
.q-image,
.card-img {
  width: 100%;
  height: auto;
  object-fit: cover;
  border-radius: 16px;
  box-shadow: var(--shadow-soft);
}

.cover-img,
.q-image {
  /* Altura aumentada para el nuevo ancho de 800px */
  max-height: 400px;
  aspect-ratio: 16/9;
  border: 1px solid rgba(255, 255, 255, 0.05);
  margin-bottom: 1.2rem;
}

/* --- TARJETAS --- */
.test-card,
.question-card {
  background: var(--card-bg);
  border-radius: 20px;
  overflow: hidden;
  text-decoration: none;
  color: white;
  transition: all 0.3s ease;
  border: 1px solid #334155;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-soft);
}

.question-card {
  padding: 2rem; /* Más espacio interno */
  width: 100%;
}

.test-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(139, 92, 246, 0.15);
  border-color: var(--primary);
}

.card-img-container {
  width: 100%;
  height: 180px;
  background: #0f172a;
  position: relative;
  overflow: hidden;
}

.card-img {
  height: 100%;
  border-radius: 0;
  transition: transform 0.5s;
}

.test-card:hover .card-img {
  transform: scale(1.05);
}

.no-img {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #334155;
  background: #0f172a;
}

.card-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.card-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text-main);
}

.card-desc {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.5;
  margin-bottom: 1.5rem;
  flex-grow: 1;
}

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid #334155;
  padding-top: 1rem;
  margin-top: auto;
}

.badge {
  font-size: 0.8rem;
  color: #2dd4bf;
  display: flex;
  align-items: center;
  gap: 5px;
}

/* --- BOTONES --- */
.options-grid {
  display: flex;
  flex-direction: column;
  gap: 15px; /* Más separación */
  width: 100%;
}

.option-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid #334155;
  color: var(--text-main);
  padding: 18px 24px; /* Botones más grandes */
  border-radius: 14px;
  cursor: pointer;
  font-size: 1.1rem;
  font-weight: 500;
  text-align: left;
  transition: all 0.2s ease;
  font-family: "Outfit", sans-serif;
}

.option-btn:active,
.option-btn:hover {
  background: var(--primary);
  border-color: var(--primary);
  transform: scale(0.98);
  box-shadow: var(--shadow-glow);
}

.btn-primary,
.btn-play {
  background: var(--primary);
  color: white;
  border: none;
  font-weight: 700;
  cursor: pointer;
  text-transform: uppercase;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  padding: 16px 0;
  width: 100%;
  max-width: 320px;
  font-size: 1.1rem;
  border-radius: 50px;
  box-shadow: var(--shadow-glow);
  margin-top: 10px;
  transition: transform 0.2s;
}

.btn-primary:active {
  transform: scale(0.95);
}

.btn-play {
  padding: 8px 20px;
  border-radius: 50px;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
}

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 4rem;
  color: var(--text-muted);
}

/* --- SOCIAL --- */
.share-area {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  width: 100%;
}

.share-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  width: 100%;
}

.btn-social {
  padding: 14px;
  border-radius: 12px;
  color: white;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  transition: filter 0.2s;
  min-width: 150px;
}

.btn-wa {
  background-color: #25d366;
}
.btn-fb {
  background-color: #1877f2;
}

/* --- SEO CONTENT --- */
.short-desc {
  font-size: 1.2rem;
  color: var(--text-main);
  font-weight: 500;
  margin-bottom: 2rem;
}

.seo-content {
  text-align: left;
  background: rgba(255, 255, 255, 0.03);
  padding: 2rem;
  border-radius: 16px;
  margin-bottom: 2rem;
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.8;
  border: 1px solid rgba(255, 255, 255, 0.05);
  width: 100%;
}

.seo-content h2,
.seo-content h3 {
  color: var(--primary);
  margin-top: 2rem;
  margin-bottom: 1rem;
  font-size: 1.5rem;
  font-weight: 700;
}

.seo-content p {
  margin-bottom: 1.2rem;
}

.seo-content ul,
.seo-content ol {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
  text-align: left;
}

.seo-content li {
  margin-bottom: 0.5rem;
}

.seo-content a {
  color: var(--accent);
  text-decoration: underline;
  font-weight: bold;
}

.seo-content a:hover {
  color: var(--text-main);
}

.seo-content strong {
  color: var(--text-main);
}

/* --- MEDIA QUERIES (ESCRITORIO) --- */
@media (min-width: 768px) {
  .logo-img {
    height: 120px;
  }
  h1 {
    font-size: 3.5rem;
  }
  .hero h1 {
    font-size: 4rem;
  }
  h2 {
    font-size: 2rem;
  }
  .navbar {
    padding: 2.5rem;
  }
  .question-card {
    padding: 3rem;
  }

  /* GRID DE RESPUESTAS EN 2 COLUMNAS EN PC */
  .options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
  }

  .share-grid {
    flex-direction: row;
    justify-content: center;
  }
  .option-btn:hover {
    transform: translateY(-3px);
  }
}

/* =========================================
   ESTILOS PARA RESULTADO (HTML DEL CMS)
   ========================================= */
.result-rich-text {
  text-align: justify;
  line-height: 1.8;
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-top: 20px;
}
.result-rich-text p {
  margin-bottom: 1.2rem;
  color: var(--text-muted);
}
.result-rich-text strong {
  color: var(--text-main);
  font-weight: 700;
}
.result-rich-text h3,
.result-rich-text h4 {
  color: var(--primary);
  margin-top: 1.5rem;
  margin-bottom: 0.8rem;
}
.result-rich-text ul,
.result-rich-text ol {
  margin-left: 20px;
  margin-bottom: 1.2rem;
  text-align: left;
  color: var(--text-muted);
}
.result-rich-text li {
  margin-bottom: 0.5rem;
}
.result-rich-text a {
  color: var(--accent);
  text-decoration: underline;
}

/* =========================================
   ANIMACIONES DE TRANSICIÓN (EFECTOS VISUALES)
   ========================================= */
/* IMPORTANTE: !important asegura que estas reglas ganen a la base */

/* 1. FADE IN */
.screen.effect-fade {
  transform: none !important;
  opacity: 0;
}
.screen.effect-fade.active {
  opacity: 1;
}

/* 2. ZOOM IN */
.screen.effect-zoom {
  transform: scale(0.5) !important;
  opacity: 0;
}
.screen.effect-zoom.active {
  transform: scale(1) !important;
  opacity: 1;
}

/* 3. DESLIZAR IZQUIERDA */
.screen.effect-slide-left {
  transform: translateX(100%) !important;
  opacity: 0;
}
.screen.effect-slide-left.active {
  transform: translateX(0) !important;
  opacity: 1;
}

/* 4. DESLIZAR DERECHA */
.screen.effect-slide-right {
  transform: translateX(-100%) !important;
  opacity: 0;
}
.screen.effect-slide-right.active {
  transform: translateX(0) !important;
  opacity: 1;
}
