body {
    margin: 0;
    background-color: #241f1f;
    color: #F7E8F1;
}

#rose-intro {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100dvh;
    z-index: 9999;
    overflow: hidden;
    pointer-events: none;
}

.rose-particle {
    position: absolute;
    top: -180px;
    animation: roseFall ease-out forwards;
    object-fit: contain;
    will-change: transform;
}

/* Rose falling animation */
@keyframes roseFall {
    from {
        transform: translateY(0) rotate(0deg);
    }

    to {
        transform: translateY(calc(100dvh + 200px)) rotate(var(--rotation));
    }
}


/*WELCOME PAGE */
#welcome {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 30px;
    text-align: center;
    gap: 25px;
    transition: opacity 0.8s ease;
    color: #681c2c;
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
    font-family: 'Libre Baskerville', serif;
    /*the khat*/
    background-color: #f8f1e3;

    /*Vintage background photo*/
    background-image: url("images/vintage-background.png");
    background-size: 100% 100%;
    background-position: center;
    background-repeat: no-repeat;

}


/*vintage welcome title*/
#welcome h1 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 48px;
    font-weight: 600;
    font-style: italic;
    color: #681c2c;
    margin: 0;
}

.message {
    max-width: 320px;
    font-size: 17px;
    line-height: 1.7;
    animation-delay: 1s;
    font-family: 'tajawal', sans-serif;
    font-weight: 400;
}

#open-button {
    /*vintage welcome button*/
    background-color: #681c3c;
    color: #f8f1e3;
    border: 4px double #b79a5d;
    border-radius: 4px;
    padding: 15px 30px;
    font-family: 'tajawal', sans-serif;
    font-weight: 700;
    font-size: 22px;
    cursor: pointer;
    transition: all 0.3s ease;
    animation-delay: 1.4s;

}

#open-button:hover {
    background-color: #9e293c;
    color: #f8f1e3;
    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;
    font-family: 'aref ruqaa', serif;
    font-weight: 400;
}


#letter {
    display: none;
    opacity: 0;
    transition: opacity 0.8s ease;
    background-color: #f3e5cf;
    color: #681c2c;
    min-height: 100vh;
    box-sizing: border-box;
    padding-top: 40px;
    padding-bottom: 40px;
}

/*vintage golden mail slot*/
.mail-slot {
    position: relative;
    width: 340px;
    max-width: 92%;
    height: 45px;
    margin: 30px auto 0;
    background: linear-gradient(#e5cf9e,
            #b79a5d,
            #e5cf9e);
    border: 2px solid #95733e;
    border-radius: 8px;
    box-shadow: 0 3px 8px #00000030;
    box-sizing: border-box;
}


/*dark opening line for mail slot */
.mail-slot::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 5%;
    width: 90%;
    height: 8px;
    background: #30251c;
    border-radius: 4px;
    transform: translateY(-50%);
    box-shadow: inset 0 2px 4px #000;
}

/*envelope sliding container*/
.mail-drop {
    position: relative;
    overflow: hidden;
    padding-bottom: 15px;
    margin-top: -22px;
}


.envelope {
    /*المكتوب*/
    position: relative;
    width: 300px;
    height: 200px;
    margin: 0 auto 50px;
    animation: mailSlideDown 2s ease-out both;
}

@keyframes mailSlideDown {
    from {
        transform: translateY(-100%);
    }

    to {
        transform: translateY(0);
    }
}

.envelope-body {
    position: absolute;
    width: 100%;
    height: 100%;
    background-color: #681c2c;
    border-radius: 4px;
    box-shadow: 0 5px 15px #00000030;
    overflow: hidden;
}

/*envelope side folds*/
.envelope-body::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #9e293c);
    clip-path: polygon(0 0, 50% 50%, 100 0, 100% 100%, 0 100%);
}

/*envelope bottom fold */
.envelope-body::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top,
            #912536,
            #681c2c 85%,
            #501321 100%);
    clip-path: polygon(0 100%, 50% 45%, 100% 100%);

}


/*top flap*/
.envelope-flap {
    position: absolute;
    width: 100%;
    height: 110px;
    background: linear-gradient(to bottom, #9e293c 0%,
            #681c2c 85%,
            #350910 100%);
    clip-path: polygon(0 0, 100% 0, 100% 8%, 54% 94%, 50% 98%, 46% 94%, 0 8%);
    border-radius: 4px;
    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, 0));
}

.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;
}

.letter-heading p {
    line-height: 1.6;
    font-family: 'aref ruqaa', serif;
    font-size: 24px;
    font-weight: 400;
    margin: 15px auto;
}

