/* ================================= */
/* BASIC RESET */
/* ================================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Arial, Helvetica, sans-serif;
}


/* ================================= */
/* COMMON PAGE */
/* ================================= */

body {
    overflow: hidden;
}

.page {
    width: 100vw;
    height: 100vh;
    position: relative;
    overflow: hidden;
}


/* ================================= */
/* PAGE 1 - HOME */
/* ================================= */

.home-page {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    background: radial-gradient(circle at center, #9d4edd 0%, #6a1b9a 30%, #240046 65%, #10002b 100%);
}


/* ================================= */
/* HOME GLOW */
/* ================================= */

.home-page::before {
    content: "";
    position: absolute;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: #c77dff;
    filter: blur(150px);
    opacity: .25;
}


/* ================================= */
/* HOME CONTENT */
/* ================================= */

.home-content {
    position: relative;
    z-index: 2;
    max-width: 700px;
    padding: 20px;
}

.home-content h1 {
    color: white;
    font-size: clamp(50px, 8vw, 100px);
    letter-spacing: 3px;
    text-shadow: 0 0 10px white, 0 0 30px #c77dff, 0 0 60px #9d4edd;
}

.home-content h2 {
    color: #e9d5ff;
    font-size: 35px;
    margin-top: 20px;
}

.home-content p {
    color: #f3e8ff;
    font-size: 20px;
    margin-top: 20px;
}

.sparkle {
    color: white;
    font-size: 50px;
    animation: sparkle 2s infinite;
}

@keyframes sparkle {
    0% { transform: scale(.8); opacity: .5; }
    50% { transform: scale(1.3); opacity: 1; }
    100% { transform: scale(.8); opacity: .5; }
}


/* ================================= */
/* STARS PAGE 1 */
/* ================================= */

.stars::before,
.stars::after {
    content: "✦  ·  ✧  ·  ★  ·  ✦  ·  ✧";
    position: absolute;
    width: 100%;
    color: white;
    font-size: 25px;
    letter-spacing: 30px;
    opacity: .6;
    animation: moveStars 15s linear infinite;
}

.stars::before {
    top: 15%;
}

.stars::after {
    top: 70%;
    animation-delay: 5s;
}

@keyframes moveStars {
    from { transform: translateX(-20%); }
    to { transform: translateX(20%); }
}


/* ================================= */
/* PAGE 1 - HOME BUTTONS */
/* ================================= */

#startBtn {
    position: absolute;
    bottom: 40px;
    right: 50%;
    transform: translateX(50%);
    padding: 14px 30px;
    border: none;
    border-radius: 40px;
    font-size: 18px;
    cursor: pointer;
    transition: .3s;
    background: white;
    color: #6a1b9a;
    box-shadow: 0 0 15px white, 0 0 30px #c77dff;
    z-index: 20;
}

#startBtn:hover {
    transform: translateX(50%) scale(1.08);
}


/* ================================= */
/* PAGE 2 - NIGHT SKY */
/* ================================= */

.letter-page {
    background: linear-gradient(180deg, #020024, #090979, #2c1654, #10002b);
}


/* ================================= */
/* MOON */
/* ================================= */

.moon {
    position: absolute;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: #fff7d6;
    top: 12%;
    right: 12%;
    box-shadow: 0 0 20px #fff7d6, 0 0 60px rgba(255,247,214,.6), 0 0 120px rgba(255,247,214,.3);
}

.moon::after {
    content: "";
    position: absolute;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: linear-gradient(180deg, #020024, #090979);
    left: -35px;
    top: -15px;
}


/* ================================= */
/* NIGHT STARS */
/* ================================= */

.sky-stars span {
    position: absolute;
    color: white;
    font-size: 20px;
    animation: twinkle 2s infinite alternate;
}

.sky-stars span:nth-child(1) { top: 15%; left: 10%; }
.sky-stars span:nth-child(2) { top: 25%; left: 25%; }
.sky-stars span:nth-child(3) { top: 12%; left: 45%; }
.sky-stars span:nth-child(4) { top: 35%; left: 60%; }
.sky-stars span:nth-child(5) { top: 20%; left: 75%; }
.sky-stars span:nth-child(6) { top: 50%; left: 15%; }
.sky-stars span:nth-child(7) { top: 60%; left: 30%; }
.sky-stars span:nth-child(8) { top: 45%; left: 80%; }
.sky-stars span:nth-child(9) { top: 70%; left: 10%; }
.sky-stars span:nth-child(10) { top: 75%; left: 45%; }
.sky-stars span:nth-child(11) { top: 65%; left: 70%; }
.sky-stars span:nth-child(12) { top: 40%; left: 90%; }

@keyframes twinkle {
    from { opacity: .2; transform: scale(.8); }
    to { opacity: 1; transform: scale(1.3); }
}


/* ================================= */
/* LETTER CONTENT */
/* ================================= */

.letter-content {
    position: relative;
    z-index: 5;
    width: 70%;
    max-width: 900px;
    margin: auto;
    padding-top: 15vh;
}

.letter-content h1 {
    color: white;
    font-size: 40px;
    margin-bottom: 30px;
    text-shadow: 0 0 10px #c77dff, 0 0 25px #9d4edd;
}

#letterText {
    color: #f8edff;
    font-size: 20px;
    line-height: 2;
    white-space: pre-line;
}



/* ================================= */
/* PAGE 2 - LETTER BUTTONS */
/* ================================= */

#backHome {
    position: absolute;
    left: 40px;
    bottom: 40px;
    padding: 14px 30px;
    border: 1px solid rgba(255,255,255,.4);
    border-radius: 40px;
    font-size: 18px;
    cursor: pointer;
    transition: .3s;
    background: rgba(255,255,255,.15);
    color: white;
    z-index: 20;
}

