@font-face {
  font-family: "Poppins";
  src: url("/fonts/poppins-bold.woff") format("woff");
  font-weight: 700;
  font-display: swap;
}

:root {
  --primario: #5b3df5;
  --primario-oscuro: #4326d9;
  --acento: #ff5e8a;
  --amarillo: #ffc83d;
  --titulos: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --whatsapp: #1fa855;
  --fondo: #f5f3ff;
  --tarjeta: #ffffff;
  --texto: #1d1b2c;
  --suave: #6b6880;
  --borde: #e4e0f5;
  --radio: 18px;
  --sombra: 0 6px 24px rgba(67, 38, 217, 0.08);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--texto);
  background: var(--fondo);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; }
h1, h2, h3 { font-family: var(--titulos); font-weight: 700; line-height: 1.2; margin: 0.4em 0; letter-spacing: -0.01em; }
h1 { font-size: 1.7rem; }
h3 { font-size: 1.05rem; margin-top: 1.6em; }
button { font: inherit; cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.5; }
input {
  font: inherit; width: 100%; padding: 0.75em 0.9em;
  border: 2px solid var(--borde); border-radius: 12px; background: #fff;
}
input:focus { outline: none; border-color: var(--primario); }

.cabecera { padding: 1rem 1.25rem; }
.logo { display: inline-block; line-height: 0; }
.logo img { height: 34px; width: auto; }
.contenedor { width: 100%; max-width: 560px; margin: 0 auto; padding: 0 1rem 2rem; flex: 1; }
.pie { text-align: center; color: var(--suave); font-size: 0.85rem; padding: 1.5rem; }
.cargando { text-align: center; color: var(--suave); margin-top: 4rem; }

.portada { text-align: center; padding: 1.5rem 0.5rem; }
.portada h1 { font-size: 2.1rem; }
.portada h1 .signo { color: var(--acento); }

.tarjeta {
  background: var(--tarjeta); border-radius: var(--radio); box-shadow: var(--sombra);
  padding: 1.5rem; margin-bottom: 1rem;
}
.centrado { text-align: center; }
.suave { color: var(--suave); }
.pequeno { font-size: 0.85rem; }
.etiqueta {
  display: inline-block; background: #ece8ff; color: var(--primario-oscuro);
  padding: 0.25em 0.8em; border-radius: 999px; font-weight: 600; font-size: 0.9rem; margin: 0;
}
.emoji-grande { font-size: 3rem; margin: 0.3em 0 0; text-align: center; }

/* Juegos de la portada */
.juegos { display: grid; gap: 0.8rem; }
.juego {
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 1rem;
  text-align: left; padding: 1.2rem; border: 2px solid transparent; border-radius: var(--radio);
  background: var(--tarjeta); box-shadow: var(--sombra); transition: transform 0.15s, border-color 0.15s;
}
.juego:hover { transform: translateY(-2px); border-color: var(--primario); }
.juego-emoji { grid-row: span 2; font-size: 2.4rem; align-self: center; }
.juego-nombre { font-family: var(--titulos); font-weight: 700; font-size: 1.1rem; }
.juego-desc { color: var(--suave); font-size: 0.92rem; }

/* Formularios */
.campo { display: block; margin: 1.3rem 0; }
.campo > span, .campo .fila > span { display: block; font-weight: 600; margin-bottom: 0.5rem; }
.fila { display: flex; gap: 0.5rem; align-items: center; }
.fila.espaciada { justify-content: space-between; margin-top: 1rem; }
.fila.espaciada > span { margin: 0; }
.volver, .enlace {
  background: none; border: none; color: var(--primario); font-weight: 600; padding: 0.3em 0;
}

