body {
    background: linear-gradient(-45deg, #ffe6fa, #ffc0cb, #f8bbd0, #e1bee7);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    font-family: 'Nunito', sans-serif;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden;
    scroll-behavior: smooth;
}

.romance-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(60% 60% at 50% 40%, rgba(255, 255, 255, 0.35) 0%, rgba(255, 255, 255, 0) 60%),
        radial-gradient(50% 50% at 20% 20%, rgba(255, 182, 193, 0.25) 0%, rgba(255, 182, 193, 0) 70%),
        radial-gradient(50% 50% at 80% 30%, rgba(255, 105, 180, 0.18) 0%, rgba(255, 105, 180, 0) 70%);
    mix-blend-mode: screen;
    opacity: 0.9;
    animation: glowPulse 6s ease-in-out infinite;
}

html {
    scroll-behavior: smooth;
}

.buttons {
    display: flex;
    justify-content: center;
    margin-top: 20px;
    flex-direction: row;
    align-items: end;
    flex-wrap: wrap;
    opacity: 1;
    visibility: visible;
    transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.buttons.hide {
    opacity: 0;
    visibility: hidden;
}

#no-button {
    margin: 0 10px;
    color: #ff4081;
    background-color: #ffebee;
    border: 2px solid #ff4081;
    min-height: 44px;
    min-width: 44px;
    height: auto;
    padding: 10px 20px;
    width: auto;
    cursor: pointer;
    margin-top: 10px;
    border-radius: 50px;
    font-weight: 700;
    transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    touch-action: manipulation;
    box-shadow: 0 4px 12px rgba(255, 64, 129, 0.15);
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;

    p {
        margin: 0;
        object-fit: contain;
        transition: all 0.3s ease;
        font-size: 1rem;
    }
}

#no-button:hover {
    box-shadow: 0 6px 20px rgba(255, 64, 129, 0.25);
}

#yes-button {
    margin: 0 10px;
    color: white;
    border: none;
    background-color: #ff4081;
    cursor: pointer;
    min-height: 44px;
    min-width: 44px;
    height: auto;
    padding: 10px 20px;
    border-radius: 50px;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(255, 64, 129, 0.3);
    touch-action: manipulation;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    animation: heartPulse 2.2s ease-in-out infinite;
    will-change: transform, box-shadow;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;

    p {
        margin: 0;
        object-fit: contain;
        font-size: 1rem;
    }
}

#yes-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 64, 129, 0.4);
}

/* Make responsive for mobile */
@media (max-width: 768px) {
    body {
        padding: 0;
        min-height: 100vh;
        overflow-x: hidden;
    }

    .container {
        padding: 20px 15px;
        width: 95%;
        margin: 20px auto;
        border-radius: 20px;
        max-width: 100%;
    }

    #question-heading {
        font-size: clamp(1.3rem, 4.5vw, 1.8rem);
        margin-bottom: 20px;
    }

    .buttons {
        flex-wrap: wrap;
        justify-content: center;
        gap: 12px;
    }

    #no-button {
        margin: 5px;
        font-size: 0.9rem;
        padding: 10px 18px;
        min-height: 44px;
    }

    #yes-button {
        margin: 5px;
        font-size: 0.9rem;
        padding: 10px 18px;
        min-height: 44px;
    }

    .banner-gif {
        width: 100%;
        height: auto;
        margin-top: 15px;
    }

    .banner-gif img {
        max-width: 100%;
        height: auto;
        max-height: 250px;
        border-radius: 12px;
    }

    #reset-button {
        margin-top: 15px;
        padding: 12px 24px;
        font-size: 0.95rem;
        min-height: 44px;
    }

    .floating-envelope {
        bottom: 70px;
        right: 15px;
        font-size: 40px;
    }

    #countdown-container {
        margin-bottom: 12px;
        padding: 0 10px;
    }

    #countdown-container p {
        font-size: 0.9rem;
    }

    #timer {
        font-size: 0.95rem;
        padding: 6px 16px;
    }
}

.container {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    margin-top: 0;
    padding: 30px 20px;
    text-align: center;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    max-width: 600px;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    animation: softRise 1s ease-out both;
    position: relative;
    z-index: 1;
    margin-left: auto;
    margin-right: auto;
    width: 90%;
}

#question-heading {
    font-family: 'Pacifico', cursive;
    color: #d81b60;
    font-size: clamp(1.5rem, 5vw, 2rem);
    transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    line-height: 1.3;
    word-wrap: break-word;
}