/*golden subtitle */
.letter-heading .golden-subtitle {
    font-family: 'Libre Baskerville', serif;
    font-size: 11px;
    letter-spacing: 3px;
    color: #95733e;
    margin-bottom: 15px;
}

/*envelope opening instruction*/
.seal-instruction {
    text-align: center;
    font-family: 'aref ruqaa', serif;
    font-size: 22px;
    font-style: normal;
    color: #95733e;
    margin: -35px auto 20px;
}

.letter-paper .letter-text {
    font-family: 'amiri', serif;
    font-size: 22px;
    line-height: 1.8;
    font-weight: 400;
    text-align: right;
}

.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: 20px;
    cursor: pointer;
    transition: transform 0.3s ease, color 0.3s ease;
    font-family: 'amiri', serif;
}

#memories-button:hover {
    transform: translatex (6px);
    color: #b76e95;
}

#memories {
    display: none;
    opacity: 0;
    transition: opacity 0.8s ease;

    background: #f3e5cf;
    min-height: 100vh;
    padding: 25px 20px 70px;
    box-sizing: border-box;
    color: #713f55
}

#memories h2 {
    text-align: center;
    font-size: 42px;
}

#memories-intro {
    text-align: center;
    font-size: 22px;
    color: #b79a5d;
    font-family: 'amiri', serif;
}

/* Vintage photo gallery */
.memories-gallery {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 30px 20px;
    max-width: 650px;
    margin: 40px auto;
    padding: 15px;
    position: relative;
    isolation: isolate;
}

/* Vintage photo frame */
.memory-card {
    width: 100%;
    box-sizing: border-box;
    padding: 7px;
    background: #F5e8cf;
    border: 3px double #a88a50;
    box-shadow: 2px 5px 10px #62472c40,
        inset 0 0 5px #b79a5d50;
}

/* Photo inside the frame */
.memory-card img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

/* Horizontal photos */
.memory-card.wide {
    grid-column: 1 / -1;
    width: 85%;
    justify-self: center;
}

.memory-card.wide img {
    aspect-ratio: 4 / 3;
}

/* Square photos */
.memory-card.square img {
    aspect-ratio: 1 / 1;
}

/* Random-looking rotation */
.memory-card:nth-child(odd) {
    transform: rotate(-4deg);
}

.memory-card:nth-child(even) {
    transform: rotate(4deg);
}


.memories-ending {
    max-width: 650px;
    margin: 120px auto 80px;
    padding: 30px;
    text-align: center;
    color: #b79a5d;
    font-family: Georgia, serif;
    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: 'amiri', serif;
    font-size: 22px;
    line-height: 1.9;
}

.memories-ending h3 {
    font-size: 30px;
    color: #b79a5d;
    font-family: 'amiri', serif;
    font-weight: 700;
    font-style: normal;
    font-weight: normal;
    margin-top: 35px;
}



.memories-gallery {
    position: relative;
    isolation: isolate;
}

.gallery-decor {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: auto;
}

.gallery-decor img {
    position: absolute;
    z-index: -1;
    height: auto;
    opacity: 0.9;
    pointer-events: none;
    filter: drop-shadow(2px 3px 3px #00000020);
}

/* First white bouquet */
.gallery-decor img.flower-left {
    width: 140px;
    top: -25px;
    left: -10px;
    transform: rotate(25deg);
    z-index: 5;
}

/* Second white bouquet */
.gallery-decor .flower-right {
    width: 130px;
    bottom: -140px;
    right: 30%;
    transform: rotate(15deg);
    z-index: 5;
}

/* Dried red rose */
.dried-rose {
    width: 110px;
    top: 48%;
    right: 0;
    transform: rotate(25deg);
}

.gallery-decor .dried-rose-last {
    width: 100px;
    bottom: 150px;
    right: 0;
    transform: rotate(30deg);
    z-index: -1;
}

/*rose petals decoratio */
.gallery-decor .petal {
    width: 65px;
    opacity: 0.85;
}

.petal-1 {
    top: 19%;
    left: 40%;
    transform: rotate(-20deg);
}

.petal-2 {
    top: 35%;
    right: 5%;
    transform: rotate(30deg);
}

.petal-3 {
    top: 60%;
    left: 5%;
    transform: rotate(-15deg);
}

.petal-4 {
    bottom: 23%;
    left: 5%;
    transform: rotate(25deg);
}

.petal-5 {
    top: 80%;
    left: 7%;
    transform: rotate(-35deg);
}

@keyframes floatLove {

    0%,
    100% {
        transform: translateY(0) rotate(-10deg);
    }

    50% {
        transform: translateY(-20px) rotate(10deg);
    }
}


@media (max-width: 600px) {
    .memories-gallery {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 25px 15px;
        padding: 10px;
    }



    .memory-card img {
        width: 100%;
        height: auto;
        object-fit: cover;
    }

    .memories-gallery .memory-card:has(img[src="images/memory9.jpg"]) {
        grid-column: 1 / -1;
        justify-self: center;
        width: 45%;
    }
}

#memories {
    position: relative;
    overflow: hidden;
}

