/* English Kids · un álbum de estampas sobre hoja de cuaderno cuadriculado */
@font-face { font-family: 'Baloo 2'; font-weight: 600; font-display: swap; src: url(fonts/baloo-2-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: 'Baloo 2'; font-weight: 800; font-display: swap; src: url(fonts/baloo-2-latin-800-normal.woff2) format('woff2'); }

:root {
  --tinta: #1B2A6B;
  --tinta-suave: #4A5890;
  --papel: #F5FAFF;
  --cuadro: #DCEAF8;
  --margen: #F7A8A8;
  --rojo: #FF5A4E;
  --sol: #FFC93C;
  --pasto: #22A55A;
  --cielo: #3DA5FF;
  --uva: #8E5CF7;
  --blanco: #FFFFFF;
  --sombra: 0 3px 0 rgba(27, 42, 107, .16), 0 10px 22px -12px rgba(27, 42, 107, .35);
  --letra: 'Baloo 2', 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', ui-rounded, 'Arial Rounded MT Bold', system-ui, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; color: var(--tinta); font-family: var(--letra); font-weight: 600; font-size: 18px; line-height: 1.35;
  background-color: var(--papel);
  background-image:
    linear-gradient(90deg, transparent 0 calc(100% - 1px), var(--cuadro) 0),
    linear-gradient(0deg, transparent 0 calc(100% - 1px), var(--cuadro) 0);
  background-size: 26px 26px;
}
@media (min-width: 760px) {
  body { background-image:
    linear-gradient(90deg, transparent 0 46px, var(--margen) 46px 48px, transparent 48px),
    linear-gradient(90deg, transparent 0 calc(100% - 1px), var(--cuadro) 0),
    linear-gradient(0deg, transparent 0 calc(100% - 1px), var(--cuadro) 0);
    background-size: 100% 100%, 26px 26px, 26px 26px; }
}
button, a { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 4px solid var(--uva); outline-offset: 3px; border-radius: 12px; }

/* ---------- barra ---------- */
.barra { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: var(--cielo); color: #fff; box-shadow: 0 3px 0 rgba(27,42,107,.18); }
.barra a { text-decoration: none; color: #fff; }
.volver { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: rgba(255,255,255,.22); font-size: 22px; }
.marca { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 22px; letter-spacing: .01em; }
.marca-ico { font-size: 26px; }
.cuenta { margin-left: auto; background: #fff; color: var(--tinta); border-radius: 999px; padding: 4px 14px; font-weight: 800; }

main { max-width: 980px; margin: 0 auto; padding: 18px 16px 64px; outline: none; }
.cargando { text-align: center; padding: 60px 0; color: var(--tinta-suave); }

/* ---------- inicio ---------- */
.hola { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center; margin: 6px 0 22px; }
.hola h1 { font-weight: 800; font-size: clamp(32px, 7vw, 52px); line-height: 1; margin: 0 0 8px; }
.hola p { margin: 0; max-width: 34em; color: var(--tinta-suave); }
.hola .globo { font-size: clamp(60px, 14vw, 104px); line-height: 1; transform: rotate(-6deg); filter: drop-shadow(0 4px 0 rgba(27,42,107,.15)); }
.como { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 26px; padding: 0; list-style: none; }
.como li { background: #fff; border: 2px solid var(--cuadro); border-radius: 14px; padding: 6px 12px; font-size: 16px; }
.como b { color: var(--uva); }

.etapa { margin: 0 0 30px; }
.etapa h2 { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; font-weight: 800; font-size: 26px; margin: 0 0 4px; }
.etapa h2 small { font-weight: 600; font-size: 16px; color: var(--tinta-suave); }
.estampas { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 18px; padding: 10px 2px; }

.estampa {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 14px 10px 10px; min-height: 172px;
  text-decoration: none; text-align: center; border-radius: 20px; background: #fff; border: 3px dashed #B9CBE4;
  transition: transform .15s ease;
}
.estampa .dibujo { display: grid; place-items: center; width: 84px; height: 84px; border-radius: 50%; font-size: 48px; background: #EEF3FA; filter: grayscale(.35); opacity: .85; }
.estampa b { font-weight: 800; font-size: 21px; line-height: 1.1; margin-top: 6px; }
.estampa span { font-size: 15px; color: var(--tinta-suave); }
.estampa .est { font-size: 15px; letter-spacing: 2px; min-height: 20px; }
.estampa.pegada { border: 6px solid #fff; background: var(--c, var(--sol)); box-shadow: var(--sombra); }
.estampa.pegada:nth-child(odd) { transform: rotate(-2deg); }
.estampa.pegada:nth-child(even) { transform: rotate(1.6deg); }
.estampa.pegada .dibujo { background: rgba(255,255,255,.85); filter: none; opacity: 1; }
.estampa.pegada b, .estampa.pegada span { color: var(--tinta); }
.estampa:hover { transform: translateY(-3px) rotate(0); }
.estampa.pegada::after { content: ''; position: absolute; top: -10px; left: 50%; width: 46px; height: 18px; margin-left: -23px; background: rgba(255, 236, 160, .85); transform: rotate(-4deg); border-radius: 3px; }

.nota { background: #fff; border-left: 6px solid var(--sol); border-radius: 0 14px 14px 0; padding: 12px 16px; color: var(--tinta-suave); font-size: 16px; max-width: 46em; }

/* ---------- botones ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 56px; padding: 8px 24px; border: 0; border-radius: 18px; background: var(--pasto); color: #fff; font-weight: 800; font-size: 21px; text-decoration: none; box-shadow: 0 5px 0 #157A40; transition: transform .08s; }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 #157A40; }
.btn.azul { background: var(--cielo); box-shadow: 0 5px 0 #1F7CCB; }
.btn.blanco { background: #fff; color: var(--tinta); box-shadow: 0 5px 0 #C9D6EA; }
.btn.chico { min-height: 46px; font-size: 18px; padding: 6px 16px; border-radius: 14px; }
.btn[disabled] { opacity: .45; cursor: default; }
.fila { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; align-items: center; }

/* ---------- tarjetas para aprender ---------- */
.cabeza { display: flex; align-items: center; gap: 12px; margin: 4px 0 14px; }
.cabeza h1 { margin: 0; font-weight: 800; font-size: clamp(26px, 6vw, 38px); line-height: 1.05; }
.cabeza p { margin: 0; color: var(--tinta-suave); font-size: 16px; }
.cabeza .ico { font-size: 44px; }
.puntos { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; margin: 6px 0 14px; }
.puntos i { width: 11px; height: 11px; border-radius: 50%; background: #C9D6EA; }
.puntos i.ya { background: var(--cielo); }
.puntos i.aqui { background: var(--uva); transform: scale(1.35); }

.tarjeta {
  max-width: 460px; margin: 0 auto 18px; padding: 22px 18px 20px; text-align: center; background: #fff; border-radius: 28px;
  border: 8px solid #fff; outline: 3px solid var(--c, var(--sol)); box-shadow: var(--sombra);
}
.tarjeta .img { display: grid; place-items: center; min-height: 150px; font-size: 118px; line-height: 1; cursor: pointer; user-select: none; }
.tarjeta .palabra { font-weight: 800; font-size: clamp(38px, 10vw, 56px); line-height: 1.05; margin: 10px 0 2px; word-break: break-word; }
.tarjeta .frase { font-weight: 800; font-size: clamp(28px, 7vw, 38px); line-height: 1.15; margin: 10px 0 2px; }
.tarjeta .es { color: var(--tinta-suave); font-size: 19px; margin-bottom: 14px; }
.tarjeta .dilo { min-height: 26px; margin-top: 10px; font-size: 18px; }
.mancha { width: 132px; height: 132px; border-radius: 46% 54% 50% 50% / 52% 44% 56% 48%; border: 4px solid rgba(27,42,107,.18); }
.monton { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; max-width: 290px; font-size: 40px; line-height: 1.1; }
.monton.mini { font-size: 24px; max-width: 150px; }
.encasa { max-width: 520px; margin: 0 auto 18px; padding: 18px; background: #FFF6D6; border-radius: 22px; border: 3px solid var(--sol); }
.encasa h2 { margin: 0 0 6px; font-weight: 800; font-size: 24px; }
.encasa p { margin: 0 0 12px; }

/* ---------- juego ---------- */
.avance { height: 16px; background: #fff; border-radius: 999px; border: 3px solid #fff; box-shadow: inset 0 0 0 2px var(--cuadro); overflow: hidden; margin: 2px 0 16px; }
.avance i { display: block; height: 100%; background: var(--pasto); border-radius: 999px; transition: width .3s ease; }
.pide { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 0 0 16px; text-align: center; font-weight: 800; font-size: clamp(22px, 5.4vw, 30px); line-height: 1.15; }
.oye { flex: none; display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; border: 0; background: var(--cielo); color: #fff; font-size: 30px; box-shadow: 0 5px 0 #1F7CCB; }
.oye.grande { width: 104px; height: 104px; font-size: 50px; margin: 6px auto 18px; }
.oye:active { transform: translateY(4px); box-shadow: 0 1px 0 #1F7CCB; }
.opciones { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; max-width: 520px; margin: 0 auto; }
.op { position: relative; display: grid; place-items: center; min-height: 128px; padding: 10px; border: 4px solid #fff; border-radius: 22px; background: #fff; box-shadow: var(--sombra); font-size: 70px; line-height: 1; }
.op.texto { min-height: 74px; font-size: 28px; font-weight: 800; }
.op .mancha { width: 84px; height: 84px; }
.opciones.palabras { grid-template-columns: 1fr; max-width: 420px; }
.op.mal { opacity: .35; animation: no .35s; }
.op.bien { border-color: var(--pasto); background: #E4F7EC; animation: si .4s; }
.grande-img { display: grid; place-items: center; min-height: 140px; font-size: 110px; line-height: 1; margin: 0 auto 14px; }
.sino { display: flex; gap: 14px; justify-content: center; }
.sino .op { min-width: 140px; min-height: 90px; font-size: 30px; font-weight: 800; }

.memoria { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; max-width: 560px; margin: 0 auto; }
.carta { aspect-ratio: 3 / 4; border: 0; border-radius: 16px; background: var(--uva); color: #fff; font-size: 34px; box-shadow: var(--sombra); display: grid; place-items: center; padding: 4px; }
.carta.abierta, .carta.lista { background: #fff; color: var(--tinta); }
.carta.lista { outline: 4px solid var(--pasto); }
.carta .t { font-size: clamp(15px, 3.8vw, 22px); font-weight: 800; line-height: 1.05; word-break: break-word; }
.carta .mancha { width: 56%; height: auto; aspect-ratio: 1; }
@media (max-width: 420px) { .memoria { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; } .carta { font-size: 28px; } }

.casillas { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; min-height: 64px; margin: 0 auto 16px; }
.casilla { width: 50px; height: 58px; border-radius: 12px; background: #fff; border: 3px dashed #B9CBE4; display: grid; place-items: center; font-size: 30px; font-weight: 800; }
.casilla.llena { border-style: solid; border-color: var(--cielo); }
.letras { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-bottom: 16px; }
.letra { width: 56px; height: 60px; border: 0; border-radius: 14px; background: var(--sol); font-size: 30px; font-weight: 800; box-shadow: 0 5px 0 #D9A21C; }
.letra:disabled { visibility: hidden; }
.tiras { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-bottom: 16px; min-height: 60px; }
.tira { min-height: 52px; padding: 4px 16px; border: 0; border-radius: 14px; background: var(--sol); font-size: 24px; font-weight: 800; box-shadow: 0 5px 0 #D9A21C; }
.tira.puesta { background: #fff; box-shadow: 0 5px 0 #C9D6EA; }
.renglon { min-height: 70px; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: center; padding: 8px; margin: 0 auto 14px; max-width: 560px; border-bottom: 4px solid var(--margen); }
.aviso { text-align: center; min-height: 32px; font-weight: 800; font-size: 22px; margin: 12px 0 6px; }
.aviso.bien { color: var(--pasto); }
.aviso.mal { color: var(--rojo); }

/* ---------- final ---------- */
.final { text-align: center; padding-top: 10px; }
.final .estrellas { font-size: 64px; letter-spacing: 6px; margin: 4px 0; }
.final .nueva { width: 190px; margin: 6px auto 18px; transform: rotate(-4deg); }
.final .nueva.estampa { animation: pegar .7s cubic-bezier(.2,1.4,.4,1) both; }
.final h1 { font-weight: 800; font-size: clamp(32px, 8vw, 46px); margin: 0; line-height: 1.05; }
.confeti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 9; }
.confeti i { position: absolute; top: -40px; font-size: 26px; font-style: normal; animation: cae 2.2s ease-in forwards; }

@keyframes si { 50% { transform: scale(1.06); } }
@keyframes no { 25% { transform: translateX(-7px); } 75% { transform: translateX(7px); } }
@keyframes pegar { from { transform: scale(1.6) rotate(12deg); opacity: 0; } to { transform: scale(1) rotate(-4deg); opacity: 1; } }
@keyframes cae { to { transform: translateY(110vh) rotate(540deg); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .confeti { display: none; }
}
@media (max-width: 420px) {
  .hola { grid-template-columns: 1fr; }
  .hola .globo { display: none; }
  .estampas { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .op { min-height: 112px; font-size: 60px; }
  .letra { width: 48px; height: 54px; font-size: 26px; }
  .casilla { width: 42px; height: 50px; font-size: 26px; }
}
