body {
    margin: 0;
    background-color: #241f1f;
    color: #F7E8F1;
    font-family: 'Tajawal', 'Outfit', sans-serif;
}

#welcome {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 30px;
    text-align: center;
    gap: 25px;
    transition: opacity 0.8s ease;
    background-color: #f4d6df;
    color: #542638;
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
    font-family: 'Tajawal', 'Outfit', sans-serif;

}

h1 {
    font-family: 'Aref Ruqaa', serif;
    font-weight: 700;
    letter-spacing: 0;
    font-size: 52px;
    margin: 0;
}

.message {
    max-width: 320px;
    font-size: 17px;
    line-height: 1.7;
    animation-delay: 1s;
}

#open-button {
    background-color: #74364e;
    color: #fff5f7;
    border: 1px solid #74364e;
    border-radius: 30px;
    padding: 15px 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    animation-delay: 1.4s;

}

#open-button:hover {
    background-color: #542638;
    color: #fff5f7;
    transform: scale(1.05);
}

@keyframes fadeup {
    from {
        opacity: 0;
        transform: translateY(25px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#welcome .small-text {
    animation: fadeup 0.9s ease-out 0.2s both;
    font-size: 12px;
    letter-spacing: 3px;
    font-weight: 400;
}

#welcome h1 {
    animation: fadeup 0.9s ease-out 0.6s both;
    color: #74364e;
    font-size: clamp(42px, 8vw, 65px);
    font-weight: 300;
    letter-spacing: 0px;
    font-family: 'Outfit', sans-serif;
}

#welcome .message {
    animation: fadeup 0.9s ease-out 1s both;
    font-size: 17px;
    font-weight: 300;
    max-width: 400px;
    line-height: 1.7;
    font-family: 'Outfit', sans-serif;
}

#welcome #open-button {
    animation: fadeup 0.9s ease-out 1.4s both;
    font-family: inherit;
    font-size: 16px;
    font-weight: 400;
}

#welcome .footer-text {
    animation: fadeup 0.9s ease-out 1.8s both;
}


#letter {
    display: none;
    opacity: 0;
    transition: opacity 0.8s ease;
    background-color: #efd6dd;
    color: #74364e;
    min-height: 100vh;
    box-sizing: border-box;
    padding-top: 40px;
    padding-bottom: 40px;
}

.envelope {
    position: relative;
    width: 300px;
    height: 200px;
    margin: 50px auto;
}

.envelope-body {
    position: absolute;
    width: 100%;
    height: 100%;
    background-color: #F7E8F1;
    border-radius: 10px;
}

.envelope-flap {
    position: absolute;
    width: 100%;
    height: 110px;
    background-color: #dfa3c5;

    clip-path: polygon(0 0, 100% 0, 100% 8%, 54% 94%, 50% 98%, 46% 94%, 0 8%);
    border-radius: 10px;
    top: 0;
    left: 0;
    z-index: 2;

    transform-origin: top center;
    transition: transform 0.5s ease;
}

.envelope.open .envelope-flap {
    transform: rotateX(180deg);
}

.letter-paper {
    position: relative;

    width: 75vw;
    max-width: 600px;
    box-sizing: border-box;
    padding: 40px;
    height: auto;
    margin: -200px auto 40px;
    overflow: visible;

    background-color: transparent;
    background-image: url("images/vintage-paper.png");
    background-size: 100% 100%;
    background-repeat: no-repeat;
    background-position: center;
    scrollbar-width: none;
    color: #241f1f;
    border-radius: 8px;

    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: scale(0.2);
    transform-origin: center top;
    transition: transform 1s ease, opacity 0.5s ease, visibility 0s linear 1s;
}

.letter-paper::-webkit-scrollbar {
    display: none;
}

.letter-paper.expanded {
    opacity: 1;
    visibility: visible;
    transform: translateY(var(--rise, 0px)) scale(1);
    transition: transform 1.5s ease, opacity 0.5s ease;
    margin-bottom: calc(20px + var(--rise, 0px));
}

