:root {
  --azul: #2f45ff;
  --azul-oscuro: #1d2bd1;
  --noche: #0d1030;
  --lavanda: #9aa6ff;
  --suave: #e8ebff;
  --fondo: #eef0f4;
  --lima: #dcf55a;
  --tinta: #0d1030;
  --tenue: #3a405e;
  --titulo: 'Baloo 2', system-ui, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { overflow-x: hidden; }
@supports (overflow-x: clip) { html, body { overflow-x: clip; } }
body { margin: 0; font-family: Nunito, system-ui, sans-serif; color: var(--tinta); background: var(--fondo); }
img { max-width: 100%; }
a { color: var(--azul-oscuro); }
a:hover { color: var(--noche); }
h1, h2, h3 { font-family: var(--titulo); font-weight: 800; margin: 0; }
p { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--lima); outline-offset: 3px; }
.solo-lectores { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
section[id] { scroll-margin-top: 84px; }
#inicio { scroll-margin-top: 0; }

/* Botones */
.boton { display: inline-flex; align-items: center; justify-content: center; text-align: center; padding: 12px 20px; border-radius: 16px; border: 3px solid var(--noche); box-shadow: 4px 4px 0 var(--noche); font: inherit; font-weight: 800; text-decoration: none; cursor: pointer; transition: transform .15s ease, box-shadow .15s ease; }
.boton:hover { transform: translate(-2px, -2px); box-shadow: 7px 7px 0 var(--noche); }
.boton-lima { background: var(--lima); color: var(--noche); }
.boton-azul { background: var(--azul); color: #fff; }
.boton-blanco { background: #fff; color: var(--noche); }
.boton-lima:hover, .boton-blanco:hover { color: var(--noche); }
.boton-azul:hover { color: #fff; }
.boton-grande { padding: 18px 26px; font-size: 19px; border-radius: 18px; }

/* Encabezado */
.hero { background: var(--azul); color: #fff; position: relative; overflow: hidden; }
.encabezado { max-width: 1280px; margin: 0 auto; padding: 18px 24px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; position: relative; z-index: 2; }
.marca { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; }
.marca:hover { color: #fff; }
.marca img { height: 72px; width: auto; display: block; }
.marca span { font-weight: 800; font-size: 15px; line-height: 1.15; text-transform: uppercase; letter-spacing: .04em; }
.menu-grande { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-weight: 800; }
.menu-grande a:not(.boton) { padding: 10px 14px; color: #fff; text-decoration: none; border-radius: 12px; }
.menu-grande a:not(.boton):hover { background: rgba(13, 16, 48, .2); }
.hamburguesa { width: 52px; height: 52px; border-radius: 16px; background: var(--lima); border: 3px solid var(--noche); box-shadow: 4px 4px 0 var(--noche); cursor: pointer; display: grid; place-items: center; padding: 0; }
.solo-chico { display: none; }
.menu-panel { display: flex; flex-direction: column; gap: 6px; background: var(--noche); border-radius: 22px; padding: 12px; box-shadow: 6px 6px 0 rgba(13, 16, 48, .4); }
.menu-panel a { padding: 13px 16px; border-radius: 14px; color: #fff; text-decoration: none; font-weight: 800; font-size: 17px; }
.menu-panel a:hover { background: var(--azul); color: #fff; }
.menu-panel a.destacado { background: var(--lima); color: var(--noche); text-align: center; }
.menu-chico { flex-basis: 100%; }
@media (max-width: 1000px) {
  .menu-grande { display: none; }
  .solo-chico { display: grid; }
}
@media (min-width: 1001px) { .menu-chico { display: none !important; } }
@media (max-width: 420px) {
  .marca img { height: 58px; }
  .marca span { font-size: 12px; }
}

/* Portada */
.hero-texto { max-width: 1280px; margin: 0 auto; padding: 12px 24px 0; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 18px; position: relative; z-index: 2; }
.hero-texto h1 { font-size: clamp(56px, 8vw, 120px); line-height: .88; }
.etiqueta-lima { background: var(--lima); color: var(--noche); padding: 0 16px; border-radius: 20px; display: inline-block; transform: rotate(-2deg); }
.hero-sub { font-size: clamp(20px, 2.2vw, 26px); font-weight: 800; }
.hero-juego { max-width: 1280px; margin: 0 auto; padding: 28px 24px 96px; position: relative; z-index: 2; }
.hero-ola { position: absolute; left: 0; bottom: -1px; width: 100%; height: 80px; display: block; }

/* Juego */
.juego { position: relative; height: 460px; border-radius: 32px; border: 3px solid var(--noche); background: var(--azul-oscuro); overflow: hidden; box-shadow: 8px 8px 0 var(--noche); outline: none; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.juego:focus-visible { outline: 4px solid var(--lima); outline-offset: -4px; }
.juego-puntos { position: absolute; inset: 0; opacity: .16; background-image: radial-gradient(#fff 2px, transparent 2.5px); background-size: 32px 32px; background-position: 0 0; pointer-events: none; }
.juego-suelo { position: absolute; left: 0; right: 0; bottom: 0; height: 20px; background: var(--noche); }
.mundo { position: absolute; left: 0; top: 0; height: 100%; will-change: transform; }
.plataforma { position: absolute; height: 46px; padding: 0 8px; border: 3px solid var(--noche); border-radius: 14px; cursor: pointer; font: inherit; font-weight: 800; font-size: 16px; color: var(--noche); background: var(--lavanda); box-shadow: 0 6px 0 var(--noche); transition: transform .2s, background .2s; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plataforma.meta { background: var(--lima); height: 54px; font-size: 19px; }
.plataforma.aqui { transform: translateY(3px); }
.plataforma.aqui:not(.meta) { background: #fff; color: var(--azul); }
.juego.chico .plataforma { font-size: 18px; }
.juego.chico .plataforma.meta { font-size: 20px; }
.engrane { position: absolute; width: 30px; height: 30px; pointer-events: none; z-index: 1; }
.engrane svg { width: 100%; height: 100%; animation: girar 6s linear infinite; }
@keyframes girar { to { transform: rotate(360deg); } }
.particula { position: absolute; border-radius: 50%; pointer-events: none; z-index: 2; }
.robot { position: absolute; left: 0; top: 0; pointer-events: none; z-index: 3; }
.robot-envoltura { position: relative; transform-origin: 50% 100%; }
.robot-cuerpo { display: block; width: 100%; overflow: visible; }
.robot-cabeza { position: absolute; left: -6%; width: 112%; top: 1.4%; }
.robot-cabeza img { display: block; width: 100%; height: auto; }
.robot-cabeza svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.marcador { position: absolute; left: 16px; top: 14px; z-index: 4; display: inline-flex; align-items: center; gap: 8px; background: var(--noche); color: #fff; border-radius: 999px; padding: 6px 14px 6px 8px; font-weight: 800; font-size: 15px; }
.borde { position: absolute; top: 0; bottom: 20px; width: 44px; display: grid; place-items: center; color: var(--lima); font-size: 26px; font-weight: 800; pointer-events: none; z-index: 3; }
.borde-izq { left: 0; background: linear-gradient(90deg, rgba(13,16,48,.55), rgba(13,16,48,0)); }
.borde-der { right: 0; background: linear-gradient(270deg, rgba(13,16,48,.55), rgba(13,16,48,0)); }
.juego-inicio { position: absolute; inset: 0; background: rgba(13, 16, 48, .28); border: 0; cursor: pointer; display: grid; place-items: center; font: inherit; z-index: 5; }
.juego-inicio span { background: var(--lima); color: var(--noche); border: 3px solid var(--noche); box-shadow: 6px 6px 0 var(--noche); border-radius: 24px; padding: 18px 28px; font-family: var(--titulo); font-weight: 800; font-size: 28px; line-height: 1; animation: flotar 2.4s ease-in-out infinite; }
@keyframes flotar { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.aviso { position: absolute; left: 50%; top: 16px; transform: translateX(-50%); background: #fff; color: var(--noche); border: 3px solid var(--noche); border-radius: 16px; box-shadow: 4px 4px 0 var(--noche); padding: 8px 16px; font-weight: 800; white-space: nowrap; z-index: 4; }
.juego-pie { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; margin-top: 18px; }
.juego-instrucciones { display: flex; flex-direction: column; gap: 4px; flex: 1 1 320px; min-width: 0; }
.juego-instrucciones span { font-weight: 400; font-size: 17px; color: var(--suave); }
.juego-instrucciones .pista { font-size: 15px; color: #c8cfff; }
.controles-web { display: flex; gap: 10px; }
.ctrl { width: 60px; height: 60px; border-radius: 18px; background: #fff; color: var(--noche); border: 3px solid var(--noche); box-shadow: 4px 4px 0 var(--noche); font-size: 24px; font-weight: 800; cursor: pointer; touch-action: none; }
.ctrl-saltar { width: auto; padding: 0 22px; background: var(--lima); font-family: var(--titulo); font-size: 22px; }

/* Control retro (pantallas táctiles) */
.control { position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 60; background: var(--suave); border: 3px solid var(--noche); border-radius: 30px; box-shadow: 0 6px 0 var(--noche); padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; max-width: 560px; margin: 0 auto; }
.cruceta { display: grid; grid-template-columns: 50px 44px 50px; grid-template-rows: 40px 50px 40px; align-items: center; justify-items: center; }
.cruz { background: var(--noche); border: 0; color: var(--lavanda); font-size: 20px; padding: 0; touch-action: none; -webkit-tap-highlight-color: transparent; }
.cruz-arriba { grid-column: 2; grid-row: 1; width: 44px; height: 40px; border-radius: 10px 10px 0 0; }
.cruz-abajo { grid-column: 2; grid-row: 3; width: 44px; height: 40px; border-radius: 0 0 10px 10px; }
.cruz-izq { grid-column: 1; grid-row: 2; width: 50px; height: 50px; border-radius: 12px 0 0 12px; cursor: pointer; }
.cruz-der { grid-column: 3; grid-row: 2; width: 50px; height: 50px; border-radius: 0 12px 12px 0; cursor: pointer; }
.cruz-centro { grid-column: 2; grid-row: 2; width: 44px; height: 50px; display: grid; place-items: center; }
.cruz-centro span { width: 18px; height: 18px; border-radius: 50%; background: #1a1f45; }
.control button:active { transform: translateY(3px); }
.control-centro { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.control-centro span { font-family: var(--titulo); font-weight: 800; font-size: 18px; color: var(--azul); letter-spacing: .08em; }
.control-centro div { display: flex; gap: 8px; }
.control-centro i { width: 34px; height: 10px; border-radius: 999px; background: var(--lavanda); transform: rotate(-20deg); }
.control-a { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.control-a button { width: 84px; height: 84px; border-radius: 50%; background: var(--lima); border: 4px solid var(--noche); box-shadow: 0 6px 0 var(--noche); color: var(--noche); font-family: var(--titulo); font-weight: 800; font-size: 30px; cursor: pointer; touch-action: none; -webkit-tap-highlight-color: transparent; }
.control-a span { font-weight: 800; font-size: 12px; letter-spacing: .12em; }

/* Cinta */
.cinta { padding: 16px 0 12px; overflow: hidden; }
.cinta-giro { background: var(--noche); color: var(--lima); transform: rotate(-1.5deg); margin: 0 -40px; padding: 18px 0; overflow: hidden; }
.cinta-pista { display: flex; gap: 40px; width: max-content; animation: cinta 26s linear infinite; font-family: var(--titulo); font-weight: 800; font-size: 30px; white-space: nowrap; }
@keyframes cinta { to { transform: translateX(-50%); } }

/* Secciones */
.seccion { max-width: 1280px; margin: 0 auto; padding: 110px 24px 0; }
.seccion h2 { font-size: clamp(40px, 5vw, 72px); line-height: .95; }
.centrado { text-align: center; }
.subtitulo { margin: 12px 0 40px; font-size: 19px; }
.tenue { color: var(--tenue); }
.azul { color: var(--azul); }
.chip { align-self: flex-start; background: var(--lima); padding: 8px 14px; border-radius: 12px; font-weight: 800; border: 3px solid var(--noche); }
.tarjeta { background: #fff; border: 3px solid var(--noche); border-radius: 28px; box-shadow: 8px 8px 0 var(--noche); }
.resalte { background: var(--lima); padding: 0 6px; border-radius: 6px; font-weight: 800; }
.somos { display: flex; flex-wrap: wrap; gap: 40px; align-items: center; padding-top: 100px; }
.somos-titulo { flex: 1 1 380px; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.somos-titulo h2 { font-size: clamp(44px, 6vw, 84px); }
.foto-sticker { display: block; width: 100%; max-width: 440px; height: auto; aspect-ratio: 3 / 2; object-fit: cover; border: 3px solid var(--noche); border-radius: 24px; box-shadow: 6px 6px 0 var(--noche); transform: rotate(-2deg); }
.somos-texto { flex: 2 1 520px; min-width: 0; padding: 36px; display: flex; flex-direction: column; gap: 18px; font-size: 20px; line-height: 1.55; }
.cursos { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 24px; }
.curso { border: 3px solid var(--noche); border-radius: 28px; box-shadow: 6px 6px 0 var(--noche); padding: 18px; display: flex; flex-direction: column; gap: 12px; background: var(--fondo, #fff); background: var(--fondo); transform: rotate(var(--giro)); transition: transform .2s ease; }
.curso:hover { transform: rotate(0) scale(1.03); }
.curso img { display: block; width: 100%; height: 170px; object-fit: cover; border-radius: 18px; border: 3px solid var(--noche); background: #fff; }
.curso h3 { font-size: 32px; line-height: 1; }
.curso p { font-size: 15px; line-height: 1.5; }
.curso-oscuro { color: #fff; }
.aliados-titulo { margin: 64px 0 0; text-align: center; font-family: var(--titulo); font-weight: 800; font-size: 32px; }
.aliados { list-style: none; padding: 0; margin: 20px 0 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; }
.aliados li { background: #fff; border: 3px solid var(--noche); border-radius: 16px; box-shadow: 4px 4px 0 var(--noche); padding: 14px 20px; font-weight: 800; }
.inscribete { background: var(--lima); border: 3px solid var(--noche); border-radius: 40px; box-shadow: 10px 10px 0 var(--noche); padding: clamp(32px, 6vw, 64px); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 28px; }
.inscribete h2 { font-size: clamp(40px, 5.5vw, 84px); line-height: .92; margin-bottom: 14px; }
.inscribete p { font-size: 18px; line-height: 1.5; max-width: 620px; }
.inscribete-botones { display: flex; flex-direction: column; gap: 12px; min-width: 260px; }
.galeria { display: flex; flex-wrap: wrap; gap: 20px; justify-content: center; margin-top: 40px; }
.galeria figure { margin: 0; width: 240px; background: #fff; border: 3px solid var(--noche); padding: 12px 12px 14px; border-radius: 10px; box-shadow: 6px 6px 0 var(--noche); transform: rotate(var(--giro)); transition: transform .2s ease; }
.galeria figure:hover { transform: rotate(0) scale(1.03); }
.galeria img { display: block; width: 100%; height: 200px; object-fit: cover; border-radius: 6px; background: #d9ddf0; }
.galeria figcaption { font-family: var(--titulo); font-weight: 800; font-size: 20px; text-align: center; padding-top: 10px; }
.contacto { display: flex; flex-wrap: wrap; gap: 32px; }
.contacto-texto { flex: 1 1 360px; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.redes { display: flex; flex-wrap: wrap; gap: 10px; }
.formulario { flex: 1 1 440px; min-width: 0; padding: 32px; display: flex; flex-direction: column; gap: 14px; }
.formulario h3 { font-size: 32px; }
.formulario .fila { display: flex; flex-wrap: wrap; gap: 12px; }
.formulario .fila label { flex: 1 1 180px; }
.formulario label { display: flex; flex-direction: column; gap: 6px; font-weight: 800; }
.formulario input, .formulario textarea { font: inherit; font-weight: 500; padding: 12px 14px; border: 3px solid var(--noche); border-radius: 14px; background: var(--fondo); color: var(--noche); }
.formulario textarea { resize: vertical; }
.formulario .boton { align-self: flex-start; font-size: 18px; }
.formulario .boton[disabled] { opacity: .6; cursor: wait; }
.trampa { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-estado { font-weight: 700; min-height: 1.4em; }
.form-estado.ok { color: #146c43; }
.form-estado.error { color: #a11d1d; }
.mapa { margin-top: 32px; overflow: hidden; display: flex; flex-wrap: wrap; }
.mapa-iframe { flex: 2 1 480px; min-width: 0; height: 340px; border: 0; display: block; }
.mapa-texto { flex: 1 1 280px; min-width: 0; padding: 28px; display: flex; flex-direction: column; gap: 12px; justify-content: center; }
.mapa-texto h3 { font-size: 28px; line-height: 1; }
.mapa-texto p { font-size: 17px; line-height: 1.5; }
.mapa-texto .boton { align-self: flex-start; margin-top: 6px; }
.pie { max-width: 1280px; margin: 0 auto; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; padding: 48px 32px 40px; font-weight: 700; color: var(--tenue); font-size: 15px; }

/* Encabezado flotante y botón volver */
.flotante { position: fixed; left: 0; right: 0; top: 0; z-index: 70; padding: 10px 16px; pointer-events: none; display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; max-width: 1312px; margin: 0 auto; animation: bajar .28s ease-out; }
.flotante > * { pointer-events: auto; }
.flotante-logo img { display: block; height: 60px; width: auto; filter: drop-shadow(3px 3px 0 rgba(13, 16, 48, .35)); }
.flotante-menu { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.flotante-menu .menu-panel { min-width: 230px; }
@keyframes bajar { from { transform: translateY(-110%); } to { transform: translateY(0); } }
.volver { position: fixed; right: 20px; bottom: 20px; z-index: 50; display: inline-flex; align-items: center; gap: 10px; padding: 8px 18px 8px 10px; border-radius: 999px; background: var(--lima); color: var(--noche); border: 3px solid var(--noche); box-shadow: 5px 5px 0 var(--noche); font: inherit; font-weight: 800; font-size: 16px; cursor: pointer; }
.volver img { width: 48px; height: auto; display: block; }

@media (max-width: 420px) {
  .cruceta { grid-template-columns: 44px 38px 44px; grid-template-rows: 34px 44px 34px; }
  .cruz-arriba, .cruz-abajo { width: 38px; height: 34px; }
  .cruz-izq, .cruz-der { width: 44px; height: 44px; }
  .cruz-centro { width: 38px; height: 44px; }
  .control-a button { width: 72px; height: 72px; font-size: 26px; }
}
@media (max-width: 360px) { .control-centro { display: none; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .cinta-pista, .engrane svg, .juego-inicio span, .flotante { animation: none; }
}
