:root {
    --primary-pink: #d4a5a5;
    --dark-pink: #b08080;
    --soft-white: #fafafa;
    --primary-dark: #2c2c2c;
    --accent-gold: #c9a961;
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--soft-white);
    color: var(--primary-dark);
    overflow: hidden;
    height: 100vh;
    width: 100%;
    overflow-x: hidden;
    touch-action: manipulation;
}

/* Background & Particles */
.slideshow-container {
    position: relative;
    height: 100%;
    width: 100%;
}

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

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

.heart {
    position: absolute;
    top: -50px;
    animation: fall linear forwards;
    opacity: 0.6;
}

@keyframes fall {
    to {
        transform: translateY(110vh) rotate(360deg);
    }
}

.sparkle {
    position: fixed;
    width: 20px;
    height: 20px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ff85a1'%3E%3Cpath d='M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z'/%3E%3C/svg%3E") no-repeat center;
    pointer-events: none;
    z-index: 10000;
    animation: sparkleAnim 1s ease-out forwards;
}

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

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

/* Slide System */
.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: safe center;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.8s ease, transform 0.8s ease;
    z-index: 10;
    padding: 40px 20px;
    text-align: center;
}

.slide.active {
    opacity: 1;
    visibility: visible;
}

.slide-content {
    width: 100%;
    max-width: 500px;
    /* Ensure content doesn't touch edges on small screens */
    padding: 0 20px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Ensure images don't overflow */
img {
    max-width: 100%;
    height: auto;
}

/* Envelope */
.envelope-wrapper {
    cursor: pointer;
    perspective: 1000px;
    margin-bottom: 40px;
}

.envelope {
    width: 280px;
    height: 180px;
    background: #f8bbd0;
    position: relative;
    border-radius: 0 0 10px 10px;
    transition: transform 0.6s ease;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.envelope .flap {
    position: absolute;
    top: 0;
    left: 0;
    border-left: 140px solid transparent;
    border-right: 140px solid transparent;
    border-top: 100px solid #f06292;
    transform-origin: top;
    transition: transform 0.6s ease;
    z-index: 3;
}

.envelope .pocket {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #f8bbd0;
    border-radius: 0 0 10px 10px;
    z-index: 2;
}

.letter {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 260px;
    height: 160px;
    background: white;
    z-index: 1;
    transition: transform 0.6s ease;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.letter-text {
    font-family: 'Dancing Script', cursive;
    color: var(--primary-dark);
    font-size: 1.2rem;
    line-height: 1.5;
}

.envelope.open .flap {
    transform: rotateX(180deg);
}

.envelope.open .letter {
    transform: translateY(-100px);
    z-index: 4;
}

/* Conversational Elements */
.narrative-box {
    margin-bottom: 30px;
    min-height: 60px;
}

.typewriter {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-dark);
}

.reveal-item {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease-out;
}

.reveal-item.show {
    opacity: 1;
    transform: translateY(0);
}

/* Metric & Photos */
.single-metric {
    background: rgba(255, 255, 255, 0.75);
    padding: 30px;
    border-radius: 30px;
    box-shadow: 0 15px 45px rgba(255, 133, 161, 0.2);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    display: flex;
    flex-direction: column;
    margin-bottom: 30px;
    width: 100%;
    max-width: 350px;
    transition: transform 0.3s ease;
}

.count {
    font-size: 4.5rem;
    font-weight: 900;
    line-height: 1;
    color: var(--primary-dark);
}

.label {
    font-size: 1.1rem;
    margin-top: 10px;
    font-weight: 600;
    opacity: 0.8;
}

.floating-photo {
    width: 200px;
    height: 200px;
    object-fit: cover;
    border-radius: 50%;
    border: 8px solid white;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
    animation: float 4s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-15px);
    }
}

/* Controls */
.response-actions {
    margin-top: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.response-actions.show {
    opacity: 1;
    pointer-events: auto;
}

.btn-response {
    padding: 15px 30px;
    background: var(--primary-pink);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(255, 133, 161, 0.4);
    transition: all 0.3s ease;
}

.btn-response:hover {
    transform: scale(1.05);
    background: var(--dark-pink);
}

/* Final Ask */
.ask-photo img {
    width: 100%;
    max-width: 320px;
    border-radius: 25px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
    margin-bottom: 30px;
}

.ask-title {
    font-family: 'Playfair Display', serif;
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.button-group {
    display: flex;
    gap: 20px;
    margin-top: 30px;
}

.btn-yes {
    padding: 20px 50px;
    background: var(--primary-pink);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 1.5rem;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 0 20px rgba(255, 133, 161, 0.4);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.btn-yes::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, transparent 70%);
    animation: pulse 2s infinite;
}

.btn-no {
    padding: 15px 30px;
    background: white;
    color: var(--primary-dark);
    border: 2px solid #ddd;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 20000;
    /* Ensure it's above everything while running away */
}

/* Reward Screen & Invitation Card */
.video-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.video-container video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.6);
}