#backHome:hover {
    transform: scale(1.08);
}

#letterNext {
    position: absolute;
    right: 40px;
    bottom: 40px;
    padding: 14px 30px;
    border: none;
    border-radius: 40px;
    font-size: 18px;
    cursor: pointer;
    transition: .3s;
    background: white;
    color: #6a1b9a;
    box-shadow: 0 0 15px white, 0 0 30px #c77dff;
    z-index: 20;
}

#letterNext:hover {
    transform: scale(1.08);
}


/* ================================= */
/* HIDDEN */
/* ================================= */

.hidden {
    display: none !important;
}


/* ================================= */
/* PAGE 3 - MEMORIES */
/* ================================= */

.memories-page {
    background: linear-gradient(180deg, #8ed6ff 0%, #bde9ff 45%, #e9d5ff 100%);
}


/* ================================= */
/* DORAEMON STYLE BACKGROUND */
/* ================================= */

.doraemon-bg {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    overflow: hidden;
    pointer-events: none;
}

.doraemon-cloud {
    position: absolute;
    font-size: 70px;
    opacity: .65;
    animation: cloudMove 18s linear infinite;
}

.cloud1 { top: 12%; left: -100px; }
.cloud2 { top: 40%; left: 40%; animation-delay: 5s; }
.cloud3 { top: 70%; left: 75%; animation-delay: 9s; }

@keyframes cloudMove {
    from { transform: translateX(-100px); }
    to { transform: translateX(120vw); }
}

.doraemon-stars {
    position: absolute;
    width: 100%;
    top: 8%;
    text-align: center;
    font-size: 25px;
    letter-spacing: 25px;
    animation: starGlow 2s infinite alternate;
}

@keyframes starGlow {
    from { opacity: .4; transform: scale(.95); }
    to { opacity: 1; transform: scale(1.05); }
}


/* ================================= */
/* MEMORY CONTENT */
/* ================================= */

.memory-content {
    position: relative;
    z-index: 5;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}


/* ================================= */
/* TITLE */
/* ================================= */

.memory-title {
    text-align: center;
    margin-bottom: 20px;
}

.memory-title span {
    font-size: 45px;
}

.memory-title h1 {
    color: white;
    font-size: 25px;
    margin-top: 5px;
    text-shadow: 0 0 10px #6a1b9a, 0 0 25px #9d4edd;
}

#memoryNumber {
    color: #5b2c87;
    font-size: 18px;
    font-weight: bold;
    margin-top: 8px;
}


/* ================================= */
/* PHOTO */
/* ================================= */

.photo-container {
    width: min(600px, 80vw);
    height: min(430px, 55vh);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 12px;
    background: rgba(255,255,255,.5);
    border-radius: 25px;
    box-shadow: 0 15px 40px rgba(0,0,0,.25), 0 0 30px rgba(255,255,255,.5);
    backdrop-filter: blur(8px);
}

#memoryPhoto {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 18px;
    transition: opacity .4s ease, transform .4s ease;
}


/* ================================= */
/* MEMORY BUTTON */
/* ================================= */

