/* =====================================================================
FIESTA DE CUYOS · estilos
Paleta: fresa, lechuga, heno, terciopelo de teatro y cacao.
Mobile-first: todo escala con clamp(), vw y vh.
===================================================================== */

:root {
    --fresa: #ff5d8f;
    --fresa-osc: #d93d70;
    --fresa-claro: #ffd3e1;
    --lechuga: #6cc25a;
    --lechuga-osc: #2f7d32;
    --heno: #ffd977;
    --terciopelo: #a3123a;
    --terciopelo-osc: #640624;
    --cacao: #4a2a24;
    --cacao-suave: #7d5650;
    --algodon: #fff0f4;

    --header-h: 48px;
    /* tamaño del cuyo protagonista y de los cuyos chiquitos */
    --cuyo-g: clamp(130px, min(46vw, 33vh), 260px);
    --cuyo-m: clamp(52px, 14vw, 78px);

    color-scheme: light;
}

* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body {
    margin: 0;
    font-family: 'Fredoka', ui-rounded, 'Segoe UI Rounded', system-ui, sans-serif;
    color: var(--cacao);
    background:
        radial-gradient(900px 500px at 15% -5%, #fff4c4 0%, transparent 60%),
        radial-gradient(800px 600px at 105% 15%, #ffd0df 0%, transparent 55%),
        linear-gradient(180deg, var(--algodon) 0%, #ffe9d6 100%);
    background-color: var(--algodon);
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
}

button {
    font-family: inherit;
    touch-action: manipulation;
}

:focus-visible {
    outline: 3px solid var(--fresa);
    outline-offset: 3px;
    border-radius: 12px;
}

/* ---------- capas ---------- */
#fondo {
    position: fixed;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

#oscuridad {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    opacity: 0;
    background: radial-gradient(circle at 50% 55%, rgba(50, 12, 32, .55) 0%, rgba(24, 6, 18, .93) 70%);
    transition: opacity 1.2s ease;
}

body.luces-bajas #oscuridad {
    opacity: 1;
}

#teatro {
    position: fixed;
    inset: 0;
    z-index: 2;
}

/* decoración flotante */
.flotante {
    position: absolute;
    bottom: -12vh;
    font-size: var(--s, 24px);
    opacity: .28;
    animation: flotar var(--d, 20s) linear infinite;
    animation-delay: var(--delay, 0s);
}

@keyframes flotar {
    from {
        transform: translateY(0) rotate(0deg);
    }

    to {
        transform: translateY(-125vh) rotate(var(--r, 40deg));
    }
}

/* ---------- progreso ---------- */
#progreso {
    position: fixed;
    z-index: 50;
    top: calc(env(safe-area-inset-top, 0px) + 8px);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 4px;
    padding: 4px 12px;
    background: rgba(255, 255, 255, .72);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    border-radius: 999px;
    box-shadow: 0 4px 14px rgba(160, 60, 90, .15);
    transition: opacity .6s;
}

.huella {
    font-size: 17px;
    line-height: 1.6;
    filter: grayscale(1);
    opacity: .3;
    transition: filter .4s, opacity .4s;
}

.huella.hecho {
    filter: none;
    opacity: 1;
}

.huella.actual {
    filter: none;
    opacity: 1;
    animation: latido 1.3s ease-in-out infinite;
}

body.luces-bajas #progreso {
    opacity: .35;
}

@keyframes latido {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.25);
    }
}

/* ---------- botón de música ---------- */
.btn-musica {
    position: fixed;
    z-index: 60;
    right: calc(env(safe-area-inset-right, 0px) + 14px);
    bottom: calc(env(safe-area-inset-bottom, 0px) + 14px);
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 0;
    background: #fff;
    font-size: 20px;
    box-shadow: 0 4px 0 var(--fresa-claro), 0 8px 18px rgba(160, 60, 90, .2);
}

.btn-musica:active {
    transform: translateY(3px);
    box-shadow: 0 1px 0 var(--fresa-claro);
}

/* ---------- actos ---------- */
.acto {
    position: absolute;
    inset: 0;
    display: none;
    flex-direction: column;
    align-items: center;
    gap: clamp(6px, 1.6vh, 16px);
    padding:
        calc(var(--header-h) + env(safe-area-inset-top, 0px) + 6px) calc(16px + env(safe-area-inset-right, 0px)) calc(70px + env(safe-area-inset-bottom, 0px)) calc(16px + env(safe-area-inset-left, 0px));
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    text-align: center;
}