.reward-overlay {
    padding: 0;
    margin-top: 15vh;
    /* Slightly higher to show more of their bodies/faces */
    border-radius: 20px;
    background: transparent;
    border: none;
    box-shadow: none;
    max-width: 320px;
    /* More compact for mobile/desktop overlap */
    width: 85%;
    opacity: 0;
    transform: translateY(30px) translateZ(0);
    transition: opacity 1.2s cubic-bezier(0.4, 0, 0.2, 1) 0.8s,
        transform 1.2s cubic-bezier(0.4, 0, 0.2, 1) 0.8s;
    will-change: opacity, transform;
    /* Delay appearance to let video breath */
}

.reward-overlay.show {
    opacity: 1;
    transform: translateY(0) translateZ(0);
    pointer-events: auto;
}

.invitation-card {
    background: rgba(255, 255, 255, 0.03);
    /* Ultra-pure glass */
    backdrop-filter: blur(20px);
    /* Reduced slightly for stability */
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    /* Crystal rim */
    padding: 30px 25px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
    will-change: backdrop-filter;
    transform: translateZ(0);
}

.invitation-card::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    bottom: 10px;
    border: 1px solid var(--accent-gold);
    pointer-events: none;
    opacity: 0.5;
}

.invitation-title {
    font-family: 'Dancing Script', cursive;
    font-size: 3.5rem;
    color: #fff;
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.4);
    margin-bottom: 15px;
}

.divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    margin: 20px 0;
}

.invitation-card h2 {
    font-size: 2.2rem;
    margin-bottom: 20px;
    color: #fff;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    font-family: 'Playfair Display', serif;
}

.invitation-card .label {
    font-size: 0.7rem;
    letter-spacing: 3px;
    color: rgba(255, 255, 255, 0.8);
    text-transform: uppercase;
}

.invitation-card .place {
    font-size: 1.8rem;
    margin: 10px 0;
    color: #D4AF37;
    /* Gold pops on glass */
    text-shadow: 0 0 15px rgba(212, 175, 55, 0.5);
    font-weight: 700;
}

.invitation-card .time {
    font-size: 1.2rem;
    margin-bottom: 20px;
    color: #fff;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.invitation-card .note {
    font-size: 0.9rem;
    margin-top: 25px;
    color: rgba(255, 255, 255, 0.9);
    font-style: italic;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 15px;
}

.invitation-subtitle {
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-size: 0.9rem;
    color: #fff;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    margin-bottom: 25px;
}

.reservation-details {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 30px 0;
}

.detail-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.detail-label {
    font-size: 0.75rem;
    font-weight: 900;
    color: rgba(255, 255, 255, 0.6);
    letter-spacing: 2px;
    margin-bottom: 5px;
}

.detail-value {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    font-weight: 700;
    color: #D4AF37;
    text-shadow: 0 0 15px rgba(212, 175, 55, 0.4);
}

.invitation-footer {
    font-family: 'Dancing Script', cursive;
    font-size: 1.8rem;
    color: #fff;
    margin-top: 20px;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

/* Animations */
@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 0.5;
    }

    50% {
        transform: scale(1.2);
        opacity: 0.8;
    }

    100% {
        transform: scale(1);
        opacity: 0.5;
    }
}

.shake {
    animation: shakeAnim 0.5s ease-in-out;
}

@keyframes shakeAnim {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-10px) rotate(-1deg);
    }

    75% {
        transform: translateX(10px) rotate(1deg);
    }
}

.reaction {
    position: fixed;
    font-size: 2rem;
    pointer-events: none;
    z-index: 20001;
    /* Above the button */
    animation: floatUp 0.8s ease-out forwards;
}

@keyframes floatUp {
    0% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }

    100% {
        transform: translateY(-100px) scale(1.5);
        opacity: 0;
    }
}