.memory-button {
    margin-top: 25px;
    padding: 15px 35px;
    border: none;
    border-radius: 50px;
    background: white;
    color: #7b2cbf;
    font-size: 19px;
    cursor: pointer;
    box-shadow: 0 5px 20px rgba(0,0,0,.2), 0 0 20px rgba(255,255,255,.8);
    transition: .3s;
}

.memory-button:hover {
    transform: scale(1.08);
    box-shadow: 0 0 30px white, 0 0 50px #c77dff;
}


/* ================================= */
/* PAGE 3 - MEMORIES BUTTONS */
/* ================================= */

#backToLetter {
    position: absolute;
    bottom: 40px;
    left: 40px;
    padding: 14px 30px;
    border: 1px solid rgba(255,255,255,.7);
    border-radius: 40px;
    background: rgba(255,255,255,.2);
    color: #5b2c87;
    font-size: 18px;
    cursor: pointer;
    transition: .3s;
    z-index: 20;
}

#backToLetter:hover {
    transform: scale(1.05);
}

#goToGallery {
    position: absolute;
    bottom: 40px;
    right: 40px;
    padding: 14px 30px;
    border: none;
    border-radius: 40px;
    font-size: 18px;
    cursor: pointer;
    transition: .3s;
    background: white;
    color: #6a1b9a;
    box-shadow: 0 0 15px white, 0 0 30px #c77dff;
    z-index: 20;
}

#goToGallery:hover {
    transform: scale(1.08);
}


/* ================================= */
/* DORAEMON STICKER */
/* ================================= */

.doraemon-sticker {
    position: absolute;
    left: 5%;
    top: 55%;
    transform: translateY(-50%);
    width: 300px;
    z-index: 10;
    pointer-events: none;
}

.doraemon-sticker img {
    width: 100%;
    height: auto;
    display: block;
    filter: drop-shadow(0 15px 15px rgba(0, 0, 0, 0.15));
    animation: doraemonFloat 3s ease-in-out infinite;
}

@keyframes doraemonFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}


/* ================================= */
/* PAGE 4 - PHOTO GALLERY */
/* ================================= */

.gallery-page {
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    background: radial-gradient(circle at 20% 20%, rgba(255, 182, 193, .45), transparent 35%),
                radial-gradient(circle at 80% 80%, rgba(196, 145, 255, .45), transparent 35%),
                linear-gradient(135deg, #f8dfff 0%, #ead7ff 45%, #ffd9eb 100%);
}


/* ================================= */
/* DECORATIONS */
/* ================================= */

.gallery-background {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.gallery-background span {
    position: absolute;
    font-size: 28px;
    opacity: .55;
    animation: galleryFloat 4s ease-in-out infinite;
}

.gallery-background span:nth-child(1) { top: 12%; left: 8%; }
.gallery-background span:nth-child(2) { top: 15%; right: 10%; }
.gallery-background span:nth-child(3) { top: 45%; left: 3%; }
.gallery-background span:nth-child(4) { top: 50%; right: 4%; }
.gallery-background span:nth-child(5) { bottom: 10%; left: 12%; }
.gallery-background span:nth-child(6) { bottom: 12%; right: 15%; }

@keyframes galleryFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}


/* ================================= */
/* MAIN CONTENT */
/* ================================= */

.gallery-content {
    position: relative;
    z-index: 5;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 25px 40px 25px;
}


/* ================================= */
/* TITLE */
/* ================================= */

.gallery-title {
    flex-shrink: 0;
    text-align: center;
    margin-bottom: 12px;
}

.gallery-heart {
    font-size: 27px;
    animation: heartBeat 1.5s infinite;
}

.gallery-title h1 {
    margin: 0;
    color: #7136a5;
    font-size: clamp(28px, 3vw, 40px);
    text-shadow: 0 3px 10px rgba(255,255,255,.9);
}

.gallery-title p {
    margin: 3px 0 0;
    color: #8d548f;
    font-size: 15px;
}

@keyframes heartBeat {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}


/* ================================= */
/* 12 PHOTO GRID */
/* ================================= */

.photo-grid {
    width: min(1150px, 92vw);
    height: calc(100vh - 245px);
    min-height: 0;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-template-rows: repeat(3, minmax(0, 1fr));
    gap: 12px;
    flex-shrink: 1;
}


/* ================================= */
/* PHOTO CARD */
/* ================================= */

.gallery-photo {
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    padding: 5px;
    border-radius: 15px;
    background: rgba(255,255,255,.65);
    box-shadow: 0 7px 18px rgba(120,70,150,.18), 0 0 12px rgba(255,255,255,.7);
    backdrop-filter: blur(5px);
    transition: transform .3s ease, box-shadow .3s ease;
}

.gallery-photo img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    border-radius: 10px;
    transition: transform .4s ease;
}