.letter-heading {
    max-width: 550px;
    margin: 50px auto 20px;
    text-align: center;
    transition: opacity 1s ease;
}

.letter-heading h2 {
    font-family: 'Great Vibes', cursive;
    font-size: 52px;
    font-weight: 400;
    color: #74364e;
    direction: ltr;
}

.letter-heading p {
    line-height: 1.8;
    font-family: 'Tajawal', sans-serif;
    font-size: 18px;
    font-weight: 400;
    margin: 15px auto;
    max-width: 280px;
}

.letter-paper .letter-text {
    font-family: 'Aref Ruqaa', serif;
    font-size: 22px;
    line-height: 1.6;
    font-weight: 400;
}

.letter-heading.hidden {
    opacity: 0;
    visibility: hidden;
}

@media (max-width: 600px) {
    .letter-paper {
        width: 96vw;
        padding: 40px 25px;
    }
}

#memories-button {
    display: block;
    margin: 30px auto 0;
    padding: 12px 20px;
    background: transparent;
    border: none;
    color: #8b4f75;
    font-size: 17px;
    cursor: pointer;
    transition: transform 0.3s ease, color 0.3s ease;
}

#memories-button:hover {
    transform: translatex (6px);
    color: #b76e95;
}

#memories {
    display: none;
    opacity: 0;
    transition: opacity 0.8s ease;

    background: #f4d6df;
    min-height: 100vh;
    padding: 25px 40px 70px;
    box-sizing: border-box;
    color: #713f55
}

#memories h2 {
    text-align: center;
    font-size: 42px;
}

#memories-intro {
    text-align: center;
    font-size: 22px;
}

.memory-card {
    width: 280px;
    padding: 12px 12px 25px;
    background: #fff8f7;
    box-shadow: 0 8px 25px rgba(80, 30, 50, 0.2);
    transform: rotate(-6deg);
    text-align: center;
}

.memory-card img {
    width: 100%;
    height: 250px;
    object-fit: cover;
}

.memory-card p {
    color: #713f55;
    font-size: 16px;
    margin-top: 15px;
    font-family: 'Aref Ruqaa', serif;
    font-weight: 400;
    line-height: 1.5;
}

.memories-gallery {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    justify-items: center;
    align-items: start;
    gap: 50px 30px;
    margin-top: 70px;
    padding: 20px;
}

.memory-card:nth-child(1) {
    transform: rotate(-8deg);
    margin-top: 20px;
}

.memory-card:nth-child(2) {
    transform: rotate(7deg);
    margin-top: 150px;
}

.memory-card:nth-child(3) {
    transform: rotate(-4deg);
    margin-top: 60px;
}

.memory-card {
    max-width: 85%;
}

.memory-card:nth-child(4) {
    width: 220px;
    transform: rotate(9deg);
    margin-top: -40px;
}

.memory-card:nth-child(5) {
    width: 300px;
    transform: rotate(11edg);
    margin-top: 60px;
}

.memory-card:nth-child(6) {
    width: 240px;
    transform: rotate(8edg);
    margin-top: -20px;
}

.memory-card:nth-child(7) {
    width: 260px;
    transform: rotate(-10edg);
    margin-top: 50px;
}

.memory-card:nth-child(8) {
    width: 230px;
    transform: rotate(12edg);
    margin-top: 130px;
}

.memory-card:nth-child(9) {
    width: 290px;
    transform: rotate(-3edg);
    margin-top: 10px;
}

.memory-card:nth-child(10) {
    width: 280px;
    transform: rotate(2edg);
    grid-column: 1 / -1;
    justify-self: center;
    margin-top: 39px;
}

.memory-card {
    opacity: 0;
    translate: 0 40px;
    transition: opacity 0.6s ease, translate 0.6s ease;
}

