/* ===== BASE RESET & VARIABLES ===== */
:root {
    --pink: #ff6b9d;
    --deep-pink: #c2185b;
    --rose: #f48fb1;
    --gold: #ffd700;
    --purple: #7c4dff;
    --dark: #0a0015;
    --dark2: #1a0030;
    --white: #fff0f5;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: 'Poppins', sans-serif;
    background: var(--dark);
    color: var(--white);
    overflow-x: hidden;
    min-height: 100vh;
}

/* ===== SCREENS ===== */
.screen {
    min-height: 100vh;
    display: none;
    position: relative;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}
.screen.active { display: flex; }

/* ===== PARTICLE CANVAS ===== */
#particleCanvas {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 0;
}

/* ===== HEARTS BACKGROUND ===== */
.hearts-container {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}
.floating-heart {
    position: absolute;
    bottom: -50px;
    animation: floatUp linear infinite;
    opacity: 0.6;
    font-size: 1.5rem;
}
@keyframes floatUp {
    0% { transform: translateY(0) rotate(0deg) scale(1); opacity: 0.6; }
    50% { opacity: 1; }
    100% { transform: translateY(-110vh) rotate(720deg) scale(0.3); opacity: 0; }
}

/* ===== STARS ===== */
.stars { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 0; }
.star {
    position: absolute;
    width: 3px; height: 3px;
    background: #fff;
    border-radius: 50%;
    animation: twinkle 2s ease-in-out infinite alternate;
}
@keyframes twinkle { 0% { opacity: 0.2; transform: scale(0.8); } 100% { opacity: 1; transform: scale(1.3); } }

/* ===== LANDING SCREEN ===== */
.landing-screen {
    background: radial-gradient(ellipse at center, var(--dark2) 0%, var(--dark) 70%);
    flex-direction: column;
}
.landing-content {
    text-align: center;
    z-index: 2;
    position: relative;
}
.glow-ring {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 400px; height: 400px;
    border-radius: 50%;
    border: 2px solid rgba(255, 107, 157, 0.2);
    box-shadow: 0 0 80px rgba(255, 107, 157, 0.15), inset 0 0 80px rgba(255, 107, 157, 0.05);
    animation: pulseRing 3s ease-in-out infinite;
}
@keyframes pulseRing {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.5; }
    50% { transform: translate(-50%, -50%) scale(1.1); opacity: 1; }
}
.main-title { margin-bottom: 1.5rem; }
.line1 {
    display: block;
    font-family: 'Poppins', sans-serif;
    font-size: 1.8rem;
    font-weight: 300;
    opacity: 0;
    animation: fadeSlideDown 1s 0.5s forwards;
    color: var(--rose);
}
.line2 {
    display: block;
    font-family: 'Great Vibes', cursive;
    font-size: 4rem;
    background: linear-gradient(135deg, var(--pink), var(--gold), var(--pink));
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: fadeSlideDown 1s 1s forwards, shimmer 3s linear infinite;
    opacity: 0;
}
.sparkle {
    display: inline-block;
    animation: fadeSlideDown 1s 1.5s forwards, sparkleAnim 1.5s ease-in-out infinite;
    opacity: 0;
    font-size: 2rem;
}
@keyframes fadeSlideDown {
    from { opacity: 0; transform: translateY(-30px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes shimmer { to { background-position: 200% center; } }
@keyframes sparkleAnim {
    0%, 100% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.3) rotate(15deg); }
}
.subtitle {
    font-size: 1.1rem;
    color: var(--rose);
    opacity: 0;
    animation: fadeSlideDown 1s 2s forwards;
    margin-bottom: 2.5rem;
    font-weight: 300;
}

/* ===== MAGIC BUTTON ===== */
.magic-btn {
    position: relative;
    padding: 16px 40px;
    border: none;
    border-radius: 50px;
    background: linear-gradient(135deg, var(--pink), var(--purple));
    color: white;
    font-size: 1.1rem;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.4s ease;
    box-shadow: 0 8px 32px rgba(255, 107, 157, 0.4);
    opacity: 0;
    animation: fadeSlideDown 1s 2.5s forwards;
    z-index: 5;
}
.magic-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 12px 40px rgba(255, 107, 157, 0.6);
}
.btn-icon { margin-left: 8px; }
.next-btn { animation-delay: 0s; opacity: 1; margin-top: 2rem; }

