/* ============ GIFT SLIDE — FLORAL ANIMATION ============ */
#s2 {
    position: relative;
    overflow: hidden;
}

/* ============ GIFTS SLIDE — BLOOMING FLOWERS ============ */
.bloom-container {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}
.bloom-flower {
    position: absolute;
    left: var(--x);
    top: var(--y);
    width: var(--s);
    height: auto;
    opacity: 0;
    filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.16));
    transform: scale(0.2) rotate(var(--rot, 0deg));
    transition: filter 0.3s ease;
}
#s2.active .bloom-flower {
    animation: bloomFade var(--dur, 20s) ease-in-out var(--d) infinite;
    will-change: opacity, transform;
}
@keyframes bloomFade {
    0% {
        opacity: 0;
        transform: scale(0.2) rotate(var(--rot, 0deg));
    }
    12% {
        opacity: 0.2;
        transform: scale(0.55) rotate(calc(var(--rot, 0deg) + 4deg));
    }
    24% {
        opacity: 0.85;
        transform: scale(0.9) rotate(calc(var(--rot, 0deg) + 8deg));
    }
    34% {
        opacity: 1;
        transform: scale(1) rotate(calc(var(--rot, 0deg) + 2deg));
    }
    44% {
        opacity: 0.9;
        transform: scale(0.97) rotate(calc(var(--rot, 0deg) - 3deg));
    }
    58% {
        opacity: 0.8;
        transform: scale(0.93) translateY(-8px) rotate(calc(var(--rot, 0deg) + 4deg));
    }
    72% {
        opacity: 0.4;
        transform: scale(0.92) translateY(-18px) rotate(calc(var(--rot, 0deg) - 2deg));
    }
    86% {
        opacity: 0.1;
        transform: scale(0.8) translateY(-26px) rotate(calc(var(--rot, 0deg) + 5deg));
    }
    100% {
        opacity: 0;
        transform: scale(0.3) translateY(-34px) rotate(calc(var(--rot, 0deg) - 6deg));
    }
}
#s2 .story-panel {
    position: relative;
    z-index: 5;
    transition: box-shadow 0.6s ease, transform 0.6s ease;
    background: rgba(255, 255, 255, 0.28);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
#s2.active .story-panel {
    box-shadow: 0 8px 48px rgba(255, 200, 150, 0.15), 0 4px 24px rgba(255, 180, 120, 0.08);
}

.floral-frame {
    position: absolute;
    inset: -3rem -3rem;
    pointer-events: none;
    z-index: 1;
    overflow: visible;
    opacity: 0;
    transition: opacity 1.8s ease 0.2s;
}
#s2.active .floral-frame {
    opacity: 1;
}