.acto.activo {
    display: flex;
}

/* centra verticalmente cuando cabe, y deja hacer scroll cuando no */
.acto> :first-child {
    margin-top: auto;
}

.acto> :last-child {
    margin-bottom: auto;
}

/* durante el fundido conviven dos actos: el que entra queda arriba */
.acto.entrando {
    z-index: 2;
}

.acto.saliendo {
    z-index: 1;
    pointer-events: none;
}

/* mensaje final del pastel, cuando se cumple el deseo */
.instr.deseo {
    font-family: 'Gochi Hand', 'Fredoka', cursive;
    font-size: clamp(1.7rem, 7vw, 2.6rem);
    line-height: 1.1;
    max-width: 18ch;
    color: var(--cacao);
    text-shadow: 0 3px 0 #fff;
}

.pista {
    margin: 0;
    font-size: .82rem;
    color: var(--cacao-suave);
    opacity: .8;
}

.instr {
    margin: 0 auto;
    max-width: 34ch;
    font-size: clamp(1rem, 3.8vw, 1.2rem);
    font-weight: 500;
    color: var(--cacao);
    transition: color .8s;
}

body.luces-bajas .instr {
    color: #ffe9c9;
}

/* ---------- cartel del acto 1 ---------- */
.cartel {
    position: relative;
    max-width: 300px;
    padding: 18px 26px 20px;
    border-radius: 18px;
    color: #fff6e8;
    background:
        repeating-linear-gradient(0deg, rgba(0, 0, 0, .05) 0 3px, transparent 3px 11px),
        linear-gradient(#c88a58, #a96c41);
    box-shadow: inset 0 -6px 0 rgba(0, 0, 0, .15), 0 12px 26px rgba(120, 60, 30, .28);
    transform: rotate(-3deg);
}

.cartel-icono {
    font-size: 2.2rem;
}

.cartel-titulo {
    margin: 4px 0 2px;
    font-size: 1.7rem;
    font-weight: 700;
}

.cartel-sub {
    margin: 0;
    font-size: .95rem;
    opacity: .9;
}

/* ---------- escena (cuyo protagonista + burbuja) ---------- */
.escena {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 560px;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
}

.burbuja {
    position: relative;
    min-width: 160px;
    max-width: min(92vw, 440px);
    min-height: 4.1em;
    margin-bottom: 18px;
    padding: 10px 20px 14px;
    background: #fff;
    border: 3px solid var(--fresa-claro);
    border-radius: 26px;
    box-shadow: 0 10px 24px rgba(150, 50, 80, .14);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px) scale(.96);
    transition: opacity .22s, transform .22s, visibility .22s;
}

.burbuja.visible {
    opacity: 1;
    visibility: visible;
    transform: none;
}

.burbuja::before,
.burbuja::after {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    border-style: solid;
    border-color: transparent;
}

.burbuja::before {
    bottom: -19px;
    border-width: 18px 14px 0;
    border-top-color: var(--fresa-claro);
}

.burbuja::after {
    bottom: -13px;
    border-width: 14px 11px 0;
    border-top-color: #fff;
}

.burbuja-nombre {
    display: inline-block;
    font-size: .78rem;
    font-weight: 600;
    color: var(--fresa-osc);
}

.burbuja-texto {
    margin: 0;
    font-family: 'Gochi Hand', 'Fredoka', cursive;
    font-size: clamp(1.3rem, 5vw, 1.75rem);
    line-height: 1.18;
    color: var(--cacao);
    min-height: 1.18em;
}

.slot {
    position: relative;
    width: var(--cuyo-g);
    height: calc(var(--cuyo-g) * .95);
}

.slot .cuyo {
    position: absolute;
    inset: 0;
}

.cuyo-svg {
    display: block;
    width: 100%;
    height: 100%;
    overflow: visible;
}

.cuyo-idle {
    height: 100%;
    transform-origin: 50% 95%;
    animation: respirar 2.6s ease-in-out infinite;
}

@keyframes respirar {

    0%,
    100% {
        transform: scale(1, 1);
    }

    50% {
        transform: scale(1.035, .965);
    }
}

.cuyo-svg .ojos {
    transform-box: fill-box;
    transform-origin: center;
    animation: parpadeo 4.6s infinite;
}

@keyframes parpadeo {

    0%,
    92%,
    100% {
        transform: scaleY(1);
    }

    95% {
        transform: scaleY(.1);
    }
}

