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

html, body { height: 100%; }

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #ff69b4 0%, #ffb6d9 50%, #ffc0cb 100%);
    min-height: 100vh;
    overflow: hidden;
    color: #333;
    position: relative;
}

/* Floating Hearts Background */
.hearts-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.heart {
    position: absolute;
    font-size: 2rem;
    opacity: 0.1;
    animation: float-up 20s infinite linear;
    color: #ff1493;
}

.heart:nth-child(1) { left: 5%; animation-delay: 0s; }
.heart:nth-child(2) { left: 15%; animation-delay: 2s; }
.heart:nth-child(3) { left: 25%; animation-delay: 4s; }
.heart:nth-child(4) { left: 35%; animation-delay: 1s; }
.heart:nth-child(5) { left: 50%; animation-delay: 3s; }
.heart:nth-child(6) { left: 65%; animation-delay: 5s; }
.heart:nth-child(7) { left: 75%; animation-delay: 2.5s; }
.heart:nth-child(8) { left: 85%; animation-delay: 4.5s; }
.heart:nth-child(9) { left: 95%; animation-delay: 1.5s; }
.heart:nth-child(10) { left: 45%; animation-delay: 3.5s; }

@keyframes float-up {
    from {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0.1;
    }
    to {
        transform: translateY(-100vh) rotate(360deg);
        opacity: 0;
    }
}

/* Main Content Container */
.content-wrapper {
    position: relative;
    z-index: 10;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

/* Page Display */
.page {
    display: none;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
    width: 100%;
    max-width: 900px;
    box-sizing: border-box;
}

.page.active {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: calc(100vh - 40px);
    opacity: 1;
    transform: translateY(0);
}

/* Home Page */
#home {
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 30px;
}

#home h1 {
    font-size: 4rem;
    color: #fff;
    text-shadow: 3px 3px 8px rgba(0, 0, 0, 0.2);
    margin-bottom: 20px;
    animation: gentle-bounce 2s ease-in-out infinite;
}

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

#home p {
    font-size: 1.3rem;
    color: #fff;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1);
    max-width: 500px;
    line-height: 1.6;
}

/* Message Sections */
.section {
    background: rgba(255, 255, 255, 0.98);
    border-radius: 25px;
    padding: 50px 40px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.2);
    text-align: center;
    min-height: 400px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.section h2 {
    font-size: 2rem;
    color: #ff1493;
    margin-bottom: 30px;
}

.section p {
    font-size: 1.15rem;
    line-height: 1.8;
    color: #333;
    margin: 15px auto;
    max-width: 700px;
    text-align: left;
}

.section strong {
    color: #ff1493;
    font-weight: 600;
}

.section ul {
    text-align: left;
    margin: 20px auto;
    padding-left: 30px;
    max-width: 700px;
}

.section li {
    font-size: 1.1rem;
    color: #333;
    margin: 15px 0;
    list-style: none;
    position: relative;
    padding-left: 30px;
}

.section li:before {
    content: "•";
    position: absolute;
    left: 0;
}

/* Gallery for memories (5 slots) */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
    margin-top: 24px;
    justify-items: center;
    align-items: start;
}
/* Photo slot: responsive, keeps aspect ratio */
.photo {
    width: 100%;
    max-width: 160px;
    aspect-ratio: 4 / 3;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(255,182,193,0.2), rgba(255,105,180,0.05));
    border: 2px dashed rgba(255,105,180,0.25);
    box-shadow: 0 6px 18px rgba(0,0,0,0.08);
    overflow: hidden;
    display: block;
}
/* Images should cover the slot */
.gallery img.photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Final Celebration Page */
#celebration {
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 40px;
}

#celebration h1 {
    font-size: 5rem;
    color: #fff;
    text-shadow: 4px 4px 10px rgba(0, 0, 0, 0.3);
    animation: celebration-bounce 0.8s ease-out;
    letter-spacing: 3px;
    font-weight: bold;
}

@keyframes celebration-bounce {
    0% {
        opacity: 0;
        transform: scale(0.5) translateY(-50px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Removed old celebration-scoped confetti rules to avoid conflicts.
   Confetti pieces are styled using the global #confetti-container and .confetti rules further below. */

#celebration .hearts-burst {
    font-size: 3rem;
    animation: burst-out 2s ease-out;
}

@keyframes burst-out {
    0% {
        opacity: 1;
        transform: scale(0);
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: scale(1);
    }
}

/* Celebration text letter animation */
#celebration-text {
    font-size: 4rem;
    color: #fff;
    text-shadow: 4px 4px 12px rgba(0,0,0,0.35);
    letter-spacing: 2px;
    font-weight: 800;
}
.birthday-letter {
    display: inline-block;
    transform: translateY(20px) scale(0.8);
    opacity: 0;
    animation: letter-in 0.45s cubic-bezier(.2,.8,.2,1) forwards;
}
@keyframes letter-in {
    to { transform: translateY(0) scale(1); opacity: 1; }
}

/* Confetti container & pieces */
#confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: 1000;
}
.confetti {
    position: absolute;
    top: -20px;
    width: 10px;
    height: 14px;
    opacity: 0.95;
    transform-origin: center;
    border-radius: 2px;
    animation: confetti-fall 3.5s cubic-bezier(.2,.6,.2,1) forwards;
}
@keyframes confetti-fall {
    0% { transform: translateY(-10vh) rotate(0deg); opacity: 1; }
    100% { transform: translateY(110vh) rotate(720deg); opacity: 0; }
}

/* Buttons */
button {
    background: linear-gradient(135deg, #ff1493 0%, #ff69b4 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 30px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 20px rgba(255, 20, 147, 0.3);
}

button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(255, 20, 147, 0.5);
}

button:active {
    transform: translateY(-1px);
}

.button-container {
    margin-top: 40px;
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Responsive */
@media (max-width: 768px) {
    #home h1 {
        font-size: 2.5rem;
    }

    #celebration h1 {
        font-size: 3rem;
    }

    #home p {
        font-size: 1.1rem;
    }

    .section {
        padding: 30px 20px;
        min-height: auto;
        border-radius: 15px;
    }

    .section h2 {
        font-size: 1.5rem;
    }

    .section p {
        font-size: 1rem;
    }

    button {
        width: 100%;
    }
}

html {
    scroll-behavior: smooth;
}
