/*
VOICE: alegre, cálida y clara, como un videojuego infantil bien hecho.
IDEA: un cielo de día sobre colinas, con Tico el búho guiando un camino de mundos.
PICTURE: Tico grande con burbuja de diálogo; botones gruesos tipo caramelo con sombra inferior.
COLOUR and TYPE: cielo azul #2b8cff, sol #ffcc33, naranja de Tico #ff9f1c, coral, verde pasto; Baloo 2.
LAYOUT: una columna centrada (máx. 960px), botones grandes, se reorganiza en tableta y computadora.
*/
:root {
  --sky1: #2b8cff; --sky2: #8fd3ff; --sky3: #d9f1ff;
  --ink: #23304a; --muted: #5f6b85; --card: #ffffff; --line: #e3e9f3;
  --green: #3ccf5a; --green-d: #23a23e; --orange: #ff9f1c; --orange-d: #d97a00;
  --blue: #2b8cff; --blue-d: #1665cc; --purple: #8b5cf6; --purple-d: #6634d6;
  --yellow: #ffcc33; --yellow-d: #d9a400; --red: #ff5a5f; --red-d: #d63a3f;
  --r: 22px; --shadow: 0 10px 24px rgba(20, 50, 110, .18);
  --font: 'Baloo 2', 'Trebuchet MS', 'Segoe UI', system-ui, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; min-width: 0; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; }
