:root {
  --tinta: #1d2440; --cielo: #8fc7ff; --cielo2: #e3f3ff; --papel: #fff; --crema: #fff8e6;
  --amarillo: #ffd23f; --rosa: #ff5d8f; --verde: #2fd07a; --rojo: #ff5a5a; --naranja: #ff9f43; --violeta: #7b61ff; --celeste: #3fb6ff;
  --gris: #c9d3e6; --suave: #5a648a;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; }
body { font-family: Nunito, system-ui, sans-serif; font-weight: 700; color: var(--tinta); background: linear-gradient(#8fc7ff, #cfe9ff 45%, #eef8ff); background-attachment: fixed; font-size: 16px; line-height: 1.4; overflow-x: hidden; }
h1, h2, h3, .t { font-family: 'Baloo 2', Nunito, sans-serif; font-weight: 800; line-height: 1.1; margin: 0; }
h1 { font-size: 30px; } h2 { font-size: 23px; } h3 { font-size: 18px; }
p { margin: 0 0 10px; }
b { font-weight: 800; }
button { font: inherit; color: inherit; cursor: pointer; }
#app { position: relative; z-index: 1; max-width: 500px; margin: 0 auto; padding: 14px 16px calc(96px + env(safe-area-inset-bottom)); min-height: 100vh; }

/* nubes */
.nubes { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
.nubes i { position: absolute; width: 150px; height: 46px; background: #fff; border-radius: 40px; opacity: .75; animation: nube 60s linear infinite; }
.nubes i::before, .nubes i::after { content: ''; position: absolute; background: #fff; border-radius: 50%; }
.nubes i::before { width: 66px; height: 66px; left: 22px; top: -30px; } .nubes i::after { width: 50px; height: 50px; right: 26px; top: -20px; }
.nubes i:nth-child(1) { top: 9%; left: -160px; } .nubes i:nth-child(2) { top: 34%; left: -160px; animation-duration: 85s; animation-delay: -30s; transform: scale(.7); }
.nubes i:nth-child(3) { top: 62%; left: -160px; animation-duration: 110s; animation-delay: -70s; transform: scale(.5); }
@keyframes nube { to { translate: calc(100vw + 320px) 0; } }

/* piezas */
.carta { background: var(--papel); border: 3px solid var(--tinta); border-radius: 22px; box-shadow: 0 6px 0 var(--tinta); padding: 16px; margin-bottom: 16px; animation: entra .35s cubic-bezier(.2, 1.4, .4, 1) both; }
.carta.crema { background: var(--crema); }
@keyframes entra { from { opacity: 0; transform: translateY(14px) scale(.97); } }
.btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 54px; padding: 10px 16px; background: var(--amarillo); border: 3px solid var(--tinta); border-radius: 18px; box-shadow: 0 5px 0 var(--tinta); font-family: 'Baloo 2', sans-serif; font-weight: 800; font-size: 19px; text-align: center; transition: transform .08s, box-shadow .08s; margin-bottom: 12px; }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--tinta); }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn.rosa { background: var(--rosa); color: #fff; } .btn.verde { background: var(--verde); } .btn.blanco { background: #fff; } .btn.violeta { background: var(--violeta); color: #fff; }
.btn.rojo { background: var(--rojo); color: #fff; } .btn.celeste { background: var(--celeste); } .btn.naranja { background: var(--naranja); }
.btn.chico { min-height: 42px; font-size: 16px; width: auto; padding: 6px 14px; margin: 0; box-shadow: 0 4px 0 var(--tinta); border-radius: 14px; }
.fila { display: flex; gap: 10px; align-items: center; } .fila > * { flex: 1; } .fila.junta > * { flex: none; }
.centro { text-align: center; } .suave { color: var(--suave); font-size: 14px; } .mt { margin-top: 12px; }
.pastilla { display: inline-flex; align-items: center; gap: 5px; background: #fff; border: 2.5px solid var(--tinta); border-radius: 99px; padding: 3px 11px; font-size: 14px; font-weight: 800; white-space: nowrap; }
.pastilla.e0 { background: #ffd9e6; } .pastilla.e1 { background: #ffe4c2; } .pastilla.e2 { background: #d6ecff; } .pastilla.e3 { background: #d9f8e6; }

/* barra superior */
.tope { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.tope .atras { width: 44px; height: 44px; flex: none; border-radius: 14px; background: #fff; border: 3px solid var(--tinta); box-shadow: 0 4px 0 var(--tinta); font-size: 20px; font-weight: 800; }
.tope .atras:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--tinta); }
.tope .titulo { flex: 1; min-width: 0; font-family: 'Baloo 2'; font-size: 21px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.progreso { height: 16px; background: #fff; border: 3px solid var(--tinta); border-radius: 99px; overflow: hidden; margin-bottom: 14px; }
.progreso i { display: block; height: 100%; background: repeating-linear-gradient(45deg, var(--verde), var(--verde) 10px, #58e39a 10px, #58e39a 20px); border-right: 3px solid var(--tinta); transition: width .4s cubic-bezier(.2, 1.4, .4, 1); min-width: 6px; }

/* tutora */
.tutora { display: flex; align-items: flex-end; gap: 10px; margin-bottom: 14px; }
.tutora img { width: 76px; height: 76px; flex: none; border-radius: 50%; background: #b9d6fb; border: 3px solid var(--tinta); box-shadow: 0 4px 0 var(--tinta); object-fit: cover; animation: flota 3s ease-in-out infinite; }
.tutora.salta img { animation: salta .7s cubic-bezier(.3, 1.6, .5, 1) 2; } .tutora.duda img { animation: duda .5s ease-in-out 2; }
.globo { position: relative; background: #fff; border: 3px solid var(--tinta); border-radius: 18px 18px 18px 4px; padding: 10px 13px; font-size: 15.5px; box-shadow: 0 4px 0 var(--tinta); animation: pop .4s cubic-bezier(.2, 1.6, .4, 1) both; margin-bottom: 8px; }
@keyframes pop { from { transform: scale(.6); opacity: 0; } }
@keyframes flota { 50% { transform: translateY(-5px) rotate(-2deg); } }
@keyframes salta { 40% { transform: translateY(-18px) rotate(6deg) scale(1.08); } }
@keyframes duda { 25% { transform: rotate(-8deg); } 75% { transform: rotate(8deg); } }
.heroe { position: relative; height: 250px; margin: 0 -6px 0; display: flex; justify-content: flex-end; }
.heroe img { height: 270px; margin-right: -14px; filter: drop-shadow(0 6px 0 rgba(29, 36, 64, .18)); animation: flota 4s ease-in-out infinite; transform-origin: bottom center; }
.heroe .globo { position: absolute; left: 6px; top: 16px; width: 52%; border-radius: 18px 18px 4px 18px; font-size: 16px; }
.heroe + .carta { position: relative; margin-top: -26px; }

/* inicio */
.quien { display: grid; gap: 14px; }
.quien .btn { min-height: 92px; font-size: 24px; flex-direction: column; gap: 0; }
.quien .btn small { font-family: Nunito; font-size: 14px; font-weight: 700; }
.estad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; }
.estad div { background: var(--crema); border: 2.5px solid var(--tinta); border-radius: 14px; padding: 6px 2px; }
.estad b { display: block; font-family: 'Baloo 2'; font-size: 22px; line-height: 1.1; } .estad span { font-size: 12px; color: var(--suave); }
.xp { height: 14px; background: #eef2fb; border: 2.5px solid var(--tinta); border-radius: 99px; overflow: hidden; margin: 6px 0 10px; }
.xp i { display: block; height: 100%; background: var(--amarillo); border-right: 2.5px solid var(--tinta); }
.juegos { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.juego { position: relative; text-align: left; border: 3px solid var(--tinta); border-radius: 22px; box-shadow: 0 6px 0 var(--tinta); padding: 12px 12px 14px; min-height: 132px; transition: transform .08s, box-shadow .08s; animation: entra .4s cubic-bezier(.2, 1.4, .4, 1) both; }
.juego:nth-child(2) { animation-delay: .05s; } .juego:nth-child(3) { animation-delay: .1s; } .juego:nth-child(4) { animation-delay: .15s; } .juego:nth-child(5) { animation-delay: .2s; }
.juego:active { transform: translateY(5px); box-shadow: 0 1px 0 var(--tinta); }
.juego .ico { font-size: 38px; line-height: 1; display: block; margin-bottom: 6px; animation: flota 3.4s ease-in-out infinite; }
.juego b { font-family: 'Baloo 2'; font-size: 19px; display: block; line-height: 1.05; } .juego span { font-size: 13px; font-weight: 700; }
.juego.ancho { grid-column: 1 / -1; min-height: 0; display: flex; align-items: center; gap: 12px; } .juego.ancho .ico { margin: 0; font-size: 44px; }
.j1 { background: #ffe37a; } .j2 { background: #ffb3cb; } .j3 { background: #b9f3d3; } .j4 { background: #bfe3ff; } .j5 { background: #d3c8ff; }
.barra { position: fixed; z-index: 5; left: 50%; bottom: calc(12px + env(safe-area-inset-bottom)); transform: translateX(-50%); width: min(468px, calc(100% - 32px)); display: flex; background: #fff; border: 3px solid var(--tinta); border-radius: 22px; box-shadow: 0 5px 0 var(--tinta); overflow: hidden; }
.barra button { flex: 1; background: none; border: 0; padding: 8px 4px 7px; font-size: 12.5px; font-weight: 800; }
.barra button span { display: block; font-size: 22px; line-height: 1.1; } .barra button.activo { background: var(--amarillo); }

/* preguntas */
.pregunta { font-size: 18px; font-weight: 800; }
textarea, input[type=date], input[type=text] { width: 100%; font: inherit; font-weight: 700; color: var(--tinta); background: #fff; border: 3px solid var(--tinta); border-radius: 16px; padding: 12px; outline: none; }
textarea { min-height: 130px; resize: vertical; } textarea:focus, input:focus { box-shadow: 0 0 0 4px rgba(123, 97, 255, .3); }
.micro { width: 58px; flex: none !important; background: #fff; } .micro.on { background: var(--rojo); animation: late 1s infinite; }
@keyframes late { 50% { transform: scale(1.08); } }
.escalones { display: flex; align-items: flex-end; gap: 6px; margin: 4px 0 12px; }
.escalon { flex: 1; border: 3px solid var(--tinta); border-radius: 12px 12px 0 0; background: #eef2fb; text-align: center; font-size: 12.5px; font-weight: 800; padding: 6px 2px; color: var(--suave); }
.escalon:nth-child(1) { height: 46px; } .escalon:nth-child(2) { height: 66px; } .escalon:nth-child(3) { height: 86px; }
.escalon.ok { background: var(--verde); color: var(--tinta); animation: pop .5s cubic-bezier(.2, 1.6, .4, 1) both; } .escalon:nth-child(2).ok { animation-delay: .15s; } .escalon:nth-child(3).ok { animation-delay: .3s; }
.sello { display: inline-block; font-family: 'Baloo 2'; font-size: 22px; padding: 2px 16px; border: 3px solid var(--tinta); border-radius: 14px; transform: rotate(-3deg); animation: sello .45s cubic-bezier(.2, 1.8, .4, 1) both; margin-bottom: 10px; }
@keyframes sello { from { transform: scale(2.2) rotate(-14deg); opacity: 0; } }
.sello.bien { background: var(--verde); } .sello.regular { background: var(--amarillo); } .sello.mal { background: var(--rojo); color: #fff; }
.claves { list-style: none; padding: 0; margin: 0 0 10px; } .claves li { display: flex; gap: 8px; padding: 6px 0; border-bottom: 2px dashed #dfe5f3; font-size: 15px; } .claves li:last-child { border: 0; }
.claves li.tocable { cursor: pointer; }
details { border: 2.5px solid var(--tinta); border-radius: 14px; background: #f4f8ff; margin-bottom: 12px; } summary { padding: 9px 12px; font-weight: 800; cursor: pointer; } details > div { padding: 0 12px 10px; font-weight: 600; font-size: 15px; }
.alerta { background: #ffe0e0; border: 2.5px solid var(--rojo); border-radius: 14px; padding: 9px 12px; margin-bottom: 12px; font-size: 15px; }
.nota-caso { background: #fff3c4; border: 2.5px solid var(--tinta); border-radius: 14px; padding: 9px 12px; margin-bottom: 12px; font-size: 14.5px; }
.ajuste { display: flex; gap: 8px; margin-bottom: 12px; } .ajuste button { flex: 1; border: 3px solid var(--tinta); border-radius: 14px; background: #fff; padding: 7px 2px; font-size: 14px; font-weight: 800; opacity: .55; }
.ajuste button.activo { opacity: 1; box-shadow: 0 4px 0 var(--tinta); transform: translateY(-2px); } .ajuste .bien.activo { background: var(--verde); } .ajuste .regular.activo { background: var(--amarillo); } .ajuste .mal.activo { background: var(--rojo); color: #fff; }

/* opciones de caso */
.opcion { display: block; width: 100%; text-align: left; background: #fff; border: 3px solid var(--tinta); border-radius: 16px; box-shadow: 0 4px 0 var(--tinta); padding: 12px; margin-bottom: 12px; font-size: 15.5px; font-weight: 700; }
.opcion:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--tinta); }
.opcion.mala { background: #ffe0e0; box-shadow: none; opacity: .8; animation: tiembla .4s; pointer-events: none; } .opcion.buena { background: #c9f7dd; pointer-events: none; }
@keyframes tiembla { 20% { transform: translateX(-7px); } 40% { transform: translateX(7px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(5px); } }
.pasos { display: flex; gap: 4px; margin-bottom: 14px; } .pasos i { flex: 1; height: 12px; border: 2.5px solid var(--tinta); border-radius: 99px; background: #fff; } .pasos i.hecho { background: var(--verde); } .pasos i.actual { background: var(--amarillo); }

/* trampa y cuadro */
.frase { font-size: 18px; line-height: 1.9; } .seg { display: inline; padding: 3px 5px; border-radius: 9px; border: 2.5px dashed #b8c3de; margin-right: 2px; cursor: pointer; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.seg.sel { background: var(--amarillo); border: 2.5px solid var(--tinta); } .seg.era { background: var(--rojo); color: #fff; border: 2.5px solid var(--tinta); } .seg.falso { background: #ffd9a8; border: 2.5px solid var(--tinta); text-decoration: line-through; } .frase.lista .seg { cursor: default; }
.ficha { background: var(--amarillo); border: 3px solid var(--tinta); border-radius: 18px; box-shadow: 0 5px 0 var(--tinta); padding: 22px 14px; text-align: center; font-size: 19px; font-weight: 800; margin: 12px 0 16px; animation: pop .35s cubic-bezier(.2, 1.6, .4, 1) both; }
.ficha.ok { background: var(--verde); } .ficha.no { background: var(--rojo); color: #fff; animation: tiembla .4s; }
table.cuadro { width: 100%; border-collapse: collapse; font-size: 14px; margin-bottom: 12px; } .cuadro th, .cuadro td { border: 2.5px solid var(--tinta); padding: 6px; vertical-align: top; width: 50%; } .cuadro th { background: var(--amarillo); }

/* tarjeta */
.tarjeta { min-height: 250px; display: flex; flex-direction: column; justify-content: center; cursor: pointer; } .tarjeta.vuelta { background: var(--crema); animation: gira .45s ease both; cursor: default; }
@keyframes gira { from { transform: rotateY(90deg); } }

/* semáforo */
.mapa { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin: 6px 0 14px; }
.luz { aspect-ratio: 1; border: 3px solid var(--tinta); border-radius: 50%; background: #eef2fb; font-family: 'Baloo 2'; font-size: 16px; font-weight: 800; display: grid; place-items: center; padding: 0; }
.luz.verde { background: var(--verde); } .luz.amarillo { background: var(--amarillo); } .luz.rojo { background: var(--rojo); color: #fff; }
.luz:active { transform: scale(.9); }
.leyenda { display: flex; gap: 12px; flex-wrap: wrap; font-size: 13px; margin-bottom: 4px; } .leyenda i { display: inline-block; width: 13px; height: 13px; border-radius: 50%; border: 2px solid var(--tinta); vertical-align: -2px; margin-right: 4px; }
.puntaje { font-family: 'Baloo 2'; font-size: 64px; line-height: 1; } .puntaje small { font-size: 24px; }
.lista-res > div { display: flex; gap: 8px; align-items: flex-start; padding: 8px 0; border-bottom: 2px dashed #dfe5f3; font-size: 14.5px; }

/* hoja inferior */
.velo { position: fixed; inset: 0; background: rgba(29, 36, 64, .55); z-index: 20; display: flex; align-items: flex-end; justify-content: center; animation: aparece .2s both; }
@keyframes aparece { from { opacity: 0; } }
.hoja { width: 100%; max-width: 500px; max-height: 88vh; overflow: auto; background: var(--cielo2); border: 3px solid var(--tinta); border-bottom: 0; border-radius: 26px 26px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); animation: sube .3s cubic-bezier(.2, 1.2, .4, 1) both; }
@keyframes sube { from { transform: translateY(100%); } }
.ejes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; } .ejes .btn { margin: 0; font-size: 16px; min-height: 60px; flex-direction: column; gap: 0; line-height: 1.1; }

/* fiesta y aviso */
#fiesta { position: fixed; inset: 0; pointer-events: none; z-index: 30; overflow: hidden; }
#fiesta span { position: absolute; top: -40px; font-size: 26px; animation: cae 1.7s ease-in forwards; }
@keyframes cae { to { transform: translateY(110vh) rotate(540deg); } }
#aviso { position: fixed; z-index: 40; left: 50%; top: 14px; transform: translate(-50%, -150%); background: var(--tinta); color: #fff; padding: 9px 16px; border-radius: 99px; font-size: 14.5px; transition: transform .3s cubic-bezier(.2, 1.4, .4, 1); max-width: 90%; text-align: center; }
#aviso.ver { transform: translate(-50%, 0); }
.girando { display: inline-block; animation: gira2 1s linear infinite; font-size: 40px; } @keyframes gira2 { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01s !important; animation-iteration-count: 1 !important; } }