.cuyo-svg .ojos-latido {
    transform-box: fill-box;
    transform-origin: center;
    animation: latido 1s ease-in-out infinite;
}

/* ---------- palco (cuyos que ya pasaron) ---------- */
.palco {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2px 8px;
    width: 100%;
    max-width: 640px;
    min-height: calc(var(--cuyo-m) + 18px);
}

.mini {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: var(--cuyo-m);
}

.mini .cuyo-idle {
    width: var(--cuyo-m);
    height: calc(var(--cuyo-m) * .95);
}

.mini-nombre {
    display: block;
    font-size: .7rem;
    font-weight: 600;
    line-height: 1.2;
    color: var(--cacao-suave);
    white-space: nowrap;
}

body.luces-bajas .mini-nombre {
    color: #ffe9c9;
}

.mini.saltar {
    animation: saltito .55s ease-in-out 4;
}

@keyframes saltito {

    0%,
    100% {
        transform: translateY(0);
    }

    45% {
        transform: translateY(-22px) rotate(-6deg);
    }
}

/* ---------- botones ---------- */
.acciones {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    align-items: center;
    min-height: 62px;
}

.btn-fiesta {
    border: 0;
    padding: .7em 1.6em;
    border-radius: 999px;
    font-size: clamp(1.02rem, 3.8vw, 1.15rem);
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, var(--fresa), #ff8a6a);
    box-shadow: 0 6px 0 var(--fresa-osc), 0 12px 24px rgba(217, 61, 112, .3);
    transition: transform .1s, box-shadow .1s;
}

.btn-fiesta:active {
    transform: translateY(4px);
    box-shadow: 0 2px 0 var(--fresa-osc), 0 4px 10px rgba(217, 61, 112, .3);
}

.btn-fiesta.secundario {
    color: var(--fresa-osc);
    background: #fff;
    box-shadow: 0 6px 0 var(--fresa-claro), 0 12px 24px rgba(217, 61, 112, .15);
}

.btn-fiesta.secundario:active {
    box-shadow: 0 2px 0 var(--fresa-claro);
}

.btn-fiesta:disabled {
    opacity: .7;
}

/* ---------- destello entre escenas ---------- */
#destello {
    position: fixed;
    inset: 0;
    z-index: 70;
    pointer-events: none;
    opacity: 0;
    background:
        radial-gradient(circle at 50% 48%, rgba(255, 255, 255, .95) 0%, rgba(255, 240, 246, .7) 28%, rgba(255, 211, 225, .35) 55%, transparent 80%);
}

/* ---------- acto 4: juego de la lechuga ---------- */
.juego {
    width: 100%;
    max-width: 720px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.marcador {
    display: flex;
    align-items: center;
    gap: 10px;
    width: min(100%, 360px);
}

.marcador .progress {
    flex: 1;
    height: 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .8);
}

.marcador .progress-bar {
    background: linear-gradient(90deg, var(--lechuga), #9be07f);
    transition: width .4s ease;
}

.contador {
    font-weight: 700;
    min-width: 3.2em;
}

.comensales {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: clamp(6px, 2vw, 14px);
}

.comensal {
    position: relative;
    width: clamp(84px, 27vw, 124px);
    padding: 22px 6px 6px;
    border: 3px solid transparent;
    border-radius: 22px;
    background: rgba(255, 255, 255, .62);
    color: var(--cacao);
    cursor: pointer;
    transition: transform .15s, background-color .3s, border-color .3s;
}

.comensal:active {
    transform: scale(.94);
}

.comensal .avatar {
    aspect-ratio: 1 / .95;
}

.comensal .avatar .cuyo-idle {
    height: 100%;
}

.comensal .nombre {
    display: block;
    font-size: .78rem;
    font-weight: 600;
}

.pensamiento {
    position: absolute;
    top: 4px;
    right: 6px;
    padding: 0 7px;
    font-size: .95rem;
    background: #fff;
    border-radius: 999px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .1);
    animation: balanceo 1.8s ease-in-out infinite;
}

@keyframes balanceo {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-4px);
    }
}

.comensal.lleno {
    background: #e3f7d9;
    border-color: #b9e6a8;
    cursor: default;
}

.comensal.lleno .pensamiento {
    animation: none;
}

.comensal.comiendo .avatar {
    animation: masticar .16s ease-in-out 4;
}

@keyframes masticar {
    50% {
        transform: scale(1.06, .94) rotate(2deg);
    }
}

