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

body {
    background-color: #f5f5f5;
    /* Light neutral background for desktop */
    font-family: 'Inter', sans-serif;
    display: flex;
    justify-content: center;
    min-height: 100vh;
}

.app-container {
    width: 100%;
    max-width: 480px;
    /* Mobile width */
    background: transparent;
    position: relative;
    overflow-x: hidden;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}

.card-section {
    position: relative;
    width: 100%;
    font-size: 0;
    /* Remove gaps below images */
    overflow: hidden;
    display: block;
}

.bg-layer {
    width: 100%;
    height: auto;
    display: block;
    position: relative;
}

.fg-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: auto;
    pointer-events: none;
    /* Let clicks pass through to forms/buttons underneath if needed */
}

/* ENVELOPE SECTION */
.envelope-view {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: transparent;
    cursor: pointer;
    overflow: hidden;
    position: relative;
}

.envelope-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.envelope-container video {
    width: 100%;
    height: auto;
    max-height: 100vh;
    object-fit: contain;
}

.tap-hint {
    position: absolute;
    bottom: 10%;
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: 2px;
    animation: pulse 2s infinite;
    z-index: 10;
}

@keyframes pulse {
    0% {
        opacity: 0.5;
        transform: translateY(0);
    }

    50% {
        opacity: 1;
        transform: translateY(-5px);
    }

    100% {
        opacity: 0.5;
        transform: translateY(0);
    }
}

/* CINEMATIC TRANSITION & SPARKLES */
.light-ray {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200vw;
    height: 200vh;
    background: radial-gradient(circle, 
        rgba(255, 255, 255, 1) 0%, 
        rgba(255, 215, 0, 0.8) 20%, 
        rgba(255, 215, 0, 0) 70%);
    opacity: 0;
    pointer-events: none;
    z-index: 20;
    transition: opacity 0.8s ease-in;
}

#sparkles-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 21;
}

.sparkle {
    position: absolute;
    background: #fff;
    border-radius: 50%;
    filter: blur(1px);
    box-shadow: 0 0 10px #ffd700;
    animation: sparkle-float 2s infinite ease-in-out;
}

@keyframes sparkle-float {
    0%, 100% { transform: translateY(0) scale(1); opacity: 0; }
    50% { transform: translateY(-20px) scale(1.5); opacity: 1; }
}

/* REFINED SECTION REVEAL */
.card-section {
    opacity: 0;
    transform: translateY(40px);
    transition: all 1.2s cubic-bezier(0.25, 1, 0.5, 1);
    will-change: transform, opacity;
}

.card-section.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* NATURE OVERLAY (BIRDS & SPARKLES) */
#nature-overlay {
    position: absolute; /* Changed from fixed to absolute to scroll with content */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
}

/* HUMMINGBIRD ANIMATION */
.hummy-bird-container {
    position: absolute;
    top: 15%;
    right: 5%;
    width: 25%;
    z-index: 3;
    pointer-events: none;
}

.hummy-bird {
    width: 100%;
    height: auto;
    filter: invert(84%) sepia(34%) saturate(765%) hue-rotate(354deg) brightness(94%) contrast(89%); /* Golden Tint */
    opacity: 0.8;
    animation: hummingbird-float 4s infinite ease-in-out;
}

@keyframes hummingbird-float {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(-10px, -15px) rotate(-5deg); }
    50% { transform: translate(15px, -5px) rotate(5deg); }
    75% { transform: translate(-5px, 10px) rotate(-2deg); }
}

.bird-svg {
    position: absolute;
    width: 30px;
    height: 30px;
    fill: rgba(0, 0, 0, 0.4);
    z-index: 101;
}

.bird-flying {
    animation: fly 8s linear forwards;
}

/* Floating Animation for Birds */
@keyframes fly {
    0% { transform: translate(-50px, 0) rotate(5deg); }
    25% { transform: translate(25vw, -20px) rotate(-5deg); }
    50% { transform: translate(50vw, 10px) rotate(5deg); }
    75% { transform: translate(75vw, -10px) rotate(-5deg); }
    100% { transform: translate(110vw, 0) rotate(5deg); }
}

/* GLOBAL SPARKLE ENHANCEMENT */
.global-sparkle {
    position: absolute;
    background: #fff;
    border-radius: 50%;
    filter: blur(0.5px);
    box-shadow: 0 0 10px #fff, 0 0 15px #ffd700; /* Stronger Glow */
    pointer-events: none;
    opacity: 0;
    animation: twinkle var(--duration) infinite ease-in-out;
    z-index: 99;
}

@keyframes twinkle {
    0%, 100% { opacity: 0; transform: scale(0.3); }
    50% { opacity: 0.9; transform: scale(1.5); }
}

