/* Carta a los Reyes Pop */
:root {
  --tinta: #3a2142;
  --oro: #ffd84a;
  --oro2: #e2a514;
  --crema: #fff8e8;
  --noche: #1b2a7a;
  --rojo: #e2453a;
  --verde: #2fbf4f;
  --lila: #a77bff;
  --alto: 100vh;
}
@supports (height: 100dvh) { :root { --alto: 100dvh; } }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #0b1a5c; }
body { font-family: "Baloo 2", system-ui, sans-serif; color: var(--tinta); user-select: none; -webkit-user-select: none; touch-action: manipulation; }
button { font-family: inherit; color: inherit; cursor: pointer; }
input { font-family: inherit; }
[hidden] { display: none !important; }
#fondo { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; }
#app { position: relative; z-index: 1; height: var(--alto); max-width: 600px; margin: 0 auto; }
.pant { position: absolute; inset: 0; display: flex; flex-direction: column; padding: calc(8px + env(safe-area-inset-top, 0px)) 10px calc(8px + env(safe-area-inset-bottom, 0px)); animation: entra 0.35s ease-out; }
@keyframes entra { from { opacity: 0; transform: translateY(12px); } }

/* ---------- botones */
.btn { border: 0; border-radius: 999px; min-height: 52px; padding: 6px 22px; font: 800 20px/1.1 "Baloo 2", sans-serif; box-shadow: 0 5px 0 rgba(0, 0, 0, 0.3), inset 0 2px 0 rgba(255, 255, 255, 0.5); transition: transform 0.08s; position: relative; }
.btn:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 1px 0 rgba(0, 0, 0, 0.3); }
.btn:disabled { filter: grayscale(0.7) brightness(0.9); opacity: 0.6; cursor: default; }
.btn.oro { background: linear-gradient(180deg, #fff1a6, var(--oro) 45%, var(--oro2)); color: #5a3400; text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6); }
.btn.crema { background: linear-gradient(180deg, #fff, #f3e6c8); }
.btn.lila { background: linear-gradient(180deg, #e2d4ff, var(--lila)); color: #2a1660; }
.btn.verde { background: linear-gradient(180deg, #8ef07c, var(--verde)); color: #fff; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.25); }
.btn.rojo { background: linear-gradient(180deg, #ff8f84, var(--rojo)); color: #fff; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.25); }
.btn.azul { background: linear-gradient(180deg, #9cc8ff, #3a7ae0); color: #fff; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.25); }
.btn.grande { min-height: 64px; font-size: 26px; }
.btn.peq { min-height: 44px; font-size: 17px; padding: 4px 14px; }
.redondo { width: 44px; height: 44px; flex: 0 0 auto; border-radius: 50%; border: 3px solid var(--tinta); background: var(--crema); font-size: 20px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 3px 0 rgba(0, 0, 0, 0.3); padding: 0; }
.chip { flex: 0 0 auto; background: var(--crema); border: 3px solid var(--tinta); border-radius: 999px; padding: 2px 12px; font-weight: 800; font-size: 17px; white-space: nowrap; box-shadow: 0 3px 0 rgba(0, 0, 0, 0.25); }
.chip.dinero { background: linear-gradient(180deg, #fff6c4, #ffd84a); }

/* ---------- barra superior */
.barra { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.barra h1 { flex: 1; margin: 0; font: 400 clamp(18px, 5vw, 24px)/1.05 "Lilita One", sans-serif; color: #fff; text-shadow: 0 2px 0 var(--tinta), 0 0 8px rgba(0, 0, 0, 0.4); text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- portada */
#pMenu { justify-content: space-between; align-items: center; }
.ajustes { position: absolute; top: calc(10px + env(safe-area-inset-top, 0px)); right: 10px; z-index: 2; }
.menu-logo { width: min(92%, 440px); margin-top: 18px; }
.menu-logo canvas { width: 100%; height: auto; display: block; filter: drop-shadow(0 6px 6px rgba(0, 0, 0, 0.35)); }
.menu-reyes { flex: 1; min-height: 0; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 0; position: relative; }
.menu-reyes .spr { filter: drop-shadow(0 8px 6px rgba(0, 0, 0, 0.35)); }
.menu-botones { width: min(100%, 380px); display: flex; flex-direction: column; gap: 12px; padding-bottom: 6px; }
.menu-botones .fila { display: flex; gap: 10px; }
.menu-botones .fila .btn.lila { flex: 1; }
.cursos { display: flex; gap: 6px; justify-content: center; align-items: center; flex-wrap: wrap; color: #fff; font-weight: 800; text-shadow: 0 2px 0 var(--tinta); }
.cursos button { min-width: 46px; height: 40px; border-radius: 12px; border: 3px solid var(--tinta); background: rgba(255, 248, 232, 0.85); font-weight: 800; font-size: 17px; color: var(--tinta); text-shadow: none; }
.cursos button.sel { background: var(--oro); transform: scale(1.1); box-shadow: 0 0 0 3px #fff; }

/* ---------- sprites */
.spr { display: block; pointer-events: none; }

/* ---------- mapa */
.mapa { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; padding: 4px 2px 20px; }
.cap { position: relative; border-radius: 26px; border: 4px solid var(--tinta); padding: 10px 12px 12px 112px; min-height: 150px; box-shadow: 0 6px 0 rgba(0, 0, 0, 0.3); background: linear-gradient(160deg, rgba(255, 248, 232, 0.97), rgba(243, 230, 200, 0.97)); }
.cap .rey { position: absolute; left: 0; bottom: 0; }
.cap h2 { margin: 0; font: 400 20px/1.1 "Lilita One", sans-serif; }
.cap p { margin: 2px 0 8px; font-size: 14px; font-weight: 700; color: #6b5a74; line-height: 1.2; }
.cap .sobres { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.cap.bloq { filter: grayscale(0.6); opacity: 0.85; }
.sobre-btn { border: 3px solid var(--tinta); border-radius: 14px; background: #fff; padding: 2px 0 0; display: flex; flex-direction: column; align-items: center; font-weight: 800; font-size: 15px; line-height: 1; min-height: 64px; box-shadow: 0 3px 0 rgba(0, 0, 0, 0.25); }
.sobre-btn .num { font: 400 22px/1 "Lilita One", sans-serif; }
.sobre-btn .est { font-size: 11px; letter-spacing: -1px; margin-top: 2px; }
.sobre-btn.hecha { background: linear-gradient(180deg, #fff6c4, #ffd84a); }
.sobre-btn.sig { animation: late 1.2s infinite; background: #dff7ff; }
.sobre-btn:disabled { background: #d8d0e4; color: #8a7a9a; }
@keyframes late { 50% { transform: scale(1.08); } }
.cap .medalla { position: absolute; right: 8px; top: 6px; width: 46px; height: 46px; }

/* ---------- juguetería */
.pedidos { display: flex; gap: 6px; justify-content: center; margin-bottom: 6px; }
.pedido { flex: 1 1 0; max-width: 140px; min-width: 0; border: 3px solid var(--tinta); border-radius: 18px; background: rgba(255, 248, 232, 0.95); display: flex; align-items: center; gap: 4px; padding: 3px 5px 3px 3px; box-shadow: 0 3px 0 rgba(0, 0, 0, 0.25); font-weight: 800; font-size: 13px; line-height: 1.05; text-align: left; }
.pedido.act { background: #fff6c4; box-shadow: 0 0 0 3px var(--oro), 0 3px 0 rgba(0, 0, 0, 0.25); transform: translateY(-2px); }
.pedido .quien { flex: 1; min-width: 0; overflow: hidden; }
.pedido .quien small { display: block; font-size: 12px; color: #6b5a74; white-space: nowrap; }
.pedido .hueco { width: 40px; height: 40px; flex: 0 0 auto; border-radius: 12px; border: 2px dashed #b9a6c8; display: flex; align-items: center; justify-content: center; background: #fff; font-size: 18px; color: #b9a6c8; }
.pedido .hueco.lleno { border-style: solid; border-color: var(--oro2); animation: pum 0.35s; }
@keyframes pum { 40% { transform: scale(1.25); } }
.estante { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-rows: 1fr; gap: 0 6px; padding: 8px 8px 0; border-radius: 20px; border: 4px solid #5a3418; background: linear-gradient(180deg, rgba(92, 46, 18, 0.88), rgba(70, 34, 12, 0.92)); box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.45), 0 6px 0 rgba(0, 0, 0, 0.3); overflow: hidden; }
.juguete { position: relative; border: 0; background: none; padding: 0 0 14px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; min-height: 0; }
.juguete::after { content: ""; position: absolute; left: -10px; right: -10px; bottom: 0; height: 14px; background: linear-gradient(180deg, #e3a868, #a86d2c); border-top: 3px solid #ffd08a; box-shadow: 0 4px 6px rgba(0, 0, 0, 0.35); }
.juguete .spr { width: min(78px, 20vw, 9vh); height: auto; aspect-ratio: 1; filter: drop-shadow(0 4px 2px rgba(0, 0, 0, 0.35)); transition: transform 0.15s; }
.juguete:active .spr { transform: scale(0.9); }
.juguete.elegido .spr { animation: salta 0.4s; }
@keyframes salta { 40% { transform: translateY(-14px) scale(1.1); } }
.precio { position: relative; z-index: 1; margin: -6px 0 2px; background: #fff; border: 2.5px solid var(--tinta); border-radius: 8px 8px 8px 2px; padding: 0 6px; font: 400 17px/1.2 "Lilita One", sans-serif; transform: rotate(-4deg); box-shadow: 0 2px 0 rgba(0, 0, 0, 0.25); white-space: nowrap; }
.precio s { color: #9a8aa8; font-size: 13px; }
.oferta { position: absolute; top: 2px; right: 0; z-index: 2; background: var(--rojo); color: #fff; border: 2px solid var(--tinta); border-radius: 10px; padding: 0 5px; font: 400 13px/1.3 "Lilita One", sans-serif; transform: rotate(8deg); }
.juguete .marca { position: absolute; top: 2px; left: 2px; z-index: 2; width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--tinta); overflow: hidden; background: #fff; }
.juguete .marca canvas { width: 100%; height: 100%; }

/* ---------- pie con el paje */
.pie { position: relative; display: flex; align-items: flex-end; gap: 8px; min-height: 92px; padding-top: 6px; }
.pie.solo { min-height: 0; justify-content: space-between; }
.pie.solo .btn { flex: 1; }
.paje-zona { flex: 0 0 auto; width: 78px; height: 104px; margin-bottom: -6px; }
.bocadillo { position: relative; flex: 1; align-self: center; background: #fff; border: 3px solid var(--tinta); border-radius: 18px; padding: 6px 34px 6px 10px; font-weight: 700; font-size: clamp(14px, 3.9vw, 17px); line-height: 1.2; box-shadow: 0 3px 0 rgba(0, 0, 0, 0.25); min-height: 46px; display: flex; align-items: center; }
.bocadillo::before { content: ""; position: absolute; left: -12px; bottom: 14px; border: 8px solid transparent; border-right: 12px solid var(--tinta); border-left: 0; }
.bocadillo::after { content: ""; position: absolute; left: -7px; bottom: 16px; border: 6px solid transparent; border-right: 9px solid #fff; border-left: 0; }
.bocadillo .voz { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 28px; height: 28px; border: 0; background: none; font-size: 18px; padding: 0; }
.bocadillo:empty { visibility: hidden; }
.btn.pagar { margin: 8px auto 0; min-height: 48px; width: min(100%, 320px); }
.btn.pagar:not(:disabled) { animation: late 1.4s infinite; }

/* ---------- caja / ventanas */
.velo { position: fixed; inset: 0; z-index: 20; background: rgba(15, 10, 40, 0.6); display: flex; align-items: center; justify-content: center; padding: 12px; animation: aparece 0.2s; }
@keyframes aparece { from { opacity: 0; } }
.ventana { width: min(100%, 460px); max-height: calc(var(--alto) - 24px); overflow-y: auto; background: linear-gradient(180deg, #fffdf6, #f6ead0); border: 4px solid var(--tinta); border-radius: 26px; padding: 14px 14px 16px; box-shadow: 0 10px 0 rgba(0, 0, 0, 0.35); animation: pop 0.3s cubic-bezier(0.2, 1.5, 0.4, 1); text-align: center; }
@keyframes pop { from { transform: scale(0.7); opacity: 0; } }
.ventana h2 { margin: 0 0 4px; font: 400 24px/1.1 "Lilita One", sans-serif; }
.ventana p { margin: 4px 0 8px; font-weight: 700; font-size: 17px; line-height: 1.25; }
.ventana .fila { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 10px; }
.ventana .fila .btn { flex: 1; min-width: 120px; }
.ventana label { display: block; text-align: left; font-weight: 800; margin: 8px 0 2px; }
.ventana input[type="text"] { width: 100%; border: 3px solid var(--tinta); border-radius: 14px; padding: 8px 12px; font-size: 18px; font-weight: 700; }
.ventana .nota { font-size: 13px; color: #6b5a74; font-weight: 700; }
.ventana .opcs { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.ventana .opcs button { border: 3px solid var(--tinta); background: #fff; border-radius: 14px; font-weight: 800; font-size: 17px; padding: 6px 12px; }
.ventana .opcs button.sel { background: var(--oro); }
.caja-items { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 6px; margin: 4px 0 6px; font-weight: 800; font-size: 18px; align-items: center; }
.caja-items .it { display: flex; flex-direction: column; align-items: center; background: #fff; border: 2.5px solid var(--tinta); border-radius: 14px; padding: 2px 6px 4px; min-width: 70px; }
.caja-items .it canvas { width: 50px; height: 50px; }
.caja-items .mas { font: 400 26px "Lilita One", sans-serif; }
.pantalla-num { display: inline-flex; align-items: center; justify-content: center; min-width: 170px; min-height: 58px; margin: 4px auto 8px; background: #1d1640; color: #6dffa6; border-radius: 14px; border: 3px solid var(--tinta); font: 700 34px/1 "Courier New", monospace; letter-spacing: 1px; text-shadow: 0 0 8px rgba(109, 255, 166, 0.6); padding: 0 14px; }
.pantalla-num.mal { animation: tiembla 0.4s; color: #ff8a8a; }
@keyframes tiembla { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.teclado { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; max-width: 300px; margin: 0 auto; }
.teclado button { min-height: 54px; border-radius: 16px; border: 3px solid var(--tinta); background: #fff; font: 400 26px "Lilita One", sans-serif; box-shadow: 0 4px 0 rgba(0, 0, 0, 0.25); }
.teclado button:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25); }
.teclado .ok { background: linear-gradient(180deg, #8ef07c, var(--verde)); color: #fff; }
.teclado .borra { background: #ffe0dc; }
.monedero { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 6px 0; }
.monedero button { border: 0; background: none; padding: 0; }
.monedero canvas { display: block; filter: drop-shadow(0 3px 0 rgba(0, 0, 0, 0.25)); }
.mostrador { min-height: 66px; border-radius: 16px; background: rgba(90, 52, 24, 0.18); box-shadow: inset 0 3px 6px rgba(0, 0, 0, 0.2); display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px; padding: 6px; margin: 4px 0; }
.mostrador:empty::after { content: "Toca monedas y billetes para pagar"; color: #8a7a6a; font-weight: 700; font-size: 14px; }
.mostrador button { border: 0; background: none; padding: 0; animation: pum 0.3s; }
.explica { background: #eaf7ff; border: 3px solid #3a7ae0; border-radius: 16px; padding: 8px 10px; font-weight: 700; font-size: 16px; line-height: 1.25; margin: 6px 0; text-align: left; }
.explica.bien { background: #e6fbe6; border-color: var(--verde); }
.explica b { color: #c21a2c; }
.sino { display: flex; gap: 12px; justify-content: center; }
.sino .btn { flex: 1; max-width: 160px; font-size: 24px; }

/* ---------- papel del taller */
.papel { flex: 1; min-height: 0; position: relative; display: flex; }
.papel-in { flex: 1; overflow-y: auto; padding: 13% 9% 8%; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; background-size: 100% 100%; }
.ej-tit { font: 400 clamp(19px, 5vw, 24px)/1.1 "Lilita One", sans-serif; color: #7a3b10; margin: 0; }
.ej-sub { font-weight: 700; font-size: 15px; color: #6b5a74; margin: -6px 0 0; line-height: 1.2; }
.frase { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 6px; font-weight: 700; font-size: clamp(19px, 5vw, 23px); }
.pal { border: 2.5px solid #c7b48a; background: #fffdf4; border-radius: 12px; padding: 2px 10px; font: inherit; box-shadow: 0 3px 0 rgba(0, 0, 0, 0.12); min-height: 44px; }
.pal.sel { background: var(--oro); border-color: var(--tinta); }
.pal.mal { background: #ffd6d0; border-color: var(--rojo); animation: tiembla 0.4s; }
.pal.ok { background: #d2f7d6; border-color: var(--verde); }
.pal.puesta { opacity: 0.25; pointer-events: none; }
.linea-frase { min-height: 56px; width: 100%; border-bottom: 3px dashed #c7b48a; display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; align-items: center; padding: 4px; }
.palabra-grande { font: 400 clamp(38px, 11vw, 56px)/1.1 "Lilita One", sans-serif; letter-spacing: 1px; color: var(--tinta); }
.palabra-grande .h { display: inline-block; min-width: 0.9em; border-bottom: 5px solid var(--rojo); color: var(--rojo); }
.palabra-grande .h.lleno { color: #1d8e3f; border-color: #1d8e3f; animation: pum 0.4s; }
.opciones { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; width: 100%; }
.opciones .op { min-width: 86px; min-height: 58px; border-radius: 18px; border: 3px solid var(--tinta); background: #fff; font: 400 26px "Lilita One", sans-serif; box-shadow: 0 4px 0 rgba(0, 0, 0, 0.25); padding: 4px 14px; }
.opciones.texto .op { width: 100%; font: 800 18px/1.2 "Baloo 2", sans-serif; text-align: left; }
.op.mal { background: #ffd6d0; animation: tiembla 0.4s; }
.op.ok { background: #d2f7d6; }
.partes { width: 100%; display: flex; flex-direction: column; gap: 6px; }
.parte-hueco { display: flex; align-items: center; gap: 8px; border: 2.5px dashed #c7b48a; border-radius: 14px; padding: 4px 8px; min-height: 44px; text-align: left; font-weight: 700; font-size: 16px; background: rgba(255, 255, 255, 0.5); }
.parte-hueco b { flex: 0 0 auto; font: 400 14px/1 "Lilita One", sans-serif; color: #fff; background: #b58a4a; border-radius: 8px; padding: 4px 6px; }
.parte-hueco.lleno { border-style: solid; border-color: var(--verde); background: #effbea; animation: pum 0.35s; }
.parte-hueco.toca { border-color: var(--oro2); background: #fff6c4; }
.tiras { display: flex; flex-direction: column; gap: 6px; width: 100%; }
.tira { border: 3px solid var(--tinta); border-radius: 14px; background: #fff; font-weight: 700; font-size: 16px; padding: 6px 10px; text-align: left; box-shadow: 0 3px 0 rgba(0, 0, 0, 0.2); line-height: 1.2; }
.tira.mal { background: #ffd6d0; animation: tiembla 0.4s; }
.progreso { display: flex; gap: 6px; }
.progreso i { width: 12px; height: 12px; border-radius: 50%; background: #d8cbb0; border: 2px solid #b39a6a; }
.progreso i.hecho { background: var(--verde); border-color: #1d8e3f; }
.progreso i.act { background: var(--oro); border-color: var(--oro2); transform: scale(1.25); }

/* ---------- carta terminada */
.escena { flex: 1; min-height: 0; position: relative; }
.rey-zona { position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); width: min(70%, 300px); aspect-ratio: 280 / 340; transition: opacity 0.4s; }
.carta-vista { position: absolute; inset: 0 4% 2%; display: flex; align-items: center; justify-content: center; transition: transform 0.7s cubic-bezier(0.5, 0, 0.3, 1), opacity 0.5s; }
.carta-vista canvas { max-width: 100%; max-height: 100%; filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.45)); }
.carta-vista.envia { transform: translateY(30%) scale(0.2) rotate(-10deg); opacity: 0; }
.bocadillo.rey { position: absolute; left: 6px; right: 6px; top: 4px; padding-right: 10px; justify-content: center; text-align: center; font-size: 18px; }
.bocadillo.rey::before { left: 50%; bottom: -14px; border: 10px solid transparent; border-top: 14px solid var(--tinta); border-bottom: 0; }
.bocadillo.rey::after { left: calc(50% + 3px); bottom: -9px; border: 7px solid transparent; border-top: 10px solid #fff; border-bottom: 0; }
.acciones { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; padding-top: 8px; }
.acciones .btn { flex: 1 1 40%; min-width: 140px; font-size: 18px; }
.estrellas-fin { display: flex; justify-content: center; gap: 4px; margin: 4px 0; }
.estrellas-fin canvas { width: 54px; height: 54px; animation: pop 0.4s backwards; }
.estrellas-fin canvas:nth-child(2) { animation-delay: 0.2s; }
.estrellas-fin canvas:nth-child(3) { animation-delay: 0.4s; }
.camello-pasa { position: absolute; bottom: 4%; left: -45%; width: 42%; animation: cruza 3.2s linear forwards; }
@keyframes cruza { to { left: 105%; } }

/* ---------- carta libre */
.libre { flex: 1; min-height: 0; overflow-y: auto; background: rgba(255, 253, 246, 0.96); border: 4px solid var(--tinta); border-radius: 24px; padding: 12px; box-shadow: 0 6px 0 rgba(0, 0, 0, 0.3); }
.libre h2 { margin: 0 0 6px; font: 400 22px/1.1 "Lilita One", sans-serif; text-align: center; }
.libre h3 { margin: 12px 0 4px; font: 400 18px/1.1 "Lilita One", sans-serif; color: #7a3b10; }
.libre label { display: block; font-weight: 800; margin: 8px 0 2px; }
.libre input[type="text"] { width: 100%; border: 3px solid var(--tinta); border-radius: 14px; padding: 8px 12px; font-size: 18px; font-weight: 700; }
.papeles { display: flex; gap: 8px; justify-content: center; }
.papeles button { flex: 1; max-width: 110px; border: 3px solid var(--tinta); border-radius: 14px; background: #fff; padding: 4px; font-weight: 800; font-size: 13px; }
.papeles button.sel { box-shadow: 0 0 0 4px var(--oro); }
.papeles canvas { width: 100%; height: auto; display: block; }
.para-quien { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-bottom: 6px; }
.para-quien button { border: 3px solid var(--tinta); border-radius: 999px; background: #fff; display: flex; align-items: center; gap: 4px; padding: 2px 10px 2px 2px; font-weight: 800; font-size: 14px; }
.para-quien button.act { background: #fff6c4; box-shadow: 0 0 0 3px var(--oro); }
.para-quien canvas { width: 34px; height: 34px; }
.para-quien .mini { width: 30px; height: 30px; }
.cuenta-libre { text-align: center; font-weight: 800; font-size: 18px; margin: 4px 0; }
.cuenta-libre b { font-family: "Lilita One", sans-serif; font-weight: 400; }
.cuenta-libre.pasa b { color: var(--rojo); }
.rejilla { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px; }
.rejilla button { border: 2.5px solid #d8c8a8; border-radius: 14px; background: #fff; padding: 2px 2px 4px; display: flex; flex-direction: column; align-items: center; font-weight: 800; font-size: 12px; line-height: 1.05; }
.rejilla button canvas { width: 60px; height: 60px; }
.rejilla button .p { font: 400 15px "Lilita One", sans-serif; }
.rejilla button.sel { border-color: var(--verde); background: #e6fbe6; }
.frases-opc { display: flex; flex-direction: column; gap: 6px; }
.frases-opc button { border: 3px solid #d8c8a8; border-radius: 14px; background: #fff; font-weight: 700; font-size: 16px; padding: 6px 10px; text-align: left; line-height: 1.2; }
.frases-opc button.sel { border-color: var(--verde); background: #e6fbe6; }

/* ---------- reto */
.reto-tiempo { height: 12px; border-radius: 99px; background: rgba(0, 0, 0, 0.3); border: 2px solid var(--tinta); overflow: hidden; margin: 2px 4px 8px; }
.reto-tiempo i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #ffd84a, #6dffa6); border-radius: 99px; }
.reto-card { flex: 1; min-height: 0; overflow-y: auto; background: rgba(255, 253, 246, 0.97); border: 4px solid var(--tinta); border-radius: 26px; padding: 14px 12px; box-shadow: 0 6px 0 rgba(0, 0, 0, 0.3); display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.reto-card .q { font: 400 clamp(20px, 5.5vw, 26px)/1.15 "Lilita One", sans-serif; margin: 0; }
.reto-card .area { font-weight: 800; font-size: 14px; color: #6b5a74; text-transform: uppercase; letter-spacing: 1px; }
.reto-card .opciones .op { flex: 1 1 40%; }
.reto-card .op canvas { width: 56px; height: 56px; display: block; margin: 0 auto; }
.reto-card .op small { display: block; font: 800 14px "Baloo 2", sans-serif; }

/* ---------- avisos */
.toast { position: fixed; left: 50%; top: 18%; z-index: 30; transform: translate(-50%, -20px); opacity: 0; pointer-events: none; background: #fff; border: 4px solid var(--tinta); border-radius: 20px; padding: 8px 18px; font: 400 22px/1.2 "Lilita One", sans-serif; box-shadow: 0 6px 0 rgba(0, 0, 0, 0.3); transition: opacity 0.25s, transform 0.25s; text-align: center; max-width: 90%; }
.toast.ver { opacity: 1; transform: translate(-50%, 0); }
.toast.bien { background: #e6fbe6; }
.toast.mal { background: #ffe6e2; }
.chispas { position: fixed; inset: 0; pointer-events: none; z-index: 25; }
.vuela { position: fixed; z-index: 26; pointer-events: none; transition: transform 0.55s cubic-bezier(0.5, -0.3, 0.6, 1), opacity 0.55s; }

/* ---------- pantallas grandes */
@media (min-width: 700px) and (min-height: 700px) {
  .juguete .spr { width: 92px; }
  .paje-zona { width: 96px; height: 128px; }
}
@media (max-height: 640px) {
  .pie { min-height: 74px; }
  .paje-zona { width: 60px; height: 80px; }
  .menu-logo { margin-top: 4px; width: min(80%, 360px); }
  .btn.grande { min-height: 56px; font-size: 22px; }
  .btn { min-height: 46px; }
}

/* ---------- impresión: solo la carta */
#imprimir { display: none; }
@media print {
  @page { size: A4 portrait; margin: 10mm; }
  html, body { height: auto; overflow: visible; background: #fff; }
  body > *:not(#imprimir) { display: none !important; }
  #imprimir { display: block !important; }
  #imprimir img { width: 100%; height: auto; max-height: 275mm; object-fit: contain; display: block; margin: 0 auto; }
}
