/* --- ESCENA CUMPLEAÑOS --- */
#escena-cumple {
    background: radial-gradient(ellipse at center, #1a0525 0%, #0d0015 60%, #050008 100%);
    z-index: 10;
    overflow: hidden;
    flex-direction: column;
    position: relative;
    justify-content: flex-start;
    align-items: center;
    padding-top: 2vh;
}

/* Partículas de fondo */
#cumple-particulas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.cumple-particula {
    position: absolute;
    border-radius: 50%;
    animation: cumple-flotar ease-in-out infinite;
    filter: blur(1px);
}

@keyframes cumple-flotar {

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

    25% {
        transform: translateY(-20px) translateX(10px) scale(1.1);
    }

    50% {
        transform: translateY(-10px) translateX(-15px) scale(0.9);
    }

    75% {
        transform: translateY(-25px) translateX(5px) scale(1.05);
    }
}

/* ── Mensajes superiores ──────────────────────────────────── */
#cumple-msg-principal {
    position: relative;
    z-index: 20;
    font-family: 'Playfair Display', serif;
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 700;
    color: #fff;
    text-align: center;
    margin-top: 2vh;
    text-shadow: 0 0 15px rgba(255, 105, 180, 0.7), 0 0 40px rgba(186, 85, 211, 0.5);
    opacity: 0;
    padding: 0 20px;
}

#cumple-msg-sub {
    position: relative;
    z-index: 20;
    font-family: 'Outfit', sans-serif;
    font-size: clamp(0.95rem, 2vw, 1.3rem);
    color: rgba(255, 182, 193, 0.9);
    text-align: center;
    margin-top: 45px;
    opacity: 0;
    font-weight: 500;
}

#cumple-instruccion {
    position: relative;
    z-index: 20;
    font-family: 'Outfit', sans-serif;
    font-size: 0.9rem;
    color: rgba(206, 147, 216, 0.8);
    text-align: center;
    margin-top: 8px;
    opacity: 0;
    letter-spacing: 1px;
}

#cumple-contador {
    position: relative;
    z-index: 20;
    font-family: 'Outfit', sans-serif;
    font-size: 0.9rem;
    color: rgba(255, 128, 171, 0.8);
    text-align: center;
    margin-top: 4px;
    opacity: 0;
}

/* ── Contenedor del pastel ────────────────────────────────── */
#cumple-pastel-container {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 160px;
    opacity: 0;
    flex-shrink: 0;
}

/* ── Pastel CSS — versión grande y lujosa ─────────────────── */
.cumple-pastel {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    filter: drop-shadow(0 20px 50px rgba(194, 24, 91, 0.5)) drop-shadow(0 0 30px rgba(186, 85, 211, 0.35));
}