/* Vines */
.vine {
    position: absolute;
    background: linear-gradient(135deg, #2d7d46, #4a9e6b, #2d7d46);
    border-radius: 4px;
    transform-origin: 0 0;
    opacity: 0;
    box-shadow: 0 0 12px rgba(45, 125, 70, 0.15);
}
.vine-tl {
    top: 0.5rem;
    left: 0.5rem;
    width: 0;
    height: 4px;
    transform: rotate(45deg);
    animation: vineGrow 2.2s var(--ease-out-expo) 0.3s forwards;
}
.vine-tr {
    top: 0.5rem;
    right: 0.5rem;
    width: 0;
    height: 4px;
    transform-origin: 100% 0;
    transform: rotate(-45deg);
    animation: vineGrow 2.2s var(--ease-out-expo) 0.5s forwards;
}
.vine-bl {
    bottom: 0.5rem;
    left: 0.5rem;
    width: 0;
    height: 4px;
    transform-origin: 0 100%;
    transform: rotate(-45deg);
    animation: vineGrow 2.2s var(--ease-out-expo) 0.7s forwards;
}
.vine-br {
    bottom: 0.5rem;
    right: 0.5rem;
    width: 0;
    height: 4px;
    transform-origin: 100% 100%;
    transform: rotate(45deg);
    animation: vineGrow 2.2s var(--ease-out-expo) 0.9s forwards;
}
.vine-edge-top {
    top: 0.5rem;
    left: 20%;
    width: 0;
    height: 3px;
    transform: rotate(0deg);
    animation: vineGrow 2.0s var(--ease-out-expo) 0.6s forwards;
}
.vine-edge-bottom {
    bottom: 0.5rem;
    right: 20%;
    width: 0;
    height: 3px;
    transform: rotate(180deg);
    animation: vineGrow 2.0s var(--ease-out-expo) 0.8s forwards;
}
.vine-edge-left {
    top: 25%;
    left: 0.5rem;
    width: 3px;
    height: 0;
    transform: rotate(0deg);
    animation: vineGrowVertical 2.0s var(--ease-out-expo) 0.7s forwards;
}
.vine-edge-right {
    top: 35%;
    right: 0.5rem;
    width: 3px;
    height: 0;
    transform: rotate(180deg);
    animation: vineGrowVertical 2.0s var(--ease-out-expo) 0.9s forwards;
}

@keyframes vineGrow {
    0% {
        width: 0;
        opacity: 0;
    }
    20% {
        opacity: 1;
    }
    100% {
        width: 120px;
        opacity: 1;
    }
}
@keyframes vineGrowVertical {
    0% {
        height: 0;
        opacity: 0;
    }
    20% {
        opacity: 1;
    }
    100% {
        height: 100px;
        opacity: 1;
    }
}

/* Leaves */
.leaf {
    position: absolute;
    width: 18px;
    height: 10px;
    background: radial-gradient(ellipse at 30% 40%, #4a9e6b, #2d7d46);
    border-radius: 50% 0 50% 0;
    transform-origin: 0 50%;
    opacity: 0;
    box-shadow: 0 2px 8px rgba(45, 125, 70, 0.2);
}
.leaf-l1 {
    top: 1.6rem;
    left: 4.2rem;
    --rot: -20deg;
    animation: leafUnfurl 1.2s var(--ease-bounce) 0.8s forwards;
}
.leaf-l2 {
    top: 3.8rem;
    left: 2.8rem;
    width: 14px;
    height: 8px;
    --rot: 30deg;
    animation: leafUnfurl 1.2s var(--ease-bounce) 1.0s forwards;
}
.leaf-l3 {
    top: 1.2rem;
    right: 4.5rem;
    --rot: 20deg;
    animation: leafUnfurl 1.2s var(--ease-bounce) 1.1s forwards;
}
.leaf-l4 {
    bottom: 1.8rem;
    left: 3.8rem;
    --rot: -10deg;
    animation: leafUnfurl 1.2s var(--ease-bounce) 1.3s forwards;
}
.leaf-l5 {
    bottom: 3.5rem;
    right: 3.0rem;
    --rot: 15deg;
    animation: leafUnfurl 1.2s var(--ease-bounce) 1.5s forwards;
}
.leaf-l6 {
    top: 5.5rem;
    left: 0.8rem;
    width: 12px;
    height: 7px;
    --rot: -30deg;
    animation: leafUnfurl 1.2s var(--ease-bounce) 1.2s forwards;
}
.leaf-l7 {
    bottom: 5.0rem;
    right: 0.8rem;
    width: 12px;
    height: 7px;
    --rot: 25deg;
    animation: leafUnfurl 1.2s var(--ease-bounce) 1.4s forwards;
}

@keyframes leafUnfurl {
    0% {
        transform: rotate(var(--rot, 0deg)) scale(0);
        opacity: 0;
    }
    60% {
        opacity: 1;
        transform: rotate(var(--rot, 0deg)) scale(1.3);
    }
    100% {
        transform: rotate(var(--rot, 0deg)) scale(1);
        opacity: 1;
    }
}

/* Flowers — each flower is a container with petals */
.flower {
    position: absolute;
    width: 44px;
    height: 44px;
    opacity: 0;
    transform: scale(0) rotate(0deg);
    animation: flowerBloom 2.0s var(--ease-bounce) forwards;
}
.flower .petal {
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50% 50% 50% 0;
    top: 50%;
    left: 50%;
    transform-origin: 0 0;
    opacity: 0;
    animation: petalOpen 1.0s var(--ease-bounce) forwards;
}
.flower .center {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    background: radial-gradient(circle, #fce68a, #f5c842);
    box-shadow: 0 0 16px rgba(245, 200, 66, 0.5);
    animation: centerPop 0.8s var(--ease-bounce) 0.6s forwards;
    z-index: 2;
}

@keyframes flowerBloom {
    0% {
        transform: scale(0) rotate(-30deg);
        opacity: 0;
    }
    30% {
        opacity: 1;
        transform: scale(1.2) rotate(10deg);
    }
    60% {
        transform: scale(0.95) rotate(-5deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}
@keyframes petalOpen {
    0% {
        transform: rotate(var(--rot, 0deg)) translate(0, 0) scale(0);
        opacity: 0;
    }
    50% {
        opacity: 1;
        transform: rotate(var(--rot, 0deg)) translate(8px, -8px) scale(1.3);
    }
    100% {
        transform: rotate(var(--rot, 0deg)) translate(8px, -8px) scale(1);
        opacity: 1;
    }
}
@keyframes centerPop {
    0% {
        transform: translate(-50%, -50%) scale(0);
    }
    60% {
        transform: translate(-50%, -50%) scale(1.4);
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
    }
}

/* Flower instances */
.flower-f1 {
    top: -0.8rem;
    left: 2.5rem;
    animation-delay: 0.4s;
    width: 50px;
    height: 50px;
}
.flower-f1 .petal {
    background: radial-gradient(ellipse at 30% 30%, #ff8a8a, #e8556a);
    width: 22px;
    height: 22px;
}
.flower-f1 .petal:nth-child(1) {
    --rot: 0deg;
    animation-delay: 0.5s;
}
.flower-f1 .petal:nth-child(2) {
    --rot: 60deg;
    animation-delay: 0.6s;
}
.flower-f1 .petal:nth-child(3) {
    --rot: 120deg;
    animation-delay: 0.7s;
}
.flower-f1 .petal:nth-child(4) {
    --rot: 180deg;
    animation-delay: 0.8s;
}
.flower-f1 .petal:nth-child(5) {
    --rot: 240deg;
    animation-delay: 0.9s;
}
.flower-f1 .petal:nth-child(6) {
    --rot: 300deg;
    animation-delay: 1.0s;
}

.flower-f2 {
    top: -0.2rem;
    right: 2.0rem;
    animation-delay: 0.6s;
    width: 40px;
    height: 40px;
}
.flower-f2 .petal {
    background: radial-gradient(ellipse at 30% 30%, #ffb07a, #e8845a);
    width: 18px;
    height: 18px;
}
.flower-f2 .petal:nth-child(1) {
    --rot: 0deg;
    animation-delay: 0.7s;
}
.flower-f2 .petal:nth-child(2) {
    --rot: 72deg;
    animation-delay: 0.8s;
}
.flower-f2 .petal:nth-child(3) {
    --rot: 144deg;
    animation-delay: 0.9s;
}
.flower-f2 .petal:nth-child(4) {
    --rot: 216deg;
    animation-delay: 1.0s;
}
.flower-f2 .petal:nth-child(5) {
    --rot: 288deg;
    animation-delay: 1.1s;
}

.flower-f3 {
    bottom: -0.4rem;
    left: 3.5rem;
    animation-delay: 0.8s;
    width: 48px;
    height: 48px;
}
.flower-f3 .petal {
    background: radial-gradient(ellipse at 30% 30%, #f5a0d0, #d472b8);
    width: 20px;
    height: 20px;
}
.flower-f3 .petal:nth-child(1) {
    --rot: 0deg;
    animation-delay: 0.9s;
}
.flower-f3 .petal:nth-child(2) {
    --rot: 60deg;
    animation-delay: 1.0s;
}
.flower-f3 .petal:nth-child(3) {
    --rot: 120deg;
    animation-delay: 1.1s;
}
.flower-f3 .petal:nth-child(4) {
    --rot: 180deg;
    animation-delay: 1.2s;
}
.flower-f3 .petal:nth-child(5) {
    --rot: 240deg;
    animation-delay: 1.3s;
}
.flower-f3 .petal:nth-child(6) {
    --rot: 300deg;
    animation-delay: 1.4s;
}

.flower-f4 {
    bottom: 0.2rem;
    right: 3.0rem;
    animation-delay: 1.0s;
    width: 36px;
    height: 36px;
}
.flower-f4 .petal {
    background: radial-gradient(ellipse at 30% 30%, #7fc9e8, #4a9fc7);
    width: 16px;
    height: 16px;
}
.flower-f4 .petal:nth-child(1) {
    --rot: 0deg;
    animation-delay: 1.1s;
}
.flower-f4 .petal:nth-child(2) {
    --rot: 72deg;
    animation-delay: 1.2s;
}
.flower-f4 .petal:nth-child(3) {
    --rot: 144deg;
    animation-delay: 1.3s;
}
.flower-f4 .petal:nth-child(4) {
    --rot: 216deg;
    animation-delay: 1.4s;
}
.flower-f4 .petal:nth-child(5) {
    --rot: 288deg;
    animation-delay: 1.5s;
}

.flower-f5 {
    top: 50%;
    left: -1.2rem;
    transform: translateY(-50%);
    animation-delay: 0.5s;
    width: 32px;
    height: 32px;
}
.flower-f5 .petal {
    background: radial-gradient(ellipse at 30% 30%, #f5d06a, #e8b84a);
    width: 14px;
    height: 14px;
}
.flower-f5 .petal:nth-child(1) {
    --rot: 0deg;
    animation-delay: 0.6s;
}
.flower-f5 .petal:nth-child(2) {
    --rot: 72deg;
    animation-delay: 0.7s;
}
.flower-f5 .petal:nth-child(3) {
    --rot: 144deg;
    animation-delay: 0.8s;
}
.flower-f5 .petal:nth-child(4) {
    --rot: 216deg;
    animation-delay: 0.9s;
}
.flower-f5 .petal:nth-child(5) {
    --rot: 288deg;
    animation-delay: 1.0s;
}

.flower-f6 {
    top: 50%;
    right: -1.2rem;
    transform: translateY(-50%);
    animation-delay: 0.7s;
    width: 38px;
    height: 38px;
}
.flower-f6 .petal {
    background: radial-gradient(ellipse at 30% 30%, #e8a0a0, #d47878);
    width: 16px;
    height: 16px;
}
.flower-f6 .petal:nth-child(1) {
    --rot: 0deg;
    animation-delay: 0.8s;
}
.flower-f6 .petal:nth-child(2) {
    --rot: 60deg;
    animation-delay: 0.9s;
}
.flower-f6 .petal:nth-child(3) {
    --rot: 120deg;
    animation-delay: 1.0s;
}
.flower-f6 .petal:nth-child(4) {
    --rot: 180deg;
    animation-delay: 1.1s;
}
.flower-f6 .petal:nth-child(5) {
    --rot: 240deg;
    animation-delay: 1.2s;
}
.flower-f6 .petal:nth-child(6) {
    --rot: 300deg;
    animation-delay: 1.3s;
}

/* Floating pollen / sparkles */
.sparkle {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: radial-gradient(circle, #fff9e6, #f5d06a);
    opacity: 0;
    pointer-events: none;
    box-shadow: 0 0 18px rgba(245, 208, 106, 0.5);
}
.sparkle-s1 {
    top: 8%;
    left: 12%;
    animation: sparkleFloat 5s ease-in-out 1.2s infinite;
    width: 5px;
    height: 5px;
    animation-delay: 1.2s;
}
.sparkle-s2 {
    top: 15%;
    right: 8%;
    animation: sparkleFloat 6s ease-in-out 1.8s infinite;
    width: 7px;
    height: 7px;
    animation-delay: 1.8s;
}
.sparkle-s3 {
    bottom: 20%;
    left: 5%;
    animation: sparkleFloat 5.5s ease-in-out 2.2s infinite;
    width: 4px;
    height: 4px;
    animation-delay: 2.2s;
}
.sparkle-s4 {
    bottom: 12%;
    right: 6%;
    animation: sparkleFloat 6.5s ease-in-out 2.8s infinite;
    width: 8px;
    height: 8px;
    animation-delay: 2.8s;
}
.sparkle-s5 {
    top: 40%;
    left: 2%;
    animation: sparkleFloat 4.8s ease-in-out 1.5s infinite;
    width: 5px;
    height: 5px;
    animation-delay: 1.5s;
}
.sparkle-s6 {
    top: 45%;
    right: 2%;
    animation: sparkleFloat 5.2s ease-in-out 2.0s infinite;
    width: 6px;
    height: 6px;
    animation-delay: 2.0s;
}
.sparkle-s7 {
    top: 55%;
    left: 6%;
    animation: sparkleFloat 6.0s ease-in-out 2.5s infinite;
    width: 4px;
    height: 4px;
    animation-delay: 2.5s;
}
.sparkle-s8 {
    bottom: 30%;
    right: 4%;
    animation: sparkleFloat 5.8s ease-in-out 1.9s infinite;
    width: 7px;
    height: 7px;
    animation-delay: 1.9s;
}

@keyframes sparkleFloat {
    0% {
        opacity: 0;
        transform: translate(0, 0) scale(0) rotate(0deg);
    }
    20% {
        opacity: 1;
        transform: translate(8px, -12px) scale(1.2) rotate(20deg);
    }
    40% {
        transform: translate(-4px, -20px) scale(0.9) rotate(-10deg);
        opacity: 0.8;
    }
    60% {
        transform: translate(12px, -8px) scale(1.1) rotate(15deg);
        opacity: 1;
    }
    80% {
        transform: translate(-6px, -16px) scale(0.8) rotate(-8deg);
        opacity: 0.7;
    }
    100% {
        opacity: 0;
        transform: translate(4px, -28px) scale(0) rotate(30deg);
    }
}