/*golden page border*/
#memories::before {
    content: "";
    position: absolute;
    inset: 12px;
    border: 4px double #b79a5d;
    pointer-events: none;
}

/*music button in memories page*/
#music-button {
    background: #743d49;
    border: 4px double #c9ac72;
    color: #d4af37;
    padding: 15px 30px;
    border-radius: 3px;
    font-family: 'amiri', serif;
    font-size: 20px;
    cursor: pointer;
    margin-top: 30px;
    transition: 0.4s ease;
    box-shadow: 0 4px 10px #62472c40;
}

#music-button:hover {
    background: #592c37;
    color: #d4af37;
    transform: scale(1.03);
}

#music {
    display: none;
    opacity: 0;
    transition: opacity 0.8s ease;
    min-height: 100vh;
    background: #f3e5cf;
    color: #743d49;
    text-align: center;
    padding: 70px 30px;
    box-sizing: border-box;
    outline: 4px double #b79a5d;
    outline-offset: -15px;
    font-family: Georgia, serif;
}

#music h2 {
    font-size: 42px;
    font-family: 'amiri', serif;
    font-size: 32px;
}

#music p {
    font-size: 19px;
    font-family: 'amiri', serif;
    line-height: 1.8;
    color: #b79a5d;
}

.vinyl-record {
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: repeating-radial-gradient(circle,
            #161616 0px,
            #161616 3px,
            #303030 4px);
    margin: 40px auto;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 15px 40px #00000066;
}

.vinyl-label {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: #dba5b6;
    border: 3px solid #f4d6df;
    background-image: url("images/memory1.jpg");
    background-size: cover;
    background-position: center;
}

/*golden tonearm on the vinyl*/
.record-player {
    position: relative;
    width: 300px;
    max-width: 100%;
    margin: 0 auto;
}

.tonearm {
    position: absolute;
    top: 0;
    right: 0;
    width: 24px;
    height: 190px;
    z-index: 5;
    transform-origin: 50% 12px;
    transform: rotate(-15deg);
    transition: transform 1.2s ease;
}

.tonearm-base {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: radial-gradient(circle, #f5df9b, #96713b);
    box-shadow: 0 3px 6px #00000040;
}

.tonearm-stick {
    width: 7px;
    height: 145px;
    margin: -5px auto 0;
    background: linear-gradient(90deg, #96713b, #f5df9b, #b79a5d);
    border-radius: 5px;
}

.tonearm-needle {
    width: 17px;
    height: 28px;
    margin: -3px auto 0;
    background: linear-gradient(90deg, #96713b, #d4af37);
    border-radius: 3px;
    transform: rotate(20deg);
}

.tonearm.playing {
    transform: rotate(38deg);
}

@keyframes spinRecord {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(460deg);
    }
}

.vinyl-record.playing {
    animation: spinRecord 6s linear infinite;
}

.song-info h3 {
    font-size: 28px;
    margin-bottom: 8px;
}

.song-info p {
    font-size: 18px;
    opacity: 0.8;
}

#play-button {
    width: 65px;
    height: 65px;
    border-radius: 50%;
    border: 4px double #c9ac72;
    background: #743d49;
    color: #d4af37;
    box-shadow: 0 4px 10px #62472c40;
    font-size: 25px;
    cursor: pointer;
    transition: transform 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 0 0 3px;
    box-sizing: border-box;
    line-height: 1;
    margin: 0 auto;
}

#play-button:hover {
    transform: scale(1.1);
    background: #5c303b;
}

.pause-icon {
    display: inline-block;
    width: 15px;
    height: 18px;
    border-left: 5px solid currentColor;
    border-right: 5px solid currentColor;
    box-sizing: border-box;
    vertical-align: middle;
}

@keyframes spinRecord {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.vinyl-record {
    animation: spinRecord 5s linear infinite;
    animation-play-state: paused;
}

.vinyl-record.playing {
    animation-play-state: running;
}

.music-progress {
    width: 350px;
    max-width: 85%;
    margin: 25px auto;
}

#progress-bar {
    appearance: none;
    width: 100%;
    max-width: 350px;
    height: 5px;
    background: linear-gradient(to right,
            #542638 var(--progress, 0%),
            #b79a5d var(--progress, 0%));
    border-radius: 10px;
    cursor: pointer;
}

#progress-bar::-webkit-slider-thumb {
    appearance: none;
    width: 15px;
    height: 15px;
    background: #542638;
    border-radius: 50%;
}

.music-time {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: #542638;
    margin-top: 8px;
}

#final-button {
    display: block;
    margin: 35px auto 00;
    padding: 14px 30px;
    background: #743d49;
    border: 4px double #c9ac72;
    border-radius: 3px;
    color: #d4af37;
    font-size: 19px;
    font-family: 'amiri', serif;
    box-shadow: 0 4px 10px #62472c40;
    cursor: pointer;
    transition: all 0.3s ease;
}

