/* =========================================================
   LETRILANDIA · Estilos (móvil primero)
   ========================================================= */
@font-face { font-family: 'Andika'; font-weight: 400; font-display: swap; src: url('../fonts/andika-400.woff2') format('woff2'); }
@font-face { font-family: 'Andika'; font-weight: 700; font-display: swap; src: url('../fonts/andika-700.woff2') format('woff2'); }
@font-face { font-family: 'Fredoka'; font-weight: 400 700; font-display: swap; src: url('../fonts/fredoka.woff2') format('woff2'); }

:root {
  --bg1: #e7f5ff; --bg2: #fff0f6; --bg3: #fff9db;
  --ink: #2b2d42; --ink-soft: #5c5f7a; --card: #ffffff; --line: #e9ecef;
  --accent: #7048e8; --good: #2f9e44; --bad: #e03131;
  --radius: 22px; --shadow: 0 6px 0 rgba(0,0,0,.08), 0 10px 24px rgba(60,40,120,.10);
  --font-ui: 'Fredoka', 'Andika', system-ui, sans-serif;
  --font-read: 'Andika', 'Fredoka', system-ui, sans-serif;
  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg1: #1c1b33; --bg2: #26203f; --bg3: #1f2a3a;
    --ink: #f1f3f5; --ink-soft: #b8bbd6; --card: #2c2a4a; --line: #3d3a63;
    --shadow: 0 6px 0 rgba(0,0,0,.35), 0 10px 24px rgba(0,0,0,.35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] { --bg1: #1c1b33; --bg2: #26203f; --bg3: #1f2a3a; --ink: #f1f3f5; --ink-soft: #b8bbd6; --card: #2c2a4a; --line: #3d3a63; color-scheme: dark; }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font-ui); color: var(--ink);
  background: linear-gradient(160deg, var(--bg1) 0%, var(--bg2) 55%, var(--bg3) 100%) fixed;
  background-color: var(--bg1);
  overscroll-behavior-y: none; touch-action: manipulation;
  -webkit-user-select: none; user-select: none;
}
body::before { /* puntitos decorativos */
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: .5;
  background-image: radial-gradient(circle at 10% 20%, rgba(255,212,59,.35) 0 6px, transparent 7px),
    radial-gradient(circle at 85% 12%, rgba(116,192,252,.35) 0 9px, transparent 10px),
    radial-gradient(circle at 70% 80%, rgba(240,101,149,.25) 0 7px, transparent 8px),
    radial-gradient(circle at 20% 75%, rgba(105,219,124,.3) 0 5px, transparent 6px);
}
button { font-family: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
input, select { font-family: inherit; }

#app { position: relative; z-index: 1; max-width: 560px; margin: 0 auto; min-height: 100dvh; padding-bottom: calc(24px + var(--safe-b)); }

/* ----- Barra superior ----- */
.topbar {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px;
  padding: calc(10px + var(--safe-t)) 16px 10px;
  background: color-mix(in srgb, var(--bg1) 80%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.icon-btn, .icon-spacer { width: 46px; height: 46px; flex: none; }
.icon-btn { border-radius: 16px; background: var(--card); box-shadow: var(--shadow); font-size: 22px; display: grid; place-items: center; }
.icon-btn:active { transform: translateY(3px); box-shadow: 0 2px 0 rgba(0,0,0,.1); }
.top-title { flex: 1; margin: 0; font-size: 22px; font-weight: 700; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.star-count { flex: none; min-width: 64px; height: 46px; padding: 0 14px; border-radius: 16px; background: #fff3bf; color: #8a5a00; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 18px; box-shadow: 0 4px 0 #fcc419; cursor: pointer; }
.star-count.bump { animation: bump .45s; }
.progress { flex: 1; height: 18px; background: var(--line); border-radius: 99px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 60%, #fff)); transition: width .5s cubic-bezier(.3,1.5,.6,1); }

.screen { padding: 8px 16px 16px; animation: enter .35s ease-out; }
.center-col { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 14px; }
.row { display: flex; align-items: center; }
.row.gap { gap: 12px; } .row.center { justify-content: center; } .row.wrap { flex-wrap: wrap; }

/* ----- Botones ----- */
.btn {
  font-family: var(--font-ui); font-weight: 700; font-size: 20px; padding: 14px 24px; border-radius: 20px;
  background: var(--accent); color: #fff; box-shadow: 0 6px 0 color-mix(in srgb, var(--accent) 60%, #000);
  transition: transform .08s; min-height: 56px;
}
.btn:active { transform: translateY(5px); box-shadow: 0 1px 0 color-mix(in srgb, var(--accent) 60%, #000); }
.btn.big { font-size: 22px; padding: 16px 28px; }
.btn.small { font-size: 16px; padding: 10px 16px; min-height: 46px; box-shadow: 0 4px 0 color-mix(in srgb, var(--accent) 60%, #000); }
.btn.ghost { background: var(--card); color: var(--ink); box-shadow: 0 5px 0 var(--line), 0 6px 16px rgba(0,0,0,.06); }
.btn.danger { background: #fa5252; box-shadow: 0 5px 0 #c92a2a; }
.pulse { animation: pulse 1.6s infinite; }

/* ----- Logo ----- */
.logo-word { font-weight: 700; font-size: clamp(40px, 13vw, 60px); letter-spacing: -1px; line-height: 1; text-shadow: 0 4px 0 rgba(0,0,0,.08); }
.logo-word span { display: inline-block; animation: float 2.4s ease-in-out infinite; }
.logo.small .logo-word { font-size: clamp(34px, 11vw, 48px); }
.logo { text-align: center; margin: 6px 0 4px; }
.lead { font-size: 20px; line-height: 1.35; margin: 0; max-width: 420px; }
.name-label { font-size: 20px; font-weight: 600; }
.name-input { width: 100%; max-width: 360px; font-size: 26px; padding: 14px 18px; border-radius: 18px; border: 3px solid var(--line); background: var(--card); color: var(--ink); text-align: center; font-weight: 600; outline: none; -webkit-user-select: text; user-select: text; }
.name-input:focus { border-color: var(--accent); }

/* ----- Mascota ----- */
.mascot { display: flex; align-items: center; gap: 10px; }
.mascot-body { flex: none; cursor: pointer; animation: bob 2.6s ease-in-out infinite; }
.mascot-body svg { width: 100%; height: 100%; overflow: visible; }
.mascot-body .lids { animation: blink 4.2s infinite; transform-origin: center 34px; }
.mascot-body.talk .wing-l { animation: flapL .35s infinite alternate; transform-origin: 22px 60px; }
.mascot-body.talk .wing-r { animation: flapR .35s infinite alternate; transform-origin: 98px 60px; }
.mascot-body.jump { animation: jump .55s; }
.bubble { position: relative; background: var(--card); border-radius: 20px; padding: 12px 44px 12px 16px; font-size: 19px; font-weight: 600; line-height: 1.3; box-shadow: var(--shadow); min-height: 48px; display: flex; align-items: center; }
.bubble::before { content: ''; position: absolute; left: -9px; top: 50%; margin-top: -9px; border: 9px solid transparent; border-right-color: var(--card); border-left: 0; }
.bubble.hidden { visibility: hidden; }
.bubble.pop { animation: popIn .3s ease-out; }
.bubble-say { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border-radius: 50%; background: color-mix(in srgb, var(--accent) 15%, transparent); font-size: 16px; }
.hello-row { display: flex; justify-content: center; margin: 4px 0 14px; }
.hello-row .mascot { max-width: 100%; }
.act-head { display: flex; align-items: center; gap: 10px; margin: 2px 0 10px; }
.act-head .mascot { flex: 1; min-width: 0; }
.badge { flex: none; background: var(--card); padding: 6px 12px; border-radius: 99px; font-weight: 700; font-size: 15px; box-shadow: var(--shadow); }

/* ----- Inicio ----- */
.home-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.tile {
  --c: #7048e8; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 16px; min-height: 130px;
  border-radius: var(--radius); background: var(--c); color: #fff; text-align: left;
  box-shadow: 0 7px 0 color-mix(in srgb, var(--c) 60%, #000), 0 14px 26px color-mix(in srgb, var(--c) 30%, transparent);
  animation: enter .4s backwards; position: relative; overflow: hidden; transition: transform .08s;
}
.tile::after { content: ''; position: absolute; right: -30px; top: -30px; width: 110px; height: 110px; border-radius: 50%; background: rgba(255,255,255,.14); }
.tile:active { transform: translateY(6px); box-shadow: 0 1px 0 color-mix(in srgb, var(--c) 60%, #000); }
.tile.big { grid-column: 1 / -1; min-height: 150px; flex-direction: row; align-items: center; gap: 16px; }
.tile-icon { font-size: 44px; line-height: 1; filter: drop-shadow(0 3px 0 rgba(0,0,0,.15)); }
.tile.big .tile-icon { font-size: 64px; }
.tile-text { display: flex; flex-direction: column; gap: 2px; }
.tile-text b { font-size: 21px; line-height: 1.1; }
.tile.big .tile-text b { font-size: 27px; }
.tile-text small { font-size: 15px; opacity: .92; font-weight: 500; }
.parents-link { display: block; margin: 22px auto 0; font-size: 16px; color: var(--ink-soft); padding: 10px 16px; border-radius: 14px; }

/* ----- Mapa ----- */
.map-path { position: relative; padding: 4px 0 30px; display: flex; flex-direction: column; align-items: center; }
.map-svg { position: absolute; left: 0; top: 0; pointer-events: none; z-index: 0; }
.map-line { fill: none; stroke: color-mix(in srgb, var(--ink) 25%, transparent); stroke-width: 6; stroke-dasharray: 2 14; stroke-linecap: round; }
.map-group { position: relative; z-index: 1; margin: 22px 0 6px; padding: 8px 18px; border-radius: 99px; background: var(--card); box-shadow: var(--shadow); font-weight: 700; font-size: 18px; }
.map-node {
  --c: #7048e8; position: relative; z-index: 1; width: 92px; height: 92px; margin: 10px 0; border-radius: 50%;
  transform: translateX(var(--off)); background: var(--card); color: var(--c);
  box-shadow: 0 7px 0 color-mix(in srgb, var(--c) 45%, #000), 0 0 0 6px color-mix(in srgb, var(--c) 25%, transparent);
  display: flex; flex-direction: column; align-items: center; justify-content: center; transition: transform .1s;
}
.map-node.done { background: var(--c); color: #fff; }
.map-node.next { animation: nodePulse 1.6s infinite; }
.map-node:active { transform: translateX(var(--off)) translateY(5px); }
.map-letter { font-family: var(--font-read); font-weight: 700; font-size: 32px; line-height: 1; }
.map-node .map-letter { font-size: 30px; }
.map-stars { position: absolute; bottom: -18px; display: flex; gap: 1px; font-size: 17px; font-style: normal; }
.map-stars i { font-style: normal; color: color-mix(in srgb, var(--ink) 18%, transparent); }
.map-stars i.on { color: #fab005; text-shadow: 0 1px 0 #e67700; }
.map-lolo { position: absolute; right: -66px; top: -10px; width: 60px; height: 60px; animation: bob 2s infinite; }
.map-lolo svg { width: 100%; height: 100%; }

/* ----- Actividades ----- */
.act { padding-top: 4px; }
.hero-letter {
  --c: #7048e8; display: block; margin: 4px auto 12px; font-family: var(--font-read); font-weight: 700;
  font-size: clamp(90px, 32vw, 150px); line-height: 1.05; color: var(--c); background: var(--card);
  padding: 4px 34px 14px; border-radius: 32px; box-shadow: 0 8px 0 color-mix(in srgb, var(--c) 45%, #000), 0 16px 30px rgba(0,0,0,.08);
  text-shadow: 0 5px 0 color-mix(in srgb, var(--c) 25%, transparent);
}
.hero-letter.wiggle { animation: wiggle .6s; }
.hint { text-align: center; color: var(--ink-soft); font-size: 16px; margin: 6px 0; }
.syl-wheel { display: flex; flex-direction: column; gap: 8px; margin: 6px 0 14px; }
.syl-row { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 8px; border-radius: 18px; background: var(--card); box-shadow: var(--shadow); font-family: var(--font-read); font-size: 30px; font-weight: 700; animation: enter .4s backwards; }
.syl-row.lit { animation: lit .6s; }
.syl-c { color: var(--accent); }
.syl-v { color: #f76707; }
.syl-plus, .syl-arrow { color: var(--ink-soft); font-size: 22px; }
.syl-res { background: var(--accent); color: #fff; padding: 2px 14px; border-radius: 12px; min-width: 76px; text-align: center; }
.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 18px; }
.gal-item { background: var(--card); border-radius: 20px; padding: 12px 6px; box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: center; gap: 4px; }
.gal-item:active, .pic:active, .choice:active, .chip:active, .key:active { transform: translateY(4px); }
.emoji { font-size: 54px; line-height: 1.1; font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif; }
.word { font-family: var(--font-read); font-size: 26px; font-weight: 700; }
.word .hl { color: var(--accent); text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 4px; }
.next-btn { display: block; margin: 8px auto 0; opacity: .45; transform: scale(.95); transition: opacity .3s, transform .3s; }
.next-btn.ready { opacity: 1; transform: none; animation: pulse 1.6s infinite; }

.dots { display: flex; justify-content: center; gap: 8px; margin: 2px 0 12px; }
.dots i { width: 14px; height: 14px; border-radius: 50%; background: var(--line); transition: .3s; }
.dots i.done { background: var(--good); }
.dots i.cur { background: var(--accent); transform: scale(1.3); }

.pic { display: grid; place-items: center; margin: 0 auto 14px; width: 160px; height: 160px; border-radius: 34px; background: var(--card); box-shadow: var(--shadow); animation: popIn .35s; }
.pic .emoji { font-size: 96px; }
.reveal { text-align: center; margin: -4px 0 12px; animation: popIn .3s; }
.reveal .word { font-size: 34px; }

.choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 10px 0; }
.choices.words, .choices.answers { grid-template-columns: 1fr; }
.choices.nums { grid-template-columns: repeat(3, 1fr); }
.choice {
  min-height: 84px; border-radius: 22px; background: var(--card); font-family: var(--font-read); font-weight: 700; font-size: 34px;
  box-shadow: 0 6px 0 var(--line), 0 10px 20px rgba(0,0,0,.06); transition: transform .08s; padding: 8px; animation: enter .35s backwards;
}
.choices .choice:nth-child(2) { animation-delay: .06s; } .choices .choice:nth-child(3) { animation-delay: .12s; }
.choices.words .choice { font-size: 32px; min-height: 72px; }
.choices.answers .choice { font-family: var(--font-ui); font-size: 21px; min-height: 62px; text-align: left; padding: 12px 18px; }
.choices.pics .choice { display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 108px; }
.choices.pics .emoji { font-size: 60px; }
.choices.pics small { font-family: var(--font-ui); font-size: 16px; }
.choice.good { background: #d3f9d8; color: var(--good); box-shadow: 0 6px 0 #8ce99a; animation: bump .4s; }
.choice.bad, .chip.bad, .key.bad, .find-tile.bad, .bubble-b.bad { animation: shake .45s; background: #ffe3e3; color: var(--bad); }

.word-build { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; margin: 8px 0 14px; font-family: var(--font-read); font-weight: 700; font-size: 38px; }
.chunk { display: inline-flex; align-items: center; }
.slot { display: inline-grid; place-items: center; min-width: 64px; height: 62px; padding: 0 8px; border-radius: 16px; border: 3px dashed color-mix(in srgb, var(--accent) 60%, transparent); color: var(--accent); background: color-mix(in srgb, var(--accent) 7%, transparent); }
.slot.wide { min-width: 76px; }
.slot.filled { border-style: solid; background: var(--accent); color: #fff; animation: popIn .3s; }
.slot.shake { animation: shake .45s; }
.letter-slot { min-width: 46px; height: 58px; font-size: 34px; padding: 0 4px; }
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin: 6px 0 14px; }
.chip { min-width: 84px; min-height: 66px; padding: 8px 16px; border-radius: 20px; background: #fff3bf; color: #7a4b00; font-family: var(--font-read); font-weight: 700; font-size: 32px; box-shadow: 0 6px 0 #fcc419; animation: enter .35s backwards; }
.chip.used { opacity: .2; transform: scale(.85); pointer-events: none; }
.word-chip { background: #e7f5ff; color: #1864ab; box-shadow: 0 6px 0 #74c0fc; font-size: 28px; }
.sentence-line { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; margin: 10px 0 16px; font-family: var(--font-read); font-weight: 700; font-size: 28px; }
.word-slot { min-width: 70px; height: 56px; font-size: 28px; }
.word-slot.read { animation: lit .8s; }
.dot-end { font-size: 34px; color: var(--accent); }

/* Encierra la letra */
.find-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.find-tile { aspect-ratio: 1; border-radius: 20px; background: var(--card); font-family: var(--font-read); font-weight: 700; font-size: clamp(32px, 10vw, 44px); box-shadow: var(--shadow); animation: popIn .35s backwards; position: relative; }
.find-tile.found { color: var(--accent); }
.find-tile.found::after { content: ''; position: absolute; inset: 6px; border-radius: 50%; border: 5px solid var(--accent); animation: circle .35s ease-out; }
.counter { text-align: center; font-size: 22px; font-weight: 700; margin: 12px 0; }
.count-q { text-align: center; animation: enter .35s; }
.count-q p { font-size: 24px; font-weight: 700; margin: 6px 0 0; }

/* Trazado */
.tracer-holder { display: flex; justify-content: center; }
.tracer { display: flex; flex-direction: column; align-items: center; gap: 12px; width: 100%; }
.tracer-stage { position: relative; background: var(--card); border-radius: 28px; box-shadow: var(--shadow); overflow: hidden; touch-action: none; }
.tracer-stage canvas { position: absolute; left: 0; top: 0; touch-action: none; }
.tracer-stage.win { animation: winGlow 1s; }
.tracer-stage.demo canvas:first-child { animation: demoGlow 2.2s ease-in-out; }
.meter { width: min(100%, 360px); height: 16px; background: var(--line); border-radius: 99px; overflow: hidden; }
.meter-fill { height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, #ffd43b, #69db7c); transition: width .25s; }
.meter.full .meter-fill { background: linear-gradient(90deg, #51cf66, #20c997); }

/* Burbujas */
.bubble-target { flex: none; background: var(--card); border-radius: 18px; padding: 8px 14px; box-shadow: var(--shadow); font-size: 18px; font-weight: 600; }
.bubble-target b { font-family: var(--font-read); font-size: 34px; color: var(--accent); margin-left: 4px; }
.hud { display: flex; justify-content: space-between; font-size: 20px; font-weight: 700; margin: 4px 4px 8px; }
.bubble-field { position: relative; height: calc(100dvh - 250px); min-height: 360px; border-radius: 28px; overflow: hidden; touch-action: none;
  background: linear-gradient(180deg, #a5d8ff 0%, #d0ebff 60%, #e3fafc 100%); box-shadow: inset 0 0 0 4px rgba(255,255,255,.6); }
.bubble-b { position: absolute; left: 0; top: 0; border-radius: 50%; display: grid; place-items: center; font-family: var(--font-read); font-weight: 700; font-size: 26px; color: #1b1e3d;
  background: radial-gradient(circle at 32% 28%, rgba(255,255,255,.95) 0 10%, transparent 11%), radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--bc) 55%, #fff) 0%, var(--bc) 75%);
  box-shadow: inset -6px -8px 14px rgba(0,0,0,.12), 0 6px 14px rgba(0,0,0,.12); will-change: transform; }
.bubble-b.popped { animation: popOut .3s forwards; pointer-events: none; }

/* Memoria */
.mem-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; perspective: 900px; }
.mem-card { position: relative; aspect-ratio: 3/3.4; transform-style: preserve-3d; transition: transform .45s; animation: popIn .35s backwards; }
.mem-card > span { position: absolute; inset: 0; border-radius: 20px; display: grid; place-items: center; backface-visibility: hidden; -webkit-backface-visibility: hidden; box-shadow: var(--shadow); }
.mem-back { background: linear-gradient(135deg, #845ef7, #f06595); font-size: 40px; }
.mem-front { background: var(--card); transform: rotateY(180deg); }
.mem-card.flip, .mem-card.ok { transform: rotateY(180deg); }
.mem-card.ok .mem-front { background: #d3f9d8; }
.mem-word { font-family: var(--font-read); font-weight: 700; font-size: clamp(18px, 5.5vw, 26px); padding: 4px; word-break: break-word; text-align: center; }
.mem-front .emoji { font-size: 48px; }

/* Rejillas de letras */
.letter-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.letter-pick { --c: #7048e8; aspect-ratio: 1; border-radius: 20px; background: var(--card); color: var(--c); font-family: var(--font-read); font-weight: 700; font-size: clamp(22px, 7vw, 32px); box-shadow: 0 5px 0 color-mix(in srgb, var(--c) 45%, #000); animation: popIn .3s backwards; }
.letter-pick:active { transform: translateY(4px); }

/* Abecedario */
.abc-card { --c: #7048e8; position: relative; width: min(92vw, 440px); background: var(--card); border-radius: 30px; padding: 22px 18px 18px; box-shadow: 0 0 0 8px var(--c), 0 20px 40px rgba(0,0,0,.25); text-align: center; animation: popIn .3s; }
.abc-letter { font-family: var(--font-read); font-weight: 700; font-size: 96px; line-height: 1; color: var(--c); }
.abc-name { font-size: 22px; font-weight: 600; color: var(--ink-soft); margin-bottom: 10px; }
.abc-words { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.abc-w { display: flex; flex-direction: column; align-items: center; padding: 10px; border-radius: 18px; background: color-mix(in srgb, var(--c) 10%, transparent); font-family: var(--font-read); font-size: 20px; font-weight: 700; }
.abc-w .emoji { font-size: 50px; }
.close-x { position: absolute; right: 12px; top: 10px; width: 42px; height: 42px; border-radius: 50%; background: var(--line); font-size: 20px; }

/* Dictado */
.keyboard { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 4px; }
.key { min-height: 64px; border-radius: 18px; background: var(--card); font-family: var(--font-read); font-weight: 700; font-size: 32px; box-shadow: 0 5px 0 var(--line), 0 8px 16px rgba(0,0,0,.05); }
.hidden-pic { width: 96px; height: 96px; margin: 0; border-radius: 24px; position: relative; }
.hidden-pic .emoji { font-size: 54px; filter: blur(14px); opacity: .4; transition: .4s; }
.hidden-pic small { position: absolute; bottom: 6px; font-size: 13px; font-weight: 600; }
.hidden-pic.shown .emoji { filter: none; opacity: 1; }
.hidden-pic.shown small { display: none; }

/* Adivinanzas */
.riddle-card { background: var(--card); border-radius: 26px; padding: 18px; box-shadow: var(--shadow); text-align: center; margin-bottom: 8px; }
.riddle-card p { font-size: 21px; line-height: 1.4; margin: 6px 0; font-family: var(--font-read); }
.riddle-card b { font-size: 22px; color: var(--accent); }
.riddle-q { font-size: 40px; }

/* Pirámide */
.pyr-list { display: grid; grid-template-columns: 1fr; gap: 10px; }
.pyr-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 20px; background: var(--card); box-shadow: var(--shadow); text-align: left; animation: enter .3s backwards; }
.pyr-item .emoji { font-size: 38px; }
.pyr-title { flex: 1; font-family: var(--font-read); font-size: 18px; font-weight: 700; }
.pyr-item.read { opacity: .8; }
.pyr-item i { font-style: normal; }
.pyr-emoji { font-size: 50px; flex: none; }
.pyramid { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 8px; background: var(--card); border-radius: 26px; box-shadow: var(--shadow); margin-bottom: 14px; min-height: 120px; }
.pyr-line { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 7px; }
.pyr-line.new { animation: enter .35s; }
.pyr-w { font-family: var(--font-read); font-weight: 700; font-size: clamp(15px, 4.6vw, 21px); padding: 2px 3px; border-radius: 8px; color: var(--ink); }
.pyr-line:not(.new) .pyr-w { color: var(--ink-soft); }
.pyr-w.fresh { background: #fff3bf; color: #c92a2a; animation: bump .5s; }
.pyr-w.karaoke { background: var(--accent); color: #fff !important; }
.qbox { margin-top: 12px; animation: enter .35s; }
.qbox .q { font-size: 22px; font-weight: 700; text-align: center; margin: 6px 0; }

/* Pizarra */
.board-wrap { position: relative; margin: 0 auto 12px; background: var(--card); border-radius: 26px; box-shadow: var(--shadow); overflow: hidden;
  background-image: linear-gradient(transparent 0 calc(25% - 1px), rgba(77,171,247,.25) calc(25% - 1px) 25%, transparent 25% calc(50% - 1px), rgba(77,171,247,.25) calc(50% - 1px) 50%, transparent 50% calc(75% - 1px), rgba(77,171,247,.25) calc(75% - 1px) 75%, transparent 75%); }
.board { position: absolute; inset: 0; touch-action: none; }
.board-letter { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--font-read); font-weight: 700; font-size: 170px; color: rgba(112,72,232,.13); pointer-events: none; }
.palette { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-bottom: 12px; }
.swatch { width: 44px; height: 44px; border-radius: 50%; box-shadow: 0 3px 0 rgba(0,0,0,.2); border: 4px solid #fff; }
.swatch.on { transform: scale(1.18); box-shadow: 0 0 0 3px var(--ink); }
.swatch.rainbow { background: conic-gradient(red, orange, yellow, lime, cyan, blue, violet, red); }

/* Juegos */
.game-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.game-card { --c: #7048e8; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 132px; border-radius: var(--radius); background: var(--c); color: #fff; padding: 12px;
  box-shadow: 0 7px 0 color-mix(in srgb, var(--c) 60%, #000); animation: popIn .35s backwards; transition: transform .08s; }
.game-card:active { transform: translateY(6px); box-shadow: 0 1px 0 color-mix(in srgb, var(--c) 60%, #000); }
.game-icon { font-size: 52px; line-height: 1; filter: drop-shadow(0 3px 0 rgba(0,0,0,.15)); }
.game-name { font-weight: 700; font-size: 18px; text-align: center; line-height: 1.15; }

/* Álbum */
.album { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.sticker { aspect-ratio: 1; border-radius: 22px; background: color-mix(in srgb, var(--ink) 7%, transparent); font-size: 40px; display: grid; place-items: center; border: 3px dashed color-mix(in srgb, var(--ink) 18%, transparent); }
.sticker.has { background: var(--card); border: 0; box-shadow: var(--shadow); font-size: 46px; animation: popIn .35s backwards; }

/* Superposiciones */
.overlay { position: fixed; inset: 0; z-index: 50; background: rgba(20,16,50,.45); display: grid; place-items: center; padding: 16px; animation: fade .2s; backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.overlay.soft { background: rgba(20,16,50,.25); }
.cele-card { background: var(--card); border-radius: 32px; padding: 24px 30px; text-align: center; box-shadow: 0 20px 40px rgba(0,0,0,.25); animation: popIn .35s cubic-bezier(.3,1.6,.6,1); }
.cele-stars { display: flex; justify-content: center; gap: 6px; }
.cele-stars span { font-size: 64px; color: var(--line); line-height: 1; }
.cele-stars span.on { color: #fcc419; text-shadow: 0 4px 0 #e67700; animation: starIn .5s backwards; }
.cele-stars.big span { font-size: 70px; }
.cele-msg { font-size: 30px; font-weight: 700; margin-top: 8px; color: var(--accent); }
.reward-card { background: var(--card); border-radius: 34px; padding: 26px; text-align: center; width: min(92vw, 380px); animation: popIn .4s cubic-bezier(.3,1.6,.6,1); box-shadow: 0 0 0 8px #fcc419, 0 20px 40px rgba(0,0,0,.3); }
.reward-title { font-size: 30px; font-weight: 700; color: #f08c00; }
.reward-sticker { font-size: 120px; line-height: 1.2; animation: spinIn .8s cubic-bezier(.3,1.5,.6,1); }
.reward-card p { font-size: 18px; color: var(--ink-soft); }
.confetti { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 60; }
.big-letter { font-family: var(--font-read); font-weight: 700; font-size: 120px; line-height: 1; text-shadow: 0 6px 0 rgba(0,0,0,.08); animation: popIn .5s; }

/* Padres */
.gate { text-align: center; padding: 40px 10px; font-size: 18px; }
.lock { font-size: 72px; width: 130px; height: 130px; border-radius: 50%; background: var(--card); box-shadow: var(--shadow); margin-top: 12px; position: relative; }
.lock.holding { animation: holdRing 1.8s linear forwards; }
.parents h3 { margin: 22px 0 8px; font-size: 19px; }
.parents input[type=range] { width: 100%; accent-color: var(--accent); height: 34px; }
.select { width: 100%; font-size: 17px; padding: 12px; border-radius: 14px; border: 2px solid var(--line); background: var(--card); color: var(--ink); }
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat { background: var(--card); border-radius: 18px; padding: 12px 6px; text-align: center; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.stat span { font-size: 28px; } .stat b { font-size: 24px; } .stat small { color: var(--ink-soft); }
.seg { display: inline-flex; background: var(--line); border-radius: 16px; padding: 4px; gap: 4px; }
.seg button { padding: 10px 20px; border-radius: 12px; font-family: var(--font-read); font-size: 22px; font-weight: 700; }
.seg button.on { background: var(--card); box-shadow: 0 2px 6px rgba(0,0,0,.12); }
.toggle { display: flex; width: 100%; justify-content: space-between; align-items: center; padding: 12px 14px; margin-bottom: 8px; background: var(--card); border-radius: 16px; font-size: 18px; font-weight: 600; box-shadow: var(--shadow); }
.toggle i { width: 54px; height: 32px; border-radius: 99px; background: var(--line); position: relative; transition: .2s; }
.toggle i::after { content: ''; position: absolute; left: 4px; top: 4px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.toggle.on i { background: var(--good); }
.toggle.on i::after { left: 26px; }
.note { font-size: 15px; background: #fff3bf; color: #7a4b00; padding: 12px; border-radius: 14px; }
.about { margin-top: 26px; font-size: 16px; line-height: 1.5; color: var(--ink-soft); -webkit-user-select: text; user-select: text; }
.about h3 { color: var(--ink); }

/* ----- Animaciones ----- */
@keyframes enter { from { opacity: 0; transform: translateY(14px); } }
@keyframes fade { from { opacity: 0; } }
@keyframes popIn { 0% { opacity: 0; transform: scale(.6); } 70% { transform: scale(1.06); } 100% { opacity: 1; transform: scale(1); } }
@keyframes popOut { to { transform: scale(1.6); opacity: 0; } }
@keyframes bump { 0%, 100% { transform: scale(1); } 40% { transform: scale(1.18); } }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-6px) rotate(2deg); } }
@keyframes jump { 0%, 100% { transform: translateY(0); } 40% { transform: translateY(-26px) rotate(-8deg); } 70% { transform: translateY(0) scale(1.1, .9); } }
@keyframes blink { 0%, 92%, 100% { height: 0; } 95% { height: 32px; } }
@keyframes flapL { to { transform: rotate(18deg); } }
@keyframes flapR { to { transform: rotate(-18deg); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-10px); } 40% { transform: translateX(9px); } 60% { transform: translateX(-6px); } 80% { transform: translateX(4px); } }
@keyframes wiggle { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-8deg) scale(1.08); } 50% { transform: rotate(6deg) scale(1.08); } 75% { transform: rotate(-3deg); } }
@keyframes lit { 0% { transform: scale(1); } 40% { transform: scale(1.08); box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 35%, transparent); } 100% { transform: scale(1); } }
@keyframes circle { from { transform: scale(1.6); opacity: 0; } }
@keyframes winGlow { 0% { box-shadow: 0 0 0 0 rgba(81,207,102,.9); } 100% { box-shadow: 0 0 0 26px rgba(81,207,102,0); } }
@keyframes demoGlow { 0%, 100% { filter: none; } 30%, 60% { filter: drop-shadow(0 0 10px var(--accent)) brightness(1.1); transform: scale(1.03); } }
@keyframes starIn { from { transform: scale(0) rotate(-180deg); } }
@keyframes spinIn { from { transform: scale(0) rotate(-360deg); } }
@keyframes nodePulse { 0%, 100% { box-shadow: 0 7px 0 color-mix(in srgb, var(--c) 45%, #000), 0 0 0 6px color-mix(in srgb, var(--c) 25%, transparent); } 50% { box-shadow: 0 7px 0 color-mix(in srgb, var(--c) 45%, #000), 0 0 0 16px color-mix(in srgb, var(--c) 10%, transparent); } }
@keyframes holdRing { to { box-shadow: 0 0 0 14px var(--good); transform: scale(.92); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
@media (min-width: 600px) {
  .gallery { grid-template-columns: repeat(4, 1fr); }
  .letter-grid, .album { grid-template-columns: repeat(6, 1fr); }
  .game-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 360px) {
  .choice { font-size: 28px; min-height: 72px; }
  .tile-text b { font-size: 18px; }
  .word-build { font-size: 30px; }
}

/* ajustes */
.badge-row { display: flex; justify-content: center; margin: 0 0 6px; }
.word-build.tight { gap: 0; }
.word-build.tight .slot { margin: 0 4px; }
.hud { align-items: center; gap: 8px; }
.hud .bubble-target { padding: 4px 14px; }
.bubble-field { height: calc(100dvh - 270px); }
.confirm-card { max-width: 360px; }
.confirm-msg { font-size: 20px; font-weight: 600; margin: 0 0 18px; line-height: 1.35; }

/* ----- Acceso de pago ----- */
.lock-badge { position: absolute; top: -6px; right: -6px; width: 34px; height: 34px; border-radius: 50%; background: var(--card); box-shadow: 0 3px 8px rgba(0,0,0,.18); display: grid; place-items: center; font-size: 17px; }
.map-node .lock-badge { top: -4px; right: -4px; }
.game-card, .letter-pick { position: relative; }
.letter-pick.locked, .pyr-item.locked { opacity: .55; }
.map-node:has(.lock-badge) { filter: saturate(.55); }
.tile.unlock { background: linear-gradient(135deg, #2b8a3e, #37b24d); }
.shop-hero { font-size: 64px; line-height: 1; margin-bottom: 6px; }
.shop .gate h2 { font-size: 26px; margin: 6px 0; }
.shop-wrap { display: flex; flex-direction: column; gap: 14px; }
.shop-card { background: var(--card); border-radius: 24px; padding: 18px; box-shadow: var(--shadow); position: relative; }
.shop-card.center { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.shop-card h2 { font-size: 26px; margin: 0 0 8px; }
.shop-card h3 { font-size: 21px; margin: 0 0 10px; padding-left: 46px; min-height: 34px; display: flex; align-items: center; }
.shop-card p { font-size: 17px; line-height: 1.45; margin: 4px 0; }
.perks { list-style: none; padding: 0; margin: 0 0 12px; display: flex; flex-direction: column; gap: 8px; font-size: 17px; line-height: 1.35; }
.price { display: flex; align-items: baseline; gap: 10px; }
.price b { font-size: 40px; color: #2b8a3e; }
.price small { font-size: 17px; color: var(--ink-soft); }
.step-n { position: absolute; left: 18px; top: 18px; width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 700; }
.yape-num { font-family: var(--font-read); font-size: 34px; font-weight: 700; letter-spacing: 1px; color: #742c8f; }
.yape-name { color: var(--ink-soft); }
.qr { display: block; width: 220px; max-width: 100%; margin: 10px 0; border-radius: 16px; }
.pay-form { display: flex; flex-direction: column; gap: 8px; }
.pay-form label, .code-card label { font-weight: 600; font-size: 16px; margin-top: 4px; }
.field { width: 100%; font: 600 19px var(--font-ui); padding: 13px 14px; border-radius: 14px; border: 2px solid var(--line); background: var(--bg1); color: var(--ink); outline: none; -webkit-user-select: text; user-select: text; }
.field:focus { border-color: var(--accent); }
.code-field { text-transform: uppercase; letter-spacing: 1px; flex: 1; min-width: 0; }
.code-card .row { align-items: stretch; }
.form-msg { color: var(--bad); font-weight: 600; min-height: 1em; }
.hint-small { font-size: 14px !important; color: var(--ink-soft); }
.note-card { background: #fff3bf; color: #7a4b00; }
.spinner { width: 54px; height: 54px; border-radius: 50%; border: 6px solid var(--line); border-top-color: var(--accent); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.wait-state { color: var(--ink-soft); font-size: 15px !important; }
.link-btn { color: var(--ink-soft); text-decoration: underline; font-size: 15px; padding: 8px; }
a.btn { text-decoration: none; display: inline-block; text-align: center; }
.acc-state { font-weight: 600; margin: 0; flex: 1; min-width: 180px; }

/* Pantalla de activación (sin prueba gratis) */
.shop-sub { font-size: 20px; margin: 10px 4px 0; text-align: center; opacity: .85; }
a.btn.wa-btn { display: block; width: 100%; background: #25d366; color: #fff; box-shadow: 0 5px 0 #1a9e4b; }
.code-card { border: 3px solid var(--accent, #7048e8); }
.code-card label { font-size: 19px; }

/* =========================================================
   Página de venta (portada para papás)
   ========================================================= */
.venta-barra { position: sticky; top: 0; z-index: 6; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: calc(10px + var(--safe-t)) 16px 10px; background: color-mix(in srgb, var(--bg1) 85%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.venta-marca { display: flex; align-items: center; gap: 8px; font-size: 22px; }
.venta-buho { font-size: 28px; }
.btn-instalar { white-space: nowrap; }
.venta-portada { text-align: center; padding: 18px 16px 8px; }
.venta-portada h1 { font-size: clamp(34px, 10vw, 48px); line-height: 1.05; margin: 8px 0 10px; text-wrap: balance; letter-spacing: -.5px; }
.resalta { background: #fcc419; color: #3b2a00; padding: 0 10px; border-radius: 14px; display: inline-block; transform: rotate(-2deg); }
.venta-sub { font-size: 20px; color: var(--ink-soft); margin: 0 auto 18px; max-width: 26ch; line-height: 1.3; }
.venta-celulares { position: relative; height: 330px; margin: 0 auto 20px; max-width: 360px; }
.cel { position: absolute; bottom: 0; width: 150px; border-radius: 26px; overflow: hidden; background: #fff;
  border: 6px solid #2b2d42; box-shadow: 0 14px 30px rgba(60,40,120,.25); }
.cel img { display: block; width: 100%; height: auto; }
.cel-frente { left: 50%; transform: translateX(-50%); width: 170px; z-index: 2; }
.cel-atras { width: 132px; opacity: .95; }
.cel-atras.izq { left: 0; transform: rotate(-8deg); bottom: 10px; }
.cel-atras.der { right: 0; transform: rotate(8deg); bottom: 10px; }
.venta-botones { display: flex; flex-direction: column; gap: 12px; max-width: 380px; margin: 0 auto; }
.venta-botones .btn { width: 100%; }
.venta-probar { background: #2f9e44; box-shadow: 0 5px 0 #237032; }
.venta-comprar { background: #7048e8; }
.venta-nota { font-size: 15px; color: var(--ink-soft); margin: 12px 0 0; }
.venta-ya { font-size: 17px; font-weight: 600; color: var(--good); margin-top: 12px; }
.venta-seccion { margin: 26px 16px 0; padding: 22px 18px; background: var(--card); border-radius: 28px; box-shadow: var(--shadow); }
.venta-seccion h2 { font-size: 26px; margin: 0 0 16px; text-align: center; text-wrap: balance; }
.venta-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.venta-dato { --c: #7950f2; border-radius: 20px; padding: 14px 12px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: color-mix(in srgb, var(--c) 12%, var(--card)); border: 2px solid color-mix(in srgb, var(--c) 35%, transparent); }
.dato-icono { font-size: 30px; line-height: 1.1; }
.dato-n { font-size: 34px; line-height: 1; color: var(--c); }
.dato-et { font-weight: 700; font-size: 16px; }
.venta-dato small { font-size: 13px; color: var(--ink-soft); line-height: 1.3; }
.venta-checks { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 8px; }
.venta-checks li { font-size: 18px; padding: 10px 14px; border-radius: 14px; background: color-mix(in srgb, #2f9e44 10%, var(--card)); }
.precio-grande { text-align: center; margin-bottom: 16px; }
.precio-grande b { display: block; font-size: 64px; line-height: 1; color: #7048e8; }
.precio-grande span { font-size: 17px; color: var(--ink-soft); }
.compra-pasos { display: grid; gap: 14px; margin-bottom: 16px; }
.paso-compra { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: 18px; background: color-mix(in srgb, var(--accent) 7%, var(--card)); }
.paso-compra > div { flex: 1; min-width: 0; }
.paso-compra b { font-size: 18px; display: block; margin-bottom: 6px; }
.paso-compra p { margin: 4px 0 0; font-size: 15px; color: var(--ink-soft); }
.paso-n { flex: none; width: 34px; height: 34px; border-radius: 50%; background: #7048e8; color: #fff; display: grid; place-items: center; font-weight: 700; }
.paso-compra .qr { display: block; width: min(220px, 100%); margin: 10px 0; border-radius: 12px; }
.qr-vacio { margin: 10px 0; padding: 18px; border: 2px dashed var(--line); border-radius: 12px; font-size: 13px; color: var(--ink-soft); text-align: center; }
.paso-compra .wa-btn { margin-top: 6px; }
.faq { border-bottom: 2px solid var(--line); padding: 4px 0; }
.faq summary { cursor: pointer; font-size: 18px; font-weight: 700; padding: 12px 4px; list-style: none; display: flex; justify-content: space-between; gap: 10px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '＋'; color: #7048e8; }
.faq[open] summary::after { content: '－'; }
.faq p { margin: 0 4px 14px; font-size: 16px; line-height: 1.5; color: var(--ink-soft); }
.venta-pie { text-align: center; padding: 26px 16px 10px; }
.venta-pie .btn { width: 100%; max-width: 380px; }
.venta-pie p { color: var(--ink-soft); font-size: 14px; }
.instalar-card .pasos { list-style: none; padding: 0; margin: 14px 0 18px; display: grid; gap: 10px; text-align: left; }
.instalar-card .pasos li { display: flex; align-items: center; gap: 10px; font-size: 16px; }
.instalar-card .paso-t { flex: 1; }
.instalar-card .paso-i { font-size: 24px; }
.reward-card .btn { margin-top: 8px; width: 100%; }
.solo-ancho { display: none; }
@media (min-width: 420px) { .solo-ancho { display: inline; } }
.venta-marca b { font-size: 22px; }

/* ---- Aviso "Abrir en tu navegador" (Facebook / Instagram no traen la voz) ---- */
.aviso-navegador { position: fixed; left: 12px; right: 12px; bottom: calc(12px + var(--safe-b)); z-index: 60; max-width: 520px; margin: 0 auto;
  background: var(--card); color: var(--ink); border-radius: var(--radius); box-shadow: 0 10px 30px rgba(30,20,80,.28); border: 3px solid var(--accent);
  padding: 14px 16px 12px; animation: avisoSube .35s cubic-bezier(.3,1.3,.6,1); font-size: 16px; }
.aviso-navegador b { display: block; font-size: 18px; margin-right: 28px; }
.aviso-navegador p { margin: 6px 0 10px; color: var(--ink-soft); }
.aviso-nav-x { position: absolute; top: 6px; right: 8px; border: 0; background: none; font-size: 20px; color: var(--ink-soft); padding: 6px; cursor: pointer; }
.aviso-nav-botones { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.aviso-nav-btn { text-decoration: none; display: inline-block; }
.aviso-nav-pasos { margin: 0 0 10px; padding-left: 22px; }
.aviso-nav-pasos li { margin: 3px 0; }
@keyframes avisoSube { from { transform: translateY(40px); opacity: 0; } }
