:root {
    --pink-light: #F8C8DC;
    --pink-rose: #FFB6C1;
    --cream: #FFF5E1;
    --white: #FFFFFF;
    --gold: #F4C430;
    --font-heading: 'Dancing Script', cursive;
    --font-body: 'Nunito', sans-serif;
    --transition: all 0.5s ease-in-out;
}

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

body {
    font-family: var(--font-body);
    background-color: var(--pink-light);
    color: #4a4a4a;
    overflow-x: hidden;
    height: 100vh;
    width: 100vw;
}

/* --- Typography --- */
h1, h2 {
    font-family: var(--font-heading);
    color: #d6336c; /* Deep pink */
    text-shadow: 2px 2px 4px rgba(255, 255, 255, 0.6);
}

h1.main-title {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    animation: fadeInDown 1.5s ease;
    background: linear-gradient(45deg, #d6336c, #ff9eb5);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: none; /* Removing shadow to make gradient clean */
}

h2.section-title {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
}

p.subtitle {
    font-size: 1.2rem;
    color: #555;
    margin-bottom: 2rem;
    font-style: italic;
    border-right: 2px solid #d6336c;
    white-space: nowrap;
    overflow: hidden;
    margin: 0 auto 2rem; /* Centering */
    width: fit-content;
    animation: typing 3.5s steps(40, end), blink-caret .75s step-end infinite;
}

/* Typing Effect Keyframes */
@keyframes typing {
  from { width: 0 }
  to { width: 100% }
}

@keyframes blink-caret {
  from, to { border-color: transparent }
  50% { border-color: #d6336c; }
}

.highlight {
    color: var(--gold);
    font-weight: bold;
}

/* --- Layout Sections --- */
.section {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none; /* Hidden by default */
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

.section.active {
    display: flex; /* Flexbox for centering */
    opacity: 1;
    z-index: 10;
}

.section.hidden {
    display: none;
    opacity: 0;
    z-index: -1;
}

.content-wrapper {
    background: rgba(255, 255, 255, 0.7); /* More transparent */
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15); /* Glassmorphism shadow */
    max-width: 90%;
    width: 600px;
    position: relative;
    backdrop-filter: blur(8px); /* Blur effect */
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.4);
}

/* --- Buttons --- */
.cta-btn {
    background: linear-gradient(135deg, var(--pink-rose), #ff9eb5);
    border: none;
    padding: 12px 30px;
    border-radius: 50px;
    color: white;
    font-family: var(--font-body);
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(255, 105, 180, 0.4);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    outline: none;
}

.cta-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(255, 105, 180, 0.6);
}

/* --- Section 2: Gift Box --- */
.gift-container {
    cursor: pointer;
    margin: 20px auto;
    position: relative;
    width: 150px;
    height: 150px;
    transition: transform 0.3s;
}

.gift-container:hover {
    transform: scale(1.05);
}

.gift {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
}

.gift-box-body {
    background: var(--pink-rose);
    width: 100%;
    height: 100%;
    position: absolute;
    bottom: 0;
    border-radius: 10px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.gift-lid {
    background: #ff8fa3;
    width: 110%;
    height: 25%;
    position: absolute;
    top: -10%;
    left: -5%;
    border-radius: 5px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: transform 0.5s ease-in-out;
    z-index: 2;
}

.gift-container:hover .gift {
    animation: shake 0.5s infinite;
}

.gift-container.open .gift-lid {
    transform: translateY(-40px) rotate(-10deg);
}

.gift-container.open .gift {
    animation: none; /* Stop shaking when open */
}

/* --- Music Button --- */
.music-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: white;
    border: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    font-size: 24px;
    cursor: pointer;
    z-index: 1000;
    transition: transform 0.3s ease, background 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.music-btn:hover {
    transform: scale(1.1) rotate(10deg);
    background: var(--pink-rose);
    color: white;
}

.music-btn.playing {
    animation: pulse-music 2s infinite;
}

@keyframes pulse-music {
    0% { box-shadow: 0 0 0 0 rgba(255, 182, 193, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(255, 182, 193, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 182, 193, 0); }
}

@keyframes shake {
    0% { transform: rotate(0deg); }
    25% { transform: rotate(5deg); }
    50% { transform: rotate(0deg); }
    75% { transform: rotate(-5deg); }
    100% { transform: rotate(0deg); }
}

/* --- Cursor Trail --- */
/* Removed per user request */

/* --- Sparkle Effect --- */
.sparkle {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background-color: var(--gold);
    pointer-events: none;
    z-index: 9999;
    animation: sparkle-anim 0.8s ease-out forwards;
}

@keyframes sparkle-anim {
    0% { opacity: 1; transform: scale(1); }
    100% { opacity: 0; transform: translate(var(--tx), var(--ty)) scale(0); }
}

.hidden-content {
    display: none; /* Initially accessible only in logic */
    opacity: 0;
    transition: opacity 1s ease;
    margin-top: 20px;
}

.hidden-content.show {
    display: block;
    opacity: 1;
}

.photo-frame {
    width: 200px;
    height: 200px;
    border-radius: 15px;
    overflow: hidden;
    margin: 0 auto 15px;
    border: 5px solid white;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.photo-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* --- Section 3: 23 Reasons Grid --- */
.reasons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    max-height: 50vh;
    overflow-y: auto;
    padding: 10px;
}

.reason-card {
    background: white;
    height: 120px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    perspective: 1000px;
    cursor: pointer;
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s;
    transform-style: preserve-3d;
    display: flex;
    align-items: center;
    justify-content: center;
}

.reason-card.flipped .card-inner {
    transform: rotateY(180deg);
}

.card-front, .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    padding: 10px;
}

.card-front {
    background: var(--cream);
    color: #d6336c;
    font-weight: bold;
    font-size: 0.9rem;
}

.card-back {
    background: var(--pink-rose);
    color: white;
    transform: rotateY(180deg);
    font-size: 0.85rem;
    line-height: 1.2;
    overflow-y: auto;
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}
.card-back::-webkit-scrollbar {
    display: none;
}

.scroll-indicator {
    margin-top: 15px;
}

/* --- Make a Wish (Cake) --- */
.cake-container {
    margin: 50px auto;
    width: 200px;
    height: 150px;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: flex-end;
}

.cake {
    width: 200px;
    height: 100px;
    background: #FFB6C1;
    border-radius: 10px 10px 0 0;
    position: relative;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.cake::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 10px;
    background: #ff8fa3;
}

.candle {
    width: 15px;
    height: 60px;
    background: white;
    position: absolute;
    bottom: 100px;
    border-radius: 5px;
}

#candle1 { left: 40px; }
#candle2 { left: 90px; }
#candle3 { left: 140px; }

.flame {
    width: 15px;
    height: 25px;
    background: orange;
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    position: absolute;
    top: -25px;
    left: 0;
    animation: flicker 1s infinite alternate;
    opacity: 1;
    transition: opacity 0.5s;
    box-shadow: 0 0 10px orange;
}

.candle.blown .flame {
    opacity: 0;
    animation: none;
}

@keyframes flicker {
    0% { transform: scale(1); }
    100% { transform: scale(1.1); }
}

/* --- Loader --- */
.loader-container {
    width: 100%;
    height: 10px;
    background: #eee;
    margin: 20px 0;
    border-radius: 5px;
    overflow: hidden;
}

.loader-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #ff9eb5, #d6336c);
    transition: width 0.2s;
}

#loading-text {
    font-style: italic;
    color: #666;
}