.gallery-photo:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 12px 25px rgba(120,70,150,.3), 0 0 20px rgba(255,255,255,.9);
    z-index: 10;
}

.gallery-photo:hover img {
    transform: scale(1.06);
}


/* ================================= */
/* PAGE 4 - GALLERY BUTTONS */
/* ================================= */

#backToMemories {
    position: absolute;
    left: 40px;
    bottom: 40px;
    padding: 14px 30px;
    border: 1px solid rgba(255,255,255,.8);
    border-radius: 40px;
    background: rgba(255,255,255,.45);
    color: #7136a5;
    font-size: 18px;
    cursor: pointer;
    backdrop-filter: blur(8px);
    transition: .3s;
    z-index: 20;
}

#backToMemories:hover {
    transform: scale(1.08);
    background: white;
}

#goToPhoto {
    position: absolute;
    right: 40px;
    bottom: 40px;
    padding: 14px 30px;
    border: none;
    border-radius: 40px;
    font-size: 18px;
    cursor: pointer;
    transition: .3s;
    background: white;
    color: #6a1b9a;
    box-shadow: 0 0 15px white, 0 0 30px #c77dff;
    z-index: 20;
}

#goToPhoto:hover {
    transform: scale(1.08);
}


/* ================================= */
/* MUSIC BUTTON */
/* ================================= */

.music-button {
    position: fixed;
    top: 25px;
    right: 25px;
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, .75);
    color: #7136a5;
    font-size: 21px;
    cursor: pointer;
    z-index: 100;
    box-shadow: 0 5px 15px rgba(100, 50, 130, .2), 0 0 15px rgba(255, 255, 255, .8);
    backdrop-filter: blur(8px);
    transition: .3s;
}

.music-button:hover {
    transform: scale(1.12);
    background: white;
}


/* ================================= */
/* PAGE 5 - FULL SCREEN PHOTO */
/* ================================= */

.photo-page {
    width: 100vw;
    height: 100vh;
    background: rgb(216, 181, 222);
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.photo-frame {
    width: 92vw;
    height: 92vh;
    max-width: 1200px;
    max-height: 900px;
    border: 15px solid #fffefe;
    border-radius: 8px;
    box-shadow: 0 0 50px rgba(204, 0, 0, 0.15), inset 0 0 50px rgba(204, 0, 0, 0.05);
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    background: white;
    position: relative;
}

.photo-frame img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.photo-page::before {
    content: "";
    position: absolute;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(204, 0, 0, 0.03) 0%, transparent 70%);
    pointer-events: none;
}


/* ================================= */
/* PAGE 5 - PHOTO BUTTONS */
/* ================================= */

#backFromPhoto {
    position: absolute;
    left: 40px;
    bottom: 40px;
    padding: 14px 30px;
    border: 2px solid rgba(255, 255, 255, 0.8);
    border-radius: 40px;
    background: rgba(255, 255, 255, 0.25);
    color: white;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 20;
    font-weight: bold;
    backdrop-filter: blur(5px);
}

#backFromPhoto:hover {
    background: rgba(255, 255, 255, 0.5);
    color: #6a1b9a;
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.3);
}

#photoNext {
    position: absolute;
    right: 40px;
    bottom: 40px;
    padding: 14px 30px;
    border: none;
    border-radius: 40px;
    background: white;
    color: #6a1b9a;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 20;
    font-weight: bold;
    box-shadow: 0 5px 20px rgba(106, 27, 154, 0.3);
}

#photoNext:hover {
    background: #da8ed2;
    color: white;
    transform: scale(1.05);
    box-shadow: 0 0 40px rgba(198, 108, 231, 0.5);
}


/* ================================= */
/* PAGE 6 - CAKE */
/* ================================= */

.cake-page {
    background: linear-gradient(180deg, #b47aeb 0%, #d66bb8 50%, #8464e7 100%);
    display: flex;
    justify-content: center;
    align-items: center;
}

.cake-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    text-align: center;
}

.cake {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px; /* Space between the tiers */
}

/* 3 Tier "Pill" shapes matching your second image */
.cake .tier-top {
    width: 120px;
    height: 60px;
    border-radius: 30px;
    background: #fecfef; /* Soft pink from first image */
    box-shadow: 0 5px 20px rgba(255, 154, 158, 0.2);
}

