* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    min-height: 100%;
    font-family: Georgia, "Times New Roman", serif;
}

body {
    overflow: hidden;
    background: #fff0f4;
}

button {
    border: none;
    cursor: pointer;
    font-family: inherit;
    transition: 0.3s ease;
}

button:hover {
    transform: translateY(-3px);
}

/* COMMON PAGES */

.page {
    position: fixed;
    inset: 0;
    width: 100%;
    min-height: 100vh;
    display: none;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.page.active {
    display: flex;
}


/* PAGE 1: WELCOME - UNCHANGED */

.password-screen {
    background:
        radial-gradient(circle at 15% 20%, #ffe0e9 0 9%, transparent 10%),
        radial-gradient(circle at 85% 80%, #f9c9d9 0 10%, transparent 11%),
        linear-gradient(135deg, #f9d7e2, #f5bccc, #f8dce5);
}

.welcome-card {
    position: relative;
    z-index: 3;
    width: min(88%, 430px);
    padding: 42px 30px;
    text-align: center;
    border-radius: 28px;
    background: rgba(255, 248, 250, 0.91);
    box-shadow: 0 15px 45px rgba(117, 49, 76, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.8);
}

.small-heart {
    color: #b64d72;
    font-size: 38px;
    margin-bottom: 10px;
}

.welcome-top {
    font-size: 32px;
    font-weight: 800;
    color: #873b5b;
    margin-bottom: 20px;
}

.welcome-card h1 {
    color: #78344f;
    font-size: clamp(30px, 6vw, 42px);
    margin-bottom: 18px;
}

.welcome-message {
    color: #805466;
    font-size: 17px;
    line-height: 1.6;
    margin-bottom: 25px;
}

.welcome-card input {
    width: 100%;
    padding: 14px;
    border: 1px solid #e4a9bd;
    border-radius: 25px;
    outline: none;
    background: #fff;
    text-align: center;
    font-size: 15px;
    margin-bottom: 15px;
}

.welcome-card input:focus {
    border-color: #a64d6e;
    box-shadow: 0 0 0 3px rgba(166, 77, 110, 0.12);
}

.welcome-card button,
.birthday-card button,
.beach-content button,
.cake-content > button,
.memory-gallery button {
    padding: 13px 28px;
    border-radius: 30px;
    color: white;
    background: #a94e70;
    font-size: 16px;
    box-shadow: 0 6px 15px rgba(120, 52, 79, 0.2);
}

.welcome-card button:hover,
.birthday-card button:hover,
.beach-content button:hover,
.cake-content > button:hover,
.memory-gallery button:hover {
    background: #853b5b;
}

#error-message {
    min-height: 20px;
    color: #c43c61;
    font-size: 14px;
    margin-top: 12px;
}

.password-hint {
    color: #a77b8c;
    font-size: 12px;
    margin-top: 15px;
}

.butterfly {
    position: absolute;
    font-size: 30px;
    animation: butterflyFloat 5s ease-in-out infinite;
    opacity: 0.8;
}

.butterfly-one {
    top: 12%;
    left: 12%;
}

.butterfly-two {
    top: 22%;
    right: 13%;
    animation-delay: 1s;
}

.butterfly-three {
    bottom: 15%;
    left: 18%;
    animation-delay: 2s;
}

.butterfly-four {
    bottom: 20%;
    right: 16%;
    animation-delay: 1.5s;
}

.butterfly-five {
    top: 50%;
    left: 5%;
    animation-delay: 0.5s;
}

@keyframes butterflyFloat {
    0%, 100% {
        transform: translateY(0) rotate(-8deg);
    }
    50% {
        transform: translateY(-22px) rotate(8deg);
    }
}


/* PAGE 2: BIRTHDAY WISH */

.birthday-screen {
    background: linear-gradient(135deg, #f9dce8, #f4c3d5, #f8d9e5);
}

.birthday-card {
    position: relative;
    z-index: 6;
    width: min(88%, 650px);
    padding: 42px 35px;
    border-radius: 28px;
    text-align: center;
    background: rgba(255, 248, 251, 0.92);
    box-shadow: 0 15px 45px rgba(105, 47, 74, 0.16);
}

.birthday-heart {
    font-size: 38px;
    color: #a64d70;
    margin-bottom: 12px;
}

.birthday-small {
    color: #a34c6b;
    letter-spacing: 2px;
    margin-bottom: 18px;
}

.birthday-card h1 {
    color: #78364f;
    font-size: clamp(27px, 5vw, 39px);
    font-style: italic;
    line-height: 1.3;
    margin-bottom: 20px;
}

.birthday-card > p {
    color: #80576a;
    font-size: 17px;
    line-height: 1.7;
}

.birthday-card .today-line {
    color: #a34c6b;
    font-weight: bold;
    margin-top: 18px;
}

.birthday-card .question-line {
    margin: 15px 0 23px;
}


/* PAGE 2: RANDOM BALLOONS */

.balloon-container {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 2;
}

.rising-balloon {
    position: absolute;
    bottom: -130px;
    left: 50%;
    width: 48px;
    height: 65px;
    border-radius: 50% 50% 46% 46%;
    opacity: 0;
    z-index: 2;
    animation: balloonRise 8s linear forwards;
    animation-play-state: paused;
    box-shadow: inset -7px -5px 10px rgba(0, 0, 0, 0.13),
                inset 6px 5px 9px rgba(255, 255, 255, 0.13);
}

/* Balloon shine */
.rising-balloon::before {
    content: "";
    position: absolute;
    top: 12px;
    left: 9px;
    width: 9px;
    height: 20px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.32);
    transform: rotate(25deg);
}

/* Balloon string */
.rising-balloon .balloon-string {
    position: absolute;
    left: 50%;
    top: calc(100% + 5px);
    width: 1px;
    height: 35px;
    background: rgba(80, 65, 75, 0.55);
    transform: translateX(-50%);
}

/* Balloon knot */
.rising-balloon .balloon-knot {
    position: absolute;
    left: 50%;
    bottom: -5px;
    width: 9px;
    height: 8px;
    background: inherit;
    clip-path: polygon(0 0, 100% 0, 50% 100%);
    transform: translateX(-50%);
}

/* Balloon rise with random sideways movement */
@keyframes balloonRise {
    0% {
        transform: translate3d(0, 0, 0) rotate(-5deg);
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    35% {
        transform: translate3d(
            calc(var(--drift) * 0.35),
            -35vh,
            0
        ) rotate(5deg);
    }

    70% {
        transform: translate3d(
            calc(var(--drift) * 0.75),
            -70vh,
            0
        ) rotate(-4deg);
        opacity: 1;
    }

    100% {
        transform: translate3d(
            var(--drift),
            calc(-100vh - 160px),
            0
        ) rotate(6deg);
        opacity: 1;
    }
}

.birthday-screen.active .rising-balloon {
    animation-play-state: running;
}

/* Balloon pop */
.balloon-pop {
    animation: balloonPop 0.28s ease-out forwards !important;
}

@keyframes balloonPop {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    35% {
        transform: scale(1.45);
        opacity: 1;
    }

    100% {
        transform: scale(0);
        opacity: 0;
    }
}

/* Bright burst flash */
.balloon-burst-flash {
    position: absolute;
    width: 18px;
    height: 18px;
    border: 3px solid white;
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0.2);
    animation: flashBurst 0.45s ease-out forwards;
    z-index: 8;
    box-shadow: 0 0 15px white, 0 0 28px #ffcae0;
}

@keyframes flashBurst {
    to {
        transform: translate(-50%, -50%) scale(4);
        opacity: 0;
    }
}

/* Confetti pieces */
.balloon-confetti {
    position: absolute;
    z-index: 9;
    pointer-events: none;
    animation: confettiExplosion 1.2s ease-out forwards;
}

@keyframes confettiExplosion {
    0% {
        transform: translate(0, 0) rotate(0deg) scale(1);
        opacity: 1;
    }

    100% {
        transform:
            translate(var(--spread-x), var(--spread-y))
            rotate(var(--spin))
            scale(0.3);
        opacity: 0;
    }
}


/* PAGE 3: BEACH */

.beach-screen {
    background-image: url("images/beach.jpg");
    background-size: cover;
    background-position: center;
}

.beach-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        rgba(30, 25, 45, 0.12),
        rgba(30, 20, 40, 0.42)
    );
}

.beach-content {
    position: relative;
    z-index: 2;
    width: min(88%, 620px);
    text-align: center;
    padding: 38px 30px;
    background: rgba(255, 245, 240, 0.22);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.65);
    border-radius: 8px 45px 8px 45px;
    box-shadow: 0 15px 45px rgba(30, 20, 35, 0.18);
    animation: beachMessageAppear 1s ease;
}