/* Capa superior: más ancha y con textura */
.cumple-pastel-top {
    width: clamp(310px, 50vw, 550px);
    height: clamp(55px, 9vh, 92px);
    background: linear-gradient(135deg,
            #f8bbd0 0%, #f48fb1 25%, #ce93d8 60%, #ba68c8 100%);
    border-radius: 24px 24px 0 0;
    position: relative;
    box-shadow:
        0 -6px 24px rgba(244, 143, 177, 0.55),
        inset 0 -4px 12px rgba(0, 0, 0, 0.15),
        inset 0 4px 8px rgba(255, 255, 255, 0.25);
    border-bottom: 3px solid rgba(255, 255, 255, 0.18);
    overflow: hidden;
}

/* Brillo superior tipo glassmorphism */
.cumple-pastel-top::after {
    content: '';
    position: absolute;
    top: 6px;
    left: 12%;
    right: 12%;
    height: 40%;
    background: linear-gradient(to bottom,
            rgba(255, 255, 255, 0.35), transparent);
    border-radius: 50%;
    filter: blur(4px);
}

/* Capa media: más alta, con patrón decorativo */
.cumple-pastel-mid {
    width: clamp(360px, 58vw, 640px);
    height: clamp(76px, 12vh, 130px);
    background: linear-gradient(135deg,
            #e91e63 0%, #ad1457 35%, #9c27b0 70%, #6a1b9a 100%);
    position: relative;
    box-shadow:
        0 6px 28px rgba(233, 30, 99, 0.4),
        inset 0 2px 8px rgba(255, 255, 255, 0.15),
        inset 0 -4px 10px rgba(0, 0, 0, 0.2);
    border-bottom: 3px solid rgba(255, 255, 255, 0.12);
    overflow: hidden;
}

/* Líneas decorativas horizontales en la capa media */
.cumple-pastel-mid::before {
    content: '';
    position: absolute;
    top: 28%;
    left: 0;
    right: 0;
    height: 2px;
    background: repeating-linear-gradient(90deg,
            transparent, transparent 14px,
            rgba(255, 255, 255, 0.22) 14px,
            rgba(255, 255, 255, 0.22) 16px);
}

.cumple-pastel-mid::after {
    content: '';
    position: absolute;
    top: 60%;
    left: 0;
    right: 0;
    height: 2px;
    background: repeating-linear-gradient(90deg,
            transparent, transparent 14px,
            rgba(255, 255, 255, 0.15) 14px,
            rgba(255, 255, 255, 0.15) 16px);
}

/* Capa inferior: la base más grande */
.cumple-pastel-bottom {
    width: clamp(410px, 66vw, 730px);
    height: clamp(84px, 13vh, 143px);
    background: linear-gradient(135deg,
            #c2185b 0%, #880e4f 40%, #7b1fa2 75%, #4a148c 100%);
    border-radius: 0 0 20px 20px;
    box-shadow:
        0 14px 50px rgba(194, 24, 91, 0.5),
        0 6px 18px rgba(0, 0, 0, 0.4),
        inset 0 2px 10px rgba(255, 255, 255, 0.12);
    position: relative;
    overflow: hidden;
}

/* Brillo inferior y patrón de puntos */
.cumple-pastel-bottom::before {
    content: '';
    position: absolute;
    top: 18%;
    left: 0;
    right: 0;
    height: 2px;
    background: repeating-linear-gradient(90deg,
            transparent, transparent 18px,
            rgba(255, 255, 255, 0.18) 18px,
            rgba(255, 255, 255, 0.18) 20px);
}

.cumple-pastel-bottom::after {
    content: '';
    position: absolute;
    bottom: 12px;
    left: 18px;
    right: 18px;
    height: 5px;
    background: linear-gradient(90deg,
            transparent, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0.22), transparent);
    border-radius: 3px;
    filter: blur(1px);
}

/* ── Glaseado que escurre ─────────────────────────────────── */
.cumple-glaseado {
    position: absolute;
    top: -12px;
    left: 0;
    width: 100%;
    height: 30px;
    overflow: visible;
    z-index: 5;
}

.cumple-gota {
    position: absolute;
    background: linear-gradient(to bottom, #fce4ec, #f8bbd0, #f48fb1);
    border-radius: 0 0 50% 50%;
    animation: cumple-gotear 3s ease-in-out infinite;
    box-shadow: 0 4px 10px rgba(244, 143, 177, 0.4);
}

/* 10 gotas distribuidas en toda la capa media */
.cumple-gota:nth-child(1) {
    left: 5%;
    width: 20px;
    height: 22px;
    animation-delay: 0.0s;
}

.cumple-gota:nth-child(2) {
    left: 14%;
    width: 16px;
    height: 32px;
    animation-delay: 0.4s;
}

.cumple-gota:nth-child(3) {
    left: 23%;
    width: 22px;
    height: 18px;
    animation-delay: 0.8s;
}

.cumple-gota:nth-child(4) {
    left: 33%;
    width: 14px;
    height: 28px;
    animation-delay: 0.2s;
}

.cumple-gota:nth-child(5) {
    left: 42%;
    width: 20px;
    height: 24px;
    animation-delay: 1.2s;
}

.cumple-gota:nth-child(6) {
    left: 52%;
    width: 18px;
    height: 20px;
    animation-delay: 0.6s;
}

.cumple-gota:nth-child(7) {
    left: 61%;
    width: 22px;
    height: 30px;
    animation-delay: 1.0s;
}

.cumple-gota:nth-child(8) {
    left: 71%;
    width: 15px;
    height: 16px;
    animation-delay: 0.3s;
}

.cumple-gota:nth-child(9) {
    left: 80%;
    width: 20px;
    height: 26px;
    animation-delay: 0.9s;
}

.cumple-gota:nth-child(10) {
    left: 90%;
    width: 17px;
    height: 20px;
    animation-delay: 0.5s;
}

@keyframes cumple-gotear {

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

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

/* ── Velas — 20 en una sola fila ─────────────────────────────────── */
#cumple-velas {
    display: grid;
    grid-template-columns: repeat(20, 1fr);
    grid-template-rows: auto;
    gap: clamp(2px, 0.4vw, 5px);
    justify-items: center;
    position: relative;
    z-index: 15;
    /* Mismo ancho que la capa superior del pastel */
    width: clamp(280px, 38vw, 520px);
    /* Ajuste de posición vertical para subirlas un poco más sobre el pastel */
    margin-bottom: 3px;
    padding: 0 2px;
}

.cumple-vela {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: transform 0.2s ease;
    animation: cumple-vela-entrada 0.6s ease-out both;
}

@keyframes cumple-vela-entrada {
    from {
        transform: translateY(30px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.cumple-vela:hover {
    transform: scale(1.12);
}

.cumple-vela-cuerpo {
    width: clamp(7px, 1vw, 11px);
    height: clamp(28px, 4.5vh, 45px);
    border-radius: 3px 3px 5px 5px;
    box-shadow:
        0 0 8px rgba(255, 105, 180, 0.35),
        inset 1px 0 3px rgba(255, 255, 255, 0.15),
        inset -1px 0 3px rgba(0, 0, 0, 0.2);
    position: relative;
}

/* Rayita de brillo lateral en la vela */
.cumple-vela-cuerpo::after {
    content: '';
    position: absolute;
    top: 8px;
    left: 25%;
    width: 2px;
    height: 60%;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 1px;
}

.cumple-vela-mecha {
    width: 2px;
    height: 8px;
    background: #555;
    border-radius: 1px;
}

/* ── Llama ────────────────────────────────────────────────── */
.cumple-llama {
    position: relative;
    width: clamp(8px, 1.2vw, 12px);
    height: clamp(12px, 2.2vh, 19px);
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    background: radial-gradient(ellipse, #fff 0%, #ffd54f 30%, #ff9800 60%, #ff5722 100%);
    animation: cumple-llama-parpadeo 0.15s ease-in-out infinite alternate;
    box-shadow:
        0 0 6px 2px rgba(255, 152, 0, 0.6),
        0 0 16px 4px rgba(255, 87, 34, 0.35);
    transform-origin: bottom center;
}

.cumple-llama-interna {
    position: absolute;
    bottom: 3px;
    left: 50%;
    transform: translateX(-50%);
    width: 45%;
    height: 45%;
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    background: radial-gradient(ellipse, #fff 0%, #ffe082 100%);
}

.cumple-llama-brillo {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 200, 50, 0.35) 0%, transparent 70%);
    pointer-events: none;
}

@keyframes cumple-llama-parpadeo {
    0% {
        transform: scaleX(1) scaleY(1);
    }

    100% {
        transform: scaleX(0.88) scaleY(1.06) rotate(2deg);
    }
}

.cumple-llama-agitada {
    animation: cumple-llama-agitar 0.1s ease-in-out infinite alternate !important;
}

@keyframes cumple-llama-agitar {
    0% {
        transform: scaleX(1.1) rotate(-8deg);
    }

    100% {
        transform: scaleX(0.85) rotate(8deg);
    }
}

/* ── Mensaje final ────────────────────────────────────────── */
#cumple-msg-final {
    position: absolute;
    bottom: 12vh;
    left: 50%;
    transform: translateX(-50%);
    z-index: 25;
    font-family: 'Playfair Display', serif;
    font-size: clamp(1.4rem, 3.5vw, 2.2rem);
    font-style: italic;
    color: #fff;
    text-align: center;
    text-shadow: 0 0 20px rgba(255, 105, 180, 0.7), 0 0 50px rgba(186, 85, 211, 0.5);
    white-space: nowrap;
}

.cumple-hidden {
    display: none !important;
}

/* ── Efectos de apagar vela ───────────────────────────────── */
.cumple-chispa {
    position: fixed;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    z-index: 30;
    pointer-events: none;
}

.cumple-humo {
    position: fixed;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(200, 200, 220, 0.5);
    z-index: 30;
    pointer-events: none;
    filter: blur(3px);
}

.cumple-confeti {
    position: absolute;
    z-index: 30;
    pointer-events: none;
}

.cumple-estrella-celebracion {
    position: absolute;
    z-index: 25;
    pointer-events: none;
    text-shadow: 0 0 10px currentColor;
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 600px) {
    #cumple-msg-principal {
        font-size: 1.8rem;
    }

    #cumple-msg-sub {
        font-size: 0.95rem;
    }

    #cumple-msg-final {
        font-size: 1.2rem;
        white-space: normal;
        padding: 0 20px;
    }

    #cumple-velas {
        gap: 4px;
    }
}

/* ── Globos anclados al mismo punto ──────────────────────── */
.cumple-globos-grupo {
    position: absolute;
    top: 50%;
    z-index: 5;
    pointer-events: none;
    /* Punto de anclaje único: tamaño 0 */
    width: 0;
    height: 0;
}

.cumple-globos-izq {
    left: clamp(120px, 18vw, 260px);
}

.cumple-globos-der {
    right: clamp(120px, 18vw, 260px);
}

/* Cada rama sale del mismo punto (bottom center) con su ángulo */
.cumple-rama {
    position: absolute;
    bottom: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    transform-origin: bottom center;
    animation: cumple-rama-sway 4s ease-in-out infinite;
    animation-delay: var(--delay, 0s);
}

@keyframes cumple-rama-sway {

    0%,
    100% {
        transform: rotate(calc(var(--ang, 0deg) - 4deg));
    }

    50% {
        transform: rotate(calc(var(--ang, 0deg) + 4deg));
    }
}

.cumple-globo-bola {
    width: clamp(40px, 5.5vw, 60px);
    height: clamp(48px, 6.5vw, 72px);
    border-radius: 50% 50% 50% 50% / 55% 55% 45% 45%;
    background: radial-gradient(ellipse at 35% 30%,
            rgba(255, 255, 255, 0.55) 0%,
            var(--c1, #ff69b4) 40%,
            var(--c2, #c2185b) 100%);
    box-shadow:
        0 0 20px rgba(255, 105, 180, 0.4),
        inset -4px -6px 12px rgba(0, 0, 0, 0.18);
    position: relative;
    flex-shrink: 0;
}

/* Nudito inferior del globo */
.cumple-globo-bola::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 6px;
    background: var(--c2, #c2185b);
    border-radius: 50% 50% 30% 30%;
}

/* Brillo superior */
.cumple-globo-bola::before {
    content: '';
    position: absolute;
    top: 14%;
    left: 22%;
    width: 28%;
    height: 22%;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    filter: blur(3px);
}

/* Hilo del globo */
.cumple-cuerda {
    width: 1.5px;
    height: var(--len, 130px);
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.12));
    flex-shrink: 0;
}

/* ── Guirnalda de banderines ─────────────────────────────── */
#cumple-guirnalda-top {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 8;
    display: flex;
    justify-content: space-around;
    align-items: flex-start;
    padding: 0 20px;
    pointer-events: none;
}

/* La cuerda de la guirnalda */
#cumple-guirnalda-top::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 182, 193, 0.7) 15%,
            rgba(206, 147, 216, 0.7) 50%,
            rgba(255, 182, 193, 0.7) 85%,
            transparent);
}