.memory-card.visible {
    opacity: 1;
    translate: 0 0;
}

.memories-ending {
    max-width: 650px;
    margin: 120px auto 80px;
    padding: 30px;
    text-align: center;
    color: #713f55;
    font-size: 20px;
    line-height: 1.8;
    visibility: hidden;
    opacity: 0;
    translate: 0 20px;
    transition: opacity 1.5s ease, translate 1.5s ease;
}

.memories-ending.ready {
    visibility: visible;
    opacity: 1;
    translate: 0 0;
}

.memories-ending p {
    margin-bottom: 25px;
    font-family: 'tajawal', sans-serif;
    font-weight: 400;
}

.memories-ending h3 {
    font-size: 32px;
    font-family: 'Aref Ruqaa', serif;
    font-weight: 700;
    color: #963c60;
    font-style: normal;
    margin-top: 35px;
}


.memories-gallery {
    position: relative;
    isolation: isolate;
}

.gallery-decor {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: -1;
}

.gallery-decor img {
    position: absolute;
    width: 100px;
    height: auto;
    opacity: 0.85;
    animation: stickerFloat 5s ease-in-out infinite;
}

@keyframes floatLove {

    0%,
    100% {
        transform: translateY(0) rotate(-10deg);
    }

    50% {
        transform: translateY(-20px) rotate(10deg);
    }
}

.gallery-decor img:nth-child(1) {
    top: 2%;
    left: 45%;
    width: 100px;
}

.gallery-decor img:nth-child(2) {
    top: 15%;
    left: 80%;
    width: 85px;
}

.gallery-decor img:nth-child(3) {
    top: 28%;
    left: 5%;
    width: 80px;
}

.gallery-decor img:nth-child(4) {
    top: 40%;
    left: 45%;
    width: 90px;
}

.gallery-decor img:nth-child(5) {
    top: 50%;
    left: 80%;
    width: 110px;
}

.gallery-decor img:nth-child(6) {
    top: 63%;
    left: 5%;
    width: 90px;
}

.gallery-decor img:nth-child(7) {
    top: 76%;
    left: 45%;
    width: 80px;
}

.gallery-decor img:nth-child(8) {
    top: 92%;
    left: 80%;
    width: 100px;
}

.love-gif {
    width: 150px;
    height: auto;
    position: absolute;
    top: 60px;
    right: 10%;
}

@media (max-width: 600px) {
    .memories-gallery {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 25px 15px;
        padding: 10px;
    }

    .memories-gallery .memory-card:nth-child(n) {
        width: 100%;
        box-sizing: border-box;
        margin: 0;
        grid-column: auto;
        grid-row: auto;
        justify-self: center;
        align-self: start;
    }

    .memory-card img {
        width: 100%;
        height: 120px;
        object-fit: cover;
    }

    .gallery-decor img {
        width: 50px;
        max-width: 50px;
        opacity: 0.85;
    }

    .memories-gallery .memory-card:nth-child(1) {
        transform: rotate(-10deg);
        margin-top: 0;
    }

    .memories-gallery .memory-card:nth-child(2) {
        transform: rotate(7deg);
        margin-top: 45px;
    }

    .memories-gallery .memory-card:nth-child(3) {
        transform: rotate(4deg);
        margin-top: 20px;
    }

    .memories-gallery .memory-card:nth-child(4) {
        transform: rotate(-8deg);
        margin-top: 0;
    }

    .memories-gallery .memory-card:nth-child(5) {
        transform: rotate(-5deg);
        margin-top: 0;
    }

    .memories-gallery .memory-card:nth-child(6) {
        transform: rotate(11deg);
        margin-top: 35px;
    }

    .memories-gallery .memory-card:nth-child(7) {
        transform: rotate(-9deg);
        margin-top: 15px;
    }

    .memories-gallery .memory-card:nth-last-child(2) {
        transform: rotate(-7deg);
    }

    .memories-gallery .memory-card:last-child {
        transform: rotate(7deg);
    }

    .love-gif {
        width: 65px;
        position: relative;
        top: auto;
        right: auto;
        display: block;
        margin: 10px auto;
    }
}