#final-button:hover {
    background: #62404a;
    color: #d4af37;
    transform: scale(1.05);
}

#final-scene {
    display: none;
    opacity: 0;
    transition: opacity 0.8s ease;
    min-height: 100vh;
    background-color: #f3e5cf;
    color: #743d49;
    text-align: center;
    padding: 60px 20px;
    box-sizing: border-box;
    outline: 4px double #b79a5d;
    outline-offset: -15px;
    font-family: Georgia, serif;
}

#final-scene h2 {
    font-size: 34px;
    margin: 20px auto;
    color: #b79a5d;
    font-family: 'amiri', serif;
    line-height: 1.5;
}

#final-scene p {
    color: #743d49;
    font-size: 19px;
    line-height: 1.8;
    font-family: 'amiri', serif;
}

#final-message {
    display: none;
    font-family: 'amiri', serif;
    font-size: 25px;
}

.birthday-cake {
    position: relative;
    width: 240px;
    max-width: 90%;
    margin: 100px auto 40px;
}

.cake-bottom {
    width: 100%;
    height: 80px;
    background: #743d49;
    border-radius: 12px;
    border-top: 15px solid #e8d5b5;
    box-sizing: border-box;
}

.cake-top {
    width: 70%;
    height: 65px;
    background: #874b57;
    border-radius: 10px 10px 0 0;
    border-top: 12px solid #e8d5b5;
    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%,
            #e8d5b5 70%,
            transparent 73%);
    background-size: 30px 22px;
}

.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: #b79a5d;
    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%;
}



.birthday-cake::after {
    content: "";
    display: block;
    width: 115%;
    height: 15px;
    background: #d6bd98;
    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,
            #b79a5d 0px,
            #b79a5d 8px,
            #e8d5b5 8px,
            #e8d5b5 14px);
    border-radius: 4px;
    cursor: pointer;
}

.flame {
    position: absolute;
    width: 14px;
    height: 30px;
    top: -33px;
    left: 50%;
    background: radial-gradient(ellipse at 50% 70%,
            #fffbea 15%,
            #ffe5a0 40%,
            #e8ad42 75%,
            #c58b32 100%);
    border-radius: 50% 50% 50% 50% / 75% 75% 25% 25%;
    box-shadow: 0 0 12px #e8ad42,
        0 0 25px #e8ad4260;
    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: 65%;
    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;
}

@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: 52px;
    height: 52px;
    border-radius: 50%;

    background-color: #74364e;
    color: #f8f1e3;
    background: radial-gradient(circle at 30% 28%,
            #fff2b8 0%,
            #f7d86f 18%,
            #e1b23d 38%,
            #c9901d 60%,
            #a86f10 82%,
            #8b5808 100%);

    border: 1.5px solid #9a670f;
    box-shadow:
        inset 0 2px 4px rgba(255, 255, 255, 0.45),
        inset 0 -5px 8px rgba(110, 70, 0, 0.28),
        0 4px 10px rgba(0, 0, 0, 0.20);

    pointer-events: none;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 3;

}

.wax-seal::before {
    content: "";
    position: absolute;
    inset: 7px;
    border-radius: 50%;
    border: 1px solid rgba(145, 95, 15, 0.45);
    box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.25),
        inset 0 -2px 4px rgba(120, 80, 0, 0.18);
}

.wax-seal::after {
    content: "";
    position: absolute;
    top: 10px;
    left: 14px;
    width: 18px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.28);
    filter: blur(1px);
    transform: rotate(-20deg);
    pointer-events: none;
}

.seal-mark {
    position: relative;
    z-index: 2;
    color: #5c2436;
    font-size: 22px;
    font-weight: 700;
    line-height: 1;
    text-shadow:
        0 1px 0 rgba(255, 255, 255, 0.22),
        0 -1px o rgba(70, 30, 40, 0.18);
}

