/* Supergimnastas y las tablas mágicas. Estilos propios, sin recursos externos. */

:root {
  --tinta: #2a1a4a;
  --fondo: #fff5fa;
  --blanco: #ffffff;
  --rosa: #c81e6f;
  --morado: #5f2aa8;
  --azul: #145fb3;
  --verde: #0f7352;
  --naranja: #b84a08;
  --amarillo: #ffd23f;
  --rojo: #b3202f;
  --sombra: 0 6px 0 rgba(42, 26, 74, 0.25);
  --letra: ui-rounded, "Arial Rounded MT Bold", "Trebuchet MS", "Verdana", sans-serif;
}

* { box-sizing: border-box; }

html { font-size: 18px; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--letra);
  color: var(--tinta);
  background: var(--fondo);
  background-image:
    radial-gradient(circle at 12% 18%, #ffe0ef 0 90px, transparent 91px),
    radial-gradient(circle at 88% 82%, #e4dcff 0 120px, transparent 121px),
    radial-gradient(circle at 80% 12%, #fff1bd 0 70px, transparent 71px);
  background-attachment: fixed;
  -webkit-tap-highlight-color: transparent;
}

h1, h2, h3, p { margin: 0; }

[hidden] { display: none !important; }

/* Pantallas */

.pantalla {
  display: none;
  min-height: 100vh;
  padding: 72px 16px 24px;
  max-width: 900px;
  margin: 0 auto;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  text-align: center;
  position: relative;
}

.pantalla.activa { display: flex; }

.titulo {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.titulo-1 {
  font-size: clamp(2.4rem, 9vw, 4.6rem);
  color: var(--rosa);
  text-shadow: 3px 3px 0 var(--amarillo);
  letter-spacing: 1px;
}

.titulo-2 {
  font-size: clamp(1.5rem, 5.5vw, 2.6rem);
  color: var(--morado);
}

.subtitulo {
  font-size: clamp(1.8rem, 6vw, 3rem);
  color: var(--morado);
}

.lema {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--azul);
}

.paso {
  font-size: 1.4rem;
  margin-bottom: 10px;
  color: var(--tinta);
}

.pista { font-size: 1.1rem; margin: 6px 0; }

.texto-grande { font-size: 1.5rem; font-weight: bold; margin: 6px 0; }

.record { font-size: 1.2rem; font-weight: bold; color: var(--naranja); }

.pie { margin-top: auto; padding-top: 20px; font-size: 0.85rem; color: #4a3a6a; }

.sin-js { text-align: center; font-size: 1.3rem; padding: 20px; }

.tarjeta {
  width: 100%;
  background: var(--blanco);
  border: 4px solid var(--tinta);
  border-radius: 22px;
  padding: 16px;
  box-shadow: var(--sombra);
}

.ayuda ol {
  margin: 0;
  padding-left: 1.4em;
  text-align: left;
  font-size: 1.25rem;
  line-height: 1.5;
}

/* Botones */

.btn {
  font-family: inherit;
  font-size: 1.3rem;
  font-weight: bold;
  color: var(--tinta);
  background: var(--blanco);
  border: 4px solid var(--tinta);
  border-radius: 18px;
  padding: 12px 24px;
  min-height: 60px;
  cursor: pointer;
  box-shadow: var(--sombra);
  transition: transform 0.08s ease, box-shadow 0.08s ease;
  touch-action: manipulation;
}

.btn:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 2px 0 rgba(42, 26, 74, 0.25); }

.btn:focus-visible,
.opcion:focus-visible,
.tabla:focus-visible,
.carta-gimnasta:focus-visible,
.btn-sonido:focus-visible {
  outline: 5px solid var(--amarillo);
  outline-offset: 3px;
}

.btn-principal { background: var(--morado); color: var(--blanco); }
.btn-secundario { background: var(--blanco); color: var(--tinta); }
.btn-enorme { font-size: 1.9rem; padding: 16px 44px; min-height: 80px; }

.btn:disabled { background: #d8d3e2; color: #5a5270; cursor: not-allowed; box-shadow: none; }

.botones {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
  align-items: center;
}

.btn-sonido {
  position: fixed;
  top: 10px;
  right: 10px;
  z-index: 50;
  font-family: inherit;
  font-size: 1rem;
  font-weight: bold;
  color: var(--tinta);
  background: var(--amarillo);
  border: 3px solid var(--tinta);
  border-radius: 999px;
  padding: 8px 16px;
  min-height: 48px;
  cursor: pointer;
}

/* Desfile de la pantalla de inicio */

.desfile {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: clamp(4px, 3vw, 28px);
  width: 100%;
  height: clamp(150px, 30vh, 240px);
}

.desfile .figura { height: 100%; animation: bote 1.2s ease-in-out infinite; }
.desfile .figura:nth-child(2) { animation-delay: 0.3s; }
.desfile .figura:nth-child(3) { animation-delay: 0.6s; }
.desfile .figura:nth-child(4) { animation-delay: 0.9s; }
.desfile svg, .gimnasta svg, .carta-gimnasta svg, .final-dibujo svg { height: 100%; width: auto; display: block; overflow: visible; }

/* Selector de gimnasta */

.lista-gimnastas {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.carta-gimnasta {
  font-family: inherit;
  color: var(--tinta);
  background: #f6f1ff;
  border: 4px solid #b9a9d9;
  border-radius: 18px;
  padding: 8px 4px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-height: 150px;
}

.carta-gimnasta .figura { height: 110px; }
.carta-gimnasta .nombre { font-size: 1.25rem; font-weight: bold; }
.carta-gimnasta .aparato { font-size: 1rem; }

.carta-gimnasta[aria-checked="true"] {
  background: #fff3c4;
  border-color: var(--tinta);
  box-shadow: var(--sombra);
  transform: translateY(-4px);
}

.carta-gimnasta[aria-checked="true"] .nombre::after { content: " ✓"; color: var(--verde); }

/* Selector de tablas */

.lista-tablas {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin: 10px 0 14px;
}

.tabla {
  font-family: inherit;
  font-size: 1.8rem;
  font-weight: bold;
  color: var(--tinta);
  background: var(--blanco);
  border: 4px solid #8f82ad;
  border-radius: 16px;
  min-height: 68px;
  cursor: pointer;
  touch-action: manipulation;
}

.tabla small { display: block; font-size: 0.8rem; font-weight: normal; }

.tabla[aria-pressed="true"] {
  background: var(--rosa);
  color: var(--blanco);
  border-color: var(--tinta);
  box-shadow: var(--sombra);
}

.btn-todas[aria-pressed="true"] { background: var(--rosa); color: var(--blanco); }

/* Pantalla de juego */

.pantalla-juego {
  height: 100vh;
  height: 100dvh;
  min-height: 560px;
  max-width: 1000px;
  padding: 66px 10px 10px;
  gap: 8px;
  align-items: stretch;
}

.marcador {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  align-items: stretch;
}

.ficha {
  background: var(--blanco);
  border: 3px solid var(--tinta);
  border-radius: 14px;
  padding: 4px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 84px;
}

.ficha-nombre { font-size: 0.8rem; font-weight: bold; text-transform: uppercase; letter-spacing: 0.5px; color: #4a3a6a; }
.ficha-valor { font-size: 1.35rem; font-weight: bold; line-height: 1.2; }
.ficha-valor.sube { animation: sube 0.5s ease; }

.vidas { letter-spacing: 2px; color: var(--rojo); white-space: nowrap; }
.vidas .vacia { color: #b9b2c9; }

.btn-pausa { font-size: 1rem; min-height: 48px; padding: 6px 16px; box-shadow: none; }

/* Escena de plataformas */

.zona-escena {
  position: relative;
  flex: 1 1 auto;
  min-height: 170px;
  display: flex;
}

.escena {
  --cielo1: #ffe3f1;
  --cielo2: #fff3d6;
  --suelo1: #5aa7e6;
  --suelo2: #ef7fb2;
  --colina: #f7c6de;
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  border: 4px solid var(--tinta);
  border-radius: 20px;
  background: linear-gradient(var(--cielo1), var(--cielo2));
}

.escena[data-nivel="2"] { --cielo1: #9fdcff; --cielo2: #e9f9ff; --suelo1: #5cbf6a; --suelo2: #3f9e56; --colina: #a6e3a1; }
.escena[data-nivel="3"] { --cielo1: #7fd3f7; --cielo2: #fff1c2; --suelo1: #f3d28a; --suelo2: #e8bd62; --colina: #58b8e8; }
.escena[data-nivel="4"] { --cielo1: #b9a6ff; --cielo2: #ffe0f0; --suelo1: #c9a6f5; --suelo2: #a678e2; --colina: #8f7fd6; }
.escena[data-nivel="5"] { --cielo1: #2a1a4a; --cielo2: #6a2fb5; --suelo1: #e8b83a; --suelo2: #c8402f; --colina: #45307a; }

.sol {
  position: absolute;
  top: 8%;
  right: 8%;
  width: 14%;
  aspect-ratio: 1;
  max-width: 90px;
  border-radius: 50%;
  background: var(--amarillo);
  box-shadow: 0 0 0 10px rgba(255, 210, 63, 0.35);
}

.nube {
  position: absolute;
  width: 110px;
  height: 34px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 28px -16px 0 2px rgba(255, 255, 255, 0.9), 58px -6px 0 -2px rgba(255, 255, 255, 0.9);
  animation: flota 40s linear infinite;
}

.nube-1 { top: 14%; left: -20%; }
.nube-2 { top: 30%; left: -20%; animation-duration: 55s; animation-delay: -20s; transform: scale(0.7); }
.nube-3 { top: 6%; left: -20%; animation-duration: 70s; animation-delay: -45s; transform: scale(0.85); }

.escena[data-nivel="5"] .nube { background: rgba(255, 210, 63, 0.35); box-shadow: none; height: 12px; }

.colinas {
  position: absolute;
  left: -10%;
  right: -10%;
  bottom: 14%;
  height: 40%;
  transition: transform 0.9s ease;
}

.colinas span {
  position: absolute;
  bottom: -40%;
  border-radius: 50%;
  background: var(--colina);
}

.colinas span:nth-child(1) { left: 0; width: 45%; height: 110%; }
.colinas span:nth-child(2) { left: 32%; width: 40%; height: 140%; opacity: 0.8; }
.colinas span:nth-child(3) { left: 62%; width: 48%; height: 100%; }

.plataforma {
  position: absolute;
  height: 16px;
  border-radius: 10px;
  border: 3px solid var(--tinta);
  background: repeating-linear-gradient(90deg, var(--suelo1) 0 24px, var(--suelo2) 24px 48px);
}

.plataforma::after {
  content: "★";
  position: absolute;
  left: 50%;
  top: -34px;
  transform: translateX(-50%);
  font-size: 24px;
  color: var(--amarillo);
  text-shadow: 0 0 0 var(--tinta), 1px 1px 0 var(--tinta), -1px -1px 0 var(--tinta), 1px -1px 0 var(--tinta), -1px 1px 0 var(--tinta);
  animation: bote 1.6s ease-in-out infinite;
}

.plataforma-1 { left: 34%; top: 34%; width: 18%; }
.plataforma-2 { left: 70%; top: 22%; width: 14%; }

.cartel-nivel {
  position: absolute;
  top: 8px;
  left: 10px;
  padding: 4px 12px;
  border-radius: 12px;
  border: 3px solid var(--tinta);
  background: var(--blanco);
  font-size: 1rem;
  font-weight: bold;
}

.suelo {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 18%;
  border-top: 4px solid var(--tinta);
  background-image: repeating-linear-gradient(90deg, var(--suelo1) 0 60px, var(--suelo2) 60px 120px);
  background-position: 0 0;
  transition: background-position 0.9s ease;
}

.gimnasta {
  position: absolute;
  left: 8%;
  bottom: 17%;
  height: 64%;
  aspect-ratio: 140 / 190;
  transform-origin: 50% 60%;
  animation: bote 0.7s ease-in-out infinite;
  transition: left 0.4s ease, height 0.3s ease;
}

.gimnasta.golpea { animation: golpea 0.45s ease-out 1; }

.gimnasta.salta { animation: salta 1s ease-in-out 1; }
.gimnasta.tambalea { animation: tambalea 0.9s ease-in-out infinite; transform-origin: 50% 100%; }
.gimnasta.celebra { animation: celebra 0.6s ease-in-out infinite; }

.gimnasta.tambalea::after {
  content: "✦  ✦  ✦";
  position: absolute;
  top: -6%;
  left: 50%;
  white-space: nowrap;
  font-size: 20px;
  color: var(--amarillo);
  text-shadow: 1px 1px 0 var(--tinta), -1px -1px 0 var(--tinta);
  animation: mareo 1s linear infinite;
}

.obstaculo {
  position: absolute;
  left: 58%;
  bottom: 17%;
  height: 34%;
  aspect-ratio: 120 / 100;
  transition: left 0.9s ease;
}

.obstaculo svg { height: 100%; width: auto; display: block; overflow: visible; }
.obstaculo.fuera-derecha { left: 115%; transition: none; }
.obstaculo.fuera-izquierda { left: -45%; }

.obstaculo .premio {
  position: absolute;
  left: 50%;
  top: -75%;
  width: 46%;
  transform: translateX(-50%);
  animation: bote 1s ease-in-out infinite;
}

.obstaculo .premio.recogida { animation: recoge 0.8s ease-out forwards; }
.obstaculo .premio svg { width: 100%; height: auto; }

.globo {
  position: absolute;
  top: 52px;
  left: 30%;
  z-index: 3;
  max-width: 60%;
  padding: 8px 16px;
  border: 3px solid var(--tinta);
  border-radius: 18px;
  background: var(--blanco);
  font-size: 1.3rem;
  font-weight: bold;
  animation: aparece 0.25s ease-out;
}

/* Pregunta de ladrillos: la gimnasta va hasta el ladrillo y lo toca */

.ladrillos {
  position: absolute;
  top: 6%;
  left: 5%;
  right: 5%;
  height: 24%;
  min-height: 60px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(8px, 3%, 28px);
  z-index: 4;
}

.opcion.ladrillo {
  min-height: 0;
  height: 100%;
  border-radius: 14px;
  border-width: 4px;
  border-color: var(--tinta);
  font-size: clamp(1.4rem, 5.5vw, 2.3rem);
  background-image: radial-gradient(circle at 12% 18%, rgba(255, 255, 255, 0.9) 0 4px, transparent 5px),
    radial-gradient(circle at 88% 82%, rgba(255, 255, 255, 0.9) 0 4px, transparent 5px);
}

.opcion.ladrillo:nth-child(1) { background-color: #ffd0e6; }
.opcion.ladrillo:nth-child(2) { background-color: #cfe6ff; }
.opcion.ladrillo:nth-child(3) { background-color: #cdf3df; }
.opcion.ladrillo:nth-child(4) { background-color: #ffe2c2; }

.opcion.ladrillo.debajo { outline: 5px solid var(--amarillo); outline-offset: 2px; }
.opcion.ladrillo.golpeado { animation: bota-ladrillo 0.3s ease-out 1; }
.opcion.ladrillo.correcta { background-color: #d4f5e4; border-color: var(--verde); }
.opcion.ladrillo.elegida-mal { background-color: #ffe0e3; border-color: var(--rojo); }

.opcion.ladrillo.premiada::after {
  content: "★";
  position: absolute;
  left: 50%;
  top: -10%;
  font-size: 2.4rem;
  color: var(--amarillo);
  text-shadow: 1px 1px 0 var(--tinta), -1px -1px 0 var(--tinta), 1px -1px 0 var(--tinta), -1px 1px 0 var(--tinta);
  animation: sale-estrella 0.9s ease-out forwards;
}

.escena.modo-ladrillos .gimnasta { height: 50%; }
.escena.modo-ladrillos .obstaculo,
.escena.modo-ladrillos .plataforma,
.escena.modo-ladrillos .cartel-nivel { display: none; }
.escena.modo-ladrillos .globo { display: none; }

.pista-ladrillos {
  font-size: 1.15rem;
  font-weight: bold;
  text-align: center;
  color: var(--azul);
}

/* Reto Monstruo */

.escena.modo-monstruo .obstaculo { height: 58%; aspect-ratio: 1; left: 56%; }
.escena.modo-monstruo .plataforma { display: none; }
.escena.modo-monstruo .cartel-nivel { background: var(--amarillo); }
.obstaculo.hipo { animation: hipo 0.7s ease-in-out 1; }
.obstaculo.rie { animation: celebra 0.5s ease-in-out infinite; }

.monstruo-dibujo { height: clamp(150px, 28vh, 230px); animation: bote 1.1s ease-in-out infinite; }
.monstruo-dibujo svg { height: 100%; width: auto; display: block; }
.monstruo-dibujo.riendo { animation: celebra 0.5s ease-in-out infinite; }
.monstruo-dibujo.vencido { animation: rueda 1.6s ease-in-out infinite; }

.monstruo-progreso { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

.paso-reto {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 4px solid var(--tinta);
  border-radius: 50%;
  background: var(--blanco);
  font-size: 1.5rem;
  font-weight: bold;
  color: #4a3a6a;
}

.paso-reto.hecho { background: var(--amarillo); color: var(--tinta); }

.monstruo-extra { color: var(--naranja); }

/* Partes animadas de las gimnastas */

.pierna { transform-box: fill-box; transform-origin: 50% 0%; }
.gimnasta .pierna-izq, .desfile .pierna-izq { animation: paso-a 0.7s ease-in-out infinite; }
.gimnasta .pierna-der, .desfile .pierna-der { animation: paso-b 0.7s ease-in-out infinite; }
.gimnasta.tambalea .pierna, .gimnasta.salta .pierna { animation: none; }

.ap { transform-box: fill-box; }
.ap-aro { transform-origin: 50% 50%; animation: gira-aro 1.6s ease-in-out infinite; }
.ap-pelota { transform-origin: 50% 100%; animation: bota-pelota 0.6s ease-in-out infinite; }
.ap-cinta { transform-origin: 0% 100%; animation: ondea 0.8s ease-in-out infinite; }
.ap-cuerda { transform-origin: 50% 100%; animation: comba 0.9s ease-in-out infinite; }

/* Panel de pregunta */

.panel {
  position: relative;
  flex: 0 0 auto;
  background: var(--blanco);
  border: 4px solid var(--tinta);
  border-radius: 20px;
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.reloj { display: flex; align-items: center; gap: 10px; }

.reloj-barra {
  flex: 1;
  height: 22px;
  border: 3px solid var(--tinta);
  border-radius: 999px;
  background: #ece7f5;
  overflow: hidden;
}

.reloj-relleno { height: 100%; width: 100%; background: var(--verde); border-radius: 999px; }
.reloj-relleno.medio { background: #c98a00; }
.reloj-relleno.poco { background: var(--rojo); }

.reloj-numero {
  min-width: 2.4em;
  font-size: 1.7rem;
  font-weight: bold;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.reloj-numero.poco { color: var(--rojo); animation: late 1s ease-in-out infinite; }

.pregunta {
  font-size: clamp(2.2rem, 8vw, 3.8rem);
  font-weight: bold;
  line-height: 1.1;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.pregunta.bien { color: var(--verde); }
.pregunta .resultado { color: var(--verde); }

.opciones {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.opcion {
  position: relative;
  font-family: inherit;
  font-size: clamp(1.7rem, 6vw, 2.4rem);
  font-weight: bold;
  color: var(--tinta);
  background: var(--blanco);
  border: 5px solid var(--morado);
  border-radius: 18px;
  min-height: 76px;
  cursor: pointer;
  box-shadow: var(--sombra);
  touch-action: manipulation;
  font-variant-numeric: tabular-nums;
}

.opcion:nth-child(1) { border-color: var(--rosa); }
.opcion:nth-child(2) { border-color: var(--azul); }
.opcion:nth-child(3) { border-color: var(--verde); }
.opcion:nth-child(4) { border-color: var(--naranja); }

.opcion:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 2px 0 rgba(42, 26, 74, 0.25); }

.opcion .tecla {
  position: absolute;
  top: 4px;
  left: 8px;
  font-size: 0.8rem;
  font-weight: normal;
  color: #4a3a6a;
}

.opcion:disabled { cursor: default; color: var(--tinta); opacity: 1; }
.opcion.correcta { background: #d4f5e4; border-color: var(--verde); }
.opcion.correcta .valor::after { content: " ✓"; color: var(--verde); }
.opcion.elegida-mal { background: #ffe0e3; border-color: var(--rojo); }
.opcion.elegida-mal .valor::after { content: " ✗"; color: var(--rojo); }

.mensaje {
  min-height: 1.5em;
  font-size: 1.25rem;
  font-weight: bold;
  text-align: center;
  color: var(--verde);
}

.tarjeta-fallo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
  background: #fff8dc;
  border: 4px dashed var(--naranja);
  border-radius: 18px;
  padding: 10px 12px 14px;
  animation: aparece 0.25s ease-out;
}

.fallo-gracia { font-size: 1.3rem; font-weight: bold; color: var(--naranja); }
.fallo-etiqueta { font-size: 1.15rem; }
.fallo-correcta { font-size: clamp(2.2rem, 8vw, 3.4rem); font-weight: bold; color: var(--verde); line-height: 1.1; }
.fallo-coste { font-size: 1.05rem; margin-bottom: 6px; }

.capa-pausa {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: var(--blanco);
  border-radius: 16px;
}

.pausa-texto { font-size: 2.4rem; font-weight: bold; color: var(--morado); }

/* Nivel superado y final */

.fila-estrellas { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.fila-estrellas svg { width: clamp(34px, 9vw, 60px); height: auto; animation: bote 1s ease-in-out infinite; }
.fila-estrellas svg:nth-child(even) { animation-delay: 0.3s; }

.final-dibujo { height: clamp(160px, 30vh, 240px); display: flex; align-items: flex-end; gap: 10px; }
.final-dibujo .figura { height: 100%; animation: celebra 0.7s ease-in-out infinite; }
.final-dibujo.animo .figura { animation: bote 1.2s ease-in-out infinite; }

.resumen {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 0 0 8px;
}

.resumen dt { font-size: 0.95rem; font-weight: bold; color: #4a3a6a; }
.resumen dd { margin: 0; font-size: 2rem; font-weight: bold; }

.lista-repaso {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.lista-repaso li {
  font-size: 1.4rem;
  font-weight: bold;
  padding: 6px 14px;
  border: 3px solid var(--tinta);
  border-radius: 12px;
  background: #fff8dc;
  font-variant-numeric: tabular-nums;
}

.confeti { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.confeti span {
  position: absolute;
  top: -20px;
  width: 12px;
  height: 18px;
  border-radius: 3px;
  animation: cae 3.5s linear infinite;
}

/* Animaciones */

@keyframes bote { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5%); } }
.plataforma::after { animation-name: bote-centro; }
.obstaculo .premio { animation-name: bote-centro; }
@keyframes bote-centro { 0%, 100% { transform: translateX(-50%) translateY(0); } 50% { transform: translateX(-50%) translateY(-6px); } }
@keyframes flota { from { translate: 0 0; } to { translate: 140vw 0; } }
@keyframes paso-a { 0%, 100% { transform: rotate(14deg); } 50% { transform: rotate(-14deg); } }
@keyframes paso-b { 0%, 100% { transform: rotate(-14deg); } 50% { transform: rotate(14deg); } }
@keyframes salta {
  0% { transform: translate(0, 0) rotate(0deg); }
  45% { transform: translate(25%, -55%) rotate(200deg); }
  80% { transform: translate(0, 0) rotate(360deg); }
  90% { transform: translate(0, -5%) rotate(360deg); }
  100% { transform: translate(0, 0) rotate(360deg); }
}
@keyframes tambalea { 0%, 100% { transform: rotate(-13deg); } 50% { transform: rotate(13deg); } }
@keyframes celebra { 0%, 100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-12%) rotate(4deg); } }
@keyframes mareo { from { transform: translateX(-50%) rotate(-12deg); } 50% { transform: translateX(-50%) rotate(12deg); } to { transform: translateX(-50%) rotate(-12deg); } }
@keyframes recoge { to { transform: translateX(-50%) translateY(-120%) scale(1.8) rotate(180deg); opacity: 0; } }
@keyframes gira-aro { 0%, 100% { transform: rotate(-14deg) scaleX(1); } 50% { transform: rotate(14deg) scaleX(0.82); } }
@keyframes bota-pelota { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-16px); } }
@keyframes ondea { 0%, 100% { transform: skewX(-10deg) scaleY(1); } 50% { transform: skewX(12deg) scaleY(0.9); } }
@keyframes comba { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(0.72); } }
@keyframes aparece { from { transform: scale(0.8); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes sube { 0% { transform: scale(1); } 40% { transform: scale(1.35); color: var(--verde); } 100% { transform: scale(1); } }
@keyframes late { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.15); } }
@keyframes golpea { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-18%); } }
@keyframes bota-ladrillo { 0%, 100% { transform: translateY(0); } 40% { transform: translateY(-12px); } }
@keyframes sale-estrella { from { transform: translate(-50%, 0) scale(0.6); opacity: 1; } to { transform: translate(-50%, -90px) scale(1.5) rotate(180deg); opacity: 0; } }
@keyframes hipo { 0%, 100% { transform: translateY(0) scale(1); } 30% { transform: translateY(-14%) scale(1.06, 0.94); } 60% { transform: translateY(0) scale(0.95, 1.05); } }
@keyframes rueda { 0%, 100% { transform: rotate(-14deg); } 50% { transform: rotate(14deg); } }
@keyframes cae { to { transform: translateY(110vh) rotate(540deg); } }

/* Pantallas pequeñas */

@media (max-width: 640px) {
  html { font-size: 16px; }
  .pantalla { padding-top: 64px; }
  .lista-gimnastas { grid-template-columns: repeat(2, 1fr); }
  .opciones { grid-template-columns: repeat(2, 1fr); }
  .opcion { min-height: 68px; }
  .resumen { grid-template-columns: repeat(2, 1fr); }
  .ficha { min-width: 0; padding: 3px 8px; flex: 1 1 28%; }
  .ficha-valor { font-size: 1.15rem; }
  .pantalla-juego { padding-top: 62px; }
  .btn-enorme { font-size: 1.6rem; padding: 14px 30px; }
  .obstaculo { left: 54%; height: 28%; }
  .escena.modo-monstruo .obstaculo { left: 50%; height: 48%; }
  .ladrillos { left: 3%; right: 3%; gap: 6px; }
  .paso-reto { width: 48px; height: 48px; }
  .gimnasta { left: 5%; }
  .globo { font-size: 1.1rem; }
}

@media (max-height: 520px) and (orientation: landscape) {
  .pantalla-juego { height: auto; }
  .escena { min-height: 190px; }
}

/* Menos movimiento si el sistema lo pide */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
