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

:root {
    --pink-light: #fff0f5;
    --pink-soft: #ffb6c1;
    --pink-medium: #ff91a4;
    --pink-bright: #ff69b4;
    --pink-deep: #ff1493;
    --cream: #fff8f0;
    --brown-soft: #8b6c5c;
}

body {
    font-family: 'Quicksand', sans-serif;
    background: linear-gradient(135deg, var(--pink-light) 0%, var(--pink-soft) 100%);
    min-height: 100vh;
    min-height: -webkit-fill-available;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

html {
    height: -webkit-fill-available;
}

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

.heart {
    position: absolute;
    color: var(--pink-bright);
    opacity: 0.3;
    animation: float-up 8s infinite ease-in-out;
    font-size: 20px;
}

.heart:nth-child(1) { left: 5%; animation-delay: 0s; font-size: 18px; }
.heart:nth-child(2) { left: 15%; animation-delay: 1s; font-size: 24px; }
.heart:nth-child(3) { left: 30%; animation-delay: 2s; font-size: 16px; }
.heart:nth-child(4) { left: 45%; animation-delay: 3s; font-size: 22px; }
.heart:nth-child(5) { left: 60%; animation-delay: 1.5s; font-size: 20px; }
.heart:nth-child(6) { left: 75%; animation-delay: 2.5s; font-size: 26px; }
.heart:nth-child(7) { left: 85%; animation-delay: 0.5s; font-size: 18px; }
.heart:nth-child(8) { left: 95%; animation-delay: 3.5s; font-size: 22px; }

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

/* Main Container */
.container {
    position: relative;
    z-index: 1;
}

/* Card Styles */
.card {
    background: var(--cream);
    border-radius: 30px;
    padding: 40px;
    max-width: 420px;
    width: 100%;
    box-shadow:
        0 20px 60px rgba(255, 105, 180, 0.3),
        0 0 0 8px var(--pink-soft),
        0 0 0 12px var(--pink-light);
    text-align: center;
    position: relative;
}

/* Header Heart */
.header-heart {
    font-size: 3rem;
    margin-bottom: 15px;
    animation: heartbeat 1.5s infinite ease-in-out;
}

/* Card Header */
.card-header h1 {
    font-size: 2.2rem;
    color: var(--pink-deep);
    margin-bottom: 8px;
    font-weight: 700;
}

.subtitle {
    color: var(--pink-bright);
    font-size: 1.1rem;
    margin-bottom: 25px;
    font-weight: 500;
}

/* Scratch Area */
.scratch-container {
    margin: 20px 0;
}

.scratch-instruction {
    color: var(--pink-medium);
    font-size: 0.95rem;
    margin-bottom: 15px;
    font-weight: 600;
}

.sparkle {
    display: inline-block;
    animation: sparkle 1.5s infinite;
}

@keyframes sparkle {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.7; }
}

.scratch-area {
    position: relative;
    width: 280px;
    height: 180px;
    margin: 0 auto;
    border-radius: 20px;
    overflow: hidden;
    box-shadow:
        inset 0 2px 10px rgba(0, 0, 0, 0.1),
        0 4px 15px rgba(255, 105, 180, 0.2);
}

#scratch-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    border-radius: 20px;
    z-index: 2;
    touch-action: none; /* Prevents scrolling while scratching on mobile */
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

.hidden-message {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #fff 0%, var(--pink-light) 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    border-radius: 20px;
}

.reveal-heart {
    font-size: 2.5rem;
    margin-bottom: 10px;
    animation: bob 2s infinite ease-in-out;
}

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

.question {
    font-size: 1.4rem;
    color: var(--pink-deep);
    font-weight: 700;
    margin-bottom: 8px;
}

.signature {
    font-size: 1.1rem;
    color: var(--pink-bright);
    font-weight: 600;
}

/* Response Section */
.response-section {
    margin-top: 30px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease;
    pointer-events: none;
}

.response-section.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

.response-prompt {
    color: var(--pink-bright);
    font-size: 1.2rem;
    margin-bottom: 20px;
    font-weight: 600;
}

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

.btn {
    padding: 14px 35px;
    border: none;
    border-radius: 50px;
    font-family: 'Quicksand', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
}

.yes-btn {
    background: linear-gradient(135deg, var(--pink-bright) 0%, var(--pink-deep) 100%);
    color: white;
    box-shadow: 0 6px 20px rgba(255, 20, 147, 0.4);
    animation: gentle-pulse 2s infinite ease-in-out;
}

@keyframes gentle-pulse {
    0%, 100% { box-shadow: 0 6px 20px rgba(255, 20, 147, 0.4); }
    50% { box-shadow: 0 6px 30px rgba(255, 20, 147, 0.6); }
}

.yes-btn:hover,
.yes-btn:active {
    transform: scale(1.08);
    box-shadow: 0 8px 25px rgba(255, 20, 147, 0.5);
    animation: none;
}

/* Better touch feedback for mobile */
@media (hover: none) {
    .yes-btn:active {
        transform: scale(0.95);
    }
}

.no-btn {
    background: var(--pink-light);
    color: var(--pink-medium);
    border: 2px solid var(--pink-soft);
    transition: all 0.2s ease;
}

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

/* Celebration */
.celebration {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 240, 245, 0.98);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.celebration.visible {
    opacity: 1;
    pointer-events: all;
}

.celebration-wrapper {
    position: relative;
    max-height: 90vh;
    max-height: 90dvh;
}

.celebration-content {
    text-align: center;
    animation: celebrate-bounce 0.6s ease;
    max-height: 90vh;
    max-height: 90dvh;
    overflow-y: auto;
    padding: 30px 25px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--pink-bright) transparent;
}

@keyframes celebrate-bounce {
    0% { transform: scale(0.5); opacity: 0; }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

.big-heart {
    font-size: 5rem;
    animation: heartbeat 1s infinite;
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    25% { transform: scale(1.1); }
    50% { transform: scale(1); }
    75% { transform: scale(1.15); }
}

.celebration h2 {
    font-size: 3rem;
    color: var(--pink-deep);
    margin: 20px 0;
}

.celebration p {
    font-size: 1.1rem;
    color: var(--pink-bright);
    margin: 15px auto;
    line-height: 1.7;
    max-width: 340px;
    text-align: left;
}

.love-note {
    font-size: 1.5rem !important;
    margin-top: 30px !important;
    font-weight: 700;
    text-align: center !important;
    padding-bottom: 20px;
}

.scroll-hint {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--pink-medium);
    font-size: 0.85rem;
    opacity: 0.8;
    animation: bounce-hint 1.5s infinite ease-in-out;
}

.scroll-hint::after {
    content: ' ↓';
}

@keyframes bounce-hint {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(5px); }
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .card {
        padding: 30px 25px;
        margin: 10px;
    }

    .card-header h1 {
        font-size: 1.8rem;
    }

    .scratch-area {
        width: 240px;
        height: 160px;
    }

    .question {
        font-size: 1.2rem;
    }

    .btn {
        padding: 12px 28px;
        font-size: 1rem;
    }

    .celebration {
        align-items: flex-start;
        padding-top: 20px;
    }

    .celebration-content {
        padding: 20px 20px 40px;
        max-height: 95vh;
        max-height: 95dvh;
    }

    .celebration h2 {
        font-size: 2rem;
        margin: 10px 0;
    }

    .celebration p {
        font-size: 1rem;
        max-width: 300px;
        line-height: 1.8;
    }

    .big-heart {
        font-size: 3.5rem;
    }

    .love-note {
        font-size: 1.2rem !important;
        padding-bottom: 20px;
    }
}
