* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

:root {
    --primary: #ff6b9d;
    --secondary: #c44569;
    --accent: #ff9ff3;
    --bg: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --text: #fff;
    --card-bg: rgba(255, 255, 255, 0.15);
}

html {
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

body {
    font-family: 'Poppins', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    font-size: 16px;
    line-height: 1.6;
}

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

.heart-particle {
    position: absolute;
    font-size: clamp(15px, 4vw, 25px);
    animation: float-up 15s linear infinite;
    opacity: 0.6;
    will-change: transform;
}

@keyframes float-up {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.6;
    }
    90% {
        opacity: 0.6;
    }
    100% {
        transform: translateY(-100px) rotate(360deg);
        opacity: 0;
    }
}

/* Hero Section */
.hero {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 1.5rem;
    position: relative;
    z-index: 1;
}

.floating-hearts {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
}

.heart-float {
    position: absolute;
    font-size: clamp(1.5rem, 5vw, 2.5rem);
    animation: float-random 8s ease-in-out infinite;
    opacity: 0.4;
}

.heart-float:nth-child(1) { left: 5%; animation-delay: 0s; }
.heart-float:nth-child(2) { left: 25%; animation-delay: 1s; }
.heart-float:nth-child(3) { left: 50%; animation-delay: 2s; }
.heart-float:nth-child(4) { left: 75%; animation-delay: 3s; }
.heart-float:nth-child(5) { left: 90%; animation-delay: 4s; }

@keyframes float-random {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-20px) rotate(10deg); }
    50% { transform: translateY(-10px) rotate(-10deg); }
    75% { transform: translateY(-30px) rotate(5deg); }
}