body {
  font: 500 17px/1.45 var(--font); color: var(--ink);
  background: linear-gradient(180deg, var(--sky1) 0%, var(--sky2) 45%, var(--sky3) 100%) fixed;
  overflow-x: clip; user-select: none; -webkit-user-select: none;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
input, select, textarea { user-select: text; -webkit-user-select: text; }
button, a, input, select { font: inherit; color: inherit; }
a { text-decoration: none; }
svg { display: block; }
.ico { display: inline-flex; width: 1.25em; height: 1.25em; vertical-align: -0.22em; }
.ico svg { width: 100%; height: 100%; }
.ico.big { width: 44px; height: 44px; }
.grow { flex: 1; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.hint { text-align: center; color: #fff; font-weight: 700; text-shadow: 0 1px 2px rgba(0,0,0,.2); margin: 14px auto; max-width: 520px; }

/* Cielo y paisaje */
.sky { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.cloud { position: absolute; width: 160px; height: 52px; background: #fff; border-radius: 60px; opacity: .9; animation: drift 60s linear infinite; }
.cloud::before, .cloud::after { content: ''; position: absolute; background: #fff; border-radius: 50%; }
.cloud::before { width: 70px; height: 70px; left: 24px; top: -34px; }
.cloud::after { width: 56px; height: 56px; left: 80px; top: -24px; }
.c1 { top: 10%; left: -10%; } .c2 { top: 26%; left: 40%; transform: scale(.7); animation-duration: 80s; animation-delay: -30s; }
.c3 { top: 6%; left: 75%; transform: scale(.85); animation-duration: 70s; animation-delay: -50s; }
@keyframes drift { from { translate: -20vw 0; } to { translate: 120vw 0; } }
.hills { position: absolute; bottom: 0; left: 0; width: 100%; height: 22vh; min-height: 120px; }

.splash { position: fixed; inset: 0; display: grid; place-items: center; color: #fff; font-size: 28px; font-weight: 800; }
.screen { min-height: 100vh; min-height: 100dvh; padding-bottom: 40px; }
main { width: min(960px, 100%); margin: 0 auto; padding: 0 16px; }

/* Botones tipo caramelo */
.btn {
  --b: var(--blue); --bd: var(--blue-d);
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap;
  min-height: 52px; padding: 10px 22px; border: 0; border-radius: 18px; cursor: pointer;
  background: var(--b); color: #fff; font-weight: 800; font-size: 19px; text-align: center; line-height: 1.15;
  box-shadow: 0 6px 0 var(--bd), 0 10px 18px rgba(0,0,0,.15);
  transition: transform .08s, box-shadow .08s; position: relative;
  text-shadow: 0 1px 0 rgba(0,0,0,.15);
}
.btn:active { transform: translateY(5px); box-shadow: 0 1px 0 var(--bd), 0 4px 8px rgba(0,0,0,.15); }
.btn:focus-visible, .icon-btn:focus-visible, button:focus-visible, a:focus-visible, .input:focus-visible { outline: 4px solid #ffe066; outline-offset: 3px; }
.btn-big { min-height: 72px; font-size: clamp(20px, 4.6vw, 24px); border-radius: 24px; width: 100%; }
.btn-small { min-height: 44px; font-size: 16px; padding: 8px 16px; border-radius: 14px; box-shadow: 0 4px 0 var(--bd); }
.btn-green { --b: var(--green); --bd: var(--green-d); }
.btn-orange { --b: var(--orange); --bd: var(--orange-d); }
.btn-blue { --b: var(--blue); --bd: var(--blue-d); }
.btn-purple { --b: var(--purple); --bd: var(--purple-d); }
.btn-yellow { --b: var(--yellow); --bd: var(--yellow-d); color: #5a3d00; text-shadow: none; }
.btn-red { --b: var(--red); --bd: var(--red-d); }
.btn-ghost { --b: #eef2f8; --bd: #cfd8e6; color: var(--ink); text-shadow: none; }
.btn .ico { width: 28px; height: 28px; }
.btn small { display: block; width: 100%; font-size: 14px; font-weight: 600; opacity: .9; }
.btn em { position: absolute; top: -12px; right: 12px; background: #ffe066; color: #5a3d00; font-style: normal; font-size: 13px; padding: 2px 10px; border-radius: 99px; text-shadow: none; box-shadow: 0 2px 0 #d9a400; }
.btn-parents { display: block; margin: 10px auto 0; padding: 12px 18px; color: #fff; font-weight: 700; text-align: center; text-decoration: underline; text-underline-offset: 4px; background: rgba(20, 60, 130, .25); border-radius: 14px; width: fit-content; }
.link-btn { background: none; border: 0; color: var(--blue-d); font-weight: 700; text-decoration: underline; cursor: pointer; padding: 10px; min-height: 44px; }

/* Barra superior */
.topbar { display: flex; align-items: center; gap: 10px; padding: 12px 16px; width: min(960px, 100%); margin: 0 auto; }
.topbar-title { flex: 1; margin: 0; font-size: clamp(20px, 5vw, 28px); font-weight: 800; color: #fff; text-align: center; text-shadow: 0 2px 0 rgba(0,0,0,.15); line-height: 1.1; }
.topbar.plain .topbar-title { color: #fff; }
.icon-btn { flex: none; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 16px; border: 0; background: #fff; color: var(--blue-d); box-shadow: 0 4px 0 #c9d8ef; cursor: pointer; }
.icon-btn svg { width: 26px; height: 26px; }
.profile-chip { display: flex; align-items: center; gap: 8px; background: #fff; border-radius: 99px; padding: 4px 14px 4px 4px; box-shadow: 0 4px 0 #c9d8ef; min-height: 48px; max-width: 46%; }
.chip-avatar { width: 40px; height: 40px; flex: none; }
.chip-name { font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.counters { display: flex; gap: 6px; }
.counter { display: flex; align-items: center; gap: 4px; background: rgba(255,255,255,.92); border-radius: 99px; padding: 4px 10px; font-weight: 800; box-shadow: 0 3px 0 #c9d8ef; white-space: nowrap; }
.counter .ico { width: 22px; height: 22px; }
@media (max-width: 420px) { .counter { padding: 3px 8px; font-size: 15px; } .profile-chip { padding-right: 8px; } .chip-name { display: none; } }

/* Logo */
.logo { display: flex; flex-direction: column; align-items: center; line-height: .9; margin: 6px 0 0; filter: drop-shadow(0 4px 0 rgba(0,0,0,.12)); }
.logo-1 { font-size: clamp(44px, 12vw, 76px); font-weight: 800; letter-spacing: 1px; }
.logo-1 i { font-style: normal; display: inline-block; -webkit-text-stroke: 3px #fff; paint-order: stroke fill; animation: bounce 2.8s ease-in-out infinite; animation-delay: calc(var(--i) * .12s); }
.logo-1 i:nth-child(6n+1) { color: #ff5a5f; } .logo-1 i:nth-child(6n+2) { color: #ff9f1c; } .logo-1 i:nth-child(6n+3) { color: #ffcc33; }
.logo-1 i:nth-child(6n+4) { color: #3ccf5a; } .logo-1 i:nth-child(6n+5) { color: #2b8cff; } .logo-1 i:nth-child(6n+6) { color: #8b5cf6; }
.logo-2 { font-size: clamp(32px, 8.5vw, 52px); font-weight: 800; color: #fff; background: #ff5d8f; padding: 0 22px 2px; border-radius: 20px; margin-top: -4px; transform: rotate(-3deg); box-shadow: 0 5px 0 #d13d6d; }
.logo.big .logo-1 { font-size: clamp(52px, 14vw, 88px); }
@keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

/* Tico */
.mascot-stage { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.mascot-stage.row { flex-direction: row; justify-content: center; }
.mascot { background: none; border: 0; padding: 0; cursor: pointer; width: clamp(150px, 38vw, 210px); animation: float 3.4s ease-in-out infinite; }
.mascot.small { width: 92px; flex: none; }
.mascot.hop { animation: hop .5s ease; }
.mascot-svg { width: 100%; height: auto; overflow: visible; }
.mascot-svg .pupils { transform-box: fill-box; transform-origin: center; animation: blink 4.5s infinite; }
.mascot-svg .wing-l { transform-box: fill-box; transform-origin: top right; animation: wave 3.4s ease-in-out infinite; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes hop { 0% { transform: translateY(0); } 40% { transform: translateY(-26px) rotate(-6deg); } 100% { transform: translateY(0); } }
@keyframes blink { 0%, 94%, 100% { transform: scaleY(1); } 97% { transform: scaleY(.1); } }
@keyframes wave { 0%, 80%, 100% { transform: rotate(0); } 88% { transform: rotate(18deg); } }
.bubble { position: relative; background: #fff; border-radius: 22px; padding: 12px 18px; margin: 0; max-width: 440px; text-align: center; font-size: clamp(18px, 4.4vw, 21px); font-weight: 700; box-shadow: var(--shadow); }
.mascot-stage:not(.row) .bubble::before { content: ''; position: absolute; top: -12px; left: 50%; translate: -50% 0; border: 12px solid transparent; border-top: 0; border-bottom-color: #fff; }
.mascot-stage.row .bubble::before { content: ''; position: absolute; left: -12px; top: 50%; translate: 0 -50%; border: 12px solid transparent; border-left: 0; border-right-color: #fff; }
.bubble.pop { animation: pop .35s ease; }
.small-bubble { margin: 16px auto 0; font-size: 18px; }
@keyframes pop { 0% { transform: scale(.85); opacity: .4; } 100% { transform: scale(1); opacity: 1; } }

/* Inicio */
.home .hero { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.journey { display: flex; align-items: center; justify-content: center; margin: 18px auto 18px; background: rgba(255,255,255,.35); border-radius: 99px; padding: 8px 12px; width: fit-content; max-width: 100%; }
.journey-step { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.journey-dot { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--c); color: #fff; font-weight: 800; font-size: 20px; box-shadow: 0 4px 0 rgba(0,0,0,.18); border: 3px solid #fff; }
.journey-step.locked .journey-dot { background: #dfe6ef; }
.journey-stars { display: flex; align-items: center; gap: 2px; font-size: 14px; font-weight: 800; color: var(--ink); }
.journey-stars .ico { width: 16px; height: 16px; }
.journey-line { width: clamp(12px, 5vw, 40px); height: 6px; background: #fff; border-radius: 6px; margin-bottom: 22px; opacity: .8; }
.menu { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; max-width: 520px; margin: 0 auto; }
@media (min-width: 760px) {
  .home { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px 36px; align-items: center; }
  .home .hero { grid-row: span 2; } .journey { grid-column: 2; margin: 0 auto; } .menu { grid-column: 2; }
}

/* Perfiles */
.welcome { display: flex; flex-direction: column; align-items: center; gap: 18px; padding-top: 24px; max-width: 520px; }
.mini-hero { display: flex; align-items: center; justify-content: center; gap: 12px; padding-top: 20px; }
.mini-hero h1, .welcome h1 { color: #fff; font-size: clamp(30px, 8vw, 44px); margin: 0; text-shadow: 0 3px 0 rgba(0,0,0,.15); }
.profile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 16px; margin: 20px 0; }
.profile-card { display: flex; flex-direction: column; align-items: center; gap: 4px; background: #fff; border: 0; border-radius: var(--r); padding: 16px 10px; cursor: pointer; box-shadow: 0 6px 0 #c9d8ef, var(--shadow); transition: transform .1s; }
.profile-card:active { transform: translateY(4px); }
.profile-avatar { width: 92px; height: 92px; }
.profile-name { font-size: 22px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; max-width: 100%; white-space: nowrap; }
.profile-meta { color: var(--muted); font-size: 15px; }

.card { background: #fff; border-radius: 28px; padding: clamp(18px, 4vw, 30px); box-shadow: var(--shadow); }
.form { display: flex; flex-direction: column; gap: 20px; max-width: 560px; margin: 8px auto 0; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field .label { font-size: 21px; font-weight: 800; }
.field input, .input { width: 100%; min-height: 56px; border: 3px solid var(--line); border-radius: 16px; padding: 8px 16px; font-size: 22px; font-weight: 700; background: #f7faff; }
.field input:focus, .input:focus { border-color: var(--blue); outline: none; }
.field.inline { gap: 4px; margin: 10px 0; } .field.inline > span { font-weight: 700; font-size: 15px; color: var(--muted); }
.field.inline .input { min-height: 48px; font-size: 16px; }
.age-row { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.age-btn { min-height: 60px; border: 3px solid var(--line); background: #f7faff; border-radius: 16px; font-size: 26px; font-weight: 800; cursor: pointer; }
.age-btn.sel { background: var(--orange); color: #fff; border-color: var(--orange-d); }
.avatar-pick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.avatar-opt { display: flex; flex-direction: column; align-items: center; gap: 2px; border: 3px solid var(--line); background: #f7faff; border-radius: 18px; padding: 8px; cursor: pointer; font-weight: 700; }
.avatar-opt svg { width: 70px; height: 70px; }
.avatar-opt.sel { border-color: var(--green); background: #e9fbe9; box-shadow: 0 0 0 3px #b2f2bb; }
.form-error { color: var(--red-d); font-weight: 700; margin: 0; min-height: 1.4em; text-align: center; }

/* Mapa de mundos */
.world-path { list-style: none; padding: 10px 0; margin: 0 auto; max-width: 620px; display: flex; flex-direction: column; gap: 18px; position: relative; }
.world-path::before { content: ''; position: absolute; left: 50%; top: 30px; bottom: 30px; width: 10px; translate: -50% 0; background: repeating-linear-gradient(#fff 0 18px, transparent 18px 32px); border-radius: 8px; opacity: .8; }
.world { position: relative; display: flex; }
.world.left { justify-content: flex-start; } .world.right { justify-content: flex-end; }
.world-btn { display: flex; align-items: center; gap: 12px; width: min(86%, 440px); padding: 12px 18px 12px 12px; border: 0; border-radius: 26px; background: #fff; cursor: pointer; text-align: left; box-shadow: 0 7px 0 color-mix(in srgb, var(--c) 70%, #000), var(--shadow); border: 4px solid var(--c); }
.world-btn:active { transform: translateY(4px); }
.world-num { display: grid; place-items: center; flex: none; width: 62px; height: 62px; border-radius: 50%; background: var(--c); color: #fff; font-size: 32px; font-weight: 800; }
.world-num .ico { width: 32px; height: 32px; }
.world-text b { display: block; font-size: 20px; line-height: 1.15; }
.world-text span { color: var(--muted); font-size: 15px; }
.world.locked .world-btn { border-color: #cfd8e6; box-shadow: 0 7px 0 #b8c4d6; filter: saturate(.3); }
.world.locked .world-num { background: #e9eef5; }

/* Etapa */
.stage-head { display: flex; align-items: center; gap: 12px; background: #fff; border-radius: 28px; padding: 14px 20px 14px 12px; box-shadow: var(--shadow); border-bottom: 8px solid var(--c); margin-bottom: 18px; }
.stage-head h2 { margin: 0; font-size: clamp(22px, 5vw, 30px); line-height: 1.1; color: var(--c); filter: brightness(.85); }
.stage-head p { margin: 2px 0 0; color: var(--muted); }
.module-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.module-card { position: relative; display: flex; align-items: center; gap: 14px; background: #fff; border-radius: 24px; padding: 16px; box-shadow: 0 6px 0 #c9d8ef, var(--shadow); color: var(--ink); }
.module-card:active { transform: translateY(4px); }
.module-icon { flex: none; width: 64px; height: 64px; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 16%, #fff); border-radius: 18px; }
.module-icon svg { width: 48px; height: 48px; }
.module-text b { display: block; font-size: 20px; line-height: 1.15; } .module-text span { color: var(--muted); font-size: 15px; }
.module-text { flex: 1; }
.module-stars { position: absolute; right: 14px; bottom: 8px; display: flex; } .module-stars .ico { width: 18px; height: 18px; }
.badge { position: absolute; top: -10px; right: 14px; background: #ffe066; color: #5a3d00; font-size: 13px; font-weight: 800; padding: 2px 10px; border-radius: 99px; box-shadow: 0 2px 0 #d9a400; }
.soon { display: flex; flex-direction: column; align-items: center; gap: 22px; padding-top: 10px; }
.soon-actions { display: grid; gap: 18px; width: min(100%, 440px); }

/* Zona de juegos */
.game-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; }
.game-card { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 160px; padding: 16px 10px 12px; border: 0; border-radius: 26px; cursor: pointer; background: var(--c); color: #fff; box-shadow: 0 7px 0 color-mix(in srgb, var(--c) 65%, #000), var(--shadow); }
.game-card:active { transform: translateY(5px); }
.game-card b { font-size: 18px; line-height: 1.15; text-align: center; text-shadow: 0 1px 0 rgba(0,0,0,.2); }
.game-glyph { display: grid; place-items: center; min-width: 76px; height: 64px; padding: 0 10px; background: #fff; color: var(--c); border-radius: 18px; font-size: 26px; font-weight: 800; white-space: nowrap; }
.game-card.soon { filter: saturate(.55); }
.game-stars { display: flex; background: rgba(255,255,255,.9); padding: 2px 8px; border-radius: 99px; } .game-stars .ico { width: 18px; height: 18px; }

/* Memoria */
.level-pick { display: flex; flex-direction: column; gap: 22px; align-items: center; }
.level-buttons { display: grid; gap: 20px; width: min(100%, 440px); }
.btn.suggested { outline: 4px solid #fff; }
.mem-status { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin: 0 0 14px; }
.mem-status span { background: #fff; padding: 6px 16px; border-radius: 99px; font-weight: 700; box-shadow: 0 3px 0 #c9d8ef; }
.mem-grid { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: clamp(8px, 2vw, 16px); max-width: 620px; margin: 0 auto; perspective: 900px; }
.mem-card { aspect-ratio: 3 / 4; border: 0; padding: 0; background: none; cursor: pointer; }
.mem-inner { position: relative; display: block; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .4s; }
.mem-card.flip .mem-inner { transform: rotateY(180deg); }
.mem-back, .mem-front { position: absolute; inset: 0; display: grid; place-items: center; border-radius: 18px; backface-visibility: hidden; -webkit-backface-visibility: hidden; box-shadow: 0 5px 0 rgba(0,0,0,.15); }
.mem-back { background: linear-gradient(135deg, #8b5cf6, #2b8cff); border: 4px solid #fff; }
.mem-back span { color: #fff; font-size: clamp(30px, 8vw, 46px); font-weight: 800; opacity: .9; }
.mem-front { background: #fff; transform: rotateY(180deg); border: 4px solid #e3e9f3; }
.mem-card.done .mem-front { border-color: var(--green); background: #effcef; animation: pop .4s; }
.mem-letter { font-size: clamp(40px, 12vw, 70px); font-weight: 800; line-height: 1; -webkit-text-stroke: 1px rgba(0,0,0,.08); }
.mem-word { font-size: clamp(14px, 3.6vw, 20px); font-weight: 800; padding: 4px; text-align: center; overflow-wrap: anywhere; }
.mem-word b { font-size: 1.5em; }

/* Premios */
.totals { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.total { display: flex; flex-direction: column; align-items: center; background: #fff; border-radius: 22px; padding: 12px 6px; box-shadow: var(--shadow); }
.total b { font-size: clamp(26px, 7vw, 38px); line-height: 1.1; } .total > span:last-child { color: var(--muted); font-size: 15px; }
.section-title { color: #fff; font-size: 26px; margin: 26px 0 0; text-shadow: 0 2px 0 rgba(0,0,0,.15); }
.rewards .hint { text-align: left; margin: 0 0 10px; }
.avatar-shop { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 12px; }
.shop-item { display: flex; flex-direction: column; align-items: center; gap: 2px; background: #fff; border: 4px solid transparent; border-radius: 20px; padding: 10px 6px; cursor: pointer; box-shadow: 0 5px 0 #c9d8ef; }
.shop-item.sel { border-color: var(--green); }
.shop-item.locked .shop-avatar { filter: grayscale(1) brightness(1.1); opacity: .6; }
.shop-avatar { width: 70px; height: 70px; }
.shop-tag { display: flex; align-items: center; gap: 3px; font-size: 14px; font-weight: 800; color: var(--blue-d); }
.shop-item.sel .shop-tag { color: var(--green-d); }
.medal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; margin-top: 12px; }
.medal { display: flex; flex-direction: column; align-items: center; text-align: center; background: rgba(255,255,255,.7); border-radius: 20px; padding: 12px 8px; }
.medal.on { background: #fff; box-shadow: var(--shadow); }
.medal-ico { width: 56px; height: 64px; } .medal b { line-height: 1.15; margin-top: 4px; } .medal span { font-size: 13px; color: var(--muted); }
.trophy-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-top: 12px; }
.trophy { display: flex; flex-direction: column; align-items: center; text-align: center; background: #fff; border-radius: 20px; padding: 12px 8px; border-bottom: 6px solid var(--c); }
.trophy span:last-child { font-size: 13px; color: var(--muted); }

/* Ventanas */
.modal-wrap { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: rgba(15, 30, 70, .45); animation: fade .2s; }
.modal-wrap.out { opacity: 0; transition: opacity .18s; }
.modal { position: relative; width: min(460px, 100%); max-height: 92vh; overflow: auto; background: #fff; border-radius: 30px; padding: 26px 22px 22px; text-align: center; box-shadow: 0 20px 50px rgba(0,0,0,.3); animation: pop .3s ease; }
.modal h2 { margin: 0 0 6px; font-size: clamp(24px, 6vw, 30px); line-height: 1.1; }
.modal-mascot { width: 110px; margin: -10px auto 4px; }
.modal-body p { margin: 8px 0; }
.modal-actions { display: flex; flex-direction: column; gap: 14px; margin-top: 18px; }
.modal-avatar svg { width: 100px; height: 100px; margin: 0 auto; }
.result-stars { display: flex; justify-content: center; gap: 6px; } .result-stars .ico { width: 56px; height: 56px; animation: pop .5s backwards; }
.result-stars .ico:nth-child(2) { animation-delay: .15s; } .result-stars .ico:nth-child(3) { animation-delay: .3s; }
.new-medals { background: #fff8db; border-radius: 16px; padding: 8px; margin-top: 10px; } .new-medals p { margin: 0 0 4px; font-weight: 800; }
.medal-chip { display: inline-block; background: var(--m); color: #fff; padding: 2px 12px; border-radius: 99px; font-weight: 800; margin: 2px; text-shadow: 0 1px 0 rgba(0,0,0,.2); }
.big-q { font-size: 32px; font-weight: 800; }
@keyframes fade { from { opacity: 0; } }
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); translate: -50% 0; z-index: 60; background: #23304a; color: #fff; padding: 12px 22px; border-radius: 16px; font-weight: 700; box-shadow: var(--shadow); animation: pop .25s; max-width: 90vw; text-align: center; }
.toast.out { opacity: 0; transition: opacity .4s; }
.confetti { position: fixed; inset: 0; z-index: 70; pointer-events: none; }

/* Panel de padres (más sobrio) */
.parents { max-width: 860px; }
.gate-card { max-width: 400px; margin: 10px auto; text-align: center; }
.gate-card h2 { margin: 0 0 4px; }
.pin-dots { display: flex; justify-content: center; gap: 16px; margin: 18px 0; }
.pin-dots i { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--blue); }
.pin-dots i.on { background: var(--blue); }
.pin-dots.shake { animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
.keypad { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.key { min-height: 62px; border: 0; border-radius: 16px; background: #eef4ff; font-size: 26px; font-weight: 800; cursor: pointer; box-shadow: 0 4px 0 #cbd9f0; }
.key:active { transform: translateY(3px); box-shadow: 0 1px 0 #cbd9f0; }
.key-fn { font-size: 16px; background: #f1f3f5; }
.key[data-k="ok"] { background: var(--green); color: #fff; box-shadow: 0 4px 0 var(--green-d); }
.tabs { display: flex; gap: 8px; margin: 4px 0 14px; overflow-x: auto; }
.tab { flex: 1; min-height: 48px; border: 0; border-radius: 14px; background: rgba(255,255,255,.55); font-weight: 800; font-size: 17px; cursor: pointer; }
.tab.on { background: #fff; color: var(--blue-d); box-shadow: 0 4px 0 #c9d8ef; }
.tab-body { background: #fff; border-radius: 24px; padding: clamp(16px, 3vw, 26px); box-shadow: var(--shadow); }
.tab-body h2 { font-size: 22px; margin: 18px 0 8px; } .tab-body h2:first-child { margin-top: 0; }
.tab-body h3 { font-size: 19px; margin: 22px 0 8px; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.row-between h2 { margin: 0 !important; }
.admin-list { display: grid; gap: 14px; }
.admin-card { border: 2px solid var(--line); border-radius: 20px; padding: 14px; }
.admin-head { display: flex; gap: 12px; align-items: center; }
.admin-avatar { width: 58px; height: 58px; flex: none; }
.admin-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.pill { display: inline-block; background: #e9fbe9; color: var(--green-d); font-size: 13px; font-weight: 800; padding: 0 10px; border-radius: 99px; }
.empty { color: var(--muted); background: #f7faff; border-radius: 14px; padding: 14px; text-align: center; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; margin-top: 10px; }
.stat { background: #f4f8ff; border-radius: 16px; padding: 12px; } .stat b { display: block; font-size: 24px; line-height: 1.1; white-space: nowrap; } .stat span { color: var(--muted); font-size: 14px; }
.bars { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; align-items: end; height: 170px; }
.bar-col { display: flex; flex-direction: column; align-items: center; height: 100%; font-size: 13px; color: var(--muted); }
.bar-val { font-size: 11px; height: 16px; white-space: nowrap; }
.bar { flex: 1; width: 70%; background: #eef2f8; border-radius: 10px; display: flex; align-items: flex-end; overflow: hidden; }
.bar i { display: block; width: 100%; background: var(--blue); border-radius: 10px; min-height: 0; }
.letter-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.lchip { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: #f1f3f5; color: #adb5bd; font-weight: 800; }
.lchip.on { background: var(--green); color: #fff; }
.err-list { display: flex; flex-wrap: wrap; gap: 8px; }
.err { background: #fff0f0; color: var(--red-d); padding: 4px 12px; border-radius: 99px; font-weight: 800; }
.err b { background: var(--red); color: #fff; border-radius: 99px; padding: 0 7px; margin-left: 4px; }
.table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table th, .table td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); }
.table td:nth-child(n+3), .table th:nth-child(n+3) { text-align: right; white-space: nowrap; }
@media (max-width: 600px) {
  .table thead { display: none; }
  .table tr { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2px 8px; padding: 10px 0; border-bottom: 1px solid var(--line); }
  .table td { border: 0; padding: 0; text-align: left !important; }
  .table td:nth-child(1) { grid-column: 1 / -1; color: var(--muted); font-size: 13px; }
  .table td:nth-child(2) { grid-column: 1 / -1; font-weight: 700; }
  .table td:nth-child(3)::before { content: 'Estrellas '; color: var(--muted); }
  .table td:nth-child(4)::before { content: 'Bien '; color: var(--muted); }
  .table td:nth-child(5)::before { content: 'Errores '; color: var(--muted); }
}
.switch-list { display: grid; gap: 6px; }
.switch { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 52px; padding: 4px 4px 4px 0; cursor: pointer; font-weight: 700; }
.switch input { position: absolute; opacity: 0; }
.switch i { flex: none; width: 58px; height: 34px; background: #ced4da; border-radius: 99px; position: relative; transition: background .2s; }
.switch i::after { content: ''; position: absolute; top: 4px; left: 4px; width: 26px; height: 26px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 2px 4px rgba(0,0,0,.2); }
.switch input:checked + i { background: var(--green); }
.switch input:checked + i::after { transform: translateX(24px); }
.switch input:focus-visible + i { outline: 4px solid #ffe066; outline-offset: 2px; }
.noscript { color: #fff; text-align: center; font-size: 22px; padding: 40px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Ajustes para celulares: el título baja a su propia línea */
@media (max-width: 600px) {
  .topbar { flex-wrap: wrap; row-gap: 6px; }
  .topbar-title { order: 5; flex-basis: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .topbar .counters { margin-left: auto; }
}
.btn-parents { background: rgba(20, 50, 120, .55); text-decoration: none; }
/* Títulos y pistas legibles sobre cualquier parte del paisaje */
.section-title { display: inline-block; background: #fff; color: var(--blue-d); padding: 2px 18px; border-radius: 16px; text-shadow: none; box-shadow: 0 4px 0 #c9d8ef; }
.hint { background: rgba(20, 50, 120, .55); text-shadow: none; padding: 8px 16px; border-radius: 16px; width: fit-content; }
.rewards .hint { margin-top: 10px; }

/* ===== Fase 2: abecedario, vocales y actividades ===== */
.meter { height: 14px; background: #eef2f8; border-radius: 99px; overflow: hidden; }
.meter i { display: block; height: 100%; background: linear-gradient(90deg, #3ccf5a, #8ce99a); border-radius: 99px; transition: width .5s; }
.abc-head { display: flex; align-items: center; gap: 12px; background: #fff; border-radius: 24px; padding: 10px 18px 14px 10px; box-shadow: var(--shadow); }
.abc-count { margin: 0 0 6px; font-size: 18px; } .abc-count b { font-size: 26px; color: var(--orange-d); }
.abc-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin: 18px 0; }
.letter-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 10px; }
.letter-tile { position: relative; display: flex; align-items: baseline; justify-content: center; gap: 4px; aspect-ratio: 1; background: #fff; border-radius: 20px; padding-top: 10px; box-shadow: 0 5px 0 #c9d8ef; color: var(--lc); }
.letter-tile:active { transform: translateY(4px); }
.lt-up { font-size: 40px; font-weight: 800; line-height: 1; } .lt-low { font-size: 26px; font-weight: 700; line-height: 1; opacity: .8; }
.letter-tile.learned { background: color-mix(in srgb, var(--lc) 14%, #fff); box-shadow: 0 5px 0 color-mix(in srgb, var(--lc) 55%, #fff); }
.letter-tile.next { outline: 4px solid #fff; animation: pulse 1.6s ease-in-out infinite; }
.lt-star { position: absolute; top: -6px; right: -6px; width: 26px; height: 26px; }
@keyframes pulse { 50% { transform: scale(1.06); } }

.letter-view { display: flex; flex-direction: column; gap: 16px; align-items: center; }
.letter-card { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: 10px; background: #fff; border-radius: 30px; padding: 18px; box-shadow: 0 8px 0 color-mix(in srgb, var(--lc) 60%, #fff), var(--shadow); }
.lc-letters { display: flex; align-items: baseline; justify-content: center; gap: 8px; color: var(--lc); -webkit-text-stroke: 2px rgba(0,0,0,.08); }
.lc-up { font-size: clamp(90px, 26vw, 170px); font-weight: 800; line-height: .9; } .lc-low { font-size: clamp(60px, 17vw, 110px); font-weight: 800; line-height: .9; }
.lc-picture { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.illu, .illu-face svg { width: clamp(110px, 30vw, 170px); height: auto; }
.illu-face { display: block; }
.word { font-weight: 800; font-size: 24px; color: var(--ink); } .word.big { font-size: clamp(26px, 6vw, 36px); } .word b { font-size: 1.15em; }
@media (max-width: 520px) { .letter-card { grid-template-columns: minmax(0, 1fr); } }
.sound-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; width: 100%; }
.sound-btn { display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 76px; border: 0; border-radius: 20px; background: #fff; color: var(--blue-d); font-weight: 800; font-size: 18px; cursor: pointer; box-shadow: 0 5px 0 #c9d8ef; padding: 8px; }
.sound-btn .ico { width: 30px; height: 30px; } .sound-btn small { color: var(--muted); font-size: 14px; }
.sound-btn:active { transform: translateY(4px); box-shadow: 0 1px 0 #c9d8ef; }
.letter-nav { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; width: 100%; }
.icon-btn.big { width: 64px; height: 64px; border-radius: 20px; }
.icon-btn.flip svg { transform: scaleX(-1); }

/* Actividades de opción */
.act { display: flex; flex-direction: column; gap: 16px; max-width: 640px; margin: 0 auto; }
.act-progress { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.act-progress i { width: 18px; height: 18px; border-radius: 50%; background: rgba(255,255,255,.6); border: 3px solid #fff; }
.act-progress i.ok { background: var(--green); } .act-progress i.half { background: var(--yellow); }
.act-prompt { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; background: #fff; border-radius: 28px; padding: 18px 56px; min-height: 140px; justify-content: center; box-shadow: var(--shadow); text-align: center; }
.act-prompt.in { animation: pop .35s ease; }
.q { margin: 0; font-size: clamp(20px, 5vw, 26px); font-weight: 800; line-height: 1.2; }
.q-letter { font-size: clamp(64px, 18vw, 100px); font-weight: 800; line-height: 1; color: var(--ink); }
.q-hint { margin: 0; color: var(--muted); font-size: 18px; }
.q-ear { display: grid; place-items: center; width: 84px; height: 84px; border-radius: 50%; background: #fff3bf; color: #e8a400; font-size: 52px; font-weight: 800; }
.q-pic .illu, .q-pic .illu-face svg { width: clamp(110px, 32vw, 150px); }
.q-word { display: flex; gap: 6px; margin: 6px 0 0; font-size: clamp(34px, 10vw, 52px); font-weight: 800; letter-spacing: 2px; }
.blank { display: inline-grid; place-items: center; min-width: 1em; border-bottom: 5px solid var(--blue); color: #ced4da; }
.filled { animation: pop .4s; }
.word-reveal { font-size: clamp(28px, 8vw, 40px); } .word-reveal b { font-size: 1.2em; }
.replay { position: absolute; top: 10px; right: 10px; width: 48px; height: 48px; border-radius: 50%; border: 0; background: #e7f5ff; color: var(--blue-d); cursor: pointer; display: grid; place-items: center; }
.replay svg { width: 26px; height: 26px; }
.act-options { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: 14px; }
.opt { min-height: clamp(96px, 26vw, 130px); border: 4px solid #fff; border-radius: 26px; background: #fff; cursor: pointer; box-shadow: 0 7px 0 #c9d8ef, var(--shadow); display: grid; place-items: center; transition: transform .1s; }
.opt:active { transform: translateY(5px); box-shadow: 0 2px 0 #c9d8ef; }
.opt-letter { font-size: clamp(54px, 15vw, 80px); font-weight: 800; line-height: 1; -webkit-text-stroke: 1px rgba(0,0,0,.06); }
.opt.ok { border-color: var(--green); background: #ebfbee; animation: pop .35s; }
.opt.no { border-color: #ffc9c9; background: #fff5f5; opacity: .55; animation: shake .35s; }
.opt.hint { border-color: var(--yellow); animation: pulse 1s ease-in-out infinite; }
.act-foot { display: flex; align-items: center; gap: 8px; justify-content: center; min-height: 80px; }
.act-foot .bubble { margin: 0; }
.act-foot .bubble:empty { visibility: hidden; }
.mascot.tiny { width: 70px; flex: none; }

/* Vocales */
.vowels .mascot-stage { margin-bottom: 14px; }
.vowel-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.vowel-card { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px; border: 0; border-radius: 22px; background: #fff; cursor: pointer; box-shadow: 0 6px 0 color-mix(in srgb, var(--lc) 55%, #fff), var(--shadow); }
.vowel-card.pop { animation: hop .5s ease; }
.vc-letters { font-size: clamp(36px, 10vw, 64px); font-weight: 800; color: var(--lc); line-height: 1; } .vc-letters small { font-size: .6em; margin-left: 2px; }
.vc-pic .illu, .vc-pic .illu-face svg { width: 100%; max-width: 90px; }
.vowels .module-grid { margin-top: 12px; }
.act-icon { color: #fff; } .act-icon svg { width: 34px; height: 34px; }

/* Atrapa las vocales */
.catch { display: flex; flex-direction: column; gap: 10px; }
.catch-hud { display: flex; justify-content: space-between; gap: 10px; }
.catch-hud span { background: #fff; padding: 6px 16px; border-radius: 99px; font-weight: 800; font-size: 18px; box-shadow: 0 3px 0 #c9d8ef; }
.catch-field { position: relative; height: min(60vh, 520px); border-radius: 28px; overflow: hidden; background: linear-gradient(#c5ecff, #e9f8ff); border: 5px solid #fff; box-shadow: var(--shadow); touch-action: manipulation; }
.catch-ready { position: absolute; inset: 0; display: grid; place-items: center; font-size: 40px; font-weight: 800; color: var(--blue-d); animation: pop .5s; }
.catch-bubble { position: absolute; top: 0; left: 0; width: 82px; height: 82px; border-radius: 50%; border: 4px solid rgba(255,255,255,.9); background: radial-gradient(circle at 30% 30%, #fff 0 14%, color-mix(in srgb, var(--bc) 30%, #fff) 15% 60%, color-mix(in srgb, var(--bc) 55%, #fff)); color: color-mix(in srgb, var(--bc) 70%, #000); font: 800 44px/1 var(--font); cursor: pointer; display: grid; place-items: center; box-shadow: 0 6px 14px rgba(0,0,0,.12); will-change: transform; padding: 0; }
.catch-bubble.popped { animation: popout .35s forwards; }
.catch-bubble.wrong { animation: shake .3s, fadeout .35s forwards; }
@keyframes popout { to { scale: 1.6; opacity: 0; } }
@keyframes fadeout { to { opacity: 0; } }

/* Meta para abrir la siguiente etapa */
.goal-box { display: flex; flex-direction: column; gap: 10px; margin-top: 22px; background: rgba(255,255,255,.92); border-radius: 24px; padding: 16px 18px; box-shadow: var(--shadow); color: var(--ink); }
.goal-box > b { font-size: 20px; }
.goal { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; font-weight: 700; }
.goal .meter { grid-column: 1 / -1; }
.goal-num { color: var(--muted); white-space: nowrap; }
.goal-box.done { background: #ebfbee; border: 3px solid var(--green); }
.world-unlocked { width: 110px; height: 110px; margin: 0 auto 8px; border-radius: 50%; background: var(--c); display: grid; place-items: center; border: 6px solid #fff; box-shadow: 0 0 0 6px var(--c), 0 10px 20px rgba(0,0,0,.2); animation: hop .7s; }
.world-unlocked b { color: #fff; font-size: 56px; }
.tab-body .empty { text-align: left; line-height: 1.5; }

/* ===== Fase 3: escritura ===== */
.trace-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 10px; margin-top: 12px; }
.trace-grid.wide { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
.trace-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 86px; background: #fff; border-radius: 20px; box-shadow: 0 5px 0 #c9d8ef; color: var(--ink); padding: 6px; }
.trace-tile:active { transform: translateY(4px); }
.tt-text { font-size: 34px; font-weight: 800; line-height: 1; color: var(--c, var(--blue)); }
.trace-grid.wide .tt-text { font-size: 26px; }
.tt-stars { display: flex; } .tt-stars .ico { width: 16px; height: 16px; }
.trace-tile.done { background: #f3fff4; }
.writing-list .section-title { margin-top: 22px; }

.trace { display: flex; flex-direction: column; gap: 10px; }
.trace-head { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; background: #fff; border-radius: 22px; padding: 10px 14px; box-shadow: var(--shadow); min-height: 74px; justify-content: center; }
.step-dots { display: flex; gap: 6px; }
.step-dots i { width: 28px; height: 8px; border-radius: 8px; background: #e3e9f3; }
.step-dots i.now { background: var(--blue); } .step-dots i.ok { background: var(--green); }
.trace-step { margin: 0; font-weight: 800; font-size: clamp(16px, 4.2vw, 20px); text-align: center; }
.trace-model { display: none; font-size: 38px; font-weight: 800; color: var(--c); line-height: 1; }
.trace-model.show { display: block; }
.tracer-wrap { position: relative; width: 100%; height: clamp(280px, 50vh, 460px); background: #fff; border-radius: 26px; box-shadow: 0 6px 0 #c9d8ef, var(--shadow); overflow: hidden; touch-action: none; }
.tracer-wrap.wide { height: clamp(220px, 40vh, 380px); }
.tracer-canvas { display: block; touch-action: none; cursor: crosshair; }
.trace-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.trace-actions .btn { min-height: 60px; padding: 8px 6px; font-size: clamp(16px, 4.2vw, 20px); }
.trace-actions .btn .ico { width: 22px; height: 22px; }
.trace .act-foot { min-height: 64px; }

/* ===== Fase 4: sílabas, palabras y arrastrar ===== */
.family-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-top: 16px; }
.family-card { display: flex; flex-direction: column; align-items: center; gap: 4px; background: #fff; border-radius: 22px; padding: 12px 8px; box-shadow: 0 5px 0 #c9d8ef; color: var(--ink); text-align: center; }
.family-card:active { transform: translateY(4px); }
.fam-label { display: grid; place-items: center; min-width: 54px; height: 54px; padding: 0 10px; border-radius: 16px; background: var(--c); color: #fff; font-size: 26px; font-weight: 800; }
.fam-label .ico { width: 28px; height: 28px; }
.fam-syl { font-weight: 800; font-size: 17px; color: var(--muted); letter-spacing: .5px; }
.family-card.locked { opacity: .65; } .family-card.locked .fam-label { background: #e9eef5; }
.family-card.done { background: #f1fffb; }

.syl-lesson { display: flex; flex-direction: column; gap: 16px; align-items: stretch; }
.join-card { background: #fff; border-radius: 28px; padding: 18px; box-shadow: var(--shadow); text-align: center; }
.join-card p { margin: 6px 0 0; }
.join-row { display: flex; align-items: center; justify-content: center; gap: clamp(6px, 2vw, 14px); flex-wrap: wrap; }
.jt { display: grid; place-items: center; min-width: clamp(64px, 18vw, 96px); height: clamp(64px, 18vw, 96px); padding: 0 10px; border-radius: 22px; font-size: clamp(34px, 10vw, 54px); font-weight: 800; color: #fff; box-shadow: 0 6px 0 rgba(0,0,0,.15); }
.jt.cons { background: #4263eb; } .jt.vowel { background: #f76707; } .jt.result { background: var(--green); min-width: clamp(90px, 26vw, 140px); }
.jplus { font-size: 34px; font-weight: 800; color: var(--muted); }
.join-row.go .jt.cons { animation: slideR .6s ease; } .join-row.go .jt.vowel { animation: slideL .6s ease; } .join-row.go .jt.result { animation: pop .5s .45s backwards; }
@keyframes slideR { from { transform: translateX(-30px); opacity: .3; } } @keyframes slideL { from { transform: translateX(30px); opacity: .3; } }
.syl-buttons { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 10px; }
.syl-btn { display: flex; flex-direction: column; align-items: center; gap: 0; min-height: 84px; border: 0; border-radius: 20px; background: #fff; cursor: pointer; box-shadow: 0 6px 0 #c9d8ef; padding: 8px; }
.syl-btn b { font-size: 32px; color: #2b8a3e; line-height: 1.1; } .syl-btn small { color: var(--muted); font-size: 15px; font-weight: 700; }
.syl-btn:active { transform: translateY(4px); }
.opt-syl { font-size: clamp(34px, 10vw, 52px); font-weight: 800; color: #2b5cd6; }
.q-join { font-size: clamp(30px, 8vw, 46px); font-weight: 800; color: var(--ink); margin: 4px 0 0; }
.q-join b { color: var(--green-d); }
.q-letter.syl { color: #2b8a3e; }
.hl { color: #f76707; }

/* Armar con arrastrar y soltar */
.slots { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 6px; min-height: 92px; }
.slot { display: grid; place-items: center; min-width: clamp(70px, 20vw, 100px); height: clamp(70px, 20vw, 92px); border-radius: 20px; border: 4px dashed #9fb4d6; background: rgba(255,255,255,.7); transition: transform .15s, background .15s; }
.slot.over { background: #e7f5ff; border-color: var(--blue); transform: scale(1.06); }
.slot.filled { border-style: solid; border-color: #fff; background: #fff; }
.slot.wrong { border-color: var(--red); animation: shake .35s; }
.slots.done .slot { border-color: var(--green); background: #ebfbee; animation: pop .4s; }
.slot-sep { font-size: 30px; font-weight: 800; color: #fff; text-shadow: 0 2px 0 rgba(0,0,0,.15); }
.bank { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; padding: 14px; background: rgba(255,255,255,.35); border-radius: 26px; min-height: 100px; }
.piece { display: grid; place-items: center; min-width: clamp(66px, 19vw, 92px); height: clamp(62px, 18vw, 84px); padding: 0 12px; border-radius: 18px; background: #fff; color: #2b5cd6; font: 800 clamp(30px, 9vw, 44px)/1 var(--font); box-shadow: 0 6px 0 #c9d8ef; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; }
.piece.in-slot { box-shadow: none; min-width: 0; width: 100%; height: 100%; background: transparent; }
.piece.ghost { opacity: .25; box-shadow: none; background: rgba(255,255,255,.5); cursor: default; }
.piece.lifted { opacity: .35; }
.piece.dragging { position: fixed; z-index: 80; pointer-events: none; transform: scale(1.12) rotate(-3deg); box-shadow: 0 14px 28px rgba(0,0,0,.25); }
.piece.hint { animation: pulse 1s ease-in-out infinite; outline: 4px solid var(--yellow); }
.build-actions { display: flex; justify-content: center; }

.level-cards { display: grid; gap: 14px; margin-top: 16px; }
.level-card { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 14px; align-items: center; background: #fff; border-radius: 24px; padding: 14px 16px; box-shadow: 0 6px 0 color-mix(in srgb, var(--c) 55%, #fff), var(--shadow); color: var(--ink); border: 4px solid var(--c); }
.level-card .meter { grid-column: 1 / -1; }
.lc-n { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--c); color: #fff; font-size: 30px; font-weight: 800; }
.lc-n .ico { width: 28px; height: 28px; }
.level-card.locked { border-color: #cfd8e6; box-shadow: 0 6px 0 #b8c4d6; filter: saturate(.3); }
.level-card.locked .lc-n { background: #e9eef5; }
.word-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.wchip { background: #fff; color: #5f3dc4; font-weight: 800; padding: 4px 14px; border-radius: 99px; box-shadow: 0 3px 0 #d0bfff; }
.slots.many { gap: 3px; flex-wrap: nowrap; }
.slots.many .slot { min-width: 0; width: clamp(56px, 20vw, 92px); height: clamp(56px, 18vw, 84px); border-radius: 16px; }
.slots.many .slot-sep { font-size: 20px; }
.slots.many .piece.in-slot, .bank.many .piece { font-size: clamp(24px, 7vw, 40px); }
.bank.many .piece { min-width: clamp(56px, 17vw, 86px); height: clamp(54px, 16vw, 78px); padding: 0 8px; }

/* ===== Fase 5: leer, cuentos y dictados ===== */
.q-read { font-size: clamp(44px, 13vw, 72px); font-weight: 800; color: #5f3dc4; letter-spacing: 2px; line-height: 1.1; }
.opt-pic .illu, .opt-pic .illu-face svg { width: clamp(70px, 22vw, 110px); height: auto; }
.opt-word { font-size: clamp(26px, 7.5vw, 40px); font-weight: 800; color: #2b5cd6; }
.opt-text { font-size: clamp(18px, 5vw, 24px); font-weight: 800; color: var(--ink); padding: 6px; line-height: 1.2; }
.text-opts .opt { min-height: 72px; }
.opt-yes, .opt-no { font-size: clamp(34px, 10vw, 48px); font-weight: 800; }
.opt-yes { color: var(--green-d); } .opt-no { color: var(--red-d); }
.q-pic.small .illu, .q-pic.small .illu-face svg { width: clamp(80px, 22vw, 110px); }
.q-sentence { margin: 4px 0; font-size: clamp(22px, 6vw, 32px); font-weight: 800; line-height: 1.3; color: var(--ink); }
.gap { display: inline-block; min-width: 3.2em; border-bottom: 5px solid var(--blue); color: #ced4da; text-align: center; }
.fill { color: var(--green-d); animation: pop .4s; }
.q-para { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 10px; align-items: start; text-align: left; }
.q-para p { margin: 0; font-size: clamp(17px, 4.6vw, 21px); line-height: 1.5; font-weight: 600; }
.q-para-pic .illu, .q-para-pic .illu-face svg { width: 64px; height: auto; }

.book-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; padding-top: 6px; }
.book { position: relative; display: flex; flex-direction: column; background: #fff; border-radius: 24px; overflow: hidden; box-shadow: 0 7px 0 color-mix(in srgb, var(--c) 55%, #fff), var(--shadow); color: var(--ink); border: 4px solid var(--c); }
.book:active { transform: translateY(4px); }
.book-cover .scene { display: block; width: 100%; height: auto; }
.book-info { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 14px; }
.book-info b { font-size: 19px; line-height: 1.15; }

.reader { display: flex; flex-direction: column; gap: 12px; max-width: 720px; }
.page-dots { display: flex; justify-content: center; gap: 6px; }
.page-dots i { width: 24px; height: 8px; border-radius: 8px; background: rgba(255,255,255,.6); }
.page-dots i.now { background: #fff; } .page-dots i.ok { background: var(--green); }
.page-scene { border-radius: 26px; overflow: hidden; box-shadow: var(--shadow); border: 5px solid #fff; background: #fff; }
.page-scene .scene { display: block; width: 100%; height: auto; }
.page-scene.turn { animation: turn .45s ease; }
@keyframes turn { from { transform: perspective(800px) rotateY(-14deg); opacity: .4; } }
.page-text { margin: 0; background: #fff; border-radius: 24px; padding: 16px 18px; font-size: clamp(22px, 6vw, 30px); line-height: 1.55; font-weight: 700; box-shadow: var(--shadow); user-select: none; }
.page-text .w { border-radius: 8px; padding: 0 2px; cursor: pointer; transition: background .15s, color .15s; }
.page-text .w.read { color: #5f6b85; }
.page-text .w.on { background: #ffe066; color: #3b2a00; box-shadow: 0 0 0 3px #ffe066; }
.reader-nav { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.reader-nav .btn { min-height: 60px; }
.icon-btn:disabled { opacity: .35; }
.hidden { display: none !important; }
.small-hint { font-size: 14px; }

.dict-intro { display: flex; flex-direction: column; align-items: center; gap: 18px; max-width: 520px; padding-top: 8px; }
.dict { display: flex; flex-direction: column; gap: 10px; max-width: 640px; }
.dict-card { display: flex; flex-direction: column; align-items: center; gap: 10px; background: #fff; border-radius: 26px; padding: 14px; box-shadow: var(--shadow); }
.dict-listen { min-height: 52px; }
.dict-flash { margin: 0; font-size: 36px; font-weight: 800; color: #5f3dc4; }
.dict-answer { width: 100%; min-height: 70px; display: flex; align-items: center; justify-content: center; flex-wrap: wrap; border: 4px dashed #9fb4d6; border-radius: 18px; font-size: clamp(32px, 9vw, 48px); font-weight: 800; color: #2b5cd6; letter-spacing: 2px; padding: 4px 10px; word-break: break-word; }
.dict-answer.long { font-size: clamp(20px, 5.6vw, 28px); letter-spacing: 0; justify-content: flex-start; text-align: left; }
.dict-answer.good { border-color: var(--green); border-style: solid; background: #ebfbee; }
.dict-answer.bad { border-color: var(--red); animation: shake .35s; }
.caret { display: inline-block; width: 3px; height: 1em; background: #2b5cd6; margin-left: 2px; animation: blinkc 1s steps(1) infinite; }
@keyframes blinkc { 50% { opacity: 0; } }
.dict-diff { letter-spacing: 3px; } .dk-ok { color: var(--green-d); } .dk-no { color: var(--red-d); text-decoration: underline; }
.kbd { display: flex; flex-direction: column; gap: 6px; background: rgba(255,255,255,.55); border-radius: 20px; padding: 8px 4px; }
.kbd-row { display: flex; justify-content: center; gap: 4px; }
.key-k { flex: 1 1 0; max-width: 54px; min-width: 0; height: clamp(46px, 12vw, 58px); border: 0; border-radius: 10px; background: #fff; box-shadow: 0 3px 0 #c9d8ef; font: 800 clamp(18px, 5vw, 24px)/1 var(--font); color: var(--ink); cursor: pointer; padding: 0; }
.key-k:active { transform: translateY(2px); box-shadow: 0 1px 0 #c9d8ef; }
.key-fn { background: #e7f5ff; color: var(--blue-d); max-width: 60px; } .key-fn svg { width: 22px; height: 22px; margin: auto; }
.key-fn.on { background: var(--yellow); color: #5a3d00; }
.key-space { flex: 5 1 0; max-width: 300px; font-size: 16px; color: var(--muted); }
.dict-actions { display: flex; justify-content: center; }
.dict-actions .btn { max-width: 420px; }
.opt-word, .opt-text { overflow-wrap: anywhere; } .text-opts .opt { min-height: 68px; } .text-opts .opt-text { font-size: clamp(20px, 5.6vw, 26px); }
.book .badge { top: 10px; right: 10px; }

/* ===== Fase 6: juegos ===== */
/* Une las letras */
.match-title { text-align: center; color: #fff; font-weight: 800; font-size: clamp(17px, 4.6vw, 21px); margin: 6px 0 10px; text-shadow: 0 1px 2px rgba(0,0,0,.25); }
.match-board { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(40px, 18vw, 140px); max-width: 560px; margin: 0 auto; background: rgba(255,255,255,.45); border-radius: 26px; padding: 14px; touch-action: none; }
.match-lines { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 2; }
.match-col { display: flex; flex-direction: column; gap: 12px; }
.m-item { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 6px; min-height: 76px; border: 4px solid #fff; border-radius: 20px; background: #fff; box-shadow: 0 5px 0 #c9d8ef; cursor: pointer; padding: 4px 10px; touch-action: none; }
.match-col[data-side="R"] .m-item { justify-content: space-between; }
.m-item .dot { flex: none; width: 16px; height: 16px; border-radius: 50%; background: #9fb4d6; }
.m-letter { flex: 1; text-align: center; font-size: clamp(36px, 10vw, 52px); font-weight: 800; line-height: 1; }
.m-pic { flex: 1; display: grid; place-items: center; } .m-pic .illu, .m-pic .illu-face svg { width: 60px; height: 60px; }
.m-item.sel { border-color: var(--blue); transform: scale(1.04); } .m-item.sel .dot { background: var(--blue); }
.m-item.done { border-color: var(--green); background: #ebfbee; } .m-item.done .dot { background: var(--green); }
.m-item.no { border-color: var(--red); animation: shake .35s; }

/* Palabra escondida */
.wsearch { display: flex; flex-direction: column; gap: 12px; max-width: 560px; }
.ws-list { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.ws-word { display: flex; align-items: center; gap: 4px; background: #fff; border-radius: 16px; padding: 4px 10px 4px 4px; box-shadow: 0 3px 0 #c9d8ef; font-size: 18px; }
.ws-pic .illu, .ws-pic .illu-face svg { width: 40px; height: 40px; }
.ws-word.found { background: #ebfbee; } .ws-word.found b { text-decoration: line-through; color: var(--green-d); }
.ws-word.found .ws-pic { opacity: .5; }
.ws-grid { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 4px; background: #fff; border-radius: 22px; padding: 10px; box-shadow: var(--shadow); touch-action: none; user-select: none; }
.ws-cell { aspect-ratio: 1; display: grid; place-items: center; border-radius: 10px; background: #f1f5fb; font-size: clamp(20px, 6.4vw, 32px); font-weight: 800; color: var(--ink); cursor: pointer; }
.ws-cell.sel { background: #74c0fc; color: #fff; }
.ws-cell.found { background: #8ce99a; color: #1b5e20; }

/* Carrera de lectura */
.race { display: flex; flex-direction: column; gap: 10px; max-width: 620px; position: relative; }
.track { position: relative; background: #495057; border-radius: 20px; padding: 8px 10px; border: 4px solid #fff; box-shadow: var(--shadow); }
.lane { position: relative; height: 56px; border-bottom: 3px dashed #ffe066; }
.lane:last-of-type { border-bottom: 0; }
.racer { position: absolute; top: 4px; left: calc(var(--p, 0) * (100% - 78px)); width: 78px; transition: left .4s ease; }
.racer[data-tico] { transition: none; }
.racer.zoom { animation: zoomcar .4s; }
@keyframes zoomcar { 50% { transform: translateX(6px) rotate(-3deg); } }
.car { width: 78px; height: 46px; display: block; overflow: visible; }
.finish { position: absolute; top: 4px; bottom: 4px; right: 6px; width: 12px; background: repeating-linear-gradient(#fff 0 8px, #212529 8px 16px); border-radius: 3px; }
.race-ready { position: absolute; inset: 0; display: grid; place-items: center; font-size: 48px; font-weight: 800; color: #fff; text-shadow: 0 3px 0 rgba(0,0,0,.25); z-index: 5; pointer-events: none; animation: pop .4s; }
.race-ready.go { color: #ffe066; animation: pop .4s; }

/* Rompecabezas: el dibujo es un cuadrado de lado --S partido en --n tiras */
.pz-ghost { width: clamp(90px, 26vw, 130px); opacity: .18; filter: grayscale(1); }
.pz-ghost .illu, .pz-ghost .illu-face svg { width: 100%; height: auto; }
.slots.puzzle, .bank.puzzle { --S: clamp(150px, 46vw, 220px); }
.slots.puzzle { gap: 0; flex-wrap: nowrap; }
.slots.puzzle .slot { width: calc(var(--S) / var(--n)); min-width: 0; height: calc(var(--S) + 30px); border-radius: 0; border-width: 3px; }
.slots.puzzle .slot:first-of-type { border-radius: 14px 0 0 14px; } .slots.puzzle .slot:last-of-type { border-radius: 0 14px 14px 0; }
.bank.puzzle { gap: 8px; }
.bank.puzzle .piece, .slots.puzzle .piece { width: calc(var(--S) / var(--n)); min-width: 0; height: calc(var(--S) + 30px); padding: 0; overflow: hidden; border-radius: 10px; }
.slots.puzzle .piece.in-slot { border-radius: 0; }
.pz { display: flex; flex-direction: column; align-items: center; width: 100%; height: 100%; }
.pz-slice { position: relative; display: block; width: 100%; height: var(--S); overflow: hidden; flex: none; }
.pz-slice > svg, .pz-slice > .illu-face { position: absolute; top: 0; width: var(--S); height: var(--S); left: calc(var(--S) / var(--n) * var(--k) * -1); }
.pz-slice > .illu-face svg { width: 100%; height: 100%; }
.pz b { font-size: clamp(16px, 4.6vw, 24px); line-height: 30px; color: #2b5cd6; }
.slots.many:not(.puzzle) { width: 100%; } .slots.many:not(.puzzle) .slot { flex: 1 1 0; width: auto; max-width: 92px; }
.trace-sentence { margin: 2px 0 0; font-size: clamp(20px, 5.4vw, 26px); font-weight: 800; color: var(--muted); text-align: center; } .trace-sentence .now { color: #2b5cd6; background: #e7f5ff; border-radius: 8px; padding: 0 6px; } .trace-sentence .done { color: var(--green-d); }
.trace-grid.sentences { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); } .trace-grid.sentences .tt-text { font-size: 22px; }

/* ===== Graduación y diploma ===== */
.grad-cap { width: 120px; margin: 0 auto; } .grad-cap svg { width: 100%; height: auto; animation: hop .8s; }
.goal-box.grad { border: 3px solid #d4a017; background: #fffbea; }
.diploma-btn { margin: 16px 0 0; }
.diploma-page { max-width: 820px; padding-top: 12px; }
.diploma-actions { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.diploma { background: #fffdf5; border-radius: 18px; padding: clamp(10px, 2.5vw, 18px); box-shadow: var(--shadow); }
.dp-border { border: 6px double #d4a017; border-radius: 12px; padding: clamp(16px, 4vw, 36px); text-align: center; background:
  radial-gradient(circle at 0 0, #fff3bf 0 30px, transparent 31px), radial-gradient(circle at 100% 0, #d3f9d8 0 30px, transparent 31px),
  radial-gradient(circle at 0 100%, #d0ebff 0 30px, transparent 31px), radial-gradient(circle at 100% 100%, #ffe3e3 0 30px, transparent 31px); }
.dp-top { display: flex; justify-content: center; align-items: flex-end; gap: 10px; }
.dp-mascot { width: clamp(70px, 16vw, 100px); } .dp-avatar { width: clamp(56px, 13vw, 80px); }
.dp-kicker { margin: 8px 0 0; color: var(--muted); font-weight: 700; letter-spacing: .5px; }
.dp-title { margin: 2px 0 6px; font-size: clamp(26px, 6.4vw, 42px); line-height: 1.05; color: #b07d00; }
.dp-to { margin: 0; color: var(--muted); }
.dp-name { margin: 0; font-size: clamp(36px, 10vw, 64px); font-weight: 800; color: #2b5cd6; line-height: 1.1; border-bottom: 3px solid #d4a017; display: inline-block; padding: 0 20px; }
.dp-text { max-width: 560px; margin: 12px auto; font-size: clamp(15px, 3.8vw, 18px); line-height: 1.45; }
.dp-stats { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 16px; margin: 6px 0 16px; color: var(--muted); }
.dp-stats b { color: var(--ink); font-size: 1.2em; }
.dp-sign { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: end; gap: 10px; }
.dp-sign > span:not(.dp-seal) { border-top: 2px solid #868e96; padding-top: 4px; font-weight: 800; display: flex; flex-direction: column; }
.dp-sign i { font-style: normal; font-weight: 600; color: var(--muted); font-size: 13px; }
.dp-seal { width: 64px; height: 64px; display: grid; place-items: center; border-radius: 50%; background: #fff3bf; border: 3px solid #d4a017; }
.dp-seal svg { width: 40px; height: 40px; }
@media print {
  body { background: #fff !important; padding: 0; } .sky, .toast, .no-print, .topbar { display: none !important; }
  .diploma-page { max-width: none; padding: 0; } .diploma { box-shadow: none; } .screen { padding: 0; }
  @page { size: landscape; margin: 10mm; }
}