#memories {
    position: relative;
    background-image: url("stickers/pattern.svg");
    background-size: 180px 180px;
    background-repeat: repeat;
}

#music-button {
    background: transparent;
    border: 1.5px solid #963c60;
    color: #963c60;
    padding: 15px 30px;
    border-radius: 30px;
    font-size: 18px;
    cursor: pointer;
    margin-top: 30px;
    transition: 0.4s ease;
}

#music-button:hover {
    background: #963c60;
    color: white;
    transform: scale(1.05);
}

#final-scene {
    display: none;
    opacity: 0;
    transition: opacity 0.8s ease;
    min-height: 100vh;
    background-color: #542638;
    color: #F7E8F1;
    text-align: center;
    padding: 60px 20px;
    box-sizing: border-box;
}

#final-scene h2 {
    font-size: 32px;
    margin: 20px auto;
    font-family: 'tajawal', sans-serif;
    font-weight: 700;
}

#final-scene p {
    color: #d49ab6;
    font-size: 16px;
    font-family: 'tajawal', sans-serif;
    font-weight: 400;
}


#final-message {
    display: none;
}

.birthday-cake {
    position: relative;
    width: 240px;
    max-width: 90%;
    margin: 100px auto 40px;
}

.icing-hearts {
    position: absolute;
    left: 0;
    width: 100%;
    text-align: center;
    pointer-events: none;
    z-index: 5;
}

.icing-hearts {
    position: absolute;
    top: 0px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-evenly;
    align-items: center;
    font-size: 16px;
    line-height: 1;
    color: #b76e95;
    z-index: 100;
    pointer-events: none;
}

.icing-hearts span {
    position: absolute;
    transform: translateX(-50%);
}

.cake-top .icing-hearts span:nth-child(1) {
    left: 10%;
}

.cake-top .icing-hearts span:nth-child(2) {
    left: 45%;
}

.cake-top .icing-hearts span:nth-child(3) {
    left: 80%;
}

.cake-bottom .icing-hearts span:nth-child(1) {
    left: 6%;
}

.cake-bottom .icing-hearts span:nth-child(2) {
    left: 23.6%;
}

.cake-bottom .icing-hearts span:nth-child(3) {
    left: 41.2%;
}

.cake-bottom .icing-hearts span:nth-child(4) {
    left: 58.8%;
}

.cake-bottom .icing-hearts span:nth-child(5) {
    left: 76.4%;
}

.cake-bottom .icing-hearts span:nth-child(6) {
    left: 94%;
}


.cake-bottom {
    width: 100%;
    height: 80px;
    background: #d49ab6;
    border-radius: 12px;
    border-top: 15px solid #fff0e5;
    box-sizing: border-box;
}

.cake-top {
    width: 70%;
    height: 65px;
    background: #f3cbdc;
    border-radius: 10px 10px 0 0;
    border-top: 12px solid #fff0e5;
    margin: 0 auto;
    box-sizing: border-box;
}

.cake-top,
.cake-bottom {
    position: relative;
}

.cake-top::before,
.cake-bottom::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 22px;
    background: radial-gradient(ellipse at 50% 0%,
            #fff0e5 70%,
            transparent 73%);
    background-size: 30px 22px;
}

.birthday-cake::after {
    content: "";
    display: block;
    width: 115%;
    height: 15px;
    background: #f4d6df;
    border-radius: 50%;
    margin: -2px 0 0 -7.5%;
    box-shadow: 0 8px 20px #00000050;
}