.title {
    font-family: 'Dancing Script', cursive;
    font-size: clamp(2.5rem, 12vw, 5rem);
    margin-bottom: 1rem;
    background: linear-gradient(45deg, #fff, #ff9ff3, #fff);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 3s ease-in-out infinite;
    line-height: 1.2;
    padding: 0 0.5rem;
}

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

.subtitle {
    font-size: clamp(1rem, 4vw, 1.5rem);
    margin-bottom: 2rem;
    opacity: 0.9;
    padding: 0 1rem;
}

.btn-reveal {
    background: linear-gradient(45deg, #ff6b9d, #ff9ff3);
    border: none;
    padding: 1.2rem 2.5rem;
    font-size: clamp(1rem, 4vw, 1.2rem);
    color: white;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(255, 107, 157, 0.5);
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    z-index: 2;
    min-width: 200px;
    min-height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-reveal:hover,
.btn-reveal:active {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 30px rgba(255, 107, 157, 0.7);
}

.btn-reveal:active {
    transform: translateY(-1px) scale(0.98);
}

/* Love Letter Section */
.love-letter {
    padding: 3rem 1rem;
    display: flex;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.envelope {
    background: linear-gradient(145deg, #ff6b9d, #c44569);
    padding: clamp(1.5rem, 5vw, 3rem);
    border-radius: 20px;
    max-width: 600px;
    width: 100%;
    margin: 0 0.5rem;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.3);
    position: relative;
    transform-style: preserve-3d;
    animation: envelope-pulse 3s ease-in-out infinite;
}

@keyframes envelope-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

.envelope::before {
    content: '💌';
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    font-size: clamp(2.5rem, 8vw, 4rem);
    animation: wiggle 2s ease-in-out infinite;
}

@keyframes wiggle {
    0%, 100% { transform: translateX(-50%) rotate(-5deg); }
    50% { transform: translateX(-50%) rotate(5deg); }
}

.letter-content {
    background: rgba(255, 255, 255, 0.95);
    color: #333;
    padding: clamp(1.5rem, 5vw, 2.5rem);
    border-radius: 15px;
    line-height: 1.8;
}

.letter-content h2 {
    font-family: 'Dancing Script', cursive;
    font-size: clamp(1.8rem, 6vw, 2.5rem);
    color: #c44569;
    margin-bottom: 1rem;
}

.letter-content p {
    margin-bottom: 1rem;
    font-size: clamp(0.95rem, 3.5vw, 1.1rem);
}

.signature {
    font-family: 'Dancing Script', cursive;
    font-size: clamp(1.2rem, 4vw, 1.5rem);
    color: #c44569;
    margin-top: 1.5rem;
    text-align: right;
}

/* Reasons Section */
.reasons {
    padding: 3rem 1rem;
    position: relative;
    z-index: 1;
}

.reasons h2 {
    text-align: center;
    font-family: 'Dancing Script', cursive;
    font-size: clamp(2rem, 8vw, 3rem);
    margin-bottom: 2rem;
    padding: 0 1rem;
}

.cards-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: clamp(0.8rem, 3vw, 1.5rem);
    max-width: 600px;
    margin: 0 auto;
    perspective: 1000px;
    padding: 0 0.5rem;
}

@media (min-width: 768px) {
    .cards-container {
        grid-template-columns: repeat(3, 1fr);
        max-width: 900px;
    }
}

.card {
    height: clamp(160px, 35vw, 220px);
    cursor: pointer;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.5s;
    -webkit-tap-highlight-color: transparent;
}

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

.card-front, .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    text-align: center;
}

.card-front {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.25), rgba(255, 255, 255, 0.1));
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.card-back {
    background: linear-gradient(145deg, #ff6b9d, #c44569);
    transform: rotateY(180deg);
}

.card-emoji {
    font-size: clamp(2rem, 8vw, 3rem);
    margin-bottom: 0.5rem;
}

.card-front p {
    font-size: clamp(0.85rem, 3.5vw, 1.1rem);
    font-weight: 600;
    line-height: 1.3;
}

.card-back p {
    font-size: clamp(0.8rem, 3vw, 1rem);
    line-height: 1.5;
}

/* Memory Lane */
.memory-lane {
    padding: 3rem 1rem;
    position: relative;
    z-index: 1;
}

.memory-lane h2 {
    text-align: center;
    font-family: 'Dancing Script', cursive;
    font-size: clamp(2rem, 8vw, 3rem);
    margin-bottom: 2rem;
}

.timeline {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    padding-left: 60px;
}

@media (max-width: 480px) {
    .timeline {
        padding-left: 50px;
    }
}

.timeline::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(to bottom, #ff6b9d, #ff9ff3);
    border-radius: 2px;
}

.moment {
    position: relative;
    margin-bottom: clamp(1.5rem, 5vw, 2.5rem);
    opacity: 0;
    transform: translateX(-30px);
    animation: slide-in 0.6s ease forwards;
}

.moment:nth-child(1) { animation-delay: 0.1s; }
.moment:nth-child(2) { animation-delay: 0.2s; }
.moment:nth-child(3) { animation-delay: 0.3s; }
.moment:nth-child(4) { animation-delay: 0.4s; }
.moment:nth-child(5) { animation-delay: 0.5s; }

@keyframes slide-in {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.moment-dot {
    position: absolute;
    left: 20px;
    top: 0;
    width: 36px;
    height: 36px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(1rem, 4vw, 1.2rem);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transform: translateX(calc(-50% + 2px));
}

.moment-content {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: clamp(1rem, 4vw, 1.5rem);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.moment-content h3 {
    font-size: clamp(1.1rem, 4vw, 1.3rem);
    margin-bottom: 0.4rem;
    color: #ff9ff3;
}

.moment-content p {
    font-size: clamp(0.9rem, 3.5vw, 1rem);
    line-height: 1.5;
}

/* Game Section */
.game-section {
    padding: 3rem 1rem;
    position: relative;
    z-index: 1;
}

.game-section h2 {
    text-align: center;
    font-family: 'Dancing Script', cursive;
    font-size: clamp(2rem, 8vw, 3rem);
    margin-bottom: 0.5rem;
}

.game-intro {
    text-align: center;
    font-size: clamp(0.9rem, 3.5vw, 1.1rem);
    opacity: 0.9;
    margin-bottom: 1.5rem;
    padding: 0 1rem;
}

.game-container {
    max-width: 800px;
    margin: 0 auto;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 20px;
    padding: 1rem;
    position: relative;
}

#gameCanvas {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 10px;
    background: linear-gradient(180deg, #87CEEB 0%, #E0F6FF 50%, #90EE90 50%, #228B22 100%);
}

.game-ui {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.game-controls {
    display: flex;
    gap: 1rem;
    font-size: clamp(0.8rem, 3vw, 0.95rem);
}

.game-controls span {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
}

.game-stats {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.game-stats span {
    font-size: clamp(1rem, 3.5vw, 1.2rem);
    font-weight: 600;
}

.btn-game {
    background: linear-gradient(45deg, #ff6b9d, #ff9ff3);
    border: none;
    padding: 0.6rem 1.5rem;
    font-size: clamp(0.9rem, 3vw, 1rem);
    color: white;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
}

.btn-game:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 107, 157, 0.5);
}

.game-overlay {
    position: absolute;
    top: 1rem;
    left: 1rem;
    right: 1rem;
    bottom: calc(1rem + 60px);
    background: rgba(0, 0, 0, 0.7);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.game-overlay.hidden {
    display: none;
}

.game-message {
    text-align: center;
    padding: 2rem;
}

.game-message h3 {
    font-family: 'Dancing Script', cursive;
    font-size: clamp(2rem, 8vw, 2.5rem);
    margin-bottom: 0.5rem;
}

.game-message p {
    font-size: clamp(0.9rem, 3.5vw, 1.1rem);
    margin-bottom: 1.5rem;
    opacity: 0.9;
}

/* Love-O-Meter Section */
.love-meter-section {
    padding: 3rem 1rem;
    position: relative;
    z-index: 1;
    text-align: center;
}

.love-meter-section h2 {
    font-family: 'Dancing Script', cursive;
    font-size: clamp(2rem, 8vw, 3rem);
    margin-bottom: 0.5rem;
}

.love-meter-intro {
    font-size: clamp(0.9rem, 3.5vw, 1.1rem);
    opacity: 0.9;
    margin-bottom: 2rem;
}

.love-meter-container {
    max-width: 400px;
    margin: 0 auto;
    position: relative;
    cursor: pointer;
    padding: 20px;
}

.love-meter-bg {
    width: 100%;
    height: 60px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 30px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 4px 15px rgba(0, 0, 0, 0.3);
    border: 3px solid rgba(255, 255, 255, 0.3);
}

.love-meter-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #ff6b9d, #ff9ff3, #c44569);
    border-radius: 27px;
    transition: width 2s ease-out;
    position: relative;
    overflow: hidden;
}

.love-meter-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.4),
        transparent
    );
    animation: shimmer-meter 2s infinite;
}

@keyframes shimmer-meter {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.love-meter-heart {
    font-size: 60px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.5s ease;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.love-meter-heart.active {
    font-size: 80px;
    animation: heartbeat-meter 0.5s ease infinite;
}

@keyframes heartbeat-meter {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.2); }
}

.love-meter-percentage {
    font-size: 24px;
    font-weight: bold;
    color: white;
    margin-top: 15px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.love-meter-message {
    font-family: 'Dancing Script', cursive;
    font-size: clamp(1.5rem, 5vw, 2rem);
    color: #ff9ff3;
    margin-top: 20px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease;
    min-height: 60px;
}

.love-meter-message.show {
    opacity: 1;
    transform: translateY(0);
}

/* Gallery Section */
.gallery-section {
    padding: 3rem 1rem;
    position: relative;
    z-index: 1;
}

.gallery-section h2 {
    text-align: center;
    font-family: 'Dancing Script', cursive;
    font-size: clamp(2rem, 8vw, 3rem);
    margin-bottom: 0.5rem;
}

.gallery-intro {
    text-align: center;
    font-size: clamp(0.9rem, 3.5vw, 1.1rem);
    opacity: 0.9;
    margin-bottom: 2rem;
    padding: 0 1rem;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: clamp(0.7rem, 3vw, 1.5rem);
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 0.5rem;
}

@media (min-width: 640px) {
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1024px) {
    .gallery-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.gallery-item {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    aspect-ratio: 1;
    background: rgba(255, 255, 255, 0.1);
    -webkit-tap-highlight-color: transparent;
}

.gallery-item:hover,
.gallery-item:active {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.gallery-item:hover img,
.gallery-item:active img {
    transform: scale(1.1);
}

.gallery-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85), transparent);
    padding: 2rem 0.8rem 0.8rem;
    color: white;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

/* Always show caption on touch devices */
@media (hover: none) {
    .gallery-caption {
        transform: translateY(0);
        padding: 1.5rem 0.6rem 0.6rem;
        background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent 80%);
    }
}

.gallery-item:hover .gallery-caption {
    transform: translateY(0);
}

.gallery-caption .date {
    display: inline-block;
    background: #ff6b9d;
    padding: 0.25rem 0.6rem;
    border-radius: 20px;
    font-size: clamp(0.7rem, 2.5vw, 0.85rem);
    font-weight: 600;
    margin-bottom: 0.3rem;
}

.gallery-caption p {
    font-size: clamp(0.75rem, 2.8vw, 0.9rem);
    line-height: 1.3;
}

/* Lightbox */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.98);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    touch-action: pan-y pinch-zoom;
}

