:root {
    --bg-gradient: linear-gradient(135deg, #fff5f7 0%, #fde2e4 100%);
    --primary-pink: #ff85a2;
    --accent-pink: #fbb6ce;
    --text-brown: #5d4037;
    --card-bg: rgba(255, 255, 255, 0.9);
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    outline: none;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Quicksand', sans-serif;
    background: var(--bg-gradient);
    background-attachment: fixed;
    color: var(--text-brown);
    min-height: 100vh;
    overflow-x: hidden;
}

/* --- ANIMATION & LAYOUT WRAPPER --- */
.page {
    display: none;
    min-height: 100vh;
    width: 100%;
    /* Flex is needed to center the content-wrap */
    flex-direction: column;
    align-items: center; 
    padding: 20px;
    position: relative;
}

.page.active {
    display: flex;
}

/* This wrapper handles the FADE UP effect */
.content-wrap {
    opacity: 0;
    transform: translateY(30px);
    width: 100%;
    max-width: 800px; /* Keeps things from getting too wide on PC */
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: auto; /* Centers perfectly */
}

.page.active .content-wrap {
    animation: fadeUp 0.8s ease-out forwards;
}

@keyframes fadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- PAGE 1: BUTTON GRID FIX --- */
.btn-container {
    display: grid; 
    /* This creates two equal columns. If "No" leaves column 2, 
       "Yes" stays locked in column 1. No jumping! */
    grid-template-columns: 1fr 1fr; 
    column-gap: 10px;
    justify-items: center;
    align-items: center;
    width: 100%;
    max-width: 320px;
    height: 100px;
    margin-top: 20px;
}

.btn {
    background: linear-gradient(45deg, #ff9a9e 0%, #fecfef 99%, #fecfef 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(255, 133, 162, 0.4);
    font-family: 'Quicksand', sans-serif;
    transition: transform 0.2s;
    white-space: nowrap; /* Prevents text breaking */
}

.btn:hover {
    transform: scale(1.05);
}

#noBtn {
    background: white;
    color: var(--primary-pink);
    border: 2px solid var(--primary-pink);
    z-index: 100; /* Ensure it stays above when moving */
    transition: left 0.25s ease, top 0.25s ease, transform 0.2s;
}

/* --- PAGE 2: NOTEBOOK STYLE --- */
.story-box {
    background-color: #fff;
    /* Notebook lines */
    background-image: linear-gradient(#e1e1e1 1px, transparent 1px);
    background-size: 100% 30px; 
    
    /* Red margin line */
    border-left: 3px solid #ff85a2; 
    
    padding: 30px;
    line-height: 30px; /* Matches background-size so text sits on lines */
    
    box-shadow: 5px 5px 15px rgba(0,0,0,0.1);
    border-radius: 5px;
    width: 90%;
    max-width: 500px;
    margin: 20px auto;
    position: relative;
    font-family: 'Quicksand', cursive; 
    color: var(--text-brown);
    text-align: left; /* Reads better left-aligned */
}

.story-box::before { content: "🌸"; position: absolute; top: -15px; right: -10px; font-size: 30px; }
.story-box::after { content: "🌺"; position: absolute; bottom: -15px; left: -10px; font-size: 30px; }

/* --- PAGE 4: BURST EFFECT --- */
.burst-item {
    position: fixed;
    pointer-events: none;
    font-size: 24px;
    animation: burst-fly 1s ease-out forwards;
    z-index: 9999;
}

@keyframes burst-fly {
    0% { transform: translate(-50%, -50%) scale(0.5); opacity: 1; }
    100% { transform: translate(var(--tx), var(--ty)) scale(1.5); opacity: 0; }
}

/* --- GLOBAL STYLES (Keep existing) --- */
h1 {
    font-family: 'Pacifico', cursive;
    color: var(--primary-pink);
    font-size: 2.5rem;
    text-shadow: 2px 2px white;
    text-align: center;
}

.cute-cat {
    width: clamp(200px, 50vw, 300px);
    border-radius: 20px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

/* Gallery & Cards (Simplified from your code) */
.gallery-grid {
    display: flex;
    flex-direction: column;
    gap: 18px;
    width: 100%;
    align-items: center;
}
.photo-card {
    background: white;
    padding: 12px;
    border-radius: 16px;
    box-shadow: 0 8px 18px rgba(0,0,0,0.08);
    width: 100%;
    max-width: 520px;
}
.photo-card img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 12px;
}
.gallery-grid + .btn {
    margin-top: 28px;
}
.card-wrap {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}
.flip-card {
    width: 140px;
    height: 180px;
    perspective: 1000px;
    cursor: pointer;
}
.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    justify-content: center;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}
.flip-card.flipped .flip-card-inner { transform: rotateY(180deg); }
.card-front, .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
.card-front { background: white; font-size: 2.5rem; border: 2px dashed var(--accent-pink); }
.card-back { background: var(--primary-pink); color: white; transform: rotateY(180deg); font-weight: bold; font-size: 0.9rem; text-align: center; }
.card-back p {
    text-align: center;
    margin: 0;
}

/* Decor */
.decoration, .decoration-right {
    position: fixed;
    width: 100px;
    z-index: 50;
    pointer-events: none;
    animation: float 4s ease-in-out infinite;
}
.decoration { bottom: 10px; left: 10px; }
.decoration-right { top: 10px; right: 10px; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

/* Modals & Scroll Lock */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(3px);
    padding: 20px;
    justify-content: center;
    align-items: center;
}
.modal-content {
    display: block;
    max-width: min(90vw, 720px);
    max-height: 70vh;
    width: auto;
    height: auto;
    border-radius: 14px;
    box-shadow: 0 12px 30px rgba(0,0,0,0.4);
}
#captionText {
    margin-top: 14px;
    color: white;
    text-align: center;
    font-size: 1.05rem;
    font-weight: 700;
    font-family: 'Quicksand', sans-serif;
    letter-spacing: 0.3px;
    max-width: min(90vw, 720px);
}
.close-modal {
    position: fixed;
    right: 16px;
    top: 16px;
    color: white;
    font-size: 34px;
    cursor: pointer;
    line-height: 1;
    background: rgba(0,0,0,0.45);
    border-radius: 999px;
    padding: 6px 12px;
    z-index: 2100;
}

/* Page 1 Scroll Lock */
#page1 { overflow: hidden; height: 100vh; position: fixed; top: 0; left: 0; }
/* Unlock others */
#page2, #page3, #page4 { overflow-y: auto; -webkit-overflow-scrolling: touch; }

.date-text {
    font-size: 0.9rem;
    color: var(--text-brown);
    margin-top: 4px;
    font-style: italic;
}