.candle {
    position: absolute;
    width: 18px;
    height: 55px;
    top: -55px;
    left: 50%;
    transform: translateX(-50%);
    background: repeating-linear-gradient(45deg,
            #bc7196 0px,
            #bc7196 8px,
            #fce4ef 8px,
            #fce4ef 14px);
    border-radius: 4px;
    cursor: pointer;
}

.flame {
    position: absolute;
    width: 18px;
    height: 30px;
    top: -33px;
    left: 50%;
    background: linear-gradient(#fff5c5,
            #ffc36b,
            #ff8c42);
    border-radius: 50% 50% 45% 45%;
    box-shadow: 0 0 25px #ffb347;
    transform-origin: bottom center;
    animation: flicker 0.8s infinite alternate;
}

@keyframes flicker {
    0% {
        transform: translateX(-50%) rotate(-5deg) scale(1);
    }

    100% {
        transform: translateX(-50%) rotate(5deg) scale(0.9);
    }
}

.flame.blown-out {
    opacity: 0;
    animation: none;
    transition: opacity 0.5s ease;
}

#final-scene {
    position: relative;
    overflow: hidden;
}

.birthday-decor {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.birthday-decor span {
    position: absolute;
    font-size: 45px;
    animation: birthdayFloat 2s ease-in-out infinite;
}

.birthday-decor span:nth-child(1) {
    top: 24%;
    left: 8%;
}

.birthday-decor span:nth-child(2) {
    top: 10%;
    right: 10%;
    animation-delay: 1s;
}

.birthday-decor span:nth-child(3) {
    top: 40%;
    left: 15%;
    animation-delay: 2s;
}

.birthday-decor span:nth-child(4) {
    top: 35%;
    right: 12%;
}

.birthday-decor span:nth-child(5) {
    top: 55%;
    left: 7%
}

.birthday-decor span:nth-child(6) {
    top: 60%;
    right: 8%;
    animation-delay: 1s;
}

.birthday-decor span:nth-child(7) {
    top: 85%;
    left: 20%;
}

.birthday-decor span:nth-child(8) {
    top: 80%;
    right: 20%;
    animation-delay: 2s;
}

@keyframes birthdayFloat {

    0%,
    100% {
        transform: scale(0.8) rotate(-15deg);
    }

    50% {
        transform: scale(1.6) rotate(15deg);
    }

}

@media (max-width: 600px) {
    .birthday-decor span {
        font-size: 24px;
    }
}

.confetti {
    position: fixed;
    width: 9px;
    height: 14px;
    border-radius: 2px;
    pointer-events: none;
    z-index: 999;
    animation: confettiBurst 2.5s ease-out forwards;
}

@keyframes confettiBurst {
    0% {
        transform: translate(0, 0) rotate(0deg);
        opacity: 1;
    }

    40% {
        transform: translate(var(--x), var(--y)) rotate(360deg);
        opacity: 1;
    }

    100% {
        transform: translate(var(--x), 250px) rotate(720deg);
        opacity: 0;
    }
}

#final-message h2,
#final-message p,
#final-message h3 {
    opacity: 0;
    animation: finalReveal 1.5s ease forwards;
}

#final-message h2 {
    animation-delay: 0.8s;
}

#final-message p {
    animation-delay: 2s;
}

#final-message h3 {
    animation-delay: 3s;
    font-family: 'aref ruqaa', serif;
    font-weight: 400;
}