/* Hover Effect Removal */
.glossy-btn, .map-photo, .open-maps-btn, .camera-icon {
    transition: opacity 0.3s ease; /* Keep only basic transition */
}

.glossy-btn:hover, .camera-icon:hover, .map-link-container:hover .map-photo {
    transform: none;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

/* Floating Animation for Tap Hint */
.tap-hint {
    animation: floating-hint 3s infinite ease-in-out;
}

@keyframes floating-hint {
    0%, 100% { transform: translateY(0); opacity: 0.7; }
    50% { transform: translateY(-15px); opacity: 1; text-shadow: 0 0 15px rgba(255,215,0,0.8); }
}

.countdown-container {
    position: absolute;
    /* Adjust these percentages based on where the blank space is in 'Date card(background).png' */
    top: 51.5%;
    left: 30%;
    width: 40%;
    height: 10%;
    z-index: 5;
    display: flex;
    justify-content: center;
    align-items: center;
}

.countdown-numbers {
    display: flex;
    justify-content: space-around;
    width: 100%;
    font-size: 1.5rem;
    font-weight: 800;
    color: #3e3e3e;
    /* Dark text */
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8);
    pointer-events: none;
    /* Don't interfere with scratch pad */
}

.countdown-numbers div {
    display: flex;
    flex-direction: column;
    align-items: center;
}

canvas#scratch-pad {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: crosshair;
    z-index: 10;
    border-radius: 10px;
    /* Optional: smooth edges */
}

/* MAP SECTION */
.map-section {
    position: relative;
}

.map-section .bg-layer {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}

.map-section .fg-layer {
    position: relative;
    z-index: 2;
    display: block;
}

.map-link-container {
    position: absolute;
    top: 67.9%;
    left: 20%;
    width: 60%;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    z-index: 3;
}

.map-photo {
    width: 92%;
    border-radius: 7px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    margin-bottom: 6px;
    transition: transform 0.3s;
}

.open-maps-btn {
    width: 50%;
    max-width: 160px;
    transition: transform 0.3s;
}

.map-link-container:active .map-photo,
.map-link-container:active .open-maps-btn {
    transform: scale(0.95);
}

/* RSVP FORM */
.form-container {
    position: absolute;
    top: 36.8%;
    left: 25%;
    width: 50%;
    height: 27%;
    z-index: 10;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 3px;
}

#rsvp-form {
    width: 100%;
}

.glossy-input {
    width: 100%;
    padding: 4px 6px;
    margin-bottom: 3px;
    background: rgba(255, 255, 255, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 8px;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    color: #333;
    font-size: 0.6rem;
    outline: none;
}

.glossy-input::placeholder {
    color: #555;
}

#rsvp-form input[name="email"] {
    width: 52%;
    display: block;
    margin-bottom: 4px;
}

.radio-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 3px;
    gap: 1px;
}

.glossy-radio {
    background: rgba(255, 255, 255, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.6);
    padding: 2px 6px;
    border-radius: 6px;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    font-size: 0.56rem;
    cursor: pointer;
    width: auto;
    text-align: left;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 2px;
}

.glossy-btn {
    width: 34%;
    padding: 3px 5px;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.8), rgba(218, 165, 32, 0.8));
    border: none;
    border-radius: 3px;
    color: #fff;
    font-size: 0.58rem;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    text-align: center;
    display: inline-block;
    transition: opacity 0.3s;
    margin-left: 22%;
    margin-top: 1px;
}

#rsvp-status {
    margin-top: 2px;
    font-size: 0.55rem;
    line-height: 1.2;
}

.glossy-btn:active {
    opacity: 0.8;
}

/* SHARE MOMENTS */
.upload-container {
    position: absolute;
    top: 42%;
    left: 50%;
    width: 35%;
    transform: translateX(-50%);
    z-index: 10;
    text-align: center;
}

.camera-icon {
    width: 38px;
    height: 38px;
    line-height: 38px;
    margin: 0 auto 6px auto;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.85);
    font-size: 1.1rem;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
}

.upload-btn {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.4));
    border: 1px solid rgba(255, 255, 255, 0.8);
    color: #333;
    backdrop-filter: blur(5px);
    width: 100%;
    padding: 6px 0px;
    font-size: 0.68rem;
    margin-left: 0;
}

#upload-status {
    margin-top: 4px;
    font-size: 0.55rem;
    color: #333;
    font-family: sans-serif;
}

/* FOOTER */
.footer-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #fdfdfd;
}

.footer-credit {
    font-size: 0.9rem;
    padding: 20px 0;
    color: #888;
    text-align: center;
    width: 100%;
}