/* --- Section 4: Gallery --- */
.gallery-container {
    position: relative;
    max-width: 100%;
    margin: 20px 0;
}

.gallery-wrapper {
    position: relative;
    height: 300px; /* Adjust based on image aspect ratio expectation */
    overflow: hidden;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1s ease-in-out;
    display: flex;
    flex-direction: column;
}

.slide.active {
    opacity: 1;
    z-index: 2;
}

.slide img {
    width: 100%;
    height: 250px;
    object-fit: cover;
}

.caption {
    background: white;
    padding: 10px;
    font-style: italic;
    color: #666;
}

.nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.7);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    font-size: 1.2rem;
    color: #d6336c;
    z-index: 5;
}

.nav-btn.prev { left: 10px; }
.nav-btn.next { right: 10px; }

/* --- Section 5: Closing --- */
.centered-emotional {
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: auto;
    background: rgba(255,255,255,0.9);
}

.emotional-message p {
    font-size: 1.1rem;
    margin: 5px 0;
    opacity: 0;
    animation: fadeInUp 1s forwards;
}

.emotional-message p:nth-child(1) { animation-delay: 0.5s; }
.emotional-message p:nth-child(2) { animation-delay: 1.5s; }
.emotional-message p:nth-child(4) { animation-delay: 2.5s; }
.emotional-message p:nth-child(5) { animation-delay: 3.0s; }
.emotional-message p:nth-child(6) { animation-delay: 3.5s; }
.emotional-message p:nth-child(8) { animation-delay: 4.5s; }
.emotional-message p:nth-child(9) { animation-delay: 5.0s; }
.emotional-message p:nth-child(10) { animation-delay: 5.5s; }