.message {
    display: none;
    opacity: 0;
    visibility: hidden;
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.message.show {
    display: block;
    opacity: 1;
    visibility: visible;
}

.banner-gif {
    width: 100%;
    height: auto;
    margin-top: 20px;

    img {
        max-width: 100%;
        height: auto;
        border-radius: 15px;
        box-shadow: 0 8px 20px rgba(0,0,0,0.15);
        object-fit: cover;
    }
}


.creator {
    text-decoration: none;
    color: #333;
}

.creator:visited {
    text-decoration: none;
    color: #333;
}

.creator:hover {
    text-decoration: underline;
    color: #555;
}

#reset-button {
    margin-top: 20px;
    padding: 10px 20px;
    background-color: #ff4081;
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    cursor: pointer;
    font-family: 'Nunito', sans-serif;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 4px 12px rgba(255, 64, 129, 0.25);
}

#reset-button:hover {
    transform: translateY(-3px) scale(1.05);
    background-color: #f50057;
    box-shadow: 0 8px 20px rgba(255, 64, 129, 0.4);
}

#reset-button:active {
    transform: translateY(-1px) scale(0.98);
}

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

.floating-hearts span {
    position: absolute;
    bottom: -50px;
    display: block;
    font-size: clamp(20px, 5vw, 30px);
    animation: floatUp 15s linear infinite;
    opacity: 0;
    will-change: transform, opacity;
}

@keyframes floatUp {
    0% {
        bottom: -50px;
        opacity: 1;
        transform: translateX(0) rotate(0deg);
    }
    100% {
        bottom: 100%;
        opacity: 0;
        transform: translateX(100px) rotate(360deg);
    }
}

.floating-hearts span:nth-child(1) { left: 10%; animation-duration: 12s; animation-delay: 0s; }
.floating-hearts span:nth-child(2) { left: 20%; animation-duration: 15s; animation-delay: 2s; font-size: 40px; }
.floating-hearts span:nth-child(3) { left: 30%; animation-duration: 10s; animation-delay: 4s; }
.floating-hearts span:nth-child(4) { left: 40%; animation-duration: 18s; animation-delay: 1s; font-size: 35px; }
.floating-hearts span:nth-child(5) { left: 50%; animation-duration: 14s; animation-delay: 3s; }
.floating-hearts span:nth-child(6) { left: 60%; animation-duration: 11s; animation-delay: 5s; font-size: 45px; }
.floating-hearts span:nth-child(7) { left: 70%; animation-duration: 16s; animation-delay: 2s; }
.floating-hearts span:nth-child(8) { left: 80%; animation-duration: 13s; animation-delay: 4s; font-size: 25px; }
.floating-hearts span:nth-child(9) { left: 90%; animation-duration: 17s; animation-delay: 1s; }
.floating-hearts span:nth-child(10) { left: 5%; animation-duration: 19s; animation-delay: 6s; font-size: 50px; }
.floating-hearts span:nth-child(11) { left: 15%; animation-duration: 12s; animation-delay: 7s; }
.floating-hearts span:nth-child(12) { left: 25%; animation-duration: 15s; animation-delay: 8s; font-size: 30px; }
.floating-hearts span:nth-child(13) { left: 35%; animation-duration: 10s; animation-delay: 9s; }
.floating-hearts span:nth-child(14) { left: 45%; animation-duration: 18s; animation-delay: 5s; font-size: 40px; }
.floating-hearts span:nth-child(15) { left: 55%; animation-duration: 14s; animation-delay: 2s; }

/* Carousel Styles */
#carousel {
    position: relative;
    height: 500px;
    width: 100%;
    overflow: hidden;
}

#carousel img {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 1s ease-in-out;
    height: 100%;
    width: auto;
}

#carousel img.active {
    opacity: 1;
}

/* Vertical Carousel Belts */
.carousel-belt {
    position: fixed;
    top: 0;
    bottom: 0;
    width: 150px;
    overflow: hidden;
    z-index: -2; /* Behind hearts and main content */
    pointer-events: none;
}

.carousel-belt::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(255, 255, 255, 0.9) 0%,
        rgba(255, 255, 255, 0.1) 20%,
        rgba(255, 255, 255, 0.0) 50%,
        rgba(255, 255, 255, 0.1) 80%,
        rgba(255, 255, 255, 0.9) 100%
    );
    z-index: 1;
}

.left-belt {
    left: 30px;
}

.right-belt {
    right: 30px;
}

.belt-track {
    display: flex;
    flex-direction: column;
    width: 100%;
    animation: scrollVertical 20s linear infinite;
}

.carousel-belt:hover .belt-track {
    animation-play-state: paused;
}

.right-belt .belt-track {
    animation-direction: reverse;
    animation-duration: 22s;
}

.left-belt .belt-track {
    animation-duration: 28s;
}

.belt-track img {
    width: 100%;
    height: auto;
    display: block;
    margin-bottom: 15px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    opacity: 0.9;
    filter: blur(0.35px) saturate(1.05);
}

