/*
  Estilo: colorido y neutral a la vez.
  Todos los partidos aportan su color por igual: burbujas de fondo, el título,
  la barra de progreso. En el resultado, cada partido aparece con el suyo.
*/
/* Fuentes alojadas en la propia web: no se conecta a Google (licencia en fuentes/LICENCIA-FUENTES.txt) */
@font-face {
  font-family: "Archivo";
  src: url("../fuentes/archivo.woff2") format("woff2-variations"), url("../fuentes/archivo.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("../fuentes/atkinson-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("../fuentes/atkinson-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@property --giro {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}

:root {
  --fondo: #F3F5F9;
  --papel: #FFFFFF;
  --tinta: #141B26;
  --tinta-suave: #556070;
  --linea: #D6DCE4;

  --pp: #1D84CE;
  --psoe: #E1001A;
  --vox: #5AC035;
  --fa: #D6006F;
  --podemos: #6C2A72;
  --salf: #F5A300;
  --arcoiris: linear-gradient(90deg, var(--pp), var(--psoe), var(--vox), var(--fa), var(--podemos), var(--salf));

  /* escala de respuesta (no usa colores de partido) */
  --si-mucho: #0B8F86;
  --si: #3DB8AE;
  --neutro: #8A94A3;
  --no: #F08A5D;
  --no-mucho: #D9532B;

  --display: "Archivo", system-ui, sans-serif;
  --texto: "Atkinson Hyperlegible", system-ui, sans-serif;
  --muelle: cubic-bezier(.34, 1.56, .64, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --fondo: #0E131A;
    --papel: #19212C;
    --tinta: #EDF0F4;
    --tinta-suave: #A9B3C0;
    --linea: #2E3846;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100svh;
  background: var(--fondo);
  color: var(--tinta);
  font-family: var(--texto);
  font-size: 1.0625rem;
  line-height: 1.55;
  overflow-x: hidden;
}

.columna {
  position: relative;
  max-width: 34rem;
  margin: 0 auto;
  padding: 2rem 1rem 4rem;
}

button { font: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--pp); outline-offset: 3px; }

/* ---------- Burbujas de fondo ---------- */
.burbujas {
  position: fixed; inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: -1;
  transition: opacity .6s ease;
}
.burbujas span {
  position: absolute;
  width: 46vmax; height: 46vmax;
  border-radius: 50%;
  filter: blur(70px);
  opacity: .28;
  animation: flotar 18s ease-in-out infinite alternate;
}
.burbujas span:nth-child(1) { background: var(--pp);      top: -18vmax; left: -14vmax; }
.burbujas span:nth-child(2) { background: var(--psoe);    top: -10vmax; right: -20vmax; animation-delay: -4s; }
.burbujas span:nth-child(3) { background: var(--vox);     top: 30vh;    left: -24vmax; animation-delay: -8s; }
.burbujas span:nth-child(4) { background: var(--fa);      top: 40vh;    right: -22vmax; animation-delay: -2s; }
.burbujas span:nth-child(5) { background: var(--podemos); bottom: -26vmax; left: 0;    animation-delay: -6s; }
.burbujas span:nth-child(6) { background: var(--salf);    bottom: -22vmax; right: -6vmax; animation-delay: -10s; }
@keyframes flotar {
  to { transform: translate(7vmax, -5vmax) scale(1.18); }
}
body:not([data-pantalla="portada"]) .burbujas { opacity: .45; }

#confeti {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 50;
}

/* ---------- Barra de progreso ---------- */
.progreso {
  position: fixed; inset: 0 0 auto 0;
  height: 6px;
  z-index: 10;
}
.progreso__barra {
  height: 100%;
  width: 0;
  background: var(--arcoiris);
  background-size: 100vw 100%;
  border-radius: 0 6px 6px 0;
  transition: width .5s var(--muelle);
}

/* ---------- Transiciones entre pantallas ---------- */
.pantalla { animation: aparecer .45s ease-out both; }
.pantalla.sale { animation: desaparecer .35s ease-in both; }
@keyframes aparecer { from { opacity: 0; transform: translateY(16px); } }
@keyframes desaparecer { to { opacity: 0; transform: scale(.94); } }

/* ---------- PORTADA ---------- */
.portada {
  min-height: calc(100svh - 6rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.chip {
  display: inline-block;
  margin: 0 0 1.5rem;
  padding: .35rem .9rem;
  border-radius: 999px;
  background: var(--papel);
  border: 1px solid var(--linea);
  font-weight: 700;
  font-size: .9rem;
  animation: aparecer .5s ease-out both;
}

.titulo {
  margin: 0 0 1.5rem;
  font-family: var(--display);
  font-weight: 900;
  line-height: .85;
}
.titulo__tu {
  display: block;
  font-stretch: 100%;
  font-size: clamp(2rem, 9vw, 2.8rem);
  animation: aparecer .5s .1s ease-out both;
}
.titulo__papeleta {
  display: block;
  font-stretch: 68%;
  font-size: clamp(3.6rem, 19vw, 8rem);
  white-space: nowrap;
  letter-spacing: -.02em;
}
.letra {
  display: inline-block;
  animation:
    caer .75s var(--muelle) both,
    ciclo 12s linear infinite;
  animation-delay: calc(var(--i) * 70ms + .15s), calc(var(--i) * -1.5s);
}
@keyframes caer {
  from { opacity: 0; transform: translateY(-140%) rotate(-14deg); }
}
@keyframes ciclo {
  0%, 100% { color: var(--pp); }
  16.6% { color: var(--psoe); }
  33.3% { color: var(--vox); }
  50% { color: var(--fa); }
  66.6% { color: var(--podemos); }
  83.3% { color: var(--salf); }
}
/* el "29N" cae como un sello de goma */
.titulo__sello {
  display: inline-block;
  margin-top: .6rem;
  padding: .1em .35em .05em;
  background: var(--tinta);
  color: var(--papel);
  border-radius: 8px;
  font-stretch: 80%;
  font-size: clamp(2.2rem, 10vw, 3.2rem);
  transform: rotate(-4deg);
  animation: sello .45s cubic-bezier(.5, 0, .75, 0) 1s both;
}
@keyframes sello {
  0% { opacity: 0; transform: scale(2.6) rotate(-14deg); }
  80% { opacity: 1; transform: scale(.94) rotate(-4deg); }
  100% { opacity: 1; transform: scale(1) rotate(-4deg); }
}
.portada.sellado .titulo { animation: temblor .25s ease-out; }
@keyframes temblor {
  25% { transform: translate(2px, 1px); }
  50% { transform: translate(-2px, -1px); }
  75% { transform: translate(1px, 0); }
}

.lema {
  max-width: 24rem;
  margin: 0 0 2rem;
  color: var(--tinta-suave);
  font-size: 1.1rem;
  animation: aparecer .5s 1.25s ease-out both;
}

.boton-empezar {
  position: relative;
  isolation: isolate;
  padding: 1.1rem 3.4rem;
  border: 0;
  border-radius: 999px;
  background: var(--tinta);
  color: var(--papel);
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.45rem;
  font-stretch: 90%;
  animation: brotar .6s var(--muelle) 1.45s both, latido 2.4s ease-in-out 2.2s infinite;
  transition: transform .15s ease;
}
/* borde arcoíris que gira */
.boton-empezar::before {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: inherit;
  background: conic-gradient(from var(--giro), var(--pp), var(--psoe), var(--vox), var(--fa), var(--podemos), var(--salf), var(--pp));
  z-index: -1;
  animation: girar 3s linear infinite;
}
.boton-empezar::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--tinta);
  z-index: -1;
}
.boton-empezar:hover { transform: scale(1.05); }
.boton-empezar:active { transform: scale(.95); }
@keyframes girar { to { --giro: 360deg; } }
@keyframes brotar { from { opacity: 0; transform: scale(.3); } }
@keyframes latido { 50% { transform: scale(1.05); } }

.cuenta {
  margin: 1.1rem 0 0;
  font-weight: 700;
  color: var(--tinta-suave);
  animation: aparecer .5s 1.7s ease-out both;
}

.garantias {
  list-style: none;
  padding: 0;
  margin: 2.5rem 0 1rem;
  display: grid;
  gap: .6rem;
  font-size: .95rem;
  color: var(--tinta-suave);
  animation: aparecer .5s 1.9s ease-out both;
}
.garantias strong { color: var(--tinta); }

.metodo {
  max-width: 28rem;
  text-align: left;
  color: var(--tinta-suave);
  font-size: .95rem;
  animation: aparecer .5s 2s ease-out both;
}
.metodo summary { cursor: pointer; font-weight: 700; color: var(--tinta); text-align: center; }

/* ---------- Botones generales ---------- */
.boton {
  display: block;
  width: 100%;
  padding: 1rem 1.25rem;
  border-radius: 14px;
  border: 2px solid var(--tinta);
  font-weight: 700;
  font-size: 1.05rem;
  transition: transform .12s ease;
}
.boton:active { transform: scale(.97); }
.boton--borde { background: var(--papel); }
.boton--color {
  background: var(--c, var(--tinta));
  color: var(--t, var(--papel));
  border-color: var(--c, var(--tinta));
}

.enlace {
  background: none; border: 0; padding: .25rem 0;
  color: var(--tinta-suave);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- TEST ---------- */
.cabecera-test {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: .75rem;
  min-height: 2rem;
}
.contador { color: var(--tinta-suave); font-weight: 700; }
#numero { display: inline-block; color: var(--tinta); }
#numero.salta { animation: saltar .35s var(--muelle); }
@keyframes saltar { 40% { transform: translateY(-6px) scale(1.25); } }

.tarjeta {
  position: relative;
  min-height: 15rem;
  display: flex;
  flex-direction: column;
  padding: 2rem 1.5rem 1.5rem;
  background: var(--papel);
  border-radius: 22px;
  box-shadow: 0 14px 34px -18px color-mix(in srgb, var(--c, #000) 70%, transparent);
  overflow: hidden;
  touch-action: pan-y;
  user-select: none;
  will-change: transform;
}
.tarjeta::before {
  content: "";
  position: absolute; inset: 0 0 auto 0;
  height: 8px;
  background: var(--c, var(--pp));
}
.tarjeta.entra { animation: entrar .45s var(--muelle) both; }
.tarjeta.sale-der { animation: salirDer .3s ease-in forwards; }
.tarjeta.sale-izq { animation: salirIzq .3s ease-in forwards; }
.tarjeta.sale-abajo { animation: salirAbajo .3s ease-in forwards; }
@keyframes entrar { from { opacity: 0; transform: translateY(40px) scale(.9) rotate(-2deg); } }
@keyframes salirDer { to { opacity: 0; transform: translateX(120%) rotate(14deg); } }
@keyframes salirIzq { to { opacity: 0; transform: translateX(-120%) rotate(-14deg); } }
@keyframes salirAbajo { to { opacity: 0; transform: translateY(60px) scale(.9); } }

.bloque {
  align-self: flex-start;
  margin: 0 0 .9rem;
  padding: .2rem .7rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--c, var(--pp)) 14%, transparent);
  color: color-mix(in srgb, var(--c, var(--pp)) 75%, var(--tinta));
  font-weight: 700;
  font-size: .9rem;
}

.pregunta {
  flex: 1;
  margin: 0;
  font-family: var(--display);
  font-stretch: 88%;
  font-weight: 700;
  font-size: clamp(1.5rem, 6vw, 1.9rem);
  line-height: 1.2;
  text-wrap: pretty;
}

.pista-deslizar {
  display: flex;
  justify-content: space-between;
  margin: 1.5rem 0 0;
  font-size: .85rem;
  font-weight: 700;
}
.pista-deslizar span:first-child { color: var(--no-mucho); }
.pista-deslizar span:last-child { color: var(--si-mucho); }
@media (hover: hover) { .pista-deslizar { display: none; } }

/* sello de color que asoma al deslizar */
.tarjeta[data-gesto="si"] { box-shadow: inset 0 0 0 4px var(--si-mucho); }
.tarjeta[data-gesto="no"] { box-shadow: inset 0 0 0 4px var(--no-mucho); }

/* ---------- Botones de respuesta: escala de círculos ----------
   Izquierda = en desacuerdo, derecha = de acuerdo (igual que al deslizar).
   Cuanto más grande el círculo, más fuerte la opinión. */
.respuestas {
  margin: 1.6rem 0 1.1rem;
}
.escala {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 .15rem;
  min-height: 72px;
}
.respuesta {
  --tam: 48px;
  position: relative;
  flex: none;
  width: var(--tam);
  height: var(--tam);
  padding: 0;
  border-radius: 50%;
  border: 3px solid var(--c);
  background: var(--papel);
  display: grid;
  place-items: center;
  box-shadow: 0 6px 16px -10px var(--c);
  transition: transform .28s var(--muelle), translate .2s ease-out;
}
.respuesta:nth-child(1) { --c: var(--no-mucho); --tam: 64px; --d: .08s; --o: 0; }
.respuesta:nth-child(2) { --c: var(--no);       --tam: 50px; --d: .04s; --o: 1; }
.respuesta:nth-child(3) { --c: var(--neutro);   --tam: 38px; --d: 0s;   --o: 2; }
.respuesta:nth-child(4) { --c: var(--si);       --tam: 50px; --d: .04s; --o: 3; }
.respuesta:nth-child(5) { --c: var(--si-mucho); --tam: 64px; --d: .08s; --o: 4; }

/* relleno de tinta que crece desde el centro */
.respuesta::before {
  content: "";
  position: absolute;
  inset: 2px;
  border-radius: 50%;
  background: var(--c);
  transform: scale(0);
  transition: transform .3s var(--muelle);
}
/* check del sello */
.respuesta::after {
  content: "";
  position: relative;
  width: 38%;
  height: 20%;
  margin-top: -8%;
  border-left: 3px solid #fff;
  border-bottom: 3px solid #fff;
  transform: rotate(-45deg) scale(0);
  transition: transform .25s var(--muelle) .08s;
}
.respuesta:nth-child(3)::after { border-width: 2.5px; }

.respuesta:hover { transform: scale(1.14) translateY(-3px); }
.respuesta:hover::before,
.respuesta:focus-visible::before { transform: scale(.5); }
.respuesta:active { transform: scale(.88); }

.respuestas .respuesta[aria-pressed="true"] {
  transform: scale(1.08);
  animation: sellar .34s var(--muelle), onda .7s ease-out;
}
.respuesta[aria-pressed="true"]::before { transform: scale(1.1); }
.respuesta[aria-pressed="true"]::after { transform: rotate(-45deg) scale(1); }

/* al cambiar de pregunta, los círculos brotan del centro hacia fuera */
.respuestas.nuevas .respuesta { animation: brotarCirculo .38s var(--muelle) both; animation-delay: var(--d); }
/* si tardas en contestar, una ola recorre la escala para invitarte a tocar */
.respuestas.invita .respuesta { animation: ola .9s ease-in-out both; animation-delay: calc(var(--o) * 80ms); }
/* la elección siempre manda sobre las otras animaciones */
.respuestas.nuevas .respuesta[aria-pressed="true"],
.respuestas.invita .respuesta[aria-pressed="true"] { animation: sellar .34s var(--muelle), onda .7s ease-out; }

@keyframes sellar {
  0% { transform: scale(1.6) rotate(-12deg); }
  60% { transform: scale(.86) rotate(2deg); }
  100% { transform: scale(1.08); }
}
@keyframes onda {
  from { box-shadow: 0 0 0 0 color-mix(in srgb, var(--c) 70%, transparent); }
  to { box-shadow: 0 0 0 22px transparent; }
}
@keyframes brotarCirculo {
  from { opacity: 0; transform: scale(.45); }
}
@keyframes ola {
  35% { transform: translateY(-9px) scale(1.12); }
  70% { transform: translateY(2px) scale(.97); }
}

/* textos debajo: extremos fijos y, en medio, la opción que señalas */
.extremos {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: baseline;
  gap: .5rem;
  margin-top: .7rem;
  font-size: .85rem;
  font-weight: 700;
}
.extremos__no { color: var(--no-mucho); }
.extremos__si { color: var(--si-mucho); text-align: right; }
.etiqueta {
  min-width: 8.5rem;
  text-align: center;
  font-family: var(--display);
  font-stretch: 85%;
  font-size: 1.05rem;
  font-weight: 800;
}
.etiqueta.cambia { animation: etiquetaEntra .25s var(--muelle); }
@keyframes etiquetaEntra { from { opacity: 0; transform: translateY(6px) scale(.9); } }

.acciones-test {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.interruptor {
  border: 2px dashed var(--salf);
  background: transparent;
  border-radius: 999px;
  padding: .45rem .95rem;
  font-size: .95rem;
  font-weight: 700;
  transition: transform .2s var(--muelle), background .2s ease;
}
.interruptor[aria-pressed="true"] {
  background: var(--salf);
  border-style: solid;
  color: #1E1400;
  transform: scale(1.06);
}
.interruptor[aria-pressed="true"]::before { content: "★ "; }

#ver-ya { animation: aparecer .4s ease-out both; }

/* ---------- RECUENTO ---------- */
.contando {
  min-height: calc(100svh - 8rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
}
.urna {
  position: relative;
  width: 160px;
  height: 190px;
}
.urna__caja {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 120px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--papel) 70%, transparent);
  border: 3px solid var(--tinta);
  backdrop-filter: blur(4px);
}
.urna__ranura {
  position: absolute;
  top: -3px; left: 50%;
  width: 70px; height: 8px;
  transform: translateX(-50%);
  background: var(--tinta);
  border-radius: 0 0 6px 6px;
}
.voto {
  position: absolute;
  left: 50%;
  top: 0;
  width: 54px; height: 68px;
  margin-left: -27px;
  border-radius: 4px;
  background: var(--c);
  opacity: 0;
  animation: votar 1.5s ease-in infinite;
}
.voto:nth-child(1) { --c: var(--pp); }
.voto:nth-child(2) { --c: var(--vox); animation-delay: .5s; }
.voto:nth-child(3) { --c: var(--fa);  animation-delay: 1s; }
@keyframes votar {
  0% { opacity: 0; transform: translateY(-40px) rotate(-8deg); }
  20% { opacity: 1; }
  60% { opacity: 1; transform: translateY(60px) rotate(0); }
  61%, 100% { opacity: 0; transform: translateY(80px); }
}
.contando__texto {
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.5rem;
  font-stretch: 85%;
  animation: respirar 1.2s ease-in-out infinite;
}
@keyframes respirar { 50% { opacity: .45; } }

/* ---------- RESULTADO ---------- */
.ganador {
  position: relative;
  overflow: hidden;
  padding: 1.75rem 1.5rem 1.6rem;
  border-radius: 26px;
  background: var(--c, var(--tinta));
  color: var(--t, #fff);
  text-align: center;
  box-shadow: 0 24px 50px -24px var(--c, #000);
  animation: estallar .7s var(--muelle) both;
}
/* brillo que cruza la tarjeta una vez */
.ganador::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 35%, rgba(255,255,255,.45) 50%, transparent 65%);
  transform: translateX(-120%);
  animation: brillo 1.1s ease-out .9s forwards;
}
@keyframes estallar { from { opacity: 0; transform: scale(.6) rotate(-3deg); } }
@keyframes brillo { to { transform: translateX(120%); } }

.ganador__etiqueta { margin: 0; font-weight: 700; opacity: .85; }
.ganador__pct {
  margin: .2rem 0 0;
  font-family: var(--display);
  font-weight: 900;
  font-stretch: 70%;
  font-size: clamp(5rem, 26vw, 7.5rem);
  line-height: .95;
  font-variant-numeric: tabular-nums;
}
.ganador__nombre {
  margin: .1rem 0 .2rem;
  font-family: var(--display);
  font-weight: 850;
  font-stretch: 80%;
  font-size: clamp(2rem, 9vw, 2.8rem);
  line-height: 1;
}
.ganador__candidato { margin: 0; opacity: .85; }

.panel {
  margin-top: 1rem;
  padding: 1.4rem 1.25rem;
  background: var(--papel);
  border-radius: 22px;
}
.resumen { margin: 0 0 1.1rem; color: var(--tinta-suave); }

.escrutinio {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: .95rem;
}
.fila {
  display: grid;
  grid-template-columns: 1fr auto;
  row-gap: .35rem;
  align-items: baseline;
  animation: aparecer .4s ease-out both;
  animation-delay: calc(var(--i) * .12s + .3s);
}
.fila__nombre { font-weight: 700; display: flex; align-items: center; gap: .5rem; }
.fila__nombre::before {
  content: "";
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--c);
}
.fila__candidato { color: var(--tinta-suave); font-weight: 400; font-size: .88rem; }
.fila__pct {
  font-family: var(--display);
  font-stretch: 75%;
  font-weight: 800;
  font-size: 1.35rem;
  font-variant-numeric: tabular-nums;
}
.fila__carril {
  display: block;
  grid-column: 1 / -1;
  height: 12px;
  background: var(--fondo);
  border-radius: 99px;
  overflow: hidden;
}
.fila__barra {
  display: block;
  height: 100%;
  width: 0;
  background: var(--c);
  border-radius: 99px;
  transition: width 1.1s cubic-bezier(.2, .8, .2, 1);
}

.compartir {
  display: grid;
  gap: .6rem;
  margin: 1.25rem 0 2rem;
}

.detalle h3 {
  font-family: var(--display);
  font-stretch: 88%;
  font-size: 1.25rem;
  margin: 1.5rem 0 .5rem;
}
.lista-temas { padding-left: 1.2rem; margin: 0; color: var(--tinta-suave); }
.lista-temas li { margin-bottom: .6rem; }
.lista-temas small { display: block; font-weight: 700; font-size: .85rem; color: var(--tinta); }

.anuncio {
  margin: 2.5rem 0 1.5rem;
  min-height: 120px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--linea);
  border-radius: 14px;
  color: var(--tinta-suave);
  font-size: .85rem;
}
.aviso { font-size: .9rem; color: var(--tinta-suave); text-align: center; }

/* ---------- ELEGIR NIVEL ---------- */
.nivel {
  min-height: calc(100svh - 6rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.nivel__titulo {
  margin: 0 0 .5rem;
  font-family: var(--display);
  font-stretch: 75%;
  font-weight: 900;
  font-size: clamp(2.2rem, 10vw, 3rem);
  line-height: 1;
  text-wrap: balance;
}
.nivel__sub { margin: 0 0 1.5rem; color: var(--tinta-suave); }
.niveles { display: grid; gap: .75rem; }
.nivel-op {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  width: 100%;
  min-height: 88px;
  padding: 1rem 1.2rem;
  text-align: left;
  background: var(--papel);
  border: 2px solid transparent;
  border-radius: 20px;
  box-shadow: 0 10px 26px -20px #000;
  transition: transform .25s var(--muelle), border-color .2s ease;
  animation: aparecer .45s var(--muelle) both;
}
.nivel-op:nth-child(1) { animation-delay: .05s; --n: 1; }
.nivel-op:nth-child(2) { animation-delay: .15s; --n: 2; }
.nivel-op:nth-child(3) { animation-delay: .25s; --n: 3; }
.nivel-op__texto { display: grid; gap: .2rem; }
.nivel-op__nombre {
  font-family: var(--display);
  font-stretch: 85%;
  font-weight: 800;
  font-size: 1.35rem;
  line-height: 1.1;
}
.nivel-op__desc { color: var(--tinta-suave); font-size: .95rem; line-height: 1.4; }

/* barras tipo cobertura: 1, 2 o 3 encendidas */
.nivel-op__barras {
  flex: none;
  display: flex;
  align-items: flex-end;
  gap: 4px;
  width: 34px;
  height: 30px;
}
.nivel-op__barras i {
  flex: 1;
  border-radius: 3px;
  background: var(--linea);
  transition: transform .3s var(--muelle);
}
.nivel-op__barras i:nth-child(1) { height: 40%; }
.nivel-op__barras i:nth-child(2) { height: 70%; }
.nivel-op__barras i:nth-child(3) { height: 100%; }
.nivel-op:nth-child(1) .nivel-op__barras i:nth-child(-n+1),
.nivel-op:nth-child(2) .nivel-op__barras i:nth-child(-n+2),
.nivel-op:nth-child(3) .nivel-op__barras i:nth-child(-n+3) {
  background: var(--tinta);
}
@media (hover: hover) {
  .nivel-op:hover { transform: translateY(-3px) scale(1.015); border-color: var(--tinta); }
  .nivel-op:hover .nivel-op__barras i { transform: scaleY(1.12); }
}
.nivel-op:active { transform: scale(.97); }
.nivel-op[aria-pressed="true"] {
  border-color: var(--tinta);
  animation: pulso .35s var(--muelle);
}

/* explicación corta en el nivel fácil */
.ayuda {
  margin: 1rem 0 0;
  padding: .6rem .8rem;
  border-radius: 12px;
  background: color-mix(in srgb, var(--c, var(--pp)) 10%, transparent);
  color: var(--tinta);
  font-size: .95rem;
  line-height: 1.45;
}
.ayuda::before { content: "Qué significa: "; font-weight: 700; }

/* ==========================================================
   AJUSTES PARA MÓVIL
   ========================================================== */

/* sin retraso de 300 ms ni zoom por doble toque al pulsar */
button, .tarjeta { touch-action: manipulation; }
.tarjeta { touch-action: pan-y; }

/* fondo: degradados en vez de desenfoque, mucho más ligero para el móvil */
.burbujas span { filter: none; opacity: .38; }
.burbujas span:nth-child(1) { background: radial-gradient(closest-side, var(--pp), transparent); }
.burbujas span:nth-child(2) { background: radial-gradient(closest-side, var(--psoe), transparent); }
.burbujas span:nth-child(3) { background: radial-gradient(closest-side, var(--vox), transparent); }
.burbujas span:nth-child(4) { background: radial-gradient(closest-side, var(--fa), transparent); }
.burbujas span:nth-child(5) { background: radial-gradient(closest-side, var(--podemos), transparent); }
.burbujas span:nth-child(6) { background: radial-gradient(closest-side, var(--salf), transparent); }
.urna__caja { backdrop-filter: none; }

/* círculos con zona de toque de 44 px como mínimo, y que encojan en pantallas muy estrechas */
.respuesta:nth-child(1), .respuesta:nth-child(5) { --tam: clamp(56px, 17vw, 66px); }
.respuesta:nth-child(2), .respuesta:nth-child(4) { --tam: clamp(48px, 14vw, 52px); }
.respuesta:nth-child(3) { --tam: 44px; }

/* en táctil no hay "pasar el ratón": que el efecto no se quede pegado tras tocar */
@media (hover: none) {
  .respuesta:not([aria-pressed="true"]):hover { transform: none; }
  .respuesta:not([aria-pressed="true"]):hover::before { transform: scale(0); }
  .boton-empezar:hover { transform: none; }
}

/* textos de la escala: extremos en una línea y la opción señalada debajo */
.extremos {
  grid-template-columns: 1fr 1fr;
  grid-template-areas: "no si" "et et";
  row-gap: .3rem;
}
.extremos__no { grid-area: no; white-space: nowrap; }
.extremos__si { grid-area: si; white-space: nowrap; }
.etiqueta { grid-area: et; min-width: 0; min-height: 1.45em; }

/* enlaces y botón de "importa mucho" fáciles de tocar, sin partirse en dos líneas */
.enlace { min-height: 44px; padding: .5rem .25rem; }
.interruptor { min-height: 44px; white-space: nowrap; }
.acciones-test { flex-wrap: wrap; row-gap: .25rem; }
#saltar { white-space: nowrap; }

/* nombre del partido y candidato: si no caben, el candidato baja entero a la línea de abajo */
.fila__nombre { flex-wrap: wrap; column-gap: .5rem; row-gap: 0; white-space: nowrap; min-width: 0; }
.fila__candidato { white-space: nowrap; }

@media (max-width: 380px) {
  .columna { padding-left: .75rem; padding-right: .75rem; }
  .interruptor { font-size: .85rem; padding: .4rem .7rem; }
  #saltar { font-size: .9rem; }
  .acciones-test { gap: .5rem; }
}
@media (max-width: 340px) {
  .tarjeta { padding: 1.75rem 1.2rem 1.25rem; min-height: 13rem; }
  .pregunta { font-size: 1.4rem; }
  .fila__candidato { font-size: .8rem; }
}

/* móvil en horizontal: todo más compacto para que quepa sin bajar */
@media (orientation: landscape) and (max-height: 500px) {
  .columna { max-width: 40rem; padding-top: 1.25rem; padding-bottom: 2rem; }
  .portada { min-height: auto; padding: .5rem 0 1rem; }
  .chip { margin-bottom: .75rem; }
  .titulo { margin-bottom: .75rem; }
  .titulo__tu { font-size: 1.6rem; }
  .titulo__papeleta { font-size: min(7rem, 22vh); }
  .titulo__sello { font-size: 1.8rem; margin-top: .3rem; }
  .lema { margin-bottom: 1rem; }
  .cabecera-test { margin-bottom: .4rem; }
  .tarjeta { min-height: 0; padding: 1.4rem 1.25rem 1rem; }
  .pregunta { font-size: 1.3rem; }
  .pista-deslizar { display: none; }
  .respuestas { margin: .8rem 0 .6rem; }
  .escala { min-height: 0; }
  .contando { min-height: calc(100svh - 3rem); }
}

/* ---------- Páginas de texto (método, privacidad, aviso legal) ---------- */
.volver {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-bottom: 1rem;
  color: var(--tinta-suave);
  font-weight: 700;
}
.texto-legal {
  padding: 1.75rem 1.4rem;
  background: var(--papel);
  border-radius: 22px;
}
.texto-legal h1 {
  margin: 0 0 1rem;
  font-family: var(--display);
  font-stretch: 80%;
  font-weight: 850;
  font-size: clamp(2rem, 8vw, 2.6rem);
  line-height: 1.05;
}
.texto-legal h2 {
  margin: 1.75rem 0 .4rem;
  font-family: var(--display);
  font-stretch: 88%;
  font-size: 1.2rem;
}
.texto-legal p, .texto-legal li { color: var(--tinta-suave); }
.texto-legal a { color: var(--tinta); text-underline-offset: 3px; }
.texto-legal .entrada { font-size: 1.1rem; color: var(--tinta); }
.texto-legal .fecha-legal { margin-top: 2rem; font-size: .9rem; }

.pie {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .25rem 1.25rem;
  margin-top: 1.5rem;
  font-size: .9rem;
}
.portada .pie { animation: aparecer .5s 2.1s ease-out both; }
.pie a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--tinta-suave);
  text-underline-offset: 3px;
}

/* ---------- Movimiento reducido ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0s !important;
    transition-duration: .01ms !important;
  }
}