.beach-content::before,
.beach-content::after {
    content: "✧";
    position: absolute;
    color: #fff5e9;
    font-size: 30px;
}

.beach-content::before {
    top: 12px;
    left: 18px;
}

.beach-content::after {
    bottom: 12px;
    right: 18px;
}

.beach-message-top {
    margin-bottom: 17px;
}

.beach-decoration {
    display: block;
    color: #542d40;
    font-size: 30px;
    margin-bottom: 7px;
}

.beach-small {
    color: #542d40;
    font-size: 13px;
    letter-spacing: 4px;
    font-weight: bold;
}

.beach-content h1 {
    color: #542d40;
    font-size: clamp(30px, 5vw, 46px);
    font-style: italic;
    line-height: 1.3;
    text-shadow: 0 3px 12px rgba(50, 25, 40, 0.35);
    margin-bottom: 22px;
}

.beach-message {
    padding: 15px 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.65);
    border-bottom: 1px solid rgba(255, 255, 255, 0.65);
    margin-bottom: 20px;
}

.beach-message p {
    color: #542d40;
    font-size: clamp(16px, 2.5vw, 19px);
    line-height: 1.8;
    text-shadow: 0 2px 8px rgba(40, 20, 35, 0.4);
}

.beach-message p + p {
    margin-top: 8px;
}