.envelope.open .wax-seal {
    opacity: 0;
}

@media (max-width: 600px) {
    #music {
        padding: 80px 15px 20px;
        min-height: 100svh;
    }

    #music h2 {
        font-size: 28px;
        margin: 10px 0;
    }

    #music p {
        font-size: 15px;
        margin: 8px 0;
    }

    .vinyl-record {
        width: 200px;
        height: 200px;
        margin: 20px auto;
    }

    .vinyl-label {
        width: 70px;
        height: 70px;
    }

    .song-info h3 {
        font-size: 21px;
        margin: 8px 0;
    }

    #play-button {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }

    .music-progress {
        margin: 15px auto;
    }
}

#surprise-button {
    display: block;
    margin: 25px auto 0;
    padding: 14px 25px;
    background: #743d49;
    color: #e8d5b5;
    border: 3px double #b79a5d;
    font-family: 'amiri', serif;
    font-size: 19px;
    cursor: pointer;
    box-shadow: 0 4px 8px #00000020;
    transition: all 0.3s ease;
}

#surprise-button:hover {
    background: #542638;
    transform: scale(1.03);
}

/*last page surprise ticket*/
#ticket-scene {
    display: none;
    opacity: 0;
    transition: opacity 0.8s ease;
    min-height: 100vh;
    background: #f3e5cf;
    text-align: center;
    padding: 30px 25px;
    box-sizing: border-box;
    outline: 4px double #b79a5d;
    outline-offset: -15px;
    font-family: 'amiri', serif;

}

.ticket-label {
    font-size: 16px;
    letter-spacing: 3px;
    color: #743d49;
}

#ticket-scene>h2 {
    color: #b79a5d;
    font-size: 32px;
    font-family: 'amiri', serif;
    font-weight: 700;
    line-height: 1.5;
}

#ticket-scene>p:not(.ticket-label) {
    color: #743d49;
    font-family: 'amiri', serif;
    font-size: 20px;
    line-height: 1.7;
}

.gold-divider {
    color: #b79a5d;
    margin: 20px auto;
}

#unwrap-ticket {
    background: transparent;
    border: none;
    padding: 0;
    width: 100%;
    max-width: 450px;
    margin: 20px auto;
    cursor: pointer;
}

#unwrap-ticket img {
    width: 100%;
    border-radius: 5px;
    display: block;
}

.unwrap-instruction {
    color: #b79a5d;
    font-style: normal;
    font-size: 17px;
    font-family: 'amiri', serif;
}

#ticket-scene .unwrap-instruction {
    color: #b79a5d;
}

/*surprise ticket last page */
#revealed-ticket {
    display: none;
    width: 100%;
    max-width: 500px;
    min-height: 110px;
    margin: 45px auto;
    background: linear-gradient(135deg, #98263f, #650f25);
    color: #e8d5b5;
    border: 4px double #b79a5d;
    box-sizing: border-box;
    box-shadow: 0 8px 20px #00000030;
    font-family: Georgia, serif;
}

.ticket-stub {
    width: 20%;
    background: #d4b477;
    color: #650f25;
    border-right: 2px dashed #650f25;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.ticket-barcode {
    width: 25px;
    height: 75px;
    background: repeating-linear-gradient(0deg,
            #650f25 0px,
            #650f25 2px,
            transparent 2px,
            transparent 5px);
}

.ticket-stub span {
    font-size: 7px;
    margin-top: 8px;
}

.ticket-main {
    flex: 1;
    padding: 10px 8px;
    text-align: center;
    border: 1px solid #b79a5d;
    margin: 5px;
}

.ticket-admit {
    font-size: 10px;
    letter-spacing: 3px;
}

.ticket-destination {
    background: #e8d5b5;
    color: #743d49;
    border: 3px double #b79a5d;
    padding: 6px 4px;
    margin: 8px auto;
    box-sizing: border-box;
    width: 90%;
}

.ticket-destination p {
    font-size: 9px;
    color: #743d49;
    margin: 0;
}

.ticket-destination h3 {
    font-size: 16px;
    letter-spacing: 1px;
    margin: 4px 0;
    color: #743d49;
}

#ticket-scene .ticket-footer {
    font-size: 8px;
    letter-spacing: 1px;
    color: #e8d5b5;
}

/*for the tall phones */
@media (min-height: 800px) {

    #final-scene {
        padding-top: 20svh !important;
    }

    #music {
        padding-top: 20svh !important;
    }

    #letter-scene {
        padding-top: 20svh !important;
    }

    #ticket-scene {
        padding-top: 12svh;
    }

    #revealed-ticket {
        margin: 8svh auto;
    }
}