.signature {
    margin-top: 2rem;
    font-family: var(--font-heading);
    font-size: 2rem;
    color: #d6336c;
}

/* --- Floating Background Items --- */
.floating-hearts {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.floating-image {
    position: absolute;
    bottom: -150px;
    opacity: 0.6;
    animation: floatUp 15s linear infinite;
    object-fit: cover;
    border-radius: 10px; /* Optional: rounded corners */
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

@keyframes floatUp {
    0% { transform: translateY(0) scale(0.8); opacity: 0; }
    20% { opacity: 0.8; }
    100% { transform: translateY(-110vh) scale(1.2); opacity: 0; }
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

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

/* ===== ENHANCEMENT STYLES ===== */

/* --- Stardust Canvas --- */
#stardust-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

/* --- Fireworks Canvas --- */
#fireworks-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 999;
    display: none;
}

/* --- Countdown Timer --- */
.countdown-container {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 1.5rem 0;
}

.countdown-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 14px;
    padding: 12px 18px;
    min-width: 70px;
    box-shadow: 0 4px 20px rgba(214, 51, 108, 0.15), 0 0 15px rgba(255, 182, 193, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.countdown-item span {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, #d6336c, #ff6b9d);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: none;
}

.countdown-item small {
    font-size: 0.7rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 2px;
}

/* --- Gift Box Enhancements --- */
.gift-ribbon-v {
    position: absolute;
    left: 50%;
    top: 0;
    transform: translateX(-50%);
    width: 20px;
    height: 100%;
    background: linear-gradient(180deg, #F4C430, #e6b800);
    z-index: 1;
}

.gift-ribbon-h {
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    width: 100%;
    height: 20px;
    background: linear-gradient(90deg, #F4C430, #e6b800);
    z-index: 1;
}

.gift-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 182, 193, 0.5) 0%, transparent 70%);
    animation: gift-pulse 2s ease-in-out infinite;
    z-index: -1;
}

@keyframes gift-pulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.5; }
    50% { transform: translate(-50%, -50%) scale(1.3); opacity: 0.8; }
}

.gift-container:not(.open) .gift {
    animation: gift-bounce 2s ease-in-out infinite;
}

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

/* --- Love Letter Section --- */
.letter-wrapper {
    max-width: 650px;
}

.letter-paper {
    background: linear-gradient(to bottom, #fdf8e1, #f5ecd0);
    border-radius: 8px;
    padding: 2rem 2.5rem;
    margin: 1rem 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08), inset 0 0 30px rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(200, 180, 140, 0.3);
    position: relative;
    max-height: 50vh;
    overflow-y: auto;
}

.letter-paper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 30px;
    right: 30px;
    height: 2px;
    background: repeating-linear-gradient(
        90deg,
        transparent,
        transparent 4px,
        rgba(200, 180, 140, 0.2) 4px,
        rgba(200, 180, 140, 0.2) 8px
    );
}

.letter-content {
    font-family: 'Caveat', cursive;
    font-size: 1.35rem;
    line-height: 2;
    color: #5a3825;
    text-align: left;
}

.letter-content .word {
    display: inline-block;
    opacity: 0;
    transform: translateY(5px);
    animation: wordReveal 0.4s forwards;
}

@keyframes wordReveal {
    to { opacity: 1; transform: translateY(0); }
}

/* --- Heart Rain --- */
#heart-rain-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 998;
    overflow: hidden;
}

.heart-drop {
    position: absolute;
    top: -50px;
    font-size: 1.5rem;
    animation: heartFall linear forwards;
    opacity: 0.8;
}

@keyframes heartFall {
    0% { transform: translateY(0) rotate(0deg) scale(0.8); opacity: 0; }
    10% { opacity: 0.9; }
    90% { opacity: 0.7; }
    100% { transform: translateY(110vh) rotate(360deg) scale(1.2); opacity: 0; }
}

/* --- Gradient Animated Title --- */
.gradient-text {
    background: linear-gradient(270deg, #d6336c, #ff6b9d, #F4C430, #ff9eb5, #d6336c);
    background-size: 400% 400%;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: none;
    animation: gradientShift 6s ease-in-out infinite;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* --- Heartbeat Signature --- */
.heartbeat {
    animation: heartbeat 1.5s ease-in-out infinite;
    display: inline-block;
}

@keyframes heartbeat {
    0% { transform: scale(1); }
    14% { transform: scale(1.08); }
    28% { transform: scale(1); }
    42% { transform: scale(1.12); }
    56% { transform: scale(1); }
    100% { transform: scale(1); }
}

/* --- Closing Glow --- */
.closing-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: radial-gradient(
        circle,
        rgba(255, 182, 193, 0.3) 0%,
        rgba(255, 158, 181, 0.15) 40%,
        transparent 70%
    );
    z-index: -1;
    animation: closingGlowPulse 4s ease-in-out infinite;
    pointer-events: none;
}

@keyframes closingGlowPulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.6; }
    50% { transform: translate(-50%, -50%) scale(1.2); opacity: 1; }
}

/* --- Cinematic Section Transitions --- */
.section {
    transition: opacity 1s ease-in-out, transform 0.8s ease-in-out;
    transform: scale(0.95);
}

.section.active {
    opacity: 1;
    transform: scale(1);
}

/* --- Love Symbol Badge (fixed top-left) --- */
.love-symbol {
    position: fixed;
    top: 15px;
    left: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px 22px;
    background: linear-gradient(135deg, rgba(255, 182, 193, 0.3), rgba(255, 240, 245, 0.5));
    border-radius: 50px;
    border: 2px solid rgba(255, 105, 180, 0.3);
    box-shadow: 0 4px 25px rgba(255, 105, 180, 0.2), inset 0 0 15px rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(6px);
    z-index: 900;
}

.love-name {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 700;
    background: linear-gradient(135deg, #d6336c, #ff6b9d);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: none;
}

.love-heart {
    font-size: 1.6rem;
    color: #ff1744;
    animation: loveHeartPulse 1s ease-in-out infinite;
    filter: drop-shadow(0 0 8px rgba(255, 23, 68, 0.6));
    -webkit-text-fill-color: initial;
}

@keyframes loveHeartPulse {
    0%, 100% { transform: scale(1); }
    15% { transform: scale(1.25); }
    30% { transform: scale(1); }
    45% { transform: scale(1.2); }
    60% { transform: scale(1); }
}

/* --- Premium Photo Frame --- */
.tilt-frame {
    position: relative;
    transition: transform 0.4s ease;
    overflow: visible;
}

.tilt-frame:hover {
    transform: perspective(500px) rotateY(5deg) rotateX(-3deg) scale(1.05);
}

.frame-glow {
    position: absolute;
    top: -6px;
    left: -6px;
    right: -6px;
    bottom: -6px;
    border-radius: 18px;
    background: conic-gradient(from 0deg, #ff6b9d, #F4C430, #ff9eb5, #FFB6C1, #ff6b9d);
    z-index: -1;
    animation: rotateGlow 4s linear infinite;
    filter: blur(4px);
    opacity: 0.7;
}

@keyframes rotateGlow {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* --- Gallery Dots --- */
.gallery-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 12px;
}

.gallery-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(214, 51, 108, 0.25);
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
}

.gallery-dot.active {
    background: #d6336c;
    transform: scale(1.3);
    box-shadow: 0 0 8px rgba(214, 51, 108, 0.5);
}

/* --- Promise Section --- */
.promise-wrapper {
    max-width: 650px;
}

.promise-list {
    text-align: left;
    margin: 1rem 0;
}

.promise-line {
    font-size: 1.05rem;
    line-height: 1.6;
    color: #555;
    padding: 12px 16px;
    margin: 8px 0;
    border-left: 3px solid #ff6b9d;
    background: rgba(255, 182, 193, 0.1);
    border-radius: 0 10px 10px 0;
    opacity: 0;
    transform: translateX(-20px);
    animation: promiseReveal 0.8s forwards;
}

.promise-line:nth-child(1) { animation-delay: 0.5s; }
.promise-line:nth-child(2) { animation-delay: 2s; }
.promise-line:nth-child(3) { animation-delay: 3.5s; }
.promise-line:nth-child(4) { animation-delay: 5s; }
.promise-line:nth-child(5) { animation-delay: 6.5s; }

@keyframes promiseReveal {
    to { opacity: 1; transform: translateX(0); }
}

/* --- Mini Confetti Sparkle --- */
.card-sparkle {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 100;
    animation: sparkleOut 0.6s ease-out forwards;
}

@keyframes sparkleOut {
    0% { opacity: 1; transform: translate(0, 0) scale(1); }
    100% { opacity: 0; transform: translate(var(--sx), var(--sy)) scale(0); }
}

/* --- Typewriter Closing --- */
.emotional-message .typed-line {
    opacity: 0;
    overflow: hidden;
    white-space: nowrap;
    border-right: 2px solid transparent;
    width: 0;
    display: inline-block;
}

.emotional-message .typed-line.typing {
    opacity: 1;
    animation: typeLine 2s steps(40) forwards, blinkType 0.6s step-end 3;
    border-right-color: #d6336c;
}

.emotional-message .typed-line.done {
    opacity: 1;
    width: auto;
    white-space: normal;
    border-right: none;
}

@keyframes typeLine {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blinkType {
    50% { border-right-color: transparent; }
}

/* --- Replay Button --- */
.replay-btn {
    background: linear-gradient(135deg, #F4C430, #ff6b9d);
    box-shadow: 0 4px 15px rgba(244, 196, 48, 0.4);
}

.replay-btn:hover {
    box-shadow: 0 6px 20px rgba(244, 196, 48, 0.6);
}

/* --- Fade-in Utility --- */
.fade-in {
    animation: fadeInUp 1s ease forwards;
}

/* --- Subtitle (non-animated) --- */
.subtitle-static {
    font-size: 1rem;
    color: #777;
    margin-bottom: 1rem;
    font-style: italic;
}

/* --- Scratch Card --- */
.scratch-container {
    position: relative;
    width: 320px;
    height: 180px;
    margin: 0 auto;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.scratch-container canvas {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2;
    cursor: crosshair;
    border-radius: 15px;
}

.scratch-message {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: linear-gradient(135deg, #fff5f5, #ffe4ec);
    padding: 20px;
    z-index: 1;
    border-radius: 15px;
}

.scratch-message p {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    color: #d6336c;
    line-height: 1.5;
}

/* --- Love Quiz --- */
.quiz-wrapper {
    max-height: 85vh;
    overflow-y: auto;
}

.quiz-container {
    text-align: left;
    margin: 1rem 0;
}

.quiz-question {
    margin-bottom: 1.5rem;
}

.quiz-question h3 {
    font-size: 1rem;
    color: #d6336c;
    margin-bottom: 0.5rem;
    font-family: var(--font-body);
}

.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.quiz-option {
    padding: 10px 15px;
    border: 2px solid rgba(255, 105, 180, 0.2);
    border-radius: 10px;
    background: rgba(255, 240, 245, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    text-align: left;
}

.quiz-option:hover {
    border-color: #ff6b9d;
    background: rgba(255, 182, 193, 0.3);
}

.quiz-option.selected {
    border-color: #d6336c;
    background: rgba(214, 51, 108, 0.1);
    font-weight: bold;
}

.quiz-option.correct {
    border-color: #28a745;
    background: rgba(40, 167, 69, 0.1);
}

.quiz-option.wrong {
    border-color: #dc3545;
    background: rgba(220, 53, 69, 0.1);
    opacity: 0.6;
}

.quiz-result {
    text-align: center;
    padding: 15px;
    font-size: 1.2rem;
    font-family: var(--font-heading);
    color: #d6336c;
    margin-top: 1rem;
}

/* --- Timeline --- */
.timeline-wrapper {
    max-width: 650px;
    overflow-y: auto;
    max-height: 80vh;
}

.timeline {
    position: relative;
    padding-left: 40px;
    margin: 1rem 0;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(to bottom, #ff6b9d, #FFB6C1, #F4C430);
    border-radius: 3px;
}

.timeline-item {
    position: relative;
    margin-bottom: 1.5rem;
    opacity: 0;
    transform: translateX(-20px);
    animation: timelineReveal 0.6s forwards;
}

.timeline-item:nth-child(1) { animation-delay: 0.3s; }
.timeline-item:nth-child(2) { animation-delay: 1s; }
.timeline-item:nth-child(3) { animation-delay: 1.7s; }
.timeline-item:nth-child(4) { animation-delay: 2.4s; }
.timeline-item:nth-child(5) { animation-delay: 3.1s; }

@keyframes timelineReveal {
    to { opacity: 1; transform: translateX(0); }
}

.timeline-dot {
    position: absolute;
    left: -33px;
    top: 5px;
    font-size: 1.2rem;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(255, 105, 180, 0.3);
}

.timeline-content {
    background: rgba(255, 240, 245, 0.6);
    padding: 12px 16px;
    border-radius: 12px;
    border-left: 3px solid #ff6b9d;
}

.timeline-content h3 {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    color: #d6336c;
    margin-bottom: 4px;
}

.timeline-content p {
    font-size: 0.95rem;
    color: #666;
    line-height: 1.4;
}

/* --- Wish Jar --- */
.wish-jar-section {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px dashed rgba(255, 105, 180, 0.3);
}

.wish-jar-title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    color: #d6336c;
    margin-bottom: 0.3rem;
}

.wish-jar-desc {
    font-size: 0.9rem;
    color: #888;
    margin-bottom: 1rem;
}

.wish-input-row {
    display: flex;
    gap: 8px;
    margin-bottom: 1rem;
}

.wish-input {
    flex: 1;
    padding: 10px 15px;
    border: 2px solid rgba(255, 105, 180, 0.3);
    border-radius: 25px;
    font-size: 0.95rem;
    font-family: var(--font-body);
    outline: none;
    transition: border-color 0.3s;
}

.wish-input:focus {
    border-color: #d6336c;
}

.wish-add-btn {
    background: linear-gradient(135deg, #ff6b9d, #FFB6C1);
    border: none;
    border-radius: 50%;
    width: 42px;
    height: 42px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: transform 0.2s;
}

.wish-add-btn:hover {
    transform: scale(1.1);
}

.wish-jar {
    position: relative;
    font-size: 4rem;
    text-align: center;
    min-height: 80px;
}

.wish-notes {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    margin-top: 0.5rem;
}

.wish-note {
    background: linear-gradient(135deg, #fff5e1, #ffe4ec);
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    color: #555;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    animation: wishDrop 0.5s ease;
    transform-origin: top center;
}

@keyframes wishDrop {
    0% { transform: translateY(-20px) scale(0.8); opacity: 0; }
    100% { transform: translateY(0) scale(1); opacity: 1; }
}

/* --- Virtual Hug --- */
.hug-section {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px dashed rgba(255, 105, 180, 0.3);
    text-align: center;
}

.hug-text {
    font-size: 1rem;
    color: #777;
    margin-bottom: 0.8rem;
}

.hug-btn {
    font-size: 3rem;
    background: none;
    border: none;
    cursor: pointer;
    transition: transform 0.2s;
    user-select: none;
}

.hug-btn:active {
    transform: scale(1.3);
}

.hug-meter {
    width: 200px;
    height: 8px;
    background: rgba(255, 105, 180, 0.15);
    border-radius: 10px;
    margin: 0.8rem auto;
    overflow: hidden;
}

.hug-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #ff6b9d, #F4C430);
    border-radius: 10px;
    transition: width 0.1s linear;
}

.hug-counter {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    color: #d6336c;
    min-height: 1.5em;
}

/* ===== NEW FEATURE STYLES ===== */

/* --- Envelope Animation --- */
.envelope-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(248, 200, 220, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 1;
    transition: opacity 0.8s ease;
}

.envelope-overlay.hidden {
    display: none;
    opacity: 0;
}

.envelope-overlay.fade-out {
    opacity: 0;
    pointer-events: none;
}

.envelope {
    position: relative;
    width: 280px;
    height: 200px;
    perspective: 800px;
}

.envelope-body {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #fff5f5, #ffe0eb);
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(214, 51, 108, 0.2);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.envelope-flap {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 50%;
    background: linear-gradient(135deg, #ffccd5, #ffb3c1);
    clip-path: polygon(0 0, 50% 100%, 100% 0);
    transform-origin: top center;
    z-index: 3;
    transition: transform 1s ease-in-out;
}

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

.envelope-letter {
    background: white;
    padding: 20px;
    border-radius: 6px;
    width: 80%;
    text-align: center;
    transform: translateY(30px);
    opacity: 0;
    transition: all 0.8s ease 0.6s;
}

.envelope.open .envelope-letter {
    transform: translateY(-10px);
    opacity: 1;
}

.envelope-letter p {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    color: #d6336c;
    margin: 0;
}

.envelope-seal {
    position: absolute;
    top: 45%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    z-index: 4;
    animation: sealPulse 1.5s ease-in-out infinite;
    transition: opacity 0.5s ease 0.3s;
    filter: drop-shadow(0 2px 8px rgba(214, 51, 108, 0.5));
}

.envelope.open .envelope-seal {
    opacity: 0;
}

@keyframes sealPulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.15); }
}

/* --- Days Together Counter --- */
.days-together {
    margin: 1rem 0 1.5rem;
    font-family: var(--font-heading);
    font-size: 1.3rem;
    color: #d6336c;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    animation: fadeInUp 1s ease 0.5s both;
}

.days-together #days-count {
    font-size: 1.8rem;
    font-weight: 700;
    background: linear-gradient(135deg, #d6336c, #ff6b9d);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: none;
}

.days-heart {
    animation: loveHeartPulse 1s ease-in-out infinite;
    display: inline-block;
}

/* --- Polaroid Style Gallery --- */
.polaroid-board {
    background: linear-gradient(135deg, rgba(139, 109, 78, 0.08), rgba(160, 130, 90, 0.06));
    border-radius: 15px;
    padding: 15px;
}

.polaroid {
    background: white;
    padding: 12px 12px 40px 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.12), 0 1px 3px rgba(0, 0, 0, 0.08);
    transform: rotate(-1deg);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    position: relative;
    margin: 0 auto;
    max-width: 90%;
}

.polaroid::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%) rotate(3deg);
    width: 60px;
    height: 20px;
    background: rgba(255, 228, 181, 0.7);
    border-radius: 2px;
    z-index: 5;
}

.polaroid:hover {
    transform: rotate(0deg) scale(1.02);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.polaroid img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 2px;
}

.polaroid-caption {
    font-family: 'Caveat', cursive;
    font-size: 1.15rem;
    color: #555;
    text-align: center;
    margin-top: 8px;
    padding: 0;
}

.slide:nth-child(2) .polaroid {
    transform: rotate(1.5deg);
}

.slide:nth-child(3) .polaroid {
    transform: rotate(-2deg);
}

/* --- Falling Petals --- */
#petal-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
    overflow: hidden;
}

.petal {
    position: absolute;
    top: -30px;
    width: 15px;
    height: 15px;
    border-radius: 50% 0 50% 50%;
    opacity: 0;
    animation: petalFall linear forwards;
}

.petal.pink { background: rgba(255, 182, 193, 0.7); }
.petal.rose { background: rgba(255, 143, 163, 0.6); }
.petal.light { background: rgba(255, 228, 225, 0.8); }
.petal.blush { background: rgba(255, 192, 203, 0.65); }

@keyframes petalFall {
    0% {
        transform: translateX(0) rotate(0deg) scale(0.8);
        opacity: 0;
    }
    10% {
        opacity: 0.8;
    }
    25% {
        transform: translateX(30px) rotate(90deg) scale(1);
    }
    50% {
        transform: translateX(-20px) rotate(180deg) scale(1.1);
    }
    75% {
        transform: translateX(25px) rotate(270deg) scale(0.9);
        opacity: 0.6;
    }
    100% {
        transform: translateX(-10px) rotate(360deg) scale(0.7);
        opacity: 0;
        top: 110vh;
    }
}

/* --- Two Truths & a Lie --- */
.truth-wrapper {
    max-width: 650px;
    max-height: 85vh;
    overflow-y: auto;
}

.truth-round {
    margin-bottom: 1.5rem;
}

.truth-round h3 {
    font-size: 1rem;
    color: #d6336c;
    margin-bottom: 0.7rem;
    font-family: var(--font-body);
}

.truth-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.truth-option {
    padding: 12px 16px;
    border: 2px solid rgba(255, 105, 180, 0.2);
    border-radius: 12px;
    background: rgba(255, 240, 245, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    text-align: left;
    position: relative;
}

.truth-option:hover {
    border-color: #ff6b9d;
    background: rgba(255, 182, 193, 0.3);
    transform: translateX(5px);
}

.truth-option.truth-revealed {
    border-color: #28a745;
    background: rgba(40, 167, 69, 0.08);
    cursor: default;
}

.truth-option.lie-revealed {
    border-color: #dc3545;
    background: rgba(220, 53, 69, 0.08);
    cursor: default;
    text-decoration: line-through;
    opacity: 0.7;
}

.truth-option.selected-correct {
    border-color: #28a745;
    background: rgba(40, 167, 69, 0.15);
    font-weight: bold;
}

.truth-option.selected-wrong {
    border-color: #dc3545;
    background: rgba(220, 53, 69, 0.15);
}

.truth-option .label-tag {
    font-size: 0.7rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-left: 8px;
    padding: 2px 6px;
    border-radius: 4px;
}

.truth-option .label-tag.truth-tag {
    background: rgba(40, 167, 69, 0.15);
    color: #28a745;
}

.truth-option .label-tag.lie-tag {
    background: rgba(220, 53, 69, 0.15);
    color: #dc3545;
}

.truth-result {
    text-align: center;
    padding: 15px;
    font-size: 1.2rem;
    font-family: var(--font-heading);
    color: #d6336c;
    margin-top: 1rem;
}

/* --- Mobile Responsiveness --- */
@media (max-width: 600px) {
    /* Typography */
    h1.main-title { font-size: 2rem; line-height: 1.2; }
    h2.section-title { font-size: 1.6rem; margin-bottom: 1rem; }
    p.subtitle { 
        white-space: normal !important; 
        overflow: visible !important;
        font-size: 0.95rem; 
        animation: none !important; 
        border-right: none !important; 
        width: auto !important;
    }
    p.subtitle-static { font-size: 0.95rem; }

    /* Love symbol badge - make smaller and don't overlap */
    .love-symbol {
        position: fixed;
        top: 8px;
        left: 8px;
        padding: 5px 12px;
        z-index: 900;
        font-size: 0.75rem;
    }
    .love-name { font-size: 1rem; }
    .love-heart { font-size: 1rem; }

    /* Sections - allow scrolling and fix flex centering cutoff bug */
    .section {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        overflow-y: auto;
        padding: 60px 10px 20px 10px;
        justify-content: flex-start;
    }

    /* Content wrapper - higher z-index than floating images */
    .content-wrapper { 
        padding: 1.2rem; 
        width: 95%; 
        max-width: 100%;
        max-height: none;
        margin: auto;
        position: relative;
        z-index: 10;
    }

    /* Floating images - lower opacity and behind content on mobile */
    .floating-image {
        opacity: 0.3 !important;
        z-index: 0 !important;
    }

    /* Landing page */
    .countdown-container { gap: 6px; flex-wrap: wrap; justify-content: center; }
    .countdown-item { padding: 6px 10px; min-width: 50px; }
    .countdown-item span { font-size: 1.3rem; }
    .countdown-item small { font-size: 0.6rem; }
    .days-together { font-size: 1rem; }
    .days-together #days-count { font-size: 1.3rem; }

    /* Gift box */
    .gift-container { width: 100px; height: 100px; }
    .photo-frame { width: 180px; height: 180px; }

    /* Reasons grid */
    .reasons-grid { 
        grid-template-columns: repeat(2, 1fr); 
        max-height: 60vh; 
        gap: 10px;
    }
    .reason-card { height: 160px; }
    .card-front { font-size: 0.85rem; }
    .card-back { font-size: 0.8rem; }

    /* Gallery */
    .gallery-wrapper { height: 250px; }
    .gallery-container { margin: 10px 0; }
    .polaroid { padding: 6px 6px 25px 6px; }
    .polaroid img { height: 160px; }
    .polaroid-caption { font-size: 0.9rem; }
    .nav-btn { width: 32px; height: 32px; font-size: 1rem; }

    /* Scratch card */
    .scratch-container { 
        width: 100%;
        max-width: 320px;
        height: auto;
        aspect-ratio: 16/9;
        transform: none; 
    }
    .scratch-container canvas {
        width: 100%;
        height: 100%;
    }

    /* Quiz */
    .quiz-wrapper { width: 95%; }
    .quiz-question h3 { font-size: 1rem; }
    .quiz-option { font-size: 0.9rem; padding: 8px 12px; }

    /* Truth or Lie */
    .truth-wrapper { width: 95%; }
    .truth-option { font-size: 0.85rem; padding: 10px; }

    /* Love Letter */
    .letter-wrapper { width: 95%; }
    .letter-paper { padding: 1rem 1.2rem; max-height: 45vh; }
    .letter-content { font-size: 1rem; line-height: 1.8; }

    /* Promise */
    .promise-wrapper { width: 95%; }
    .promise-line { font-size: 0.95rem; }

    /* Timeline */
    .timeline-wrapper { width: 95%; }
    .timeline-content h3 { font-size: 1rem; }
    .timeline-content p { font-size: 0.85rem; }

    /* Wish Jar */
    .wish-input { font-size: 0.9rem; }
    .wish-jar { font-size: 3rem; }

    /* Closing */
    .centered-emotional { padding: 1.5rem; }
    .final-title { font-size: 1.8rem; }
    .emotional-message p { font-size: 0.95rem; }
    .signature { font-size: 1.5rem; }
    .closing-glow { width: 250px; height: 250px; }
    .hug-btn { font-size: 2rem; }

    /* Envelope */
    .envelope { width: 200px; height: 140px; }
    .envelope-letter p { font-size: 1rem; }

    /* Buttons */
    .cta-btn { font-size: 0.95rem; padding: 10px 24px; }

    /* Volume popup */
    .volume-popup { padding: 2rem 1.5rem; }
    .volume-icon { font-size: 3rem; }
    .volume-text { font-size: 1rem; }
}

/* --- Volume Popup --- */
.volume-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    opacity: 1;
    transition: opacity 0.5s ease;
}

.volume-popup-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.volume-popup {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: 24px;
    padding: 2.5rem 2rem;
    text-align: center;
    max-width: 340px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(214, 51, 108, 0.25), 0 0 60px rgba(255, 182, 193, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.5);
    animation: popupBounceIn 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.volume-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: volumePulse 1.5s ease-in-out infinite;
}

.volume-text {
    font-family: var(--font-body);
    font-size: 1.15rem;
    color: #555;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

@keyframes popupBounceIn {
    0% { transform: scale(0.3); opacity: 0; }
    50% { transform: scale(1.05); }
    70% { transform: scale(0.95); }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes volumePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}