.beach-message-bottom {
    color: #542d40;
    font-size: 21px;
    font-style: italic;
    margin-bottom: 23px;
    text-shadow: 0 2px 8px rgba(40, 20, 35, 0.4);
}

.beach-content button {
    padding: 13px 29px;
    border-radius: 30px;
    color: #542d40;;
    background: rgba(255, 247, 242, 0.95);
    font-size: 16px;
    box-shadow: 0 6px 18px rgba(30, 20, 35, 0.18);
}

.beach-content button:hover {
    background: #ffffff;
    color: #a0526c;
}

@keyframes beachMessageAppear {
    from {
        opacity: 0;
        transform: translateY(18px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* PAGE 4: CAKE */

#cakeScreen {
    background-image: url("images/birthday-beach.jpg");
    background-size: cover;
    background-position: center;
}

#cakeScreen .cake-overlay {
    position: absolute;
    inset: 0;
    background: rgba(34, 25, 43, 0.25);
}

#cakeScreen .cake-content {
    position: relative;
    z-index: 2;
    width: min(92%, 650px);
    max-height: 95vh;
    overflow-y: visible;
    text-align: center;
    padding: 25px;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

#cakeScreen .cake-small {
    color: #ffffff;
    letter-spacing: 2px;
    margin-bottom: 10px;
    font-weight: 800;
    text-shadow: 2px 2px 5px #57213c,
                 0 0 10px rgba(60, 20, 40, 0.8);
}

#cakeScreen .cake-content h1 {
    color: #fffaf0;
    font-size: clamp(25px, 5vw, 36px);
    margin-bottom: 12px;
    font-weight: 900;
    text-shadow: 2px 3px 6px #542039,
                 0 0 12px rgba(50, 15, 35, 0.9);
}

#cakeScreen .cake-instruction {
    color: #ffffff;
    margin-bottom: 12px;
    font-weight: 800;
    text-shadow: 2px 2px 5px #542039,
                 0 0 10px rgba(50, 15, 35, 0.9);
}

/* TWO-TIER CAKE STAGE */

#cakeScreen .cake-stage {
    position: relative;
    width: 320px;
    height: 290px;
    margin: 10px auto 18px;
    cursor: crosshair;
    touch-action: none;
      transform: translateY(110px) scale(0.60);
}

/* Cake plate */

#cakeScreen .cake-plate {
    position: absolute;
    bottom: 22px;
    left: 15px;
    width: 290px;
    height: 25px;
    border-radius: 50%;
    background: linear-gradient(
        180deg,
        #fff,
        #f9e7ee 45%,
        #d9b9c8
    );
    box-shadow: 0 8px 15px rgba(50, 20, 35, 0.25);
}

#cakeScreen .plate-rim {
    position: absolute;
    inset: 3px 12px 10px;
    border: 2px solid rgba(255,255,255,0.9);
    border-radius: 50%;
}

