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

body {
    font-family: 'Sarabun', sans-serif;
    background: #ff6b6b;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
    position: relative;
}

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

.heart {
    position: absolute;
    font-size: 30px;
    color: rgba(255, 255, 255, 0.3);
    animation: float 15s infinite;
}

.heart::before {
    content: '💕';
}

.heart:nth-child(1) {
    left: 10%;
    animation-delay: 0s;
    animation-duration: 12s;
}

.heart:nth-child(2) {
    left: 30%;
    animation-delay: 2s;
    animation-duration: 15s;
}

.heart:nth-child(3) {
    left: 50%;
    animation-delay: 4s;
    animation-duration: 18s;
}

.heart:nth-child(4) {
    left: 70%;
    animation-delay: 6s;
    animation-duration: 14s;
}

.heart:nth-child(5) {
    left: 90%;
    animation-delay: 8s;
    animation-duration: 16s;
}

@keyframes float {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }

    10% {
        opacity: 0.3;
    }

    90% {
        opacity: 0.3;
    }

    100% {
        transform: translateY(-100px) rotate(360deg);
        opacity: 0;
    }
}

/* Container */
.container {
    position: relative;
    z-index: 1;
    width: 90%;
    max-width: 600px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 30px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.6s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

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

/* Header */
.header {
    text-align: center;
    margin-bottom: 30px;
}

.title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #f5576c;
    margin-bottom: 10px;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

.subtitle {
    font-size: 1.2rem;
    color: #666;
    font-weight: 400;
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: #f5576c;
    width: 20%;
    transition: width 0.5s ease;
    border-radius: 10px;
}

.progress-text {
    text-align: center;
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 30px;
}

/* Question Container */
.question-container {
    position: relative;
    min-height: 300px;
}

.question-card {
    position: absolute;
    width: 100%;
    opacity: 0;
    transform: translateX(100px);
    pointer-events: none;
    transition: all 0.5s ease;
}

.question-card.active {
    opacity: 1;
    transform: translateX(0);
    pointer-events: all;
}

.question-card.exit {
    opacity: 0;
    transform: translateX(-100px);
}

.question-text {
    font-size: 1.8rem;
    color: #333;
    text-align: center;
    margin-bottom: 30px;
    font-weight: 600;
    line-height: 1.4;
}

/* Answers — 4 slot rows: 3 buttons + 1 empty for dodge space */
.answers {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding-bottom: 75px; /* reserve space for empty slot row */
    position: relative;
}

.answer-btn {
    padding: 20px 30px;
    font-size: 1.1rem;
    font-family: 'Sarabun', sans-serif;
    font-weight: 500;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #764ba2;
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.answer-btn:hover {
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

/* Dodge animation for wrong answers */
.answer-btn {
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.3s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-8px) rotate(-2deg); }
    40% { transform: translateX(8px) rotate(2deg); }
    60% { transform: translateX(-6px) rotate(-1deg); }
    80% { transform: translateX(6px) rotate(1deg); }
}

/* Thank You Popup */
.thank-you-popup {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 90%;
    transform: translate(-50%, -50%) scale(0.5);
    background: rgba(255, 255, 255, 0.97);
    border: 1px solid gray;
    border-radius: 20px;
    padding: 30px 40px;
    text-align: center;
    z-index: 100;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 10px 40px rgba(245, 87, 108, 0.3);
    pointer-events: none;
}

.thank-you-popup.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.thank-you-popup.hide {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.8);
    transition: all 0.3s ease;
}

.thank-you-emoji {
    font-size: 3rem;
    margin-bottom: 10px;
    animation: popBounce 0.6s ease;
}

.thank-you-text {
    font-size: 1.3rem;
    font-weight: 600;
    color: #f5576c;
}

@keyframes popBounce {
    0% { transform: scale(0); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

/* Final Message */
.final-message {
    text-align: center;
}

.celebration {
    animation: celebrationBounce 0.6s ease-out;
}

@keyframes celebrationBounce {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }

    50% {
        transform: scale(1.1);
    }

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

.final-title {
    font-size: 2.5rem;
    color: #f5576c;
    margin-bottom: 20px;
    font-weight: 700;
}

.final-text {
    font-size: 1.4rem;
    color: #333;
    margin-bottom: 15px;
    line-height: 1.6;
}

.heart-burst {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 30px 0;
    font-size: 2rem;
}

.burst-heart {
    display: inline-block;
    animation: burstAnimation 1s ease-out infinite;
}

.burst-heart:nth-child(1) {
    animation-delay: 0s;
}

.burst-heart:nth-child(2) {
    animation-delay: 0.2s;
}

.burst-heart:nth-child(3) {
    animation-delay: 0.4s;
}

.burst-heart:nth-child(4) {
    animation-delay: 0.6s;
}

.burst-heart:nth-child(5) {
    animation-delay: 0.8s;
}

@keyframes burstAnimation {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.3);
    }
}

.love-message {
    font-size: 2rem;
    font-weight: 700;
    color: #f5576c;
    margin-top: 20px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 30px 20px;
    }

    .title {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .question-text {
        font-size: 1.4rem;
    }

    .answer-btn {
        padding: 15px 20px;
        font-size: 1rem;
    }

    .final-title {
        font-size: 2rem;
    }

    .final-text {
        font-size: 1.2rem;
    }

    .heart-burst {
        font-size: 1.5rem;
        gap: 15px;
    }
}