@keyframes finalReveal {
    from {
        opacity: 0;
        transform: translateY(25px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#wish-instruction.wish-reveal {
    animation: finalReveal 1.5s ease forwards;
}




#welcome {
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

.welcome-doodles {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: -1;
}

.welcome-doodles span {
    position: absolute;
    color: #b56885;
    font-size: 55px;
    opacity: 0.25;
    animation: doodleFloat 4s ease-in-out infinite;
}

.welcome-doodles span:nth-child(1) {
    top: 8%;
    left: 7%;
    font-size: 90px;
}

.welcome-doodles span:nth-child(2) {
    top: 12%;
    right: 15%;
}

.welcome-doodles span:nth-child(3) {
    top: 35%;
    left: 25%;
    font-size: 45px;
}

.welcome-doodles span:nth-child(4) {
    top: 30%;
    right: 8%;
}

.welcome-doodles span:nth-child(5) {
    top: 55%;
    left: 5%;
}

.welcome-doodles span:nth-child(6) {
    top: 65%;
    right: 12%;
    font-size: 100px;
}

.welcome-doodles span:nth-child(7) {
    top: 80%;
    left: 20%;
}

.welcome-doodles span:nth-child(8) {
    top: 48%;
    right: 30%;
    font-size: 35px;
}

.welcome-doodles span:nth-child(9) {
    top: 5%;
    left: 45%;
}

.welcome-doodles span:nth-child(10) {
    bottom: 5%;
    right: 35%;
}

.welcome-doodles span:nth-child(11) {
    bottom: 8%;
    left: 8%;
}

.welcome-doodles span:nth-child(12) {
    bottom: 5%;
    right: 5%;
}

@keyframes doodleFloat {

    0%,
    100% {
        transform: scale(0.9) rotate(-12deg);
    }

    50% {
        transform: scale(1.15) rotate(12deg);
    }
}

.welcome-doodles span:nth-child(even) {
    animation-delay: -2s;
}

.welcome-doodles span:nth-child(3n) {
    animation-duration: 6s;
}


.welcome-stickers {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: -1;
}

.welcome-stickers img {
    position: absolute;
    width: 100px;
    height: auto;
    animation: stickerFloat 5s ease-in-out infinite;
}

.welcome-stickers img:nth-child(1) {
    top: 10%;
    right: 23%;
    width: 120px;
}

.welcome-stickers img:nth-child(2) {
    top: 32%;
    left: 12%;
    width: 100px;
}

.welcome-stickers img:nth-child(3) {
    bottom: 12%;
    left: 25%;
    width: 110px;
}

.welcome-stickers img:nth-child(4) {
    top: 15%;
    left: 30%;
    width: 100px;
}

.welcome-stickers img:nth-child(5) {
    top: 48%;
    right: 13%;
    width: 130px;
}

.welcome-stickers img:nth-child(6) {
    bottom: 10%;
    right: 28%;
    width: 90px;
}

@keyframes stickerFloat {

    0%,
    100% {
        transform: translateY(0) rotate(-8deg) scale(0.95);
    }

    50% {
        transform: translateY(-12px) rotate(8deg) scale(1.08);
    }
}


.welcome-stickers img:nth-child(even) {
    animation-delay: -2s;
}

.welcome-stickers img:nth-child(3n) {
    animation-duration: 7s;
}

@media (max-width: 600px) {
    .welcome-stickers img {
        max-width: 65px;
    }

    .welcome-stickers img:nth-child(5) {
        top: 61%;
        right: 5%;
        width: 65px;
    }

    .welcome-stickers img:nth-child(2) {
        top: 23%;
        left: 5%;
        width: 55px;
    }
}

.wax-seal {
    position: absolute;
    top: 105px;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 45px;
    height: 45px;
    border-radius: 46% 54% 48% 52%;
    background-color: #74364e;
    color: #f4d6df;
    background: radial-gradient(circle at 35% 30%, #a65c76, #74364e 65%, #542638);
    border: 1px solid #ad7189;
    box-shadow: 0 3px 6px #00000030;
    inset: 0 0 4px #ffffff40;

    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 25px;
    z-index: 3;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.wax-seal::after {
    content: "";
    position: absolute;
    inset: 6px;
    border-radius: 50%;
    border: 1px solid #542638;
    box-shadow: 0 1px 1px #ffffff50;
    pointer-events: none;
}

.envelope.open .wax-seal {
    opacity: 0;
}

#surprise-button {
    display: block;
    margin: 25px auto 0;
    padding: 14px 25px;
    background: #f4d6df;
    color: #542638;
    border: none;
    border-radius: 30px;
    font-family: inherit;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

#surprise-button:hover {
    background: #ffffff;
    transform: scale(1.05);

}

#surprise-scene {
    display: none;
    opacity: 0;
    transition: opacity 0.8s ease;
    min-height: 100svh;
    background: #fff0f3;
    color: #542638;
    text-align: center;
    padding: 40px 20px;
    box-sizing: border-box;
}

.gift-icon {
    position: relative;
    display: block;
    width: 100px;
    height: 100px;
    margin: 5px auto;
}

.gift-box {
    position: absolute;
    width: 80px;
    height: 60px;
    bottom: 0;
    left: 10px;
    background: #ce8ca7;
    border-radius: 5px;
}

.gift-lid {
    position: absolute;
    width: 94px;
    height: 18px;
    top: 40px;
    left: 50%;
    transform: translateX(-50%);
    box-sizing: border-box;
    background: #dfa9bf;
    border-radius: 4px;
}

.gift-ribbon {
    position: absolute;
    width: 14px;
    height: 70px;
    bottom: 0;
    left: 43px;
    background: #79384f;
}

.gift-bow::before,
.gift-bow::after {
    content: "";
    position: absolute;
    width: 30px;
    height: 15px;
    top: 18px;
    border: 6px solid #79384f;
    border-radius: 50%;
}

.gift-bow::before {
    right: 46px;
    transform: rotate(30deg);
}

.gift-bow::after {
    left: 46px;
    transform: rotate(-30deg);
}

.surprise-list {
    max-width: 500px;
    margin: 30px auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.surprise-card {
    background: #fffafb;
    border: 1px solid #e7c9d5;
    border-radius: 22px;
    padding: 6px 15px;
    width: 100%;
    box-sizing: border-box;
    height: auto;
    transition: height 0.5s ease;
    overflow: hidden;
    position: relative;
}


.surprise-header {
    text-align: left;
    font-size: 15px;
    color: #986075;
}

.gift-button {
    display: block;
    background: transparent;
    border: none;
    margin: 0 auto;
    padding: 0;
    color: #986075;
    font-size: 16px;
    cursor: pointer;
    transition: opacity 0.6s ease;
}

.surprise-content {
    display: none;
}

.locked .gift-button {
    opacity: 0.3;
    cursor: default;
}

.surprise-card.open .surprise-content {
    display: block;
    animation: revealSurprise 0.8s ease both;
}

.surprise-card.open .gift-button {
    display: none;
}


.surprise-card.opening .gift-icon {
    animation: unwrapGift 0, 7s ease-in-out forwards;
}

@keyframes unwrapGift {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    35% {
        transform: scale(1.12);
        opacity: 1;
    }

    100% {
        transform: scale(0.65);
        opacity: 0;
    }
}

@keyframes revealSurprise {
    from {
        opacity: 0;
        translate: 0 15px;
    }

    to {
        opacity: 1;
        translate: 0 0;
    }
}

.mini-confetti {
    position: absolute;
    left: 50%;
    top: 50%;
    font-size: 20px;
    pointer-events: none;
    z-index: 5;
    animation: giftSparkle 0.9s ease-out forwards;
}

@keyframes giftSparkle {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(0.5);
    }

    100% {
        opacity: 0;
        transform: translate(var(--x), var(--y)) rotate(var(--rotation)) scale(1.2);
    }
}

#surprise-ending {
    display: none;
    max-width: 450px;
    margin: 40px auto 20px;
    text-align: center;
    color: #79384f;
    line-height: 1.8;
}

#surprise-ending.visible {
    display: block;
    animation: revealSurprise 3s ease both;
}

.ending-decoration {
    color: #ce8ca7;
    font-size: 25px;
    letter-spacing: 8px;
}

.ending-heart {
    font-size: 45px;
    color: #ce8ca7;
    animation: endingHeartbeat 1.8s ease-in-out infinite;
}

@keyframes endingHeartbeat {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
    }
}