.cumple-banderita {
    width: clamp(20px, 2.8vw, 34px);
    height: clamp(26px, 3.8vw, 46px);
    clip-path: polygon(0% 0%, 100% 0%, 50% 100%);
    flex-shrink: 0;
    transform-origin: top center;
    animation: cumple-banderita-swing 3s ease-in-out infinite;
}

@keyframes cumple-banderita-swing {

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

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

/* ── Destellos decorativos ───────────────────────────────── */
#cumple-destellos {
    position: absolute;
    inset: 0;
    z-index: 6;
    pointer-events: none;
}

.cumple-destello {
    position: absolute;
    font-size: var(--size, 16px);
    color: rgba(255, 215, 120, 0.85);
    animation: cumple-destello-pulso 2.8s ease-in-out infinite;
    animation-delay: var(--delay, 0s);
    text-shadow:
        0 0 10px rgba(255, 210, 60, 0.9),
        0 0 25px rgba(255, 150, 200, 0.6);
    line-height: 1;
}

@keyframes cumple-destello-pulso {

    0%,
    100% {
        opacity: 0.15;
        transform: scale(0.6) rotate(0deg);
    }

    50% {
        opacity: 1;
        transform: scale(1.25) rotate(30deg);
    }
}

/* ── Serpentinas decorativas ─────────────────────────────── */
#cumple-serpentinas-cont {
    position: absolute;
    inset: 0;
    z-index: 4;
    pointer-events: none;
}