/* Complete cake */

#cakeScreen .cake-body {
    position: absolute;
    inset: 0;
    transition: opacity 0.2s;
}

/* Bottom tier */

#cakeScreen .lower-tier {
    position: absolute;
    left: 35px;
    bottom: 45px;
    width: 250px;
    height: 105px;
    border-radius: 15px 15px 20px 20px;
background: linear-gradient(
    90deg,
    #d96b91,
    #ffc1d5 35%,
    #ffe0e9 55%,
    #d96b91
);

    box-shadow:
        inset 0 -12px 15px rgba(115, 42, 70, 0.18),
        inset 0 5px 9px rgba(255,255,255,0.35),
        0 5px 9px rgba(75,30,48,0.15);
}

#cakeScreen .tier-icing {
    position: absolute;
    top: -9px;
    left: -2px;
    width: 254px;
    height: 27px;
    border-radius: 50%;
    background: linear-gradient(#fffdfd, #ffe8ef);
    box-shadow: 0 3px 5px rgba(120,50,75,0.12);
}

#cakeScreen .tier-piping {
    position: absolute;
    top: 10px;
    left: 0;
    width: 100%;
    height: 15px;
    border-top: 4px dotted #fff8fa;
    border-bottom: 3px solid rgba(255,255,255,0.7);
}

#cakeScreen .tier-pearls {
    position: absolute;
    top: 45px;
    left: 15px;
    right: 15px;
    height: 12px;
    background-image: radial-gradient(circle, #fff6e9 3px, transparent 4px);
    background-size: 23px 12px;
}

#cakeScreen .tier-ribbon {
    position: absolute;
    bottom: 13px;
    left: 0;
    width: 100%;
    height: 7px;
    background: linear-gradient(#ffe8ef, #fff8fa, #f5c6d5);
    box-shadow: 0 2px 4px rgba(100,30,55,0.12);
}

/* Top tier */

#cakeScreen .upper-tier {
    position: absolute;
    left: 92px;
    bottom: 145px;
    width: 136px;
    height: 90px;
    border-radius: 15px 15px 13px 13px;
    background: linear-gradient(
        90deg,
        #c45b7e,
        #f5b8cb 40%,
        #f9d0dc 60%,
        #c75b7d
    );
    box-shadow:
        inset 0 -9px 12px rgba(115,42,70,0.16),
        inset 0 5px 8px rgba(255,255,255,0.4),
        0 4px 8px rgba(75,30,48,0.15);
}

#cakeScreen .top-icing {
    position: absolute;
    top: -9px;
    left: -2px;
    width: 140px;
    height: 25px;
    border-radius: 50%;
    background: linear-gradient(#fff, #ffe8ef);
}

#cakeScreen .top-piping {
    position: absolute;
    top: 10px;
    left: 0;
    width: 100%;
    height: 12px;
    border-top: 3px dotted #fff8fa;
}

#cakeScreen .top-pearls {
    position: absolute;
    top: 48px;
    left: 12px;
    right: 12px;
    height: 10px;
    background-image: radial-gradient(circle, #fff6e9 3px, transparent 4px);
    background-size: 18px 10px;
}

/* Candle */

#cakeScreen .cake-candle {
    position: absolute;
    left: 62px;
    top: -48px;
    width: 12px;
    height: 42px;
    border-radius: 4px;
    background: repeating-linear-gradient(
        45deg,
        #fff,
        #fff 5px,
        #d76b8c 5px,
        #d76b8c 10px
    );
    box-shadow: 0 2px 5px rgba(70,25,45,0.2);
}

#cakeScreen .candle-flame {
    position: absolute;
    width: 15px;
    height: 22px;
    left: -1px;
    top: -23px;
    border-radius: 50% 50% 50% 0;
    transform: rotate(45deg);
    background: #ffb52e;
    box-shadow: 0 0 15px #ffb52e;
    animation: cakePage4FlameDance 0.6s ease-in-out infinite alternate;
}

@keyframes cakePage4FlameDance {
    to {
        transform: rotate(55deg) scale(0.85);
    }
}

/* Cake halves after cutting */

#cakeScreen .cake-half {
    position: absolute;
    inset: 0;
    opacity: 0;
    z-index: 3;
    pointer-events: none;
}