/* ===== SCROLL INDICATOR ===== */
.scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    animation: fadeSlideDown 1s 3s forwards;
    z-index: 2;
}
.mouse {
    width: 26px; height: 42px;
    border: 2px solid var(--rose);
    border-radius: 13px;
    display: flex;
    justify-content: center;
    padding-top: 8px;
}
.wheel {
    width: 4px; height: 8px;
    background: var(--pink);
    border-radius: 2px;
    animation: scrollWheel 1.5s ease-in-out infinite;
}
@keyframes scrollWheel {
    0% { transform: translateY(0); opacity: 1; }
    100% { transform: translateY(12px); opacity: 0; }
}

/* ===== SECTION HEADING ===== */
.section-heading {
    font-family: 'Great Vibes', cursive;
    font-size: 3rem;
    text-align: center;
    margin-bottom: 2.5rem;
    background: linear-gradient(135deg, var(--pink), var(--gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ===== ENVELOPE SCREEN ===== */
.envelope-screen {
    background: radial-gradient(ellipse at bottom, var(--dark2) 0%, var(--dark) 70%);
}
.envelope-wrapper { text-align: center; z-index: 2; padding: 2rem; }
.envelope {
    position: relative;
    width: 320px; height: 220px;
    margin: 0 auto;
    cursor: pointer;
    perspective: 1000px;
}
.envelope-body {
    width: 100%; height: 100%;
    background: linear-gradient(135deg, #e91e63, #ad1457);
    border-radius: 0 0 12px 12px;
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 40px rgba(233, 30, 99, 0.3);
}
.envelope-top {
    position: absolute;
    top: 0; left: 0;
    width: 0; height: 0;
    border-left: 160px solid transparent;
    border-right: 160px solid transparent;
    border-top: 120px solid #c2185b;
    z-index: 4;
    transform-origin: top center;
    transition: transform 0.6s ease;
}
.envelope.opened .envelope-top { transform: rotateX(180deg); z-index: 1; }
.letter {
    width: 280px;
    background: #fff5f8;
    border-radius: 8px;
    padding: 24px 20px;
    color: #333;
    transform: translateY(0);
    transition: transform 0.8s ease 0.3s, z-index 0s 0.3s;
    position: absolute;
    top: 20px;
    z-index: 2;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}
.envelope.opened .letter { transform: translateY(-200px); z-index: 5; }
.letter-content { text-align: left; }
.letter-greeting {
    font-family: 'Dancing Script', cursive;
    font-size: 1.4rem;
    color: var(--deep-pink);
    margin-bottom: 12px;
}
.letter-text {
    font-size: 0.85rem;
    line-height: 1.7;
    color: #555;
    min-height: 80px;
}
.letter-sign {
    font-family: 'Dancing Script', cursive;
    font-size: 1rem;
    color: var(--deep-pink);
    text-align: right;
    margin-top: 12px;
}
.envelope-hint {
    margin-top: 1.5rem;
    color: var(--rose);
    animation: pulse 1.5s ease-in-out infinite;
    font-size: 0.95rem;
}
@keyframes pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* ===== REASONS SCREEN ===== */
.reasons-screen {
    background: radial-gradient(ellipse at top, var(--dark2) 0%, var(--dark) 70%);
}
.reasons-wrapper { text-align: center; z-index: 2; padding: 2rem; max-width: 900px; }
.reasons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1rem;
}
.reason-card {
    background: rgba(255, 107, 157, 0.08);
    border: 1px solid rgba(255, 107, 157, 0.2);
    border-radius: 20px;
    padding: 2rem 1.5rem;
    backdrop-filter: blur(10px);
    transition: all 0.4s ease;
    opacity: 0;
    transform: translateY(30px);
}
.reason-card.visible {
    opacity: 1;
    transform: translateY(0);
}
.reason-card:hover {
    transform: translateY(-8px) scale(1.03);
    border-color: var(--pink);
    box-shadow: 0 8px 32px rgba(255, 107, 157, 0.2);
    background: rgba(255, 107, 157, 0.15);
}
.reason-icon { font-size: 2.5rem; margin-bottom: 1rem; }
.reason-card p { font-size: 0.95rem; line-height: 1.6; color: var(--rose); }

/* ===== TIMELINE SCREEN ===== */
.timeline-screen {
    background: radial-gradient(ellipse at center, var(--dark2) 0%, var(--dark) 70%);
}
.timeline-wrapper { text-align: center; z-index: 2; padding: 2rem; max-width: 800px; width: 100%; }
.timeline { position: relative; padding: 2rem 0; }
.timeline::before {
    content: '';
    position: absolute;
    left: 50%; top: 0; bottom: 0;
    width: 3px;
    background: linear-gradient(to bottom, transparent, var(--pink), var(--gold), var(--pink), transparent);
    transform: translateX(-50%);
}
.timeline-item {
    position: relative;
    width: 45%;
    margin-bottom: 2rem;
    opacity: 0;
    transform: translateX(-30px);
    transition: all 0.6s ease;
}
.timeline-item.right { margin-left: 55%; transform: translateX(30px); }
.timeline-item.visible { opacity: 1; transform: translateX(0); }
.timeline-dot {
    position: absolute;
    width: 16px; height: 16px;
    background: var(--pink);
    border-radius: 50%;
    top: 20px;
    box-shadow: 0 0 20px var(--pink);
}
.timeline-item.left .timeline-dot { right: -32px; }
.timeline-item.right .timeline-dot { left: -32px; }
.timeline-card {
    background: rgba(255, 107, 157, 0.08);
    border: 1px solid rgba(255, 107, 157, 0.2);
    border-radius: 16px;
    padding: 1.5rem;
    text-align: left;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}
.timeline-card:hover {
    border-color: var(--pink);
    box-shadow: 0 4px 24px rgba(255, 107, 157, 0.15);
}
.timeline-card h3 {
    font-family: 'Dancing Script', cursive;
    font-size: 1.4rem;
    color: var(--pink);
    margin-bottom: 0.5rem;
}
.timeline-card p { font-size: 0.9rem; color: var(--rose); line-height: 1.6; }

/* ===== FINALE SCREEN ===== */
.finale-screen {
    background: radial-gradient(ellipse at center, var(--dark2) 0%, var(--dark) 70%);
    flex-direction: column;
}
#fireworksCanvas {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 0;
}
.finale-content { z-index: 2; text-align: center; padding: 2rem; }
.big-heart {
    font-size: 5rem;
    animation: heartbeat 1.2s ease-in-out infinite;
    margin-bottom: 1.5rem;
}
@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    15% { transform: scale(1.25); }
    30% { transform: scale(1); }
    45% { transform: scale(1.15); }
    60% { transform: scale(1); }
}
.finale-title {
    font-family: 'Great Vibes', cursive;
    font-size: 3rem;
    background: linear-gradient(135deg, var(--pink), var(--gold), var(--pink));
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmer 3s linear infinite;
    margin-bottom: 1rem;
}
.finale-subtitle {
    font-size: 1.1rem;
    color: var(--rose);
    margin-bottom: 2rem;
    max-width: 500px;
    line-height: 1.8;
}
.question-text {
    font-family: 'Dancing Script', cursive;
    font-size: 1.6rem;
    color: var(--white);
    margin-bottom: 2rem;
    line-height: 1.6;
}
.answer-buttons { display: flex; gap: 1.5rem; justify-content: center; flex-wrap: wrap; }
.answer-btn {
    padding: 14px 36px;
    border: none;
    border-radius: 50px;
    font-size: 1.1rem;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}
.yes-btn {
    background: linear-gradient(135deg, var(--pink), #ff1744);
    color: white;
    box-shadow: 0 8px 32px rgba(255, 23, 68, 0.4);
}
.yes-btn:hover { transform: scale(1.1); box-shadow: 0 12px 40px rgba(255, 23, 68, 0.6); }
.no-btn {
    background: rgba(255, 255, 255, 0.1);
    color: var(--rose);
    border: 2px solid var(--rose);
}

/* ===== CELEBRATION ===== */
.celebration {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(10, 0, 21, 0.95);
    z-index: 100;
    display: none;
    justify-content: center;
    align-items: center;
}
.celebration.show { display: flex; }
.celebration-content { text-align: center; animation: zoomIn 0.6s ease; }
@keyframes zoomIn { from { transform: scale(0); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.celebration-emoji { font-size: 4rem; margin-bottom: 1.5rem; animation: bounce 0.8s ease infinite; }
@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}
.celebration-title {
    font-family: 'Great Vibes', cursive;
    font-size: 4rem;
    background: linear-gradient(135deg, var(--pink), var(--gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1rem;
}
.celebration-text { font-size: 1.2rem; color: var(--rose); line-height: 2; margin-bottom: 2rem; }

/* ===== PHOTO CARDS ===== */
.photo-gallery {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 1.5rem;
    perspective: 1000px;
    z-index: 10;
    position: relative;
}
.photo-frame {
    width: 140px;
    height: 170px;
    background: #fff;
    padding: 8px 8px 24px 8px;
    border-radius: 4px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.4);
    opacity: 0;
    position: relative;
    cursor: pointer;
    transition: box-shadow 0.3s ease;
}
.photo-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #f0f0f0;
}
.photo-frame.left-photo { animation: dropLeft 0.8s 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; }
.photo-frame.right-photo { animation: dropRight 0.8s 1.2s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; }

.photo-frame:hover { box-shadow: 0 20px 45px rgba(255, 107, 157, 0.5); z-index: 11; }

@keyframes dropLeft {
    0% { transform: translateY(-60px) rotate(-25deg); opacity: 0; }
    100% { transform: translateY(0) rotate(-10deg); opacity: 1; }
}
@keyframes dropRight {
    0% { transform: translateY(-60px) rotate(25deg); opacity: 0; }
    100% { transform: translateY(0) rotate(10deg); opacity: 1; }
}

/* ===== MUSIC TOGGLE ===== */
.music-toggle {
    position: fixed;
    bottom: 20px; right: 20px;
    width: 50px; height: 50px;
    border-radius: 50%;
    border: 2px solid var(--pink);
    background: rgba(255, 107, 157, 0.15);
    backdrop-filter: blur(10px);
    cursor: pointer;
    z-index: 50;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}
.music-toggle:hover { background: rgba(255, 107, 157, 0.3); transform: scale(1.1); }

/* ===== FADE IN UTIL ===== */
.fade-in { opacity: 0; animation: fadeIn 1s forwards; }
@keyframes fadeIn { to { opacity: 1; } }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    /* Base */
    .line1 { font-size: 1.4rem; }
    .line2 { font-size: 2.8rem; }
    .subtitle { font-size: 0.95rem; margin-bottom: 2rem; }
    .section-heading { font-size: 2rem; padding: 0 1rem; }
    
    /* Buttons */
    .magic-btn { padding: 12px 30px; font-size: 1rem; }
    
    /* Landing Glow Ring */
    .glow-ring { width: 260px; height: 260px; }
    
    /* Envelope */
    .envelope { width: 280px; height: 180px; }
    .envelope-top { border-left-width: 140px; border-right-width: 140px; border-top-width: 100px; }
    .letter { width: 240px; padding: 16px 14px; top: 10px; }
    .envelope.opened .letter { transform: translateY(-190px); z-index: 5; }
    .letter-greeting { font-size: 1.2rem; }
    .letter-text { font-size: 0.8rem; line-height: 1.5; min-height: 100px; }
    .letter-sign { font-size: 0.9rem; }
    
    /* Timeline */
    .timeline::before { left: 24px; }
    .timeline-item, .timeline-item.right { 
        width: calc(100% - 60px); 
        margin-left: 60px; 
        transform: translateX(30px); 
        margin-bottom: 1.5rem;
    }
    .timeline-item.left .timeline-dot, .timeline-item.right .timeline-dot { 
        left: -44px; 
        right: auto; 
    }
    .timeline-card { padding: 1.2rem; }
    .timeline-card h3 { font-size: 1.2rem; }
    
    /* Reasons */
    .reasons-wrapper { padding: 1.5rem 1rem; }
    .reasons-grid { grid-template-columns: 1fr; gap: 1rem; }
    .reason-card { padding: 1.5rem 1rem; }
    .reason-icon { font-size: 2rem; margin-bottom: 0.5rem; }
    
    /* Finale */
    .finale-content { padding: 1.5rem 1rem; }
    .big-heart { font-size: 4rem; margin-bottom: 1rem; }
    .finale-title { font-size: 2.2rem; margin-bottom: 0.8rem; }
    .finale-subtitle { font-size: 0.95rem; line-height: 1.6; margin-bottom: 1.5rem; }
    .question-text { font-size: 1.3rem; margin-bottom: 1.5rem; }
    .answer-buttons { gap: 1rem; }
    .answer-btn { padding: 12px 28px; font-size: 1rem; }
    
    /* Celebration */
    .celebration-emoji { font-size: 3rem; }
    .celebration-title { font-size: 3rem; }
    .celebration-text { font-size: 1rem; line-height: 1.6; padding: 0 1rem; margin-bottom: 1.5rem; }
    .photo-gallery { gap: 1rem; margin-top: 1rem; }
    .photo-frame { width: 120px; height: 145px; padding: 6px 6px 20px 6px; }
}

@media (max-width: 480px) {
    .line2 { font-size: 2.2rem; }
    .section-heading { font-size: 1.8rem; }
    .envelope { width: 260px; height: 160px; }
    .envelope-top { border-left-width: 130px; border-right-width: 130px; border-top-width: 90px; }
    .letter { width: 220px; top: 5px; padding: 14px 12px; }
    .envelope.opened .letter { transform: translateY(-180px); z-index: 5; }
    .letter-text { font-size: 0.75rem; }
    .timeline-card h3 { font-size: 1.1rem; }
    .timeline-card p { font-size: 0.85rem; }
    .finale-title { font-size: 1.8rem; }
    .music-toggle { width: 40px; height: 40px; font-size: 1.1rem; bottom: 15px; right: 15px; }
}