.cumple-serpentina {
    position: absolute;
    width: 5px;
    height: var(--h, 55px);
    background: linear-gradient(to bottom,
            var(--col, #ff69b4),
            rgba(255, 105, 180, 0.15));
    border-radius: 50px;
    opacity: 0.55;
    transform: rotate(var(--rot, 20deg));
    animation: cumple-serpentina-onda var(--dur, 3s) ease-in-out infinite;
    animation-delay: var(--delay, 0s);
}

@keyframes cumple-serpentina-onda {

    0%,
    100% {
        transform: rotate(var(--rot, 20deg)) scaleX(1);
        opacity: 0.45;
    }

    50% {
        transform: rotate(var(--rot, 20deg)) scaleX(-1);
        opacity: 0.7;
    }
}

/* ── Flores Base ─────────────────────────────────────────── */
#cumple-flores-base {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100px;
    z-index: 2;
    pointer-events: none;
    overflow: visible;
}

.cumple-flor {
    position: absolute;
    width: 30px;
    height: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    transform-origin: center;
    animation: cumple-flor-breeze var(--dur, 4s) ease-in-out infinite;
    animation-delay: var(--delay, 0s);
    filter: drop-shadow(0 3px 6px rgba(255, 105, 180, 0.5));
}

@keyframes cumple-flor-breeze {

    0%,
    100% {
        transform: scale(var(--s, 1)) rotate(calc(var(--r, 0deg) - 8deg));
    }

    50% {
        transform: scale(var(--s, 1)) rotate(calc(var(--r, 0deg) + 8deg));
    }
}