#cakeScreen .bottom-piece {
    position: absolute;
    bottom: 45px;
    width: 125px;
    height: 105px;
    background: linear-gradient(
        90deg,
        #bd5579,
        #f1b0c5,
        #f8c6d5
    );
    box-shadow: inset 0 -10px 12px rgba(115,42,70,0.18);
}

#cakeScreen .cake-half-left .bottom-piece {
    left: 35px;
    border-radius: 15px 0 0 20px;
}

#cakeScreen .cake-half-right .bottom-piece {
    left: 160px;
    border-radius: 0 15px 20px 0;
}

#cakeScreen .bottom-piece::before {
    content: "";
    position: absolute;
    top: -8px;
    left: 0;
    width: 100%;
    height: 20px;
    border-radius: 50%;
    background: #ffe8ef;
}

#cakeScreen .top-piece {
    position: absolute;
    bottom: 145px;
    width: 68px;
    height: 90px;
    background: linear-gradient(
        90deg,
        #c45b7e,
        #f5b8cb,
        #f9d0dc
    );
    box-shadow: inset 0 -8px 10px rgba(115,42,70,0.16);
}

#cakeScreen .cake-half-left .top-piece {
    left: 92px;
    border-radius: 15px 0 0 13px;
}

#cakeScreen .cake-half-right .top-piece {
    left: 160px;
    border-radius: 0 15px 13px 0;
}

#cakeScreen .top-piece::before {
    content: "";
    position: absolute;
    top: -8px;
    left: 0;
    width: 100%;
    height: 19px;
    border-radius: 50%;
    background: #ffe8ef;
}

/* Vertical cutting line */

#cakeScreen .cake-cut-line {
    position: absolute;
    top: 48px;
    left: 158px;
    width: 4px;
    height: 190px;
    border-radius: 5px;
    background: #fff;
    box-shadow: 0 0 10px #fff;
    opacity: 0;
    z-index: 5;
}

/* Cutting animation */

#cakeScreen .cake-stage.cut .cake-body {
    opacity: 0;
}

#cakeScreen .cake-stage.cut .cake-half {
    opacity: 1;
}

#cakeScreen .cake-stage.cut .cake-half-left {
    animation: cakePage4Left 0.7s ease forwards;
}

#cakeScreen .cake-stage.cut .cake-half-right {
    animation: cakePage4Right 0.7s ease forwards;
}

#cakeScreen .cake-stage.cut .cake-cut-line {
    opacity: 1;
}

@keyframes cakePage4Left {
    to {
        transform: translateX(-22px) rotate(-3deg);
    }
}

@keyframes cakePage4Right {
    to {
        transform: translateX(22px) rotate(3deg);
    }
}

/* Birthday message */

#cakeScreen .birthday-pop {
    display: none;
    margin: 35px auto 18px;
    color: #963d61;
    animation: cakePage4MessageAppear 0.8s ease;
}

#cakeScreen .birthday-pop.show {
    display: block;
}

#cakeScreen .birthday-pop h2 {
    font-size: clamp(20px, 4vw, 27px);
    margin-bottom: 8px;
    color: #fff4c9;
    font-weight: 900;
    text-shadow: 2px 3px 6px #542039,
                 0 0 12px rgba(50, 15, 35, 0.9);
}

#cakeScreen .birthday-pop p {
    color: #ffffff;
    font-weight: 800;
    text-shadow: 2px 2px 5px #542039,
                 0 0 10px rgba(50, 15, 35, 0.9);
}

#cakeScreen .hidden {
    display: none !important;
}