.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.7rem; }
.chips.centrados { justify-content: center; }
.chip {
  display: inline-flex; align-items: center; gap: 0.4em; background: #ece8ff; color: var(--primario-oscuro);
  border: 2px solid transparent; border-radius: 999px; padding: 0.35em 0.9em; font-weight: 600;
}
.chip button { background: none; border: none; color: inherit; font-size: 1.1em; padding: 0; line-height: 1; }
.chip.grande { font-size: 1.1rem; padding: 0.6em 1.2em; }
.chip.seleccionable:hover:not(:disabled), .chip.activo { border-color: var(--primario); }
.chip.activo { background: var(--primario); color: #fff; }

.segmentos { display: flex; background: #ece8ff; border-radius: 12px; padding: 4px; }
.segmentos button {
  flex: 1; border: none; background: none; padding: 0.55em; border-radius: 9px; font-weight: 600; color: var(--suave);
}
.segmentos button.activo { background: #fff; color: var(--primario-oscuro); box-shadow: 0 1px 4px rgba(0,0,0,0.08); }

.lista-preguntas {
  max-height: 340px; overflow-y: auto; border: 2px solid var(--borde); border-radius: 12px; padding: 0.3rem;
}
.pregunta-opcion { display: flex; gap: 0.6rem; align-items: flex-start; padding: 0.55rem; border-radius: 8px; }
.pregunta-opcion:hover { background: var(--fondo); }
.pregunta-opcion input { width: auto; margin-top: 0.25em; accent-color: var(--primario); }

/* Botones */
.boton {
  font-family: var(--titulos); letter-spacing: 0.01em;
  display: inline-block; text-align: center; text-decoration: none; border: none; border-radius: 14px;
  padding: 0.8em 1.3em; font-weight: 700; background: var(--primario); color: #fff; transition: background 0.15s;
}
.boton:hover:not(:disabled) { background: var(--primario-oscuro); }
.boton.secundario { background: #ece8ff; color: var(--primario-oscuro); }
.boton.whatsapp { background: var(--whatsapp); }
.boton.grande { display: block; width: 100%; font-size: 1.1rem; padding: 1em; margin-top: 1rem; }
.botones { display: grid; gap: 0.5rem; margin: 0.8rem 0; }

.enlace-caja {
  background: var(--fondo); border: 2px dashed var(--borde); border-radius: 12px; padding: 0.8rem;
  margin-top: 1rem; overflow-wrap: anywhere;
}

/* Votación */
.progreso { height: 8px; background: var(--borde); border-radius: 999px; overflow: hidden; }
.progreso > div { height: 100%; background: linear-gradient(90deg, var(--primario), var(--acento)); transition: width 0.3s; }
.pregunta { text-align: center; font-size: 1.4rem; margin: 0.5em 0 0.8em; }
.opciones { display: grid; gap: 0.6rem; margin: 1rem 0; }
.opcion {
  padding: 0.95em; border: 2px solid var(--borde); border-radius: 14px; background: #fff; font-weight: 600; font-size: 1.05rem;
  transition: border-color 0.15s, transform 0.1s;
}
.opcion:hover { border-color: var(--primario); }
.opcion:active { transform: scale(0.98); }
.opcion.activo { background: var(--primario); border-color: var(--primario); color: #fff; }

/* Espera */
.contador-grande { font-size: 1.3rem; }
.contador-grande strong { font-family: var(--titulos); font-size: 2.2rem; color: var(--primario); }
.panel-creador { margin-top: 1.5rem; padding-top: 1rem; border-top: 2px solid var(--borde); }

/* Resultados */
.resultado { text-align: center; }
.ganador {
  font-family: var(--titulos); font-size: 1.9rem; font-weight: 700; margin: 0.2em 0 0.8em;
  background: linear-gradient(90deg, var(--primario), var(--acento));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.barra { display: grid; grid-template-columns: 7.5em 1fr 2.5em; gap: 0.6rem; align-items: center; margin: 0.45rem 0; text-align: left; }
.barra-nombre { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.barra-fondo { height: 12px; background: var(--borde); border-radius: 999px; overflow: hidden; }
.barra-fondo > span { display: block; height: 100%; background: linear-gradient(90deg, var(--primario), var(--acento)); border-radius: 999px; }
.barra-num { text-align: right; font-weight: 700; color: var(--suave); }

/* Avisos */
.aviso {
  position: fixed; left: 50%; bottom: 1.5rem; transform: translateX(-50%); max-width: 90vw;
  background: var(--texto); color: #fff; padding: 0.8em 1.2em; border-radius: 12px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.2); z-index: 10;
}

/* Especial de Navidad */
.banner-navidad {
  display: flex; gap: 0.9rem; align-items: center; margin: 0 0 1rem; padding: 1rem 1.2rem;
  border-radius: var(--radio); color: #fff; font-size: 0.95rem; line-height: 1.4;
  background: linear-gradient(135deg, #1f8a5b, #c0392b);
}
.banner-navidad strong { font-family: var(--titulos); font-size: 1.05rem; }
.banner-emoji { font-size: 2.2rem; }
.interruptor {
  display: flex; gap: 0.6rem; align-items: center; margin: 1rem 0; padding: 0.8rem 1rem;
  background: #eef8f2; border-radius: 12px; font-weight: 600; cursor: pointer;
}
.interruptor input { width: auto; accent-color: #1f8a5b; transform: scale(1.2); }

/* Etiquetas pequeñas en la lista de preguntas */
.mini {
  display: inline-block; font-size: 0.72rem; font-weight: 700; padding: 0.1em 0.55em; margin-left: 0.3em;
  border-radius: 999px; background: var(--borde); color: var(--suave); vertical-align: middle;
}
.mini.navidad { background: #e3f4ea; color: #1f8a5b; }

/* Preguntas propias */
.lista-propias { display: grid; gap: 0.4rem; margin-top: 0.6rem; }
.propia {
  display: flex; justify-content: space-between; align-items: center; gap: 0.5rem;
  background: #fff4f7; border-radius: 10px; padding: 0.55rem 0.8rem;
}
.propia button { background: none; border: none; font-size: 1.2rem; color: var(--suave); }

/* "¿No estás en la lista?" */
.no-estoy { margin: 1rem auto 0; max-width: 360px; text-align: left; }
.no-estoy summary { cursor: pointer; color: var(--primario); font-weight: 600; text-align: center; }
.no-estoy .fila { margin-top: 0.7rem; }

.chip small { font-weight: 500; opacity: 0.7; }
.pie a { color: var(--suave); }
.centrado .enlace { display: inline-block; margin-top: 0.8rem; text-decoration: none; }

/* Páginas legales */
.legal { max-width: 760px; }
.legal h2 { font-size: 1.15rem; margin-top: 1.6em; }
.legal p, .legal li { line-height: 1.6; }
.legal a { color: var(--primario); }
.legal a.boton { color: #fff; margin-top: 1rem; }

/* Llamadas a la acción */
.crea-la-vuestra {
  text-align: center; color: #fff;
  background: linear-gradient(135deg, #5B3DF5 0%, #8B45E0 55%, #FF5E8A 100%);
}
.crea-la-vuestra p { opacity: 0.92; line-height: 1.5; }
.crea-la-vuestra .boton { background: #fff; color: var(--primario-oscuro); }
.crea-la-vuestra .boton:hover { background: #f1edff; }
.gala-lanzar {
  margin-top: 1rem; background: var(--texto); font-size: 1.05rem;
}
.gala-lanzar:hover:not(:disabled) { background: #000; }

/* ================== Modo gala ================== */
body.modo-gala {
  background: radial-gradient(circle at 50% 30%, #3a2b8f 0%, #1a1440 55%, #0e0b24 100%);
  color: #fff;
}
body.modo-gala .cabecera, body.modo-gala .pie { display: none; }
body.modo-gala .contenedor { max-width: 1100px; padding: 0 1.25rem; }
.gala { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.gala-barra { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1rem 0; }
.gala-mini {
  background: rgba(255,255,255,0.1); color: #fff; border: none; border-radius: 999px;
  padding: 0.45em 1em; font-size: 0.85rem; font-weight: 600;
}
.gala-mini:hover { background: rgba(255,255,255,0.2); }
.gala-progreso { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.gala-progreso i { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,0.2); }
.gala-progreso i.hecho { background: rgba(255,255,255,0.6); }
.gala-progreso i.actual { background: var(--amarillo); transform: scale(1.35); }
.gala-escena {
  flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center;
  text-align: center; padding: 1rem 0;
}
.gala-etiqueta {
  text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.85rem; font-weight: 700;
  color: var(--amarillo); margin: 0;
}
.gala-emoji { font-size: clamp(4rem, 12vw, 8rem); margin: 0.2em 0; line-height: 1; }
.gala-titulo { font-size: clamp(1.7rem, 4.5vw, 3.4rem); max-width: 24ch; margin: 0.2em auto; }
.gala-sub { font-size: clamp(1rem, 2vw, 1.4rem); opacity: 0.8; margin: 0.4em 0; }
.gala-suspense { font-family: var(--titulos); font-size: clamp(1.3rem, 3vw, 2.2rem); color: var(--amarillo); margin-top: 1em; }
.puntos i { font-style: normal; animation: parpadeo 1.2s infinite; opacity: 0; }
.puntos i:nth-child(2) { animation-delay: 0.2s; }
.puntos i:nth-child(3) { animation-delay: 0.4s; }
@keyframes parpadeo { 0%, 100% { opacity: 0; } 40% { opacity: 1; } }
.fase-redoble .gala-emoji { animation: latido 0.6s ease-in-out infinite; }
@keyframes latido { 50% { transform: scale(1.12); } }
.gala-ganador {
  font-family: var(--titulos); font-weight: 700; font-size: clamp(2.6rem, 9vw, 6rem); line-height: 1.05;
  margin: 0.3em 0 0.1em; color: var(--amarillo);
  animation: aparecer 0.7s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}
@keyframes aparecer { from { transform: scale(0.3); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.gala-barras { width: min(520px, 100%); margin-top: 1rem; animation: aparecer 0.6s 0.4s both; }
.gala-barras .barra-nombre, .gala-barras .barra-num { color: #fff; }
.gala-barras .barra-fondo { background: rgba(255,255,255,0.15); }
.gala-podio { display: grid; gap: 0.7rem; margin-top: 1.5rem; width: min(520px, 100%); }
.gala-puesto {
  display: flex; align-items: center; gap: 0.8rem; background: rgba(255,255,255,0.08);
  border-radius: 16px; padding: 0.9rem 1.2rem; font-size: clamp(1.1rem, 2.5vw, 1.6rem); opacity: 0;
}
.gala-puesto.visible { animation: aparecer 0.6s both; }
.gala-puesto strong { flex: 1; text-align: left; font-family: var(--titulos); }
.gala-num { color: var(--amarillo); font-weight: 700; }
.gala-pie { text-align: center; padding: 1rem 0 1.5rem; }
.gala-boton { max-width: 420px; margin: 0 auto; background: var(--amarillo); color: var(--texto); font-size: 1.2rem; }
.gala-boton:hover:not(:disabled) { background: #ffd666; }
.gala-ayuda { font-size: 0.8rem; opacity: 0.5; margin-top: 0.8rem; }
.gala-acciones { display: grid; gap: 0.6rem; width: min(420px, 100%); margin-top: 1.5rem; }
.gala-enlace { color: #fff; }
.confeti { position: fixed; inset: 0; pointer-events: none; z-index: 20; }
@media (hover: none) { .gala-ayuda { display: none; } }
