:root {
    --bg-color: #0d0c0c; --paper-color: #fff0f3; --text-primary: #5c3a45; --text-accent: #ff6b81; --cover-color: #ffb8c6; --cover-text: #fff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    font-family: 'Cormorant Garamond', serif;
    color: var(--text-primary);
    overflow: hidden;
    width: 100vw;
    height: 100vh;
}

#stars-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    transition: background-color 2s ease;
}

.star {
    position: absolute;
    background-color: white;
    border-radius: 50%;
    animation: twinkle infinite ease-in-out;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.2; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1.2); }
}

.bg-warm {
    background: radial-gradient(circle at center, #3d1c2a 0%, #0d0c0c 100%);
}

.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    z-index: 10;
}

.screen.active {
    opacity: 1;
    visibility: visible;
    z-index: 20;
}

.intro-container {
    text-align: center;
}

.welcome-text {
    font-family: 'Playfair Display', serif;
    font-size: 3.5rem;
    color: white;
    font-style: italic;
    text-shadow: 0px 5px 15px rgba(0,0,0,0.8);
    margin-bottom: 10px;
}

.intro-container .subtitle {
    font-size: 1.2rem;
    color: #e5b3bb;
    margin-bottom: 20px;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-weight: 600;
}

.gift-container {
    transition: transform 0.3s ease;
    cursor: pointer;
}

.gift-container:hover {
    transform: scale(1.05);
}

.front-cat-gif {
    width: 250px;
    height: auto;
}

.tap-hint {
    margin-top: 20px;
    color: rgba(255,255,255,0.7);
    font-style: italic;
    letter-spacing: 2px;
    animation: pulseHint 1.5s infinite;
}

@keyframes pulseHint {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

.sequence-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    text-align: center;
    position: relative;
}

.haaii-container {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2; }

.haaii-container.hidden {
    display: none;
}

.cat-cake {
    width: 150px; height: auto;
    margin-bottom: 20px;
}

.haaii-text {
    font-family: 'Dancing Script', cursive;
    font-size: 5rem;
    color: #ffb6c1;
    text-shadow: 0 0 10px #ff69b4, 0 0 20px #ff1493, 0 0 40px #ff1493;
    animation: floatHaaii 2s infinite ease-in-out;
}

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

.sequence-text {
    font-family: 'Playfair Display', serif;
    font-size: 6rem;
    font-weight: 900;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 8px;
    text-shadow: 0 0 20px rgba(255,255,255,0.5), 0 0 40px #ff69b4, 0 0 80px #ff1493;
    opacity: 0;
    transform: scale(0.5);
    position: absolute;
    z-index: 1;
}

.perspective-container {
    perspective: 2000px;
    transform-style: preserve-3d;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
}

.book-wrapper {
    position: relative;
    box-shadow: 0 40px 80px rgba(0,0,0,0.9);
    border-radius: 5px;
    transition: transform 0.1s ease-out;
}

#book {
    display: none; 
}

.page {
    background-color: var(--paper-color);
    background-image: linear-gradient(to right, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0) 5%, rgba(0,0,0,0) 95%, rgba(0,0,0,0.1) 100%);
    box-shadow: inset 0 0 30px rgba(255, 184, 198, 0.3); overflow: hidden;
}

.page-content {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 0; 
    position: relative;
}

.scrapbook-bg {
    background-image: url("https://www.transparenttextures.com/patterns/cream-paper.png");
    background-color: var(--paper-color);
}

.page-cover {
    background-color: var(--cover-color);
    background-image: url("https://www.transparenttextures.com/patterns/cream-paper.png"); 
    color: var(--cover-text);
}

.page-cover-top { border-radius: 5px 15px 15px 5px; }
.page-cover-bottom { border-radius: 15px 5px 5px 15px; }