.cumple-petalo-rosa {
    position: absolute;
    transform-origin: bottom center;
    border-radius: 50% 50% 20% 20% / 60% 60% 40% 40%;
    /* Sombra suave para dar volumen entre pétalos superpuestos */
    box-shadow:
        inset 0 -2px 6px rgba(0, 0, 0, 0.08),
        0 2px 4px rgba(0, 0, 0, 0.12);
}

/* Pétalos exteriores (más grandes y claros) */
.cumple-petalo-rosa.capa-0 {
    width: 24px;
    height: 32px;
    background: radial-gradient(ellipse at bottom, var(--col) 40%, rgba(255, 255, 255, 0.9) 95%);
    z-index: 1;
}

/* Capa media */
.cumple-petalo-rosa.capa-1 {
    width: 18px;
    height: 26px;
    background: radial-gradient(ellipse at bottom, var(--col) 50%, rgba(255, 255, 255, 0.7) 100%);
    z-index: 2;
}

/* Capa interior (color más concentrado) */
.cumple-petalo-rosa.capa-2 {
    width: 12px;
    height: 18px;
    background: radial-gradient(ellipse at bottom, var(--col) 60%, rgba(255, 255, 255, 0.5) 100%);
    z-index: 3;
}

/* Núcleo de la rosa (el más pequeño y oscuro/intenso) */
.cumple-petalo-rosa.capa-3 {
    width: 8px;
    height: 12px;
    background: var(--col);
    border-radius: 50%;
    box-shadow: inset 0 -2px 4px rgba(0, 0, 0, 0.15);
    z-index: 4;
}

/* ── Celebración Final (Fuegos y Lluvia) ─────────────────── */
.cumple-cohete {
    position: absolute;
    width: 4px;
    height: 30px;
    background: linear-gradient(to top, rgba(255, 255, 255, 0), #fff);
    border-radius: 50%;
    pointer-events: none;
    z-index: 98;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.9));
}

.cumple-chispa-fuego {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 99;
}

.cumple-lluvia-serpentina {
    position: absolute;
    border-radius: 50px;
    pointer-events: none;
    z-index: 5;
    opacity: 0.5;
}