.plato {
    display: grid;
    place-items: center;
    width: 72px;
    height: 72px;
    margin-top: 4px;
    border-radius: 50%;
    background: radial-gradient(circle at 50% 40%, #fff 0 55%, #f2e6ea 56%);
    box-shadow: 0 6px 0 #ead2d9;
    font-size: 2.3rem;
}

.lechuga-volando {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 80;
    font-size: 2rem;
    pointer-events: none;
}

.corazon-flotante {
    position: fixed;
    z-index: 80;
    pointer-events: none;
    font-size: 1.3rem;
    animation: subir 1s ease-out forwards;
}

@keyframes subir {
    from {
        opacity: 1;
        transform: translate(-50%, 0) scale(.6);
    }

    to {
        opacity: 0;
        transform: translate(calc(-50% + var(--dx, 0px)), -70px) scale(1.2);
    }
}

/* ---------- acto 5: regalos ---------- */
.regalos-zona {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.regalos {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(14px, 4vw, 26px);
    width: 100%;
    max-width: 680px;
    padding-top: 26px;
}

@media (min-width: 768px) {
    .regalos {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.regalo {
    --c: #ff7aa2;
    --l: #fff1a8;
    position: relative;
    justify-self: center;
    width: clamp(110px, 34vw, 140px);
    aspect-ratio: 1 / 1.05;
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
    animation: esperando 2.6s ease-in-out infinite;
}

.regalo .caja {
    position: absolute;
    left: 8%;
    right: 8%;
    bottom: 0;
    height: 62%;
    background: var(--c);
    border-radius: 8px;
    box-shadow: inset 0 -10px 0 rgba(0, 0, 0, .1), 0 10px 18px rgba(120, 40, 70, .18);
}

.regalo .caja::before,
.regalo .tapa::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 16%;
    transform: translateX(-50%);
    background: var(--l);
}

.regalo .tapa {
    position: absolute;
    left: 2%;
    right: 2%;
    bottom: 58%;
    height: 18%;
    z-index: 2;
    background: var(--c);
    filter: brightness(1.07);
    border-radius: 8px;
    box-shadow: 0 4px 0 rgba(0, 0, 0, .08);
    transition: transform .6s cubic-bezier(.2, 1.4, .4, 1), opacity .6s;
}

.lazo {
    position: absolute;
    left: 50%;
    bottom: 100%;
    width: 0;
    height: 0;
}

.lazo::before,
.lazo::after {
    content: '';
    position: absolute;
    bottom: -6px;
    width: 34px;
    height: 26px;
    border: 7px solid var(--l);
    border-radius: 50%;
}

.lazo::before {
    right: -2px;
    transform: rotate(-22deg);
}

.lazo::after {
    left: -2px;
    transform: rotate(22deg);
}

.sorpresa {
    position: absolute;
    left: 50%;
    bottom: 28%;
    z-index: 1;
    font-size: 2.8rem;
    transform: translate(-50%, 0) scale(0);
    transition: transform .5s cubic-bezier(.2, 1.6, .4, 1) .15s;
}

.regalo.agitando {
    animation: agitar .5s ease-in-out;
}

.regalo.abierto {
    cursor: default;
    animation: none;
}

.regalo.abierto .tapa {
    transform: translate(-30%, -150%) rotate(-28deg);
    opacity: 0;
}

.regalo.abierto .sorpresa {
    transform: translate(-50%, -45%) scale(1);
}

@media (hover: hover) {
    .regalo:not(.abierto):hover {
        filter: brightness(1.06) drop-shadow(0 6px 10px rgba(120, 40, 70, .2));
    }
}

@keyframes esperando {

    0%,
    88%,
    100% {
        transform: rotate(0);
    }

    92% {
        transform: rotate(-4deg);
    }

    96% {
        transform: rotate(4deg);
    }
}

@keyframes agitar {

    0%,
    100% {
        transform: rotate(0);
    }

    20% {
        transform: rotate(-10deg) scale(1.05);
    }

    40% {
        transform: rotate(9deg) scale(1.05);
    }

    60% {
        transform: rotate(-7deg);
    }

    80% {
        transform: rotate(5deg);
    }
}

/* vale dentro de SweetAlert2 */
.vale {
    padding: 16px 14px 14px;
    border: 3px dashed var(--fresa);
    border-radius: 18px;
    background: #fff7fa;
}

.vale-emoji {
    font-size: 3.2rem;
    line-height: 1.1;
}

.vale-pre {
    font-size: .95rem;
    font-weight: 600;
    color: var(--fresa-osc);
}

.vale-texto {
    font-family: 'Gochi Hand', cursive;
    font-size: 1.75rem;
    line-height: 1.15;
    color: var(--cacao);
}

.vale-pie {
    margin-top: 10px;
    font-size: .78rem;
    color: var(--cacao-suave);
}

/* ---------- acto 6: pastel ---------- */
.pastel-zona {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(8px, 2vh, 16px);
}

.pastel {
    --pw: clamp(210px, min(66vw, 42vh), 330px);
    position: relative;
    width: var(--pw);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.velas {
    position: relative;
    z-index: 3;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: calc(var(--pw) * .055);
    height: calc(var(--pw) * .24);
    margin-bottom: calc(var(--pw) * -.03);
}

.vela {
    position: relative;
    width: max(10px, calc(var(--pw) * .04));
    height: calc(var(--pw) * .13);
    padding: 0;
    border: 0;
    border-radius: 4px 4px 2px 2px;
    background: repeating-linear-gradient(135deg, #fff 0 5px, var(--c, #ff7aa2) 5px 10px);
    cursor: pointer;
}

.vela::before {
    content: '';
    position: absolute;
    inset: -46px -12px -6px;
}

/* área táctil más grande */
.vela .mecha {
    position: absolute;
    bottom: 100%;
    left: 50%;
    width: 2px;
    height: 7px;
    transform: translateX(-50%);
    background: #3a2a22;
}

.vela .flama {
    position: absolute;
    left: 50%;
    bottom: calc(100% + 5px);
    width: 15px;
    height: 26px;
    margin-left: -7.5px;
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    background: radial-gradient(ellipse at 50% 75%, #fff 0 16%, #ffe066 34%, #ff9f1c 68%, rgba(255, 90, 0, 0) 72%);
    box-shadow: 0 0 18px 6px rgba(255, 190, 60, .5), 0 0 46px 16px rgba(255, 170, 40, .22);
    transform-origin: 50% 90%;
    animation: flicker .16s ease-in-out infinite alternate;
    transition: opacity .25s, transform .25s;
}

@keyframes flicker {
    from {
        transform: scale(1, 1) rotate(-2deg);
    }

    to {
        transform: scale(.92, 1.08) rotate(2deg);
    }
}

.vela .humo {
    position: absolute;
    left: 50%;
    bottom: calc(100% + 6px);
    width: 10px;
    height: 10px;
    margin-left: -5px;
    border-radius: 50%;
    background: rgba(215, 215, 225, .75);
    opacity: 0;
}

.vela.apagada {
    cursor: default;
}

.vela.apagada .flama {
    opacity: 0;
    transform: scale(.2);
    animation: none;
}

.vela.apagada .humo {
    animation: humo 1.5s ease-out forwards;
}

@keyframes humo {
    0% {
        opacity: .85;
        transform: translateY(0) scale(.6);
    }

    100% {
        opacity: 0;
        transform: translate(8px, -54px) scale(2.6);
    }
}

.piso {
    position: relative;
    border-radius: 12px 12px 20px 20px / 10px 10px 24px 24px;
}

.piso-arriba {
    z-index: 2;
    width: 70%;
    height: calc(var(--pw) * .25);
    background:
        radial-gradient(circle, #ffd84d 2px, transparent 2.6px) 0 0 / 24px 20px,
        radial-gradient(circle, #6cc25a 2px, transparent 2.6px) 12px 10px / 24px 20px,
        linear-gradient(#ffb7cc, #ff97b6);
}

.piso-abajo {
    z-index: 1;
    width: 100%;
    height: calc(var(--pw) * .32);
    margin-top: -2px;
    background:
        radial-gradient(circle, #fff 2px, transparent 2.6px) 0 0 / 26px 22px,
        radial-gradient(circle, #7fb0ff 2px, transparent 2.6px) 13px 11px / 26px 22px,
        linear-gradient(#ff8fb0, #f06d98);
}

.glaseado {
    position: absolute;
    left: -2%;
    right: -2%;
    top: -4%;
    height: 30%;
    background: #fffaf4;
    border-radius: 12px 12px 6px 6px;
}

.glaseado::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    height: 12px;
    background: radial-gradient(circle at 50% 0, #fffaf4 8px, transparent 8.5px) 0 0 / 18px 12px repeat-x;
}

.pastel-nombre {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 10%;
    font-family: 'Gochi Hand', cursive;
    font-size: calc(var(--pw) * .12);
    line-height: 1;
    color: #fff;
    text-shadow: 0 2px 0 rgba(160, 30, 80, .45);
}

.plato-pastel {
    width: 116%;
    height: calc(var(--pw) * .08);
    margin-top: calc(var(--pw) * -.035);
    border-radius: 50%;
    background: linear-gradient(#ffffff, #e7e0ec);
    box-shadow: 0 10px 22px rgba(0, 0, 0, .18);
}

.controles-soplar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.palco-pastel {
    --cuyo-m: clamp(40px, 10.5vw, 60px);
    gap: 2px 6px;
}

.palco-pastel .mini-nombre {
    font-size: .62rem;
}

/* ---------- carta ---------- */
#carta {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: calc(16px + env(safe-area-inset-top, 0px)) 16px calc(16px + env(safe-area-inset-bottom, 0px));
    background: rgba(74, 42, 36, .45);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
}

.papel {
    position: relative;
    width: min(560px, 100%);
    max-height: calc(100vh - 40px);
    max-height: calc(100dvh - 40px);
    overflow-y: auto;
    padding: 30px clamp(18px, 5vw, 34px) 22px;
    border-radius: 18px;
    background:
        repeating-linear-gradient(180deg, transparent 0 31px, #f6dfe6 31px 32px),
        #fffdf7;
    background-position: 0 22px;
    box-shadow: 0 24px 60px rgba(60, 20, 30, .35);
    font-family: 'Gochi Hand', cursive;
    font-size: clamp(1.2rem, 4.4vw, 1.45rem);
    line-height: 32px;
    color: var(--cacao);
    text-align: left;
    cursor: pointer;
}

.cinta {
    position: absolute;
    top: -2px;
    left: 50%;
    width: 110px;
    height: 26px;
    transform: translateX(-50%) rotate(-3deg);
    background: rgba(255, 217, 119, .75);
}

.sello {
    float: right;
    width: 64px;
    height: 64px;
    margin: 0 0 6px 10px;
    transform: rotate(8deg);
}

.carta-saludo {
    margin: 0 0 16px;
    font-size: 1.15em;
}

.carta-texto p {
    margin: 0 0 16px;
}

.carta-firma {
    margin: 8px 0 18px;
    text-align: right;
}

.carta-acciones {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    font-family: 'Fredoka', sans-serif;
}

/* ---------- SweetAlert2 con la misma personalidad ---------- */
.swal2-popup {
    border-radius: 28px !important;
    font-family: 'Fredoka', sans-serif !important;
    color: var(--cacao) !important;
}

.swal2-title {
    color: var(--cacao) !important;
}

.swal2-html-container {
    color: var(--cacao-suave) !important;
}

.swal2-actions {
    gap: 8px;
}

.swal2-styled {
    border-radius: 999px !important;
    font-weight: 600 !important;
    padding: .65em 1.5em !important;
}

.swal2-styled.swal2-confirm {
    background: linear-gradient(135deg, var(--fresa), #ff8a6a) !important;
    box-shadow: 0 5px 0 var(--fresa-osc) !important;
}

.swal2-styled.swal2-deny {
    background: #fff !important;
    color: var(--cacao-suave) !important;
    border: 2px solid #ecd6db !important;
}

.swal2-styled:focus {
    box-shadow: 0 0 0 3px var(--fresa-claro) !important;
}

.swal-cuyo {
    width: 130px;
    margin: 0 auto 6px;
}

/* ---------- pantallas chiquitas y horizontales ---------- */
@media (max-height: 560px) and (orientation: landscape) {
    :root {
        --header-h: 42px;
        --cuyo-g: clamp(100px, 32vh, 170px);
    }

    .burbuja {
        min-height: 3.4em;
        margin-bottom: 12px;
    }

    .burbuja-texto {
        font-size: 1.15rem;
    }

    .pastel {
        --pw: clamp(180px, 46vh, 260px);
    }
}

@media (max-width: 360px) {
    .comensal {
        width: 84px;
    }

    .btn-fiesta {
        padding: .65em 1.2em;
    }
}

/* ---------- menos movimiento si así lo pide el sistema ---------- */
@media (prefers-reduced-motion: reduce) {
    .flotante,
    .cuyo-idle,
    .cuyo-svg .ojos,
    .pensamiento,
    .regalo,
    .huella.actual {
        animation: none !important;
    }

    .vela .flama {
        animation-duration: .6s;
    }
}