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

body {
    min-height: 100vh;
    background: radial-gradient(ellipse at center, #1a0011 0%, #0d0008 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
    font-family: 'Georgia', serif;
    cursor: default;
}

.hearts-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.floating-heart {
    position: absolute;
    bottom: -60px;
    opacity: 0;
    font-size: 20px;
    animation: floatUp linear infinite;
    color: #ff4d6d;
}

@keyframes floatUp {
    0% {
        transform: translateY(0) rotate(0deg) scale(1);
        opacity: 0;
    }
    10% {
        opacity: 0.8;
    }
    90% {
        opacity: 0.6;
    }
    100% {
        transform: translateY(-110vh) rotate(360deg) scale(0.5);
        opacity: 0;
    }
}

.container {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 2rem;
}

.main-heart {
    font-size: 100px;
    animation: pulse 1.2s ease-in-out infinite;
    cursor: pointer;
    filter: drop-shadow(0 0 30px rgba(255, 77, 109, 0.6));
    transition: filter 0.3s;
    user-select: none;
}

.main-heart:hover {
    filter: drop-shadow(0 0 50px rgba(255, 77, 109, 0.9));
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    15% { transform: scale(1.15); }
    30% { transform: scale(1); }
    45% { transform: scale(1.1); }
    60% { transform: scale(1); }
}

.title {
    color: #ff8fab;
    font-size: 3rem;
    margin-top: 1rem;
    opacity: 0;
    animation: fadeInUp 1.5s ease forwards 0.5s;
    text-shadow: 0 0 20px rgba(255, 143, 171, 0.5);
}

.message {
    color: #ffccd5;
    font-size: 1.3rem;
    max-width: 600px;
    margin: 1.5rem auto;
    line-height: 1.8;
    opacity: 0;
    animation: fadeInUp 1.5s ease forwards 1.2s;
}

.poem {
    color: #ffc2d1;
    font-style: italic;
    font-size: 1.1rem;
    max-width: 500px;
    margin: 2rem auto;
    line-height: 2;
    opacity: 0;
    animation: fadeInUp 1.5s ease forwards 1.8s;
    border-left: 3px solid #ff4d6d;
    padding-left: 1.5rem;
    text-align: left;
}

/* ---- Gift Box 3D ---- */
.gift-box-wrapper {
    margin-top: 2.5rem;
    cursor: pointer;
    opacity: 0;
    animation: fadeInUp 1.5s ease forwards 2.5s;
    display: inline-block;
    position: relative;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.gift-box {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto;
    animation: giftBounce 1.8s ease-in-out infinite;
    filter: drop-shadow(0 8px 25px rgba(255, 77, 109, 0.5));
}

.gift-base {
    position: absolute;
    bottom: 0;
    left: 10px;
    width: 100px;
    height: 70px;
    background: linear-gradient(135deg, #e74c6f, #c9184a);
    border-radius: 6px;
    overflow: hidden;
}

.gift-ribbon-v {
    position: absolute;
    left: 50%;
    top: 0;
    transform: translateX(-50%);
    width: 18px;
    height: 100%;
    background: linear-gradient(180deg, #ffd700, #ffaa00);
}

.gift-lid {
    position: absolute;
    bottom: 62px;
    left: 4px;
    width: 112px;
    height: 22px;
    background: linear-gradient(135deg, #ff4d6d, #e74c6f);
    border-radius: 4px;
    z-index: 2;
    animation: lidShake 1.8s ease-in-out infinite;
    transform-origin: center bottom;
}

.gift-bow {
    position: absolute;
    top: -18px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 24px;
}

.gift-bow::before,
.gift-bow::after {
    content: '';
    position: absolute;
    top: 4px;
    width: 20px;
    height: 18px;
    background: linear-gradient(135deg, #ffd700, #ffaa00);
    border-radius: 50% 50% 0 50%;
}

.gift-bow::before {
    left: 0;
    transform: rotate(-25deg);
    border-radius: 50% 50% 50% 0;
}

.gift-bow::after {
    right: 0;
    transform: rotate(25deg);
    border-radius: 50% 50% 0 50%;
}

.gift-label {
    color: #ffccd5;
    font-size: 1rem;
    margin-top: 0.8rem;
    text-align: center;
    animation: labelPulse 2s ease-in-out infinite;
    letter-spacing: 1px;
}

@keyframes giftBounce {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    15% { transform: translateY(-12px) rotate(-2deg); }
    30% { transform: translateY(0) rotate(0deg); }
    45% { transform: translateY(-8px) rotate(2deg); }
    60% { transform: translateY(0) rotate(0deg); }
}

@keyframes lidShake {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    15% { transform: translateY(-6px) rotate(-4deg); }
    25% { transform: translateY(-2px) rotate(2deg); }
    35% { transform: translateY(0) rotate(0deg); }
    45% { transform: translateY(-4px) rotate(3deg); }
    55% { transform: translateY(-1px) rotate(-1deg); }
    65% { transform: translateY(0) rotate(0deg); }
}

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

.gift-box-wrapper:hover .gift-box {
    animation: giftBounceHover 0.4s ease-in-out infinite;
    filter: drop-shadow(0 12px 35px rgba(255, 77, 109, 0.8));
}

.gift-box-wrapper:hover .gift-lid {
    animation: lidShakeHover 0.3s ease-in-out infinite;
}

@keyframes giftBounceHover {
    0%, 100% { transform: translateY(0) rotate(-1deg); }
    50% { transform: translateY(-6px) rotate(1deg); }
}

@keyframes lidShakeHover {
    0%, 100% { transform: translateY(0) rotate(-3deg); }
    50% { transform: translateY(-8px) rotate(4deg); }
}

/* Sparkle particles around the gift */
.gift-box-wrapper::before,
.gift-box-wrapper::after {
    content: '\2728';
    position: absolute;
    font-size: 16px;
    animation: giftSparkle 2s ease-in-out infinite;
    pointer-events: none;
}

.gift-box-wrapper::before {
    top: 5px;
    left: -15px;
    animation-delay: 0s;
}

.gift-box-wrapper::after {
    top: 10px;
    right: -15px;
    animation-delay: 1s;
}

@keyframes giftSparkle {
    0%, 100% { opacity: 0; transform: scale(0.5) translateY(0); }
    50% { opacity: 1; transform: scale(1.2) translateY(-10px); }
}

@keyframes giftGoWild {
    0% { transform: translate(-2px, -1px) rotate(-3deg) scale(1); }
    10% { transform: translate(3px, 1px) rotate(3deg) scale(1.02); }
    20% { transform: translate(-3px, 2px) rotate(-2deg) scale(1.04); }
    30% { transform: translate(2px, -2px) rotate(4deg) scale(1.06); }
    40% { transform: translate(-1px, 3px) rotate(-4deg) scale(1.08); }
    50% { transform: translate(3px, -1px) rotate(3deg) scale(1.1); }
    60% { transform: translate(-3px, -2px) rotate(-3deg) scale(1.12); }
    70% { transform: translate(2px, 2px) rotate(4deg) scale(1.1); }
    80% { transform: translate(-2px, -3px) rotate(-2deg) scale(1.08); }
    90% { transform: translate(3px, 1px) rotate(3deg) scale(1.06); }
    100% { transform: translate(-1px, -1px) rotate(-3deg) scale(1.04); }
}

@keyframes screenShake {
    0% { transform: translate(0, 0); }
    10% { transform: translate(-8px, -5px); }
    20% { transform: translate(8px, 5px); }
    30% { transform: translate(-6px, 4px); }
    40% { transform: translate(6px, -4px); }
    50% { transform: translate(-4px, 3px); }
    60% { transform: translate(4px, -2px); }
    70% { transform: translate(-3px, 2px); }
    80% { transform: translate(2px, -1px); }
    90% { transform: translate(-1px, 1px); }
    100% { transform: translate(0, 0); }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.sparkle {
    position: fixed;
    pointer-events: none;
    font-size: 14px;
    animation: sparkleAnim 0.8s ease forwards;
    z-index: 10;
}

@keyframes sparkleAnim {
    0% {
        transform: scale(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: scale(1.5) rotate(180deg);
        opacity: 0;
    }
}

.heart-explosion {
    position: fixed;
    pointer-events: none;
    font-size: 24px;
    z-index: 10;
    animation: explode 1.2s ease forwards;
}

@keyframes explode {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

/* ---- Photo Slideshow Gift ---- */
.slideshow-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, #1a0011ee 0%, #000000f5 100%);
    z-index: 100;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    animation: fadeIn 0.5s ease;
    overflow: hidden;
}

.slideshow-overlay.active {
    display: flex;
}

.slideshow-hearts-rain {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.slideshow-rain-heart {
    position: absolute;
    top: -30px;
    animation: slideshowHeartFall linear forwards;
    opacity: 0.4;
    color: #ff4d6d;
}

@keyframes slideshowHeartFall {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.5;
    }
    90% {
        opacity: 0.3;
    }
    100% {
        transform: translateY(110vh) rotate(360deg);
        opacity: 0;
    }
}

.slideshow-close-btn {
    position: absolute;
    top: 20px;
    right: 25px;
    background: none;
    border: none;
    color: #ff8fab;
    font-size: 2.5rem;
    cursor: pointer;
    z-index: 110;
    transition: color 0.3s, transform 0.3s;
    line-height: 1;
}

.slideshow-close-btn:hover {
    color: #fff;
    transform: scale(1.2);
}

.slideshow-container {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 2rem;
}

.slideshow-photo-frame {
    background: #fff;
    padding: 12px;
    box-shadow:
        0 10px 60px rgba(255, 77, 109, 0.4),
        0 0 40px rgba(255, 77, 109, 0.2),
        0 30px 80px rgba(0, 0, 0, 0.7);
    max-width: 80vw;
    max-height: 70vh;
    position: relative;
    will-change: transform, opacity;
}

.slideshow-photo {
    display: block;
    max-width: 75vw;
    max-height: 65vh;
    object-fit: contain;
    width: auto;
    height: auto;
}

.slideshow-caption {
    color: #ffc2d1;
    font-size: 1.2rem;
    margin-top: 1.5rem;
    font-style: italic;
    text-align: center;
    max-width: 500px;
    z-index: 1;
}

.slideshow-counter {
    color: #ff8fab;
    font-size: 0.9rem;
    margin-top: 0.8rem;
    opacity: 0.7;
    z-index: 1;
}

.slideshow-burst-heart {
    position: fixed;
    pointer-events: none;
    z-index: 105;
}

/* ---- Final Message ---- */
.slideshow-final {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    z-index: 2;
    text-align: center;
    padding: 2rem;
}

.slideshow-final.active {
    display: flex;
    animation: scaleIn 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.final-heart {
    font-size: 100px;
    animation: pulse 1.2s ease-in-out infinite;
    filter: drop-shadow(0 0 40px rgba(255, 77, 109, 0.7));
}

.final-text {
    color: #ffccd5;
    font-size: 1.6rem;
    margin-top: 1.5rem;
    line-height: 2;
    max-width: 500px;
    text-shadow: 0 0 20px rgba(255, 143, 171, 0.3);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scaleIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* ---- Album Photo ---- */
.album-section {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem 1rem 4rem;
}

.album-title {
    color: #ff8fab;
    font-size: 2rem;
    text-align: center;
    margin-bottom: 0.5rem;
    text-shadow: 0 0 20px rgba(255, 143, 171, 0.5);
    opacity: 0;
    animation: fadeInUp 1.5s ease forwards 3s;
}

.album-subtitle {
    color: #ffc2d1;
    font-size: 1rem;
    text-align: center;
    margin-bottom: 2rem;
    opacity: 0;
    animation: fadeInUp 1.5s ease forwards 3.3s;
}

.album-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 2rem;
    justify-items: center;
    opacity: 0;
    animation: fadeInUp 1.5s ease forwards 3.5s;
}

.photo-card {
    background: #fff;
    padding: 12px;
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.5), 0 0 15px rgba(255, 77, 109, 0.15);
    transform: rotate(var(--rotation));
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    cursor: pointer;
    position: relative;
    max-width: 280px;
    width: 100%;
}

.photo-card:hover {
    transform: rotate(0deg) scale(1.05);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6), 0 0 30px rgba(255, 77, 109, 0.3);
    z-index: 2;
}

.photo-card img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
}

/* ---- Lightbox ---- */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.92);
    z-index: 200;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    animation: fadeIn 0.3s ease;
}

.lightbox.active {
    display: flex;
}

.lightbox-img {
    max-width: 85vw;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 0 40px rgba(255, 77, 109, 0.3);
}

.lightbox-caption {
    color: #ffc2d1;
    font-size: 1.2rem;
    margin-top: 1.2rem;
    font-style: italic;
    text-align: center;
    max-width: 500px;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 77, 109, 0.2);
    border: 2px solid rgba(255, 143, 171, 0.4);
    color: #ff8fab;
    font-size: 2rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    font-family: 'Georgia', serif;
}

.lightbox-nav:hover {
    background: rgba(255, 77, 109, 0.5);
    border-color: #ff8fab;
}

.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }

.lightbox-close-btn {
    position: absolute;
    top: 20px;
    right: 25px;
    background: none;
    border: none;
    color: #ff8fab;
    font-size: 2.5rem;
    cursor: pointer;
    transition: color 0.3s;
    line-height: 1;
}

.lightbox-close-btn:hover {
    color: #fff;
}

.lightbox-counter {
    color: #ff8fab;
    font-size: 0.9rem;
    margin-top: 0.8rem;
    opacity: 0.7;
}

@media (max-width: 600px) {
    .title { font-size: 2rem; }
    .message { font-size: 1rem; padding: 0 1rem; }
    .poem { font-size: 0.95rem; margin: 1.5rem 1rem; }
    .main-heart { font-size: 70px; }
    .gift-box { width: 100px; height: 100px; }
    .gift-base { width: 80px; height: 56px; left: 10px; }
    .gift-lid { width: 92px; bottom: 48px; left: 4px; }
    .gift-ribbon-v { width: 14px; }
    .gift-label { font-size: 0.85rem; }
    .album-title { font-size: 1.5rem; }
    .album-grid { grid-template-columns: 1fr; gap: 1.5rem; }
    .photo-card { max-width: 260px; }
    .photo-card img { height: 180px; }
    .lightbox-nav { width: 40px; height: 40px; font-size: 1.5rem; }
    .lightbox-prev { left: 10px; }
    .lightbox-next { right: 10px; }
    .slideshow-photo-frame { padding: 8px; }
    .slideshow-photo { max-width: 90vw; max-height: 60vh; }
    .final-heart { font-size: 70px; }
    .final-text { font-size: 1.2rem; padding: 0 1rem; }
}
