
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@500;600;700&family=Poppins:wght@300;400;500;600&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    background: linear-gradient(135deg, #ffe0ec, #f8c8dc, #fce4ec);
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: 'Poppins', sans-serif;
    color: #713c55;
    overflow-x: hidden;
    padding: 30px 15px;
}

.book {
    width: 100%;
    max-width: 650px;
    min-height: 550px;
    background: #fffafd;
    border-radius: 25px;
    box-shadow: 0 15px 45px rgba(120, 40, 75, 0.18);
    padding: 45px 35px 30px;
    position: relative;
    text-align: center;
    z-index: 2;
}

.page {
    display: none;
    min-height: 420px;
    animation: fadeIn 0.7s ease;
}

.page.active {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

h1, h2, h3 {
    font-family: 'Playfair Display', serif;
    color: #c0527d;
    margin-bottom: 20px;
}

h1 {
    font-size: clamp(2.2rem, 7vw, 3.5rem);
}

h2 {
    font-size: 2rem;
}

h3 {
    font-size: 1.5rem;
}

p {
    line-height: 1.9;
    margin: 10px 0;
    font-size: 1rem;
}

.small-text {
    letter-spacing: 2px;
    text-transform: uppercase;
    font-size: 0.75rem;
}

.subtitle {
    font-size: 1.2rem;
}

.big-heart {
    font-size: 75px;
    margin: 20px 0;
    animation: heartbeat 1.5s infinite;
}

.decoration {
    font-size: 35px;
    margin: 25px 0;
}

button {
    border: none;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    transition: 0.3s ease;
}

.next-btn,
#revealLetter,
#confettiButton,
#restartButton {
    background: #d86b96;
    color: white;
    padding: 12px 25px;
    border-radius: 30px;
    margin-top: 25px;
    font-size: 0.9rem;
}

button:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(180, 70, 115, 0.2);
}

.navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 25px;
    border-top: 1px solid #f3d7e3;
    padding-top: 20px;
}

#previousButton {
    background: #f6d9e5;
    color: #9e456b;
    padding: 10px 18px;
    border-radius: 20px;
}

#pageNumber {
    font-size: 0.85rem;
    color: #a86b83;
}

.music-button {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    color: #c0527d;
    padding: 10px 18px;
    border-radius: 25px;
    z-index: 10;
    box-shadow: 0 3px 12px rgba(0,0,0,0.1);
}

.wish-list {
    background: #fff0f5;
    padding: 20px;
    border-radius: 15px;
    width: 100%;
    margin-top: 15px;
}

.wish-list p {
    margin: 12px 0;
}

.highlight {
    color: #d05283;
    font-weight: 600;
}

.gallery {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 20px;
    width: 100%;
}

.gallery img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 15px;
    border: 3px solid #f5d3e0;
}

#photoUpload {
    max-width: 100%;
    margin-top: 15px;
    color: #a34d70;
}

.envelope {
    background: #fff0f5;
    padding: 30px;
    border-radius: 20px;
    margin: 20px 0;
    width: 100%;
}

.envelope-icon {
    font-size: 65px;
}

.secret-letter {
    background: #fff3f7;
    border: 1px solid #efc7d8;
    padding: 22px;
    margin-top: 20px;
    border-radius: 15px;
    text-align: left;
    white-space: pre-line;
}

.hidden {
    display: none;
}

.final-page {
    padding: 25px 0;
}

.final-page h1 {
    color: #d05283;
}

.hearts-container {
    position: fixed;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 1;
}

.heart {
    position: absolute;
    bottom: -30px;
    animation: floatUp 6s linear forwards;
    opacity: 0.7;
}

.confetti {
    position: fixed;
    top: -20px;
    z-index: 20;
    pointer-events: none;
    animation: fall 3s linear forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

@keyframes floatUp {
    to {
        transform: translateY(-110vh) rotate(360deg);
        opacity: 0;
    }
}

@keyframes fall {
    to {
        transform: translateY(110vh) rotate(720deg);
        opacity: 0;
    }
}

@media (max-width: 500px) {
    .book {
        padding: 35px 20px 25px;
        min-height: 520px;
    }

    h2 {
        font-size: 1.6rem;
    }

    p {
        font-size: 0.9rem;
    }

    .gallery img {
        height: 110px;
    }
}
