/* ===== App de Puddy · estilos ===== */
:root {
  --fondo: #FFF6EE; --tarjeta: #FFFFFF; --texto: #2B2240; --suave: #6E6585; --linea: #EFE6F5;
  --violeta: #7C5CFF; --violeta-2: #EEE8FF; --rosa: #FF7EA6; --verde: #1FAE73; --verde-2: #E3F7EE;
  --naranja: #E98A00; --naranja-2: #FFF1D9; --rojo: #E2445C; --rojo-2: #FDE7EB; --amarillo-2: #FFF5CC;
  --r: 20px; --sombra: 0 6px 22px rgba(80, 50, 140, .09);
  font-family: Nunito, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--texto); background: var(--fondo);
  -webkit-tap-highlight-color: transparent;
}
* { box-sizing: border-box; }
html, body { margin: 0; overflow-x: clip; }
body { color: var(--texto); min-height: 100dvh; padding-bottom: calc(84px + env(safe-area-inset-bottom)); font-size: 16px; line-height: 1.4; }
.hidden { display: none !important; }
button { font: inherit; color: inherit; cursor: pointer; }
input, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.2; }

/* Cabecera */
.cab { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px; background: rgba(255, 246, 238, .92); backdrop-filter: blur(10px); }
.cab-logo { font-size: 19px; display: flex; align-items: center; gap: 8px; }
.tema-ani .cab-logo strong { margin-right: 4px; }
.cab-logo strong { font-weight: 900; }
.cab-logo small { font-weight: 800; color: var(--violeta); background: var(--violeta-2); padding: 2px 10px; border-radius: 99px; font-size: 13px; }
main { max-width: 560px; margin: 0 auto; padding: 4px 14px 24px; }
.cargando-app { text-align: center; font-size: 48px; padding: 80px 0; animation: latido 1.2s infinite; }