.cake .tier-middle {
    width: 180px;
    height: 60px;
    border-radius: 30px;
    background: #ffd1ff; /* Soft pink from first image */
    box-shadow: 0 5px 20px rgba(255, 154, 158, 0.2);
}

.cake .tier-bottom {
    width: 240px;
    height: 60px;
    border-radius: 30px;
    background: #fbc2eb; /* Soft pink from first image */
    box-shadow: 0 5px 20px rgba(255, 154, 158, 0.2);
}

/* Candles */
.cake-candles {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: -14px; /* Pulls candles down to sit on top of the first tier */
    z-index: 2;
}

.candle {
    font-size: 35px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.candle[data-lit="true"] {
    filter: drop-shadow(0 0 15px #ffd700);
    animation: flicker 0.5s infinite alternate;
}

.candle[data-lit="false"] {
    opacity: 0.3;
    filter: none;
    animation: none;
}

.candle:hover {
    transform: scale(1.2);
}

@keyframes flicker {
    0% { transform: scale(1) rotate(-2deg); }
    100% { transform: scale(1.05) rotate(2deg); }
}

.cake-message {
    color: white;
    font-size: 28px;
    margin-top: 30px;
    text-shadow: 0 0 20px #c77dff;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}


/* ================================= */
/* PAGE 6 - CAKE BUTTONS */
/* ================================= */

#backToGallery {
    position: absolute;
    left: 40px;
    bottom: 40px;
    padding: 14px 30px;
    border: 1px solid rgba(255,255,255,0.5);
    border-radius: 40px;
    background: rgba(255,255,255,0.15);
    color: white;
    font-size: 18px;
    cursor: pointer;
    transition: .3s;
    z-index: 20;
}

#backToGallery:hover {
    transform: scale(1.08);
    background: rgba(255,255,255,0.3);
}


/* ================================= */
/* MOBILE RESPONSIVE */
/* ================================= */

@media(max-width: 768px) {
    .photo-frame {
        width: 90vw;
        height: 85vh;
        border-width: 10px;
    }
    
    #backFromPhoto,
    #photoNext {
        padding: 12px 24px;
        font-size: 16px;
        bottom: 25px;
    }
    
    #backFromPhoto { left: 20px; }
    #photoNext { right: 20px; }
}

@media(max-width: 600px) {
    .home-content h1 { font-size: 50px; }
    .home-content h2 { font-size: 26px; }
    
    .letter-content {
        width: 85%;
        padding-top: 20vh;
    }
    .letter-content h1 { font-size: 28px; }
    #letterText { font-size: 17px; line-height: 1.7; }
    
    .moon {
        width: 110px;
        height: 110px;
        right: 5%;
    }
    .moon::after {
        width: 110px;
        height: 110px;
    }
    
    .memory-title h1 { font-size: 32px; }
    .memory-title span { font-size: 35px; }
    .photo-container {
        width: 88vw;
        height: 50vh;
    }
    .memory-button {
        font-size: 17px;
        padding: 13px 25px;
    }
}

@media(max-width: 700px) {
    .gallery-content {
        padding: 18px 12px 20px;
    }
    .gallery-title {
        margin-bottom: 8px;
    }
    .gallery-title h1 {
        font-size: 25px;
    }
    .gallery-title p {
        font-size: 12px;
    }
    .gallery-heart {
        font-size: 22px;
    }
    .photo-grid {
        width: 94vw;
        height: calc(100vh - 190px);
        grid-template-columns: repeat(3, minmax(0, 1fr));
        grid-template-rows: repeat(4, minmax(0, 1fr));
        gap: 8px;
    }
    .gallery-photo {
        padding: 3px;
        border-radius: 9px;
    }
    .gallery-photo img {
        border-radius: 6px;
    }
    #backToMemories,
    #goToPhoto {
        padding: 12px 20px;
        font-size: 16px;
        bottom: 25px;
    }
    #backToMemories { left: 20px; }
    #goToPhoto { right: 20px; }
}

@media(max-width: 480px) {
    .photo-frame {
        width: 92vw;
        height: 80vh;
        border-width: 8px;
    }
    
    #backFromPhoto,
    #photoNext {
        padding: 10px 18px;
        font-size: 14px;
        bottom: 20px;
    }
    
    #backFromPhoto { left: 15px; }
    #photoNext { right: 15px; }
}