.left-belt .belt-track img {
    transform: rotate(-5deg);
}

.right-belt .belt-track img {
    transform: rotate(5deg);
}

@keyframes scrollVertical {
    0% { transform: translateY(0); }
    100% { transform: translateY(-50%); }
}

@media (max-width: 768px) {
    .container {
        padding: 20px;
        width: 85%;
    }
    .banner-gif img {
        height: 250px;
    }
    #carousel {
        height: 250px;
    }

    /* Horizontal Carousel Belts for Mobile */
    .carousel-belt {
        width: 100%;
        height: 140px;
        left: 0;
        right: 0;
    }

    .left-belt {
        top: 0;
        bottom: auto;
    }

    .right-belt {
        top: auto;
        bottom: 0;
    }

    .belt-track {
        flex-direction: row;
        width: max-content;
        height: 100%;
        animation-name: scrollHorizontal;
    }

    .belt-track img {
        height: 100%;
        width: auto;
        margin-bottom: 0;
        margin-right: 10px;
        transform: rotate(0deg) !important;
    }

    .carousel-belt::before {
        background: linear-gradient(
            to right,
            rgba(255, 255, 255, 0.9) 0%,
            rgba(255, 255, 255, 0.2) 20%,
            rgba(255, 255, 255, 0.0) 50%,
            rgba(255, 255, 255, 0.2) 80%,
            rgba(255, 255, 255, 0.9) 100%
        );
    }

    .left-belt .belt-track {
        animation-duration: 24s;
    }

    .right-belt .belt-track {
        animation-duration: 18s;
    }
}

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

@keyframes heartPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 4px 15px rgba(255, 64, 129, 0.3);
    }
    50% {
        transform: scale(1.06);
        box-shadow: 0 8px 25px rgba(255, 64, 129, 0.45);
    }
}

@keyframes softRise {
    0% {
        transform: translateY(10px);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes glowPulse {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; }
}

@keyframes scrollHorizontal {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* Sparkle Effect */
.sparkle {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    animation: sparkleFade 1s linear forwards;
}

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

/* Countdown Timer */
#countdown-container {
    margin-bottom: 15px;
    font-family: 'Nunito', sans-serif;
    color: #d81b60;
    cursor: pointer;
    transition: transform 0.2s;
}

#countdown-container:hover {
    transform: scale(1.05);
}

#countdown-container p {
    margin: 0 0 5px 0;
    font-weight: 700;
    font-size: 1rem;
    transition: opacity 0.3s ease-in-out;
}

#timer {
    font-size: 1.1rem;
    background: #ffebee;
    padding: 8px 20px;
    border-radius: 50px;
    display: inline-block;
    border: 2px solid #ff4081;
    color: #d81b60;
    font-weight: 700;
    box-shadow: 0 4px 10px rgba(255, 64, 129, 0.2);
}

/* Floating Envelope Icon */
.floating-envelope {
    position: fixed;
    bottom: 30px;
    right: 30px;
    font-size: 50px;
    cursor: pointer;
    animation: floatEnvelope 3s ease-in-out infinite;
    z-index: 1000;
    transition: transform 0.3s;
    display: none;
}

.floating-envelope:hover {
    transform: scale(1.2) rotate(10deg);
}

.floating-envelope.active {
    animation: floatEnvelope 3s ease-in-out infinite, envelopePulse 0.6s ease-in-out infinite;
    box-shadow: 0 0 20px rgba(255, 64, 129, 0.8);
}