@keyframes cakePage4MessageAppear {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =================================
   PAGE 5 - GIFT AND MEMORIES
================================= */

.gift-screen {
    background: linear-gradient(
        135deg,
        #f9dce8,
        #f4c3d5,
        #f8d9e5
    );

    width: 100%;
    min-height: 100vh;
    height: 100vh;

    overflow-x: hidden !important;
    overflow-y: auto !important;

    box-sizing: border-box;
    align-items: flex-start;
    justify-content: center;
    padding: 25px 12px 40px;
}

.gift-content {
    width: min(96%, 950px);
    margin: auto;
    padding: 25px 10px 35px;

    height: auto;
    max-height: none;
    overflow: visible;

    box-sizing: border-box;
    text-align: center;
    flex-shrink: 0;
}

.gift-small {
    color: #a34c6b;
    letter-spacing: 2px;
    margin-bottom: 15px;
}

.gift-content h1 {
    color: #78364f;
    font-size: clamp(25px, 5vw, 36px);
    line-height: 1.4;
    margin-bottom: 15px;
}

.gift-instruction {
    color: #87566b;
    margin-bottom: 22px;
}

/* GIFT BOX */

.gift-box {
    position: relative;
    display: block;
    width: 145px;
    height: 130px;
    margin: 25px auto 35px;
    background: transparent;
    border: none;
    cursor: pointer;
    animation: giftFloat 2.5s ease-in-out infinite;
}

.gift-body {
    position: absolute;
    left: 10px;
    bottom: 0;
    width: 125px;
    height: 90px;
    border-radius: 5px;
    background: #b94d73;
    box-shadow: 0 10px 20px rgba(100, 40, 65, 0.2);
}

.gift-body::after {
    content: "";
    position: absolute;
    left: 53px;
    top: 0;
    width: 20px;
    height: 100%;
    background: #f8d1df;
}

.gift-lid {
    position: absolute;
    z-index: 2;
    left: 2px;
    top: 28px;
    width: 141px;
    height: 25px;
    border-radius: 5px;
    background: #d66b91;
    transition: transform 0.7s ease;
}

.gift-ribbon {
    position: absolute;
    z-index: 3;
    left: 63px;
    top: 29px;
    width: 20px;
    height: 100px;
    background: #f8d1df;
}

.gift-bow {
    position: absolute;
    z-index: 4;
    top: 0;
    left: 52px;
    color: #a83e67;
    font-size: 43px;
    transition: 0.7s ease;
}

.gift-box.open {
    animation: none;
}

.gift-box.open .gift-lid {
    transform: translateY(-65px) rotate(-15deg);
}

.gift-box.open .gift-bow {
    transform: translateY(-55px) rotate(-15deg);
}

/* MEMORY GALLERY */

.memory-gallery {
    display: none;
    width: 100%;
    height: auto;
    overflow: visible;
    padding: 5px 0 25px;
    animation: messageAppear 0.8s ease;
}

.memory-gallery.show {
    display: block;
}

.memory-gallery h2 {
    color: #873e5d;
    font-size: 29px;
    margin: 18px 0 28px;
}



/* FOUR PHOTOS - ONE ROW */

.photo-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    justify-content: center;
    align-items: center;
    gap: 18px;
    width: 100%;
    max-width: 900px;
    margin: 0 auto 25px;
}

.photo-grid img {
    display: block;
    width: 100%;
    max-width: 200px;
    min-width: 0;
    justify-self: center;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    padding: 6px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 7px 18px rgba(100, 40, 65, 0.18);
    animation: memoryPhotoFloat 3s ease-in-out infinite;
}

.photo-grid img:nth-child(1) {
    transform: rotate(-4deg);
}

.photo-grid img:nth-child(2) {
    transform: rotate(4deg);
}

.photo-grid img:nth-child(3) {
    transform: rotate(-3deg);
}

.photo-grid img:nth-child(4) {
    transform: rotate(5deg);
}

.memory-gallery p {
    color: #87566b;
    font-size: 16px;
    margin: 22px 0;
}

#finalPageButton {
    padding: 13px 25px;
    border: none;
    border-radius: 25px;
    background: #b94d73;
    color: white;
    font-size: 16px;
    cursor: pointer;
    box-shadow: 0 5px 12px rgba(100, 40, 65, 0.15);
}

/* ANIMATIONS */

@keyframes giftFloat {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-9px);
    }
}

@keyframes memoryPhotoFloat {
    0%, 100% {
        translate: 0 0;
    }
    50% {
        translate: 0 -7px;
    }
}

/* SMALL SCREENS */

@media (max-width: 520px) {
    .gift-content {
        width: 100%;
        padding-left: 5px;
        padding-right: 5px;
    }

    .photo-grid {
        gap: 7px;
    }

    .photo-grid img {
        padding: 4px;
        border-radius: 8px;
    }

    .memory-gallery h2 {
        font-size: 24px;
    }
}

/* MUSIC BUTTON */