/* Barra del modo prueba */
.barra-prueba { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap;
  background: #2B2240; color: #fff; font-size: 13px; padding: 6px 10px; }
.barra-prueba button { border: 0; border-radius: 99px; padding: 3px 12px; background: #4a3f63; color: #fff; font-weight: 800; }
.barra-prueba button[aria-pressed="true"] { background: var(--rosa); }
body.con-prueba .cab { top: 34px; }

/* Botones */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: 16px; padding: 12px 18px;
  background: var(--violeta); color: #fff; font-weight: 800; font-size: 16px; box-shadow: 0 4px 0 #5b3fe0; transition: transform .08s, box-shadow .08s; }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #5b3fe0; }
.btn.verde { background: var(--verde); box-shadow: 0 4px 0 #128a59; }
.btn.verde:active { box-shadow: 0 1px 0 #128a59; }
.btn.suave { background: var(--violeta-2); color: var(--violeta); box-shadow: none; }
.btn.grande { width: 100%; padding: 16px; font-size: 18px; border-radius: 18px; margin-top: 10px; }
.btn.mini { padding: 6px 14px; font-size: 14px; box-shadow: none; }
.btn:disabled { opacity: .6; }
.btn.cargando { position: relative; color: transparent !important; }
.btn.cargando::after { content: ""; position: absolute; width: 22px; height: 22px; border-radius: 50%; border: 3px solid rgba(255,255,255,.5); border-top-color: #fff; animation: gira .7s linear infinite; }
.btn.suave.cargando::after { border-color: rgba(124,92,255,.3); border-top-color: var(--violeta); }
.pulso { animation: pulso 1.6s infinite; }
.link { background: none; border: 0; color: var(--violeta); font-weight: 800; padding: 8px 0; text-decoration: underline; text-underline-offset: 3px; }
.x { background: var(--violeta-2); border: 0; width: 34px; height: 34px; border-radius: 50%; color: var(--violeta); font-weight: 900; flex: none; }
.fila-btn { display: flex; gap: 10px; margin-top: 12px; }
.fila-btn .btn { flex: 1; padding: 13px 10px; }
.nueva-tarea { margin: 4px 0 6px; }

/* Puntos */
.hero { background: linear-gradient(135deg, #7C5CFF, #B05CFF 60%, #FF7EA6); color: #fff; border-radius: 26px; padding: 18px 20px; margin: 6px 0 14px; box-shadow: var(--sombra); }
.hero.chico { padding: 16px 20px; }
.hero-hola { font-weight: 800; font-size: 17px; opacity: .95; }
.hero-pts { display: flex; align-items: baseline; gap: 6px; margin-top: 4px; }
.hero-pts strong { font-size: 46px; font-weight: 900; line-height: 1; }
.hero-pts span { font-weight: 800; font-size: 18px; }
.hero-pts .estrella { font-size: 30px; }
.hero-sub { font-weight: 700; opacity: .92; }
.racha { display: inline-block; margin-top: 10px; background: rgba(255,255,255,.2); padding: 4px 12px; border-radius: 99px; font-weight: 800; font-size: 14px; }
.resumen { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 6px 0 12px; }
.resumen > div { background: var(--tarjeta); border-radius: 16px; padding: 10px; text-align: center; box-shadow: var(--sombra); }
.resumen strong { display: block; font-size: 22px; font-weight: 900; }
.resumen small { color: var(--suave); font-weight: 700; font-size: 12px; }

/* Secciones y tarjetas */
.seccion { margin: 18px 0; }
.seccion > h3 { font-size: 15px; font-weight: 900; color: var(--suave); text-transform: uppercase; letter-spacing: .04em; margin: 0 4px 8px; }
.tarjeta { background: var(--tarjeta); border-radius: var(--r); padding: 16px; margin-bottom: 12px; box-shadow: var(--sombra); border: 2px solid transparent; position: relative; }
.tarjeta.nueva { border-color: var(--rosa); }
.tarjeta.urgente { border-color: var(--naranja); }
.tarjeta.vencida { border-color: var(--rojo); background: #FFFBFC; }
.tarjeta.espera { opacity: .9; }
.tarjeta.canje { border-color: var(--verde); }
.tarjeta.chica { padding: 12px 14px; }
.tarjeta.apagada { opacity: .6; }
.t-cab { display: flex; gap: 12px; align-items: flex-start; }
.t-emoji { font-size: 34px; line-height: 1; flex: none; width: 44px; text-align: center; }
.tarjeta.chica .t-emoji { font-size: 26px; width: 34px; }
.t-titulo { font-weight: 900; font-size: 18px; overflow-wrap: anywhere; }
.tarjeta.chica .t-titulo { font-size: 16px; }
.t-nota, .t-meta { color: var(--suave); font-weight: 600; font-size: 14px; overflow-wrap: anywhere; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip { display: inline-block; background: var(--violeta-2); color: #4b3a8f; padding: 4px 10px; border-radius: 99px; font-weight: 800; font-size: 13px; }
.chip.amarillo { background: var(--amarillo-2); color: #7a5b00; }
.chip.naranja { background: var(--naranja-2); color: #8a4f00; }
.chip.rojo { background: var(--rojo-2); color: #a3182f; }
.chip.verde { background: var(--verde-2); color: #0c6c45; }
.ayuda { color: var(--suave); font-size: 14px; font-weight: 600; margin: 8px 2px 0; text-align: center; }
.ayuda.fuerte { color: var(--texto); font-weight: 800; font-size: 16px; }
.nota-mini { font-size: 13px; font-weight: 700; color: var(--naranja); margin-top: 8px; }
.txt { margin: 0 0 12px; font-weight: 600; }
.verde-txt { color: var(--verde); } .rojo-txt { color: var(--rojo); }
.vacio { text-align: center; padding: 22px 10px; color: var(--suave); font-weight: 700; background: rgba(255,255,255,.6); border-radius: var(--r); border: 2px dashed var(--linea); }
.vacio-emoji { font-size: 40px; }
.vacio p { margin: 6px 0 0; }

/* Alertas */
.alerta { border-radius: 16px; padding: 12px 14px; margin: 10px 0; display: flex; flex-direction: column; gap: 4px; font-weight: 600; }
.alerta.mal { background: var(--rojo-2); color: #8d1328; }
.alerta.suave { background: var(--naranja-2); color: #7a4600; }
.alerta.push { background: var(--violeta-2); color: #3d2d86; }
.alerta.push .btn { align-self: flex-start; margin-top: 6px; }
#sinRed { margin: 0 14px 10px; }

/* Fotos */
.fotos { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-top: 12px; }
.fotos figure { margin: 0; }
.fotos figcaption { font-size: 12px; font-weight: 800; color: var(--suave); text-align: center; margin-top: 4px; }
.foto-caja { display: block; width: 100%; aspect-ratio: 4 / 3; padding: 0; border: 0; border-radius: 14px; overflow: hidden; background: var(--violeta-2); position: relative; }
.foto-caja.sin, .foto-caja.rota { display: grid; place-items: center; color: var(--suave); font-weight: 700; font-size: 13px; }
.foto-caja.rota::after { content: "Foto no disponible"; position: absolute; }
.foto { width: 100%; height: 100%; object-fit: cover; display: block; }
.foto-caja.rota .foto { display: none; }
.foto-grande { width: 100%; border-radius: 14px; display: block; }

/* Filas */
.fila-hecha, .fila-canje { display: flex; justify-content: space-between; align-items: center; gap: 10px; background: var(--tarjeta); border-radius: 14px; padding: 11px 14px; margin-bottom: 8px; font-weight: 700; box-shadow: 0 2px 10px rgba(80,50,140,.05); }
.fila-hecha > span:first-child { overflow-wrap: anywhere; }
.fila-hecha small, .fila-canje small { color: var(--suave); font-weight: 600; display: block; }
.fila-hecha .der { display: flex; align-items: center; gap: 8px; flex: none; }
.fila-hecha .x { width: 28px; height: 28px; font-size: 12px; }
.reglas { margin: 0; padding: 14px 16px 14px 34px; background: var(--tarjeta); border-radius: var(--r); font-weight: 600; box-shadow: var(--sombra); }
.reglas li { margin: 4px 0; }
details.tarjeta summary { display: flex; gap: 10px; align-items: center; list-style: none; cursor: pointer; }
details.tarjeta summary::-webkit-details-marker { display: none; }
details.tarjeta summary > div { flex: 1; min-width: 0; }
details.tarjeta summary .chip { flex: none; max-width: 45%; text-align: center; }

/* Formularios */
.form { display: flex; flex-direction: column; gap: 6px; }
.etq { font-weight: 900; font-size: 14px; margin: 10px 2px 2px; color: var(--suave); }
.form input[type=text], .form input[type=number], .form input[type=time], textarea, .unir input {
  width: 100%; border: 2px solid var(--linea); border-radius: 14px; padding: 12px 14px; background: #fff; font-weight: 700; font-size: 16px; }
.form input:focus, textarea:focus, .unir input:focus { outline: none; border-color: var(--violeta); }
textarea { resize: vertical; margin-top: 8px; }
.pastillas { display: flex; flex-wrap: wrap; gap: 8px; }
.pastillas button { border: 2px solid var(--linea); background: #fff; border-radius: 99px; padding: 8px 14px; font-weight: 800; font-size: 14px; }
.pastillas button[aria-checked="true"] { background: var(--violeta); border-color: var(--violeta); color: #fff; }
.pastillas.emojis button { font-size: 22px; padding: 4px 9px; }
.pastillas.dias button { width: 42px; height: 42px; padding: 0; }
.horas { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.hora { display: flex; gap: 6px; align-items: center; }
.hora input { width: 130px !important; }
.form > .link { align-self: center; }

/* Unir el celular */
.unir { text-align: center; padding: 40px 10px; display: flex; flex-direction: column; gap: 10px; max-width: 360px; margin: 0 auto; }
.unir-emoji { font-size: 64px; }
.unir h1 { font-size: 28px; font-weight: 900; }
.unir input { text-align: center; font-size: 24px; letter-spacing: .12em; text-transform: uppercase; }

/* Navegación de abajo */
.nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; justify-content: center; gap: 2px;
  background: #fff; border-top: 1px solid var(--linea); padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); box-shadow: 0 -6px 20px rgba(80,50,140,.06); }
.nav:empty { display: none; }
.nav-b { flex: 1; max-width: 120px; border: 0; background: none; border-radius: 14px; padding: 6px 2px; display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: 12px; font-weight: 800; color: var(--suave); position: relative; }
.nav-ic { font-size: 22px; line-height: 1.1; filter: grayscale(.6); }
.nav-b[aria-current="true"] { background: var(--violeta-2); color: var(--violeta); }
.nav-b[aria-current="true"] .nav-ic { filter: none; }
.badge { position: absolute; top: 2px; right: calc(50% - 22px); background: var(--rojo); color: #fff; font-size: 11px; min-width: 18px; height: 18px; border-radius: 9px; display: grid; place-items: center; padding: 0 5px; }

/* Ventanas */
.velo { position: fixed; inset: 0; z-index: 50; background: rgba(30, 20, 50, .45); display: flex; align-items: flex-end; justify-content: center; animation: aparece .2s; }
.velo.sale { opacity: 0; transition: opacity .2s; }
.hoja { background: var(--fondo); width: 100%; max-width: 560px; max-height: 92dvh; overflow: auto; border-radius: 26px 26px 0 0; padding: 16px 16px calc(20px + env(safe-area-inset-bottom)); animation: sube .25s ease-out; }
.hoja-cab { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; position: sticky; top: -16px; background: var(--fondo); padding: 6px 0; z-index: 1; }
.hoja-cab h2 { font-size: 20px; font-weight: 900; }
@media (min-width: 700px) { .velo { align-items: center; } .hoja { border-radius: 26px; } }

/* Cámara */
.cam { position: fixed; inset: 0; z-index: 60; background: #000; color: #fff; display: flex; flex-direction: column; }
.cam-cab { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: calc(12px + env(safe-area-inset-top)) 16px 12px; }
.cam-cab strong { display: block; font-size: 20px; font-weight: 900; }
.cam-cab small { opacity: .8; font-weight: 700; }
.cam-x { background: rgba(255,255,255,.15); border: 0; color: #fff; width: 42px; height: 42px; border-radius: 50%; font-size: 18px; }
.cam-marco { flex: 1; position: relative; display: grid; place-items: center; overflow: hidden; }
.cam-video, .cam-prev { width: 100%; height: 100%; object-fit: contain; }
.cam-msg { position: absolute; padding: 20px; text-align: center; font-weight: 700; max-width: 360px; }
.cam-pie { display: flex; gap: 12px; justify-content: center; align-items: center; padding: 18px 16px calc(22px + env(safe-area-inset-bottom)); }
.cam-pie .btn { flex: 1; max-width: 240px; margin: 0; }
.cam-disparo { width: 78px; height: 78px; border-radius: 50%; border: 5px solid #fff; background: rgba(255,255,255,.25); }
.cam-disparo:active { background: #fff; }
.cam-disparo:disabled { opacity: .4; }

/* Avisito */
.toast { position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); opacity: 0; pointer-events: none; z-index: 70;
  background: #2B2240; color: #fff; padding: 12px 18px; border-radius: 16px; font-weight: 800; max-width: calc(100% - 32px); width: max-content; text-align: center; transition: all .25s; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.toast.mal { background: var(--rojo); }
.toast.bien { background: var(--verde); }

/* Festejo */
.festejo { position: fixed; inset: 0; pointer-events: none; z-index: 80; overflow: hidden; }
.festejo span { position: absolute; bottom: -40px; font-size: 30px; animation: festejo 1.8s ease-out forwards; }

@keyframes gira { to { transform: rotate(360deg); } }
@keyframes pulso { 0%, 100% { box-shadow: 0 4px 0 #5b3fe0, 0 0 0 0 rgba(124,92,255,.45); } 50% { box-shadow: 0 4px 0 #5b3fe0, 0 0 0 10px rgba(124,92,255,0); } }
@keyframes latido { 50% { transform: scale(1.15); } }
@keyframes aparece { from { opacity: 0; } }
@keyframes sube { from { transform: translateY(40px); opacity: .5; } }
@keyframes festejo { to { transform: translateY(-110vh) rotate(200deg); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition: none !important; } }

/* =====================================================================
   TEMA DE PUDDY · inspirado en BTS (lila, brillitos, lightstick, entradas)
   ===================================================================== */
body.tema-puddy {
  --fondo: #F6F0FF; --violeta: #8B5CF6; --violeta-2: #EDE4FF; --rosa: #FF6FAE; --linea: #E4D8FF; --suave: #6F5F98;
  background-color: var(--fondo);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cg fill='%23B79CFF' opacity='.28'%3E%3Cpath d='M20 14l2 5 5 2-5 2-2 5-2-5-5-2 5-2z'/%3E%3Cpath d='M84 70c-3-4-9-1-7 4l7 7 7-7c2-5-4-8-7-4z'/%3E%3Ccircle cx='96' cy='24' r='2'/%3E%3Ccircle cx='40' cy='96' r='1.6'/%3E%3C/g%3E%3C/svg%3E");
}
.tema-puddy .cab { background: rgba(246, 240, 255, .92); }
.tema-puddy .cab-logo strong, .tema-puddy .t-titulo, .tema-puddy .seccion > h3, .tema-puddy .hoja-cab h2, .tema-puddy .hero-pts strong { font-family: Fredoka, Nunito, sans-serif; }
.tema-puddy .seccion > h3 { text-transform: none; letter-spacing: 0; font-size: 19px; color: #5B3BC4; font-weight: 600; }
.tema-puddy .t-titulo { font-weight: 600; font-size: 20px; }
.tema-puddy .btn { background: var(--violeta); box-shadow: 0 4px 0 #6A3FE0; }
.tema-puddy .btn.pulso { background: var(--rosa); box-shadow: 0 4px 0 #D9468A; animation: pulso-rosa 1.6s infinite; }
.tema-puddy .btn.verde { background: #7C3AED; box-shadow: 0 4px 0 #5B21B6; }
.tema-puddy .btn.suave { background: var(--violeta-2); color: #6A3FE0; box-shadow: none; }
.tema-puddy .tarjeta { border-radius: 24px; }
.tema-puddy .tarjeta.nueva { border-color: var(--rosa); }
.tema-puddy .nav-b[aria-current="true"] { background: #E9DDFF; color: #6A3FE0; }

.hero-bts { background: linear-gradient(140deg, #5B2BD9 0%, #8B5CF6 45%, #C86DFF 75%, #FF8CC6 100%); position: relative; overflow: hidden; }
.hero-bts::before { content: "✦  ·  ✧    ·   ✦     ·  ✧"; position: absolute; top: 6px; right: 14px; font-size: 13px; letter-spacing: 3px; opacity: .55; }
.hero-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.bias { border: 0; background: rgba(255,255,255,.2); color: #fff; font-weight: 800; font-size: 13px; padding: 5px 12px; border-radius: 99px; }
.hero-main { display: flex; align-items: center; gap: 16px; margin: 10px 0 6px; }
.lightstick { position: relative; width: 46px; height: 92px; flex: none; }
.ls-bola { position: absolute; top: 0; left: 0; width: 46px; height: 46px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff, #E6D6FF 45%, #B794FF 100%); border: 3px solid #fff; }
.ls-mango { position: absolute; top: 44px; left: 15px; width: 16px; height: 48px; border-radius: 4px 4px 8px 8px; background: #fff; box-shadow: inset 0 -10px 0 #E6D6FF; }
.lightstick.b0 .ls-bola { background: radial-gradient(circle at 35% 30%, #fff, #D9CFEA 60%, #B6AACC); }
.lightstick.b1 .ls-bola { box-shadow: 0 0 6px 2px rgba(255,255,255,.5); }
.lightstick.b2 .ls-bola { box-shadow: 0 0 10px 3px rgba(255,255,255,.55); }
.lightstick.b3 .ls-bola { box-shadow: 0 0 14px 5px rgba(255,240,255,.6); }
.lightstick.b4 .ls-bola { box-shadow: 0 0 18px 7px rgba(255,220,255,.65); }
.lightstick.b5 .ls-bola { box-shadow: 0 0 22px 9px rgba(255,200,255,.7); }
.lightstick.b6 .ls-bola { box-shadow: 0 0 26px 11px rgba(255,190,250,.75); }
.lightstick.b7 .ls-bola { box-shadow: 0 0 32px 14px rgba(255,180,245,.85); animation: brilla 1.8s ease-in-out infinite; }
.hero-bts .hero-pts { margin-top: 0; }
.nivel { background: rgba(255,255,255,.16); border-radius: 14px; padding: 8px 12px; margin-top: 6px; }
.nivel-txt { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.nivel-txt small { opacity: .9; font-weight: 700; }
.barra { height: 8px; border-radius: 99px; background: rgba(255,255,255,.25); margin-top: 6px; overflow: hidden; }
.barra span { display: block; height: 100%; border-radius: 99px; background: #fff; }
.hero-bts .racha { display: flex; flex-direction: column; gap: 2px; background: none; padding: 0; margin-top: 10px; font-size: 13px; }
.corazones { display: flex; gap: 5px; font-size: 22px; }
.corazones i { font-style: normal; filter: grayscale(1) brightness(1.5); opacity: .4; transition: transform .3s; }
.corazones i.on { filter: none; opacity: 1; transform: translateY(-2px); }
.bias-lista button { min-width: 88px; }
.ticket { display: flex; border-radius: 16px; margin-bottom: 12px; overflow: hidden; position: relative;
  background: linear-gradient(120deg, #5B21B6 0%, #7C3AED 45%, #B455F5 80%, #E36BC8 100%); color: #fff; box-shadow: 0 8px 18px rgba(76, 29, 149, .28); }
.ticket-izq { flex: 1; padding: 12px 16px; border-right: 2px dashed rgba(255,255,255,.65); display: flex; flex-direction: column; position: relative; }
.ticket-izq::after { content: "✦ ✧ ✦"; position: absolute; right: 12px; top: 10px; font-size: 12px; letter-spacing: 2px; opacity: .6; }
.ticket-izq small { color: rgba(255,255,255,.88); font-weight: 800; font-size: 11px; letter-spacing: .05em; }
.ticket-izq strong { font-family: Fredoka, Nunito, sans-serif; font-size: 28px; font-weight: 600; color: #fff; line-height: 1.15; }
.ticket-der { display: grid; place-items: center; padding: 10px; background: #fff; width: 132px; flex: none; }
.ticket::before, .ticket::after { content: ""; position: absolute; right: 124px; width: 16px; height: 16px; border-radius: 50%; background: var(--fondo); z-index: 1; }
.ticket::before { top: -8px; } .ticket::after { bottom: -8px; }
.ticket.anulado { filter: grayscale(.85); opacity: .7; }

/* =====================================================================
   TEMA DE ANI · cuento oscuro (Tim Burton / gótico): rayas, luna, espirales, costuras, lacre
   ===================================================================== */
body.tema-ani {
  color-scheme: dark;
  --fondo: #15111C; --tarjeta: #211A2C; --texto: #EDE7F6; --suave: #A99CC2; --linea: #3A2F4D;
  --violeta: #9D7BFF; --violeta-2: #2E2540; --rojo: #FF6B86; --naranja: #FFB25C;
  --sombra: 0 8px 26px rgba(0,0,0,.45);
  background-color: var(--fondo);
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.05' stroke-width='2'%3E%3Cpath d='M60 150c0-12 18-12 18 0 0 20-30 20-30 0 0-28 42-28 42 0 0 36-54 36-54 0'/%3E%3C/g%3E%3Cg fill='%23ffffff' fill-opacity='.08'%3E%3Cpath d='M170 40l1.5 4 4 1.5-4 1.5-1.5 4-1.5-4-4-1.5 4-1.5z'/%3E%3Ccircle cx='30' cy='40' r='1.4'/%3E%3Ccircle cx='190' cy='170' r='1.2'/%3E%3C/g%3E%3C/svg%3E"),
    radial-gradient(circle at calc(100% - 70px) 130px, rgba(233,222,255,.09) 0 46px, rgba(233,222,255,.035) 47px 70px, transparent 71px);
  background-attachment: fixed;
}
.tema-ani .cab { background: rgba(21,17,28,.94); }
.tema-ani .cab::after { content: ""; position: absolute; left: 0; right: 0; bottom: -8px; height: 8px;
  background: repeating-linear-gradient(90deg, #EDE7F6 0 14px, #15111C 14px 28px); opacity: .9; }
.tema-ani main { padding-top: 14px; }
.tema-ani .cab-logo strong, .tema-ani .t-titulo, .tema-ani .seccion > h3, .tema-ani .hoja-cab h2, .tema-ani .saludo h1, .tema-ani .resumen strong, .tema-ani .hero-pts strong {
  font-family: "Pirata One", Georgia, serif; font-weight: 400; letter-spacing: .02em; }
.tema-ani .cab-logo small { background: #2E2540; color: #CDBBFF; }
.saludo { margin: 6px 4px 12px; }
.saludo h1 { font-size: 34px; color: #F3EEFB; }
.saludo .astro { color: #E9DEFF; }
.saludo p { margin: 2px 0 0; color: var(--suave); font-weight: 700; }
.tema-ani .seccion > h3 { text-transform: none; letter-spacing: .03em; font-size: 23px; color: #CDBBFF; }
.tema-ani .t-titulo { font-size: 22px; }
.tema-ani .tarjeta.chica .t-titulo { font-size: 19px; }
.tema-ani .tarjeta { background: var(--tarjeta); border: 1.5px dashed #4B3D66; }
.tema-ani .tarjeta.revisar { border-color: #8E7AC0; }
.tema-ani .tarjeta.vencida { border: 1.5px dashed #FF6B86; background: #2A1822; }
.tema-ani .tarjeta.canje { border-color: #C9A35B; }
.tema-ani .resumen > div { background: var(--tarjeta); border: 1.5px dashed #3A2F4D; }
.tema-ani .resumen strong { font-size: 28px; color: #F3EEFB; }
.tema-ani .btn { background: #5A3FB0; box-shadow: 0 4px 0 #34236F; }
.tema-ani .btn:active { box-shadow: 0 1px 0 #34236F; }
.tema-ani .btn.verde { background: #8E2447; box-shadow: 0 4px 0 #561228; }
.tema-ani .btn.verde:active { box-shadow: 0 1px 0 #561228; }
.tema-ani .btn.suave { background: #2E2540; color: #D9CCFF; box-shadow: none; }
.tema-ani .link { color: #CDBBFF; }
.tema-ani .x { background: #2E2540; color: #D9CCFF; }
.tema-ani .chip { background: #2E2540; color: #D9CCFF; }
.tema-ani .chip.amarillo { background: #3A3120; color: #F3D58A; }
.tema-ani .chip.naranja { background: #3D2A17; color: #FFC27F; }
.tema-ani .chip.rojo { background: #44202C; color: #FF9AAD; }
.tema-ani .chip.verde { background: #3A1A28; color: #F2A5BE; }
.tema-ani .alerta.mal { background: #44202C; color: #FFC2CE; }
.tema-ani .alerta.suave { background: #33261A; color: #FFD3A1; }
.tema-ani .alerta.push { background: #2E2540; color: #E2D8FF; }
.tema-ani .vacio { background: rgba(255,255,255,.03); border-color: #3A2F4D; }
.tema-ani .foto-caja { background: #2E2540; }
.tema-ani .reglas, .tema-ani .fila-hecha, .tema-ani .fila-canje { background: var(--tarjeta); box-shadow: none; border: 1px solid #2E2540; }
.tema-ani .hero { background: linear-gradient(135deg, #2B2140, #4A1D3A); border: 1.5px dashed #5C4A80; box-shadow: none; }
.tema-ani .form input[type=text], .tema-ani .form input[type=number], .tema-ani .form input[type=time], .tema-ani textarea {
  background: #1B1524; border-color: #3A2F4D; color: var(--texto); }
.tema-ani .form input::placeholder, .tema-ani textarea::placeholder { color: #7D7096; }
.tema-ani .pastillas button { background: #1B1524; border-color: #3A2F4D; color: var(--texto); }
.tema-ani .pastillas button[aria-checked="true"] { background: #5A3FB0; border-color: #8E7AC0; color: #fff; }
.tema-ani .nav { background: #1B1524; border-top: 1px solid #3A2F4D; box-shadow: none; }
.tema-ani .nav-b[aria-current="true"] { background: #2E2540; color: #E2D8FF; }
.tema-ani .hoja { background: #1B1524; border-top: 3px solid #EDE7F6; }
.tema-ani .hoja-cab { background: #1B1524; }
.tema-ani .velo { background: rgba(5,3,10,.7); }
.tema-ani .toast { background: #EDE7F6; color: #15111C; }
.tema-ani .toast.bien { background: #8E2447; color: #fff; }
.tema-ani .verde-txt { color: #F2A5BE; }
.tema-ani details.tarjeta summary .chip { color: #D9CCFF; }

/* Sello de lacre al aprobar */
.sello { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; z-index: 2; }
.sello span { width: 132px; height: 132px; border-radius: 50%; display: grid; place-items: center; transform: rotate(-14deg);
  background: radial-gradient(circle at 38% 32%, #C0395F, #8E2447 55%, #5C1228); color: #FFE3EA;
  font-family: "Pirata One", Georgia, serif; font-size: 26px; border: 4px double rgba(255,220,230,.55);
  box-shadow: 0 0 0 7px rgba(142,36,71,.35), 0 10px 24px rgba(0,0,0,.5); animation: sellar .55s cubic-bezier(.2,1.6,.4,1) both; }

/* =====================================================================
   MOVIMIENTO: cabecera, sonido, puntos que cuentan, entradas de cada página
   ===================================================================== */
.cab-der { display: flex; align-items: center; gap: 8px; }
.sonido-btn { border: 0; background: var(--violeta-2); width: 38px; height: 38px; border-radius: 50%; font-size: 17px; display: grid; place-items: center; }
.sonido-btn:active { transform: scale(.9); }
.murcielago { display: none; }
main > .btn { margin-bottom: 18px; }
.cab { overflow: visible; }
.hero-pts { position: relative; }
.globo-pts { position: absolute; left: 0; top: -6px; font-family: Fredoka, Nunito, sans-serif; font-weight: 700; font-size: 22px; padding: 2px 10px; border-radius: 99px;
  background: #fff; color: #7C3AED; animation: globo 1.5s ease-out forwards; pointer-events: none; }
.globo-pts.baja { color: #D9468A; }
.tema-ani .globo-pts { background: #8E2447; color: #FFE3EA; font-family: "Pirata One", Georgia, serif; }
.btn:not(:disabled):active, .pastillas button:active, .nav-b:active { transform: scale(.95); }
.nav-b { transition: background .2s, color .2s, transform .1s; }
.nav-b[aria-current="true"] .nav-ic { animation: salta .45s ease-out; }

/* ---- Puddy: todo «salta» como en un escenario ---- */
.tema-puddy main.entra .anim { animation: pop .55s cubic-bezier(.2, 1.4, .4, 1) calc(var(--i) * 55ms) both; }
.tema-puddy main.entra[data-pag="canjear"] .ticket.anim { animation: imprime .6s cubic-bezier(.2, 1.2, .4, 1) calc(var(--i) * 80ms) both; }
.tema-puddy main.entra[data-pag="historial"] .anim { animation: cae .45s ease-out calc(var(--i) * 45ms) both; }
.tema-puddy main.entra .corazones i.on { animation: salta .5s cubic-bezier(.2, 1.6, .4, 1) calc(.45s + var(--k) * 90ms) both; }
.tema-puddy main.entra .barra span { animation: llena 1.1s cubic-bezier(.3, 1, .4, 1) .35s both; }
.tema-puddy .lightstick { transform-origin: 50% 100%; animation: balanceo 3.2s ease-in-out infinite; }
.tema-puddy .hero-bts::before { animation: titila 2.4s ease-in-out infinite; }
.tema-puddy .tarjeta.nueva .t-emoji { animation: menea 2.6s ease-in-out infinite; transform-origin: 50% 80%; }
.tema-puddy .tarjeta.urgente { animation: late 1.2s ease-in-out infinite; }
.tema-puddy .vacio-emoji { animation: flota 3s ease-in-out infinite; }
.tema-puddy #logoIc { display: inline-block; animation: latido 1.6s ease-in-out infinite; }

/* ---- Ani: todo aparece entre la niebla, como en un cuento ---- */
.tema-ani main.entra .anim { animation: niebla .8s ease-out calc(var(--i) * 70ms) both; }
.tema-ani main.entra[data-pag="historial"] .anim { animation: pagina .6s ease-out calc(var(--i) * 60ms) both; transform-origin: 50% 0; }
.tema-ani main.entra[data-pag="rutinas"] .tarjeta.anim { animation: colgar .9s cubic-bezier(.3, 1.5, .5, 1) calc(var(--i) * 90ms) both; transform-origin: 50% -20px; }
.tema-ani main.entra[data-pag="puntos"] .hero.anim { animation: aparicion 1s ease-out both; }
.tema-ani main.entra .saludo .astro { display: inline-block; animation: luna 1.4s ease-out .2s both; }
.tema-ani .saludo .astro { display: inline-block; animation: brilla-luna 4s ease-in-out infinite; }
.tema-ani #logoIc { display: inline-block; animation: vela 2.2s ease-in-out infinite; transform-origin: 50% 100%; }
.tema-ani .tarjeta.vencida .t-emoji { animation: tiembla 3.5s ease-in-out infinite; }
.tema-ani .vacio-emoji { animation: flota 4s ease-in-out infinite; }
.tema-ani .murcielago { display: block; position: fixed; left: 0; top: 0; z-index: 40; border: 0; background: none; padding: 6px; line-height: 1; cursor: pointer; filter: drop-shadow(0 4px 6px rgba(0,0,0,.5)); }
.tema-ani .murcielago span { display: inline-block; animation: aletea .22s ease-in-out infinite alternate; }
@keyframes aletea { from { transform: scaleY(1) scaleX(1); } to { transform: scaleY(.55) scaleX(1.12); } }
.tema-ani .tarjeta.revisar .foto-caja { transition: transform .3s; }
.tema-ani .tarjeta.revisar .foto-caja:hover { transform: rotate(-1deg) scale(1.02); }

/* Sorpresas escondidas */
.lightstick { border: 0; background: none; padding: 0; cursor: pointer; }
.tema-puddy .lightstick.agita { animation: agitar .9s ease-in-out; }
.tema-puddy .lightstick.agita .ls-bola { box-shadow: 0 0 40px 20px rgba(255, 190, 250, .95); background: radial-gradient(circle at 35% 30%, #fff, #F5D0FE 40%, #E879F9); }
.tema-ani .saludo .astro { cursor: pointer; }
.tema-ani .saludo .astro.aullido { animation: aullar 1.6s ease-in-out; }
@keyframes agitar { 0%, 100% { transform: rotate(0); } 15% { transform: rotate(-22deg); } 30% { transform: rotate(20deg); } 45% { transform: rotate(-18deg); } 60% { transform: rotate(16deg); } 75% { transform: rotate(-8deg); } }
@keyframes aullar { 0% { text-shadow: none; transform: scale(1); } 40% { text-shadow: 0 0 24px #E9DEFF, 0 0 48px #9D7BFF; transform: scale(1.5) rotate(-10deg); } 100% { text-shadow: none; transform: scale(1); } }
@keyframes huye { to { transform: translate(60vw, -60px) scale(.3) rotate(30deg); opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(18px) scale(.92); } 65% { opacity: 1; transform: translateY(-3px) scale(1.02); } to { opacity: 1; transform: none; } }
@keyframes imprime { from { opacity: 0; transform: translateX(60px) rotate(4deg); } to { opacity: 1; transform: none; } }
@keyframes cae { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: none; } }
@keyframes salta { 0% { transform: scale(.4); } 60% { transform: scale(1.3) translateY(-4px); } 100% { transform: translateY(-2px); } }
@keyframes llena { from { width: 0; } }
@keyframes balanceo { 0%, 100% { transform: rotate(-7deg); } 50% { transform: rotate(7deg); } }
@keyframes titila { 50% { opacity: .15; } }
@keyframes menea { 0%, 70%, 100% { transform: rotate(0); } 76% { transform: rotate(-12deg); } 82% { transform: rotate(10deg); } 88% { transform: rotate(-6deg); } 94% { transform: rotate(3deg); } }
@keyframes late { 50% { transform: scale(1.012); } }
@keyframes flota { 50% { transform: translateY(-8px); } }
@keyframes globo { 0% { opacity: 0; transform: translateY(10px) scale(.6); } 20% { opacity: 1; transform: translateY(-14px) scale(1.1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translateY(-44px); } }
@keyframes niebla { from { opacity: 0; filter: blur(8px); transform: translateY(10px); } to { opacity: 1; filter: blur(0); transform: none; } }
@keyframes pagina { from { opacity: 0; transform: perspective(700px) rotateX(-35deg); } to { opacity: 1; transform: none; } }
@keyframes colgar { 0% { opacity: 0; transform: rotate(-9deg) translateY(-18px); } 45% { opacity: 1; transform: rotate(4deg); } 70% { transform: rotate(-2deg); } 100% { opacity: 1; transform: none; } }
@keyframes aparicion { from { opacity: 0; transform: scale(.9); filter: blur(10px) brightness(2); } to { opacity: 1; transform: none; filter: none; } }
@keyframes luna { from { opacity: 0; transform: translate(-12px, 10px) rotate(-40deg); } to { opacity: 1; transform: none; } }
@keyframes brilla-luna { 50% { text-shadow: 0 0 14px rgba(233, 222, 255, .9); } }
@keyframes vela { 0%, 100% { transform: rotate(-2deg) scaleY(1); filter: brightness(1); } 30% { transform: rotate(2deg) scaleY(1.04); filter: brightness(1.25); } 60% { transform: rotate(-1deg) scaleY(.98); filter: brightness(.9); } }
@keyframes tiembla { 0%, 88%, 100% { transform: none; } 90% { transform: translateX(-2px) rotate(-3deg); } 94% { transform: translateX(2px) rotate(3deg); } 97% { transform: translateX(-1px); } }
@keyframes vuelo { 0% { transform: translate(0, 0) scale(.9); } 25% { transform: translate(28vw, 14px) scale(1); } 50% { transform: translate(56vw, -4px) scale(.85); } 75% { transform: translate(84vw, 12px) scale(1); } 85%, 100% { transform: translate(115vw, 0) scale(.9); } }
@keyframes sellar { from { transform: rotate(-14deg) scale(2.4); opacity: 0; } to { transform: rotate(-14deg) scale(1); opacity: 1; } }
@keyframes brilla { 50% { box-shadow: 0 0 40px 18px rgba(255,190,250,.95); } }
@keyframes pulso-rosa { 0%, 100% { box-shadow: 0 4px 0 #D9468A, 0 0 0 0 rgba(255,111,174,.5); } 50% { box-shadow: 0 4px 0 #D9468A, 0 0 0 10px rgba(255,111,174,0); } }