.cover-border {
    border: 3px dashed rgba(255,255,255,0.6); height: calc(100% - 40px);
    margin: 20px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.cover-title {
    font-family: 'Playfair Display', serif;
    font-size: 4.5rem;
    font-weight: 600;
    font-style: italic;
    line-height: 1.1;
    margin-bottom: 10px;
    text-shadow: 2px 2px 5px rgba(255, 107, 129, 0.4);
    color: #fff;
}

.cover-subtitle {
    font-family: 'Shadows Into Light', cursive;
    font-size: 1.5rem;
    letter-spacing: 2px;
    border-top: 2px dotted rgba(255,255,255,0.6);
    border-bottom: 2px dotted rgba(255,255,255,0.6);
    padding: 10px 0;
}

.back-cover-style { justify-content: center; }
.back-text { font-family: 'Great Vibes', cursive; font-size: 2.5rem; color: #fff;}

.pattern-bg {
    background-color: var(--paper-color);
    background-image: url("https://www.transparenttextures.com/patterns/notebook.png");
}

.page-photo-text .page-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}

.photo-wrapper {
    width: 100%;
    height: 45%; padding: 20px 20px 5px 20px;
    position: relative;
}

.polaroid-frame {
    background: #fff;
    padding: 8px 8px 25px 8px; box-shadow: 0 4px 15px rgba(255, 107, 129, 0.2); position: relative;
    height: 100%;
    margin: 0 auto; z-index: 2;
    border-radius: 2px;
}

.frame-square { aspect-ratio: 1 / 1; width: auto; }
.frame-landscape { aspect-ratio: 4 / 3; width: auto; }
.frame-portrait { aspect-ratio: 3 / 4; width: auto; }

.book-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 1px;
}

.tilt-left { transform: rotate(-2deg); }
.tilt-right { transform: rotate(1.5deg); }

.washi-tape {
    position: absolute;
    width: 100px;
    height: 25px;
    background-color: rgba(255, 184, 198, 0.85); background-image: repeating-linear-gradient(45deg, transparent, transparent 5px, rgba(255,255,255,0.4) 5px, rgba(255,255,255,0.4) 10px);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    z-index: 3;
    opacity: 0.9;
}

.tape-top { top: -10px; left: 50%; transform: translateX(-50%) rotate(-2deg); }
.tape-bottom { bottom: 10px; right: -20px; transform: rotate(-15deg); }

.emoji-sticker {
    position: absolute;
    font-size: 35px;
    z-index: 5;
    animation: floatEmoji 3s ease-in-out infinite;
    text-shadow: 0 4px 10px rgba(255, 107, 129, 0.4);
}

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

.sticker-heart { bottom: -5px; right: 15px; animation-delay: 0s; }
.sticker-star { top: 15px; left: 15px; animation-delay: 1s; }

.text-wrapper {
    height: 55%; padding: 15px 25px 20px 25px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start; align-items: center;
}

.handwritten {
    font-family: 'Caveat', cursive;
    font-size: 1.55rem; line-height: 1.3;
    color: var(--text-primary);
    text-align: center;
    font-weight: 600;
}

.sign-text { font-family: 'Great Vibes', cursive; font-size: 2.2rem; color: var(--text-accent); }

.center-content { align-items: center; justify-content: center; text-align: center; padding: 30px;}

.chapter-title {
    font-family: 'Playfair Display', serif;
    font-size: 2.8rem;
    font-style: italic;
    color: var(--text-accent);
}

.divider {
    width: 60px;
    height: 2px;
    background-color: var(--text-accent);
    margin: 20px auto;
}
.date-text { color: var(--text-primary); font-style: italic; }

.pantun-card {
    background: transparent;
    padding: 10px;
    text-align: center;
}
.pantun-text { font-family: 'Shadows Into Light', cursive; font-size: 1.6rem; font-weight: bold; line-height: 1.6; margin-top: 15px; color: var(--text-primary); }

/* ========================================= */
/* MOBILE FRIENDLY RESPONSIVENESS            */
/* ========================================= */
@media (max-width: 768px) {
    /* Screen 1 */
    .welcome-text { font-size: 2.5rem; }
    .subtitle { font-size: 0.9rem; }
    .gift-container svg { width: 160px; height: 160px; }
    
    /* Screen 2 */
    .sequence-text { font-size: 3rem; letter-spacing: 4px; }
    .haaii-text { font-size: 3rem; }
    .cat-cake { width: 100px; }

    /* Screen 3 (Book) */
    .cover-title { font-size: 3.5rem; }
    .chapter-title { font-size: 2.2rem; }
    .sign-text { font-size: 1.8rem; }
    
    /* Optimize Scrapbook Layout for Mobile */
    .photo-wrapper { 
        padding: 15px 15px 0 15px; 
    }
    .polaroid-frame {
        padding: 8px 8px 20px 8px; /* Slightly thinner frame for mobile */
    }
    .text-wrapper { 
        padding: 10px 15px 15px 15px; 
    }
    .handwritten { 
        font-size: 1.25rem; /* Still highly legible in Caveat */
        line-height: 1.25;
    }
    
    /* Stickers smaller */
    .emoji-sticker { font-size: 28px; }
    .sticker-star { top: 10px; left: 10px; }
    .sticker-heart { bottom: 0px; right: 10px; }
}
