/* ============================================
   BE MY VALENTINE - Styles
   ============================================ */

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

body {
    font-family: 'Quicksand', sans-serif;
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    background: linear-gradient(135deg, #ffeef8, #fff0f5, #ffe0ec);
    cursor: default;
}

/* ============================================
   SCREENS
   ============================================ */

.screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.8s ease;
    z-index: 1;
}

.screen.active {
    opacity: 1;
    pointer-events: all;
    z-index: 10;
}

/* ============================================
   FLOATING HEARTS BACKGROUND
   ============================================ */

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

.floating-heart {
    position: absolute;
    bottom: -50px;
    font-size: 20px;
    opacity: 0.3;
    animation: floatUp linear infinite;
}

@keyframes floatUp {
    0% {
        transform: translateY(0) rotate(0deg) scale(1);
        opacity: 0.3;
    }
    50% {
        opacity: 0.5;
    }
    100% {
        transform: translateY(-110vh) rotate(360deg) scale(0.5);
        opacity: 0;
    }
}

/* ============================================
   CAPTCHA SCREEN
   ============================================ */

.captcha-container {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(255, 45, 107, 0.15), 0 0 0 1px rgba(255, 45, 107, 0.1);
    width: 620px;
    max-width: 95vw;
    overflow: hidden;
    animation: slideUp 0.6s ease;
}

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

.captcha-header {
    background: linear-gradient(135deg, #ff2d6b, #ff6b9d);
    padding: 28px 24px;
    text-align: center;
    color: white;
}

.lock-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.captcha-title {
    font-family: 'Dancing Script', cursive;
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 4px;
}

.captcha-subtitle {
    font-size: 14px;
    opacity: 0.9;
    font-weight: 400;
}

.captcha-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    padding: 4px;
    background: #f0f0f0;
}

.captcha-cell {
    aspect-ratio: 1;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease;
}

.captcha-cell img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease, filter 0.3s ease;
}

.captcha-cell:hover img {
    transform: scale(1.05);
}

.captcha-cell.selected::after {
    content: '\2713';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 45, 107, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    color: white;
    font-weight: bold;
    animation: checkPop 0.3s ease;
}

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

.captcha-cell.selected img {
    filter: brightness(0.85);
}

.captcha-footer {
    padding: 18px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid #eee;
}

.captcha-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #666;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ddd;
    transition: background 0.3s ease;
}

.status-dot.success {
    background: #4caf50;
}

.status-dot.error {
    background: #f44336;
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.verify-btn {
    background: linear-gradient(135deg, #ff2d6b, #ff6b9d);
    color: white;
    border: none;
    padding: 12px 32px;
    border-radius: 8px;
    font-family: 'Quicksand', sans-serif;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.verify-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 45, 107, 0.4);
}

.verify-btn:active {
    transform: translateY(0);
}

/* Captcha error animation */
.captcha-container.error-shake {
    animation: containerShake 0.6s ease;
}

@keyframes containerShake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-8px); }
    20%, 40%, 60%, 80% { transform: translateX(8px); }
}

/* ============================================
   QUESTION SCREEN
   ============================================ */

.question-container {
    text-align: center;
    position: relative;
    padding: 40px;
}

.question-title {
    font-family: 'Dancing Script', cursive;
    font-size: clamp(36px, 7vw, 64px);
    color: #ff2d6b;
    margin-bottom: 20px;
    animation: titleAppear 1s ease 0.3s both;
    text-shadow: 2px 2px 10px rgba(255, 45, 107, 0.2);
}

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

/* Heart */
.heart-container {
    margin: 20px auto 40px;
    display: flex;
    justify-content: center;
}

.main-heart {
    position: relative;
    width: clamp(150px, 30vw, 220px);
    height: clamp(150px, 30vw, 220px);
    animation: heartAppear 0.8s ease 0.6s both;
    cursor: pointer;
}

.main-heart:hover .heart-svg {
    transform: scale(1.1);
}

.heart-svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 8px 20px rgba(255, 45, 107, 0.4));
    animation: heartbeat 1.2s ease-in-out infinite;
    transition: transform 0.3s ease;
}

.heart-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120%;
    height: 120%;
    background: radial-gradient(circle, rgba(255, 45, 107, 0.2) 0%, transparent 70%);
    animation: glowPulse 2s ease-in-out infinite;
}