@keyframes floatEnvelope {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

@keyframes envelopePulse {
    0%, 100% { 
        box-shadow: 0 0 20px rgba(255, 64, 129, 0.8), 0 0 40px rgba(255, 64, 129, 0.4);
    }
    50% { 
        box-shadow: 0 0 30px rgba(255, 64, 129, 1), 0 0 60px rgba(255, 64, 129, 0.6);
    }
}

/* Modal Styles */
.modal {
    display: none; 
    position: fixed; 
    z-index: 10000; 
    left: 0;
    top: 0;
    width: 100%; 
    height: 100%; 
    overflow: auto; 
    background-color: rgba(0,0,0,0.5); 
    backdrop-filter: blur(5px);
    animation: fadeIn 0.5s;
}

.modal-content {
    background-color: #fff0f5;
    margin: 30% auto;
    padding: 25px;
    border: 2px solid #ff4081;
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 5px 30px rgba(0,0,0,0.3);
    position: relative;
    text-align: left;
    font-family: 'Nunito', sans-serif;
    color: #d81b60;
    max-height: 80vh;
    overflow-y: auto;
}

.close-modal {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
}

.close-modal:hover,
.close-modal:focus {
    color: #ff4081;
    text-decoration: none;
    cursor: pointer;
}

@keyframes fadeIn {
    from {opacity: 0} 
    to {opacity: 1}
}

/* Mobile adjustments for new features */
@media (max-width: 768px) {
    .modal-content {
        width: 90%;
        margin: 30% auto;
        padding: 20px;
    }
    
    .floating-envelope {
        bottom: 20px;
        right: 20px;
        font-size: 40px;
    }
}

/* Dark Mode Styles */
:root {
    --bg-light: white;
    --text-light: #333;
    --container-light: rgba(255, 255, 255, 0.9);
}

body.dark-mode {
    background: linear-gradient(-45deg, #1a1a2e, #16213e, #0f3460, #533483);
    color: #ecf0f1;
}

body.dark-mode .container {
    background: rgba(26, 26, 46, 0.95);
    color: #ecf0f1;
}

body.dark-mode h1, body.dark-mode h2 {
    color: #ff6b9d;
}

body.dark-mode #question-heading {
    color: #ff6b9d;
}

/* Theme Toggle Button */
.theme-toggle {
    position: fixed;
    top: 15px;
    left: 15px;
    background: #ff4081;
    border: none;
    padding: 10px 14px;
    border-radius: 50px;
    cursor: pointer;
    font-size: clamp(1rem, 4vw, 1.2rem);
    z-index: 1100;
    transition: transform 0.3s, box-shadow 0.3s;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    min-height: 44px;
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
}

.theme-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 15px rgba(255, 64, 129, 0.4);
}

/* Music Controls */
.music-controls {
    position: fixed;
    top: 15px;
    right: 15px;
    background: linear-gradient(135deg, #ff4081 0%, #f50057 100%);
    border-radius: 50px;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 8px 20px rgba(255, 64, 129, 0.35), 0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 1100;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
    -webkit-tap-highlight-color: transparent;
}

.music-controls:hover {
    box-shadow: 0 12px 30px rgba(255, 64, 129, 0.5), 0 2px 8px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

body.dark-mode .music-controls {
    background: linear-gradient(135deg, #ff6b9d 0%, #ff4081 100%);
    border-color: rgba(255, 107, 157, 0.3);
}

.music-btn {
    background: rgba(255, 255, 255, 0.25);
    border: 2px solid rgba(255, 255, 255, 0.4);
    padding: 8px 12px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    min-height: 40px;
    backdrop-filter: blur(5px);
    -webkit-tap-highlight-color: transparent;
}

.music-btn:hover {
    transform: scale(1.2) rotate(5deg);
    background: rgba(255, 255, 255, 0.35);
    border-color: rgba(255, 255, 255, 0.6);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.4);
}

.music-btn:active {
    transform: scale(0.95);
}

.volume-slider {
    width: 100px;
    height: 5px;
    cursor: pointer;
    border-radius: 10px;
    background: linear-gradient(to right, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.5));
    -webkit-appearance: none;
    appearance: none;
    outline: none;
    touch-action: none;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

.volume-slider::-webkit-slider-thumb:hover {
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.8), 0 2px 8px rgba(0, 0, 0, 0.3);
    transform: scale(1.2);
}

.volume-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

.volume-slider::-moz-range-thumb:hover {
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.8), 0 2px 8px rgba(0, 0, 0, 0.3);
    transform: scale(1.2);
}

#volume-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: white;
    min-width: 28px;
    text-align: right;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Score Counter */
.score-counter {
    display: none;
    text-align: center;
    margin-top: 12px;
    padding: 12px 20px;
    background: #ffebee;
    border-radius: 50px;
    border: 2px solid #ff4081;
    color: #d81b60;
    font-weight: 700;
    font-size: 0.95rem;
    word-break: break-word;
}

body.dark-mode .score-counter {
    background: rgba(255, 64, 129, 0.2);
    border-color: #ff6b9d;
    color: #ff6b9d;
}

.score-counter p {
    margin: 0;
    font-size: 0.95rem;
}

/* Final Score Display */
.final-score {
    text-align: center;
    margin: 15px 0;
    padding: 12px;
    background: #ffebee;
    border-radius: 15px;
    color: #d81b60;
    font-weight: 700;
    word-break: break-word;
}

body.dark-mode .final-score {
    background: rgba(255, 64, 129, 0.2);
    color: #ff6b9d;
}

@media (max-width: 768px) {
    .music-controls {
        top: 15px;
        right: 15px;
        padding: 10px 12px;
        gap: 8px;
    }

    .volume-slider {
        width: 80px;
    }

    .music-btn {
        padding: 8px 10px;
        min-width: 35px;
        min-height: 35px;
        font-size: 0.9rem;
    }

    #volume-label {
        font-size: 0.7rem;
        min-width: 22px;
    }

    .theme-toggle {
        left: 12px;
    }
}