.lightbox.active {
    display: flex;
}

.lightbox-img {
    max-width: 95%;
    max-height: 75vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: clamp(2rem, 10vw, 3rem);
    color: white;
    cursor: pointer;
    transition: color 0.3s ease;
    padding: 0.5rem;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.lightbox-close:hover,
.lightbox-close:active {
    color: #ff6b9d;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: clamp(1.5rem, 8vw, 2.5rem);
    color: white;
    cursor: pointer;
    padding: 1rem;
    min-width: 50px;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    user-select: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    backdrop-filter: blur(5px);
}

.lightbox-nav:hover,
.lightbox-nav:active {
    color: #ff6b9d;
    background: rgba(255, 255, 255, 0.2);
}

.lightbox-prev {
    left: 10px;
}

.lightbox-next {
    right: 10px;
}

@media (min-width: 768px) {
    .lightbox-prev {
        left: 20px;
    }
    .lightbox-next {
        right: 20px;
    }
}

.lightbox-caption {
    color: white;
    text-align: center;
    margin-top: 1rem;
    font-size: clamp(0.9rem, 3.5vw, 1.1rem);
    max-width: 90%;
    padding: 0 1rem;
    line-height: 1.5;
}

/* Final Message */
.final-message {
    padding: 4rem 1rem;
    text-align: center;
    position: relative;
    z-index: 1;
}

.heart-container {
    position: relative;
    display: inline-block;
}

.big-heart {
    font-size: clamp(5rem, 20vw, 8rem);
    animation: heartbeat 1.5s ease-in-out infinite;
    display: inline-block;
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    10% { transform: scale(1.1); }
    20% { transform: scale(1); }
    30% { transform: scale(1.1); }
    40% { transform: scale(1); }
}

.final-message h2 {
    font-family: 'Dancing Script', cursive;
    font-size: clamp(2rem, 10vw, 4rem);
    margin: 1.5rem 0;
}

.countdown-text {
    font-size: clamp(1rem, 4vw, 1.3rem);
    opacity: 0.9;
    padding: 0 1rem;
}

#days-count {
    font-weight: 700;
    color: #ff9ff3;
    font-size: clamp(1.2rem, 5vw, 1.5rem);
}

/* Footer */
footer {
    padding: 2rem 1rem;
    text-align: center;
    opacity: 0.8;
    position: relative;
    z-index: 1;
    font-size: clamp(0.85rem, 3vw, 1rem);
}

.year {
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

/* Confetti Animation */
.confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    pointer-events: none;
    animation: confetti-fall 3s linear forwards;
}

@keyframes confetti-fall {
    0% {
        transform: translateY(-100px) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* Accessibility - Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .heart-particle,
    .heart-float {
        animation: none;
    }
}