@keyframes heartAppear {
    from {
        transform: scale(0) rotate(-30deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.2) rotate(5deg);
    }
    to {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    15% { transform: scale(1.15); }
    30% { transform: scale(1); }
    45% { transform: scale(1.1); }
    60% { transform: scale(1); }
}

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

/* Buttons */
.buttons-container {
    display: flex;
    gap: 30px;
    justify-content: center;
    align-items: center;
    animation: buttonsAppear 0.6s ease 1s both;
}

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

.answer-btn {
    padding: 16px 48px;
    border: none;
    border-radius: 50px;
    font-family: 'Quicksand', sans-serif;
    font-size: 20px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
}

.yes-btn {
    background: linear-gradient(135deg, #ff2d6b, #ff6b9d);
    color: white;
    box-shadow: 0 6px 25px rgba(255, 45, 107, 0.4);
    animation: yesGlow 2s ease-in-out infinite;
}

@keyframes yesGlow {
    0%, 100% { box-shadow: 0 6px 25px rgba(255, 45, 107, 0.4); }
    50% { box-shadow: 0 6px 40px rgba(255, 45, 107, 0.7), 0 0 60px rgba(255, 45, 107, 0.3); }
}

.yes-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 35px rgba(255, 45, 107, 0.6);
}

.no-btn {
    background: #e0e0e0;
    color: #888;
    font-size: 18px;
    padding: 14px 40px;
    transition: all 0.3s ease;
}

.no-btn:hover {
    background: #d0d0d0;
    transform: scale(0.95);
}

/* Sparkles */
.sparkle-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.sparkle {
    position: absolute;
    font-size: 16px;
    animation: sparkle 2s ease-in-out infinite;
}

@keyframes sparkle {
    0%, 100% { opacity: 0; transform: scale(0) rotate(0deg); }
    50% { opacity: 1; transform: scale(1) rotate(180deg); }
}

/* ============================================
   CELEBRATION SCREEN
   ============================================ */

#fireworksCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.celebration-container {
    position: relative;
    z-index: 2;
    text-align: center;
    animation: celebrationAppear 1s ease both;
}

@keyframes celebrationAppear {
    from {
        transform: scale(0.5);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.celebration-title {
    font-family: 'Dancing Script', cursive;
    font-size: clamp(48px, 10vw, 80px);
    color: #ff2d6b;
    text-shadow: 2px 2px 10px rgba(255, 45, 107, 0.3);
    animation: bounceIn 0.8s ease both;
}

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

.celebration-subtitle {
    font-size: clamp(18px, 4vw, 28px);
    color: #ff6b9d;
    margin-top: 10px;
    font-weight: 600;
    animation: fadeInUp 0.8s ease 0.3s both;
}

/* Celebration heart with photo */
.celebration-heart {
    margin: 30px auto;
    width: 200px;
    height: 200px;
    position: relative;
}

.celebration-heart-wrapper {
    width: 100%;
    height: 100%;
    animation: pumpingHeart 0.8s ease-in-out infinite;
    filter: drop-shadow(0 10px 30px rgba(255, 45, 107, 0.5));
}

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

.heart-clip-container {
    width: 200px;
    height: 200px;
    position: relative;
}

.heart-clip-container svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.heart-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    clip-path: path('M100 180 C60 140, 0 100, 0 60 C0 20, 40 0, 70 0 C85 0, 100 15, 100 30 C100 15, 115 0, 130 0 C160 0, 200 20, 200 60 C200 100, 140 140, 100 180Z');
}

.heart-border {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.love-message {
    font-size: clamp(16px, 3vw, 22px);
    color: #ff2d6b;
    margin-top: 20px;
    font-weight: 600;
    animation: fadeInUp 1s ease 1s both;
    font-family: 'Dancing Script', cursive;
}

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

.emoji-rain {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 3;
}

.emoji-drop {
    position: absolute;
    top: -50px;
    font-size: 30px;
    animation: emojiDrop linear infinite;
}

@keyframes emojiDrop {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(110vh) rotate(720deg);
        opacity: 0.5;
    }
}

/* Confetti */
.confetti {
    position: fixed;
    top: -10px;
    width: 10px;
    height: 20px;
    animation: confettiFall linear forwards;
    z-index: 100;
}

@keyframes confettiFall {
    0% {
        transform: translateY(0) rotateZ(0deg) rotateX(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(110vh) rotateZ(720deg) rotateX(360deg);
        opacity: 0;
    }
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 480px) {
    .captcha-container {
        width: 95vw;
        border-radius: 12px;
    }

    .captcha-header {
        padding: 18px 16px;
    }

    .captcha-title {
        font-size: 24px;
    }

    .buttons-container {
        gap: 20px;
    }

    .answer-btn {
        padding: 14px 40px;
    }

    .question-container {
        padding: 20px;
    }

    .celebration-heart {
        width: 150px;
        height: 150px;
    }

    .heart-clip-container {
        width: 150px;
        height: 150px;
    }
}