.music-button {
    position: fixed;
    z-index: 20;
    right: 18px;
    bottom: 18px;
    padding: 11px 18px;
    border-radius: 25px;
    color: white;
    background: rgba(120, 52, 79, 0.85);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

.music-button:hover {
    background: #78364f;
}


/* MOBILE RESPONSIVE */

@media (max-width: 600px) {

    .welcome-card,
    .birthday-card,
    .beach-content,
    .final-card {
        padding: 30px 20px;
    }

    .cake-content {
        padding: 18px 10px;
    }

    .cake-stage {
        transform: scale(0.88);
        transform-origin: top center;
        margin-bottom: -10px;
    }

    .photo-grid img {
        height: 145px;
    }

    .gift-content {
        padding: 20px 10px;
    }

    .final-card h1 {
        font-size: 27px;
    }
}


/* PAGE 3: LOOPING TYPEWRITER EFFECT */

#beachTitle {
    min-height: 1.3em;
}

#beachTitle.typing-cursor::after {
    content: "|";
    display: inline-block;
    margin-left: 4px;
    color: #fffaf5;
    animation: cursorBlink 0.7s steps(1) infinite;
}

@keyframes cursorBlink {
    50% {
        opacity: 0;
    }
}

/* PAGE 6 */
#page6Screen {
    min-height: 100vh;
    width: 100%;
    box-sizing: border-box;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 35px 18px;
    background:
    radial-gradient(circle at 15% 20%, #ffe0e9 0 9%, transparent 10%),
    radial-gradient(circle at 85% 80%, #f9c9d9 0 10%, transparent 11%),
    linear-gradient(135deg, #f9d7e2, #f5bccc, #f8dce5);
    text-align: center;
}

#page6Screen.active {
    display: flex;
}

#page6Screen .page6-content {
    width: 100%;
    max-width: 650px;
    margin: auto;
}

#page6Screen .page6-message {
    color: #873b5b;
    font-size: 21px;
    line-height: 1.8;
    margin-bottom: 25px;
}

#page6Screen .page6-photo {
    display: block;
    width: 50%;
    max-width: 220px;
    max-height: 260px;
    height: auto;
    object-fit: cover;
    border: none;
    border-radius: 16px;
    box-shadow: 0 8px 20px rgba(100, 35, 65, 0.22);
    margin: 12px auto 22px;
}
#page6Screen .page6-final {
    color: #963d61;
    font-size: 25px;
    font-weight: bold;
    line-height: 1.6;
    margin-top: 10px;
}

@media (max-width: 600px) {
    #page6Screen .page6-message {
        font-size: 18px;
    }

    #page6Screen .page6-final {
        font-size: 21px;
    }
}
/* PAGE 6 DECORATIONS */

#page6Screen .page6-content {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 600px;
    padding: 40px 35px;
    background: #704052;
    border: 2px solid #d9a6b8;
    border-radius: 4px;
    box-shadow: 8px 10px 25px rgba(65, 25, 42, 0.3);
}
#page6Screen::before {
    content: "♡";
    position: absolute;
    top: 8%;
    left: 10%;
    color: #b64d72;
    font-size: 55px;
    animation: page6Float 3s ease-in-out infinite;
}

#page6Screen::after {
    content: "✧";
    position: absolute;
    bottom: 9%;
    right: 12%;
    color: #a64d6e;
    font-size: 55px;
    animation: page6Float 3.5s ease-in-out infinite;
}

#page6Screen .page6-message {
    color:   #fff0f4;
    line-height: 1.9;
}

#page6Screen .page6-final {
    color:  #fff0f4;

}

@keyframes page6Float {
    0%, 100% {
        transform: translateY(0) rotate(-8deg);
    }
    50% {
        transform: translateY(-15px) rotate(8deg);
    }
}

/* PAGE 6 - FLOATING HEARTS AND HUGS */

#page6Screen .floating-love {
    position: absolute;
    top: -40px;
    z-index: 1;
    pointer-events: none;
    font-size: 25px;
    animation: loveFall linear forwards;
}

@keyframes loveFall {
    0% {
        transform: translateY(-30px) rotate(0deg);
        opacity: 0;
    }
    15% {
        opacity: 1;
    }
    100% {
        transform: translateY(110vh) rotate(35deg);
        opacity: 0;
    }
}
/* BACK BUTTON */

.back-button {
    position: absolute;
    top: 20px;
    left: 20px;
    padding: 10px 18px;
    background: #fff0f5;
    color: #873e5d;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    z-index: 100;
}