:root {
    --pink: #ff5c8a;
    --pink-dark: #e63e73;
    --pink-light: #ffd6e4;
    --purple: #a78bfa;
    --cream: #fff5f8;
    --text: #4a2c38;
    --green: #46c98b;
    --gold: #ffd166;
}

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

html, body {
    height: 100%;
    overscroll-behavior: none;
}

body {
    font-family: 'Poppins', sans-serif;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(-45deg, #ffe1ec, #ffd0e0, #ffc8e0, #fbc2eb, #ffd6e4);
    background-size: 400% 400%;
    animation: gradientShift 14s ease infinite;
    color: var(--text);
    overflow: hidden;
    position: relative;
    padding: 20px;
    cursor: default;
}

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

/* ============================================================
   Ambient drifting blobs
   ============================================================ */
.blob {
    position: fixed;
    border-radius: 50%;
    filter: blur(50px);
    opacity: 0.45;
    z-index: 0;
    pointer-events: none;
}
.blob1 {
    width: 320px; height: 320px;
    background: radial-gradient(circle, #ff9ec4, transparent 70%);
    top: -80px; left: -80px;
    animation: drift1 16s ease-in-out infinite;
}
.blob2 {
    width: 260px; height: 260px;
    background: radial-gradient(circle, #c9a7ff, transparent 70%);
    bottom: -60px; right: -60px;
    animation: drift2 20s ease-in-out infinite;
}
.blob3 {
    width: 220px; height: 220px;
    background: radial-gradient(circle, #ffe08a, transparent 70%);
    top: 40%; right: 10%;
    animation: drift3 18s ease-in-out infinite;
}
@keyframes drift1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50%      { transform: translate(60px, 80px) scale(1.2); }
}
@keyframes drift2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50%      { transform: translate(-70px, -50px) scale(1.15); }
}
@keyframes drift3 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50%      { transform: translate(-40px, 60px) scale(0.85); }
}

/* ============================================================
   Floating hearts / confetti
   ============================================================ */
.hearts-bg {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
}

.floating-heart {
    position: absolute;
    bottom: -40px;
    font-size: 1.6rem;
    opacity: 0.8;
    animation: floatUp linear forwards;
    filter: drop-shadow(0 2px 4px rgba(230,62,115,0.25));
}

@keyframes floatUp {
    0%   { transform: translateY(0) translateX(0) rotate(0deg); opacity: 0; }
    10%  { opacity: 0.9; }
    100% { transform: translateY(-115vh) translateX(var(--drift, 30px)) rotate(360deg); opacity: 0; }
}

.confetti-piece {
    position: fixed;
    top: -20px;
    border-radius: 3px;
    z-index: 60;
    pointer-events: none;
    animation: confettiFall linear forwards;
}
@keyframes confettiFall {
    0%   { transform: translateY(0) rotate(0deg); opacity: 1; }
    100% { transform: translateY(110vh) rotate(720deg); opacity: 0.9; }
}

/* Sparkle cursor trail */
.sparkle {
    position: fixed;
    pointer-events: none;
    z-index: 70;
    font-size: 1rem;
    animation: sparkleFade 0.8s ease-out forwards;
}
@keyframes sparkleFade {
    0%   { transform: translate(-50%, -50%) scale(0.4) rotate(0deg); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(1.4) rotate(90deg) translateY(-20px); opacity: 0; }
}

/* ============================================================
   Sound toggle button
   ============================================================ */
.sound-toggle {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 80;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(8px);
    box-shadow: 0 6px 18px rgba(230,62,115,0.3);
    font-size: 1.3rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}
.sound-toggle:hover { transform: scale(1.1) rotate(-8deg); }
.sound-toggle:active { transform: scale(0.9); }
.sound-toggle.muted { opacity: 0.55; }

/* ============================================================
   Stage / cards
   ============================================================ */
.stage {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 460px;
}

.card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    border-radius: 28px;
    padding: 44px 32px;
    text-align: center;
    box-shadow: 0 20px 50px rgba(230, 62, 115, 0.25);
    border: 2px solid rgba(255, 255, 255, 0.6);
    animation: popIn 0.55s cubic-bezier(0.18, 0.89, 0.32, 1.28);
    position: relative;
    overflow: hidden;
}

.card[hidden] { display: none; }

/* Shimmering sweep across the card */
.card::before {
    content: '';
    position: absolute;
    top: 0; left: -150%;
    width: 60%; height: 100%;
    background: linear-gradient(120deg, transparent, rgba(255,255,255,0.55), transparent);
    animation: shimmerSweep 5s ease-in-out infinite;
    pointer-events: none;
}
@keyframes shimmerSweep {
    0%   { left: -150%; }
    45%  { left: 150%; }
    100% { left: 150%; }
}

@keyframes popIn {
    0%   { transform: scale(0.7) translateY(30px) rotate(-3deg); opacity: 0; }
    60%  { transform: scale(1.03) translateY(-4px) rotate(1deg); opacity: 1; }
    100% { transform: scale(1) translateY(0) rotate(0deg); opacity: 1; }
}

.card.shake { animation: cardShake 0.5s ease; }
@keyframes cardShake {
    0%, 100% { transform: translateX(0); }
    20%  { transform: translateX(-10px) rotate(-1deg); }
    40%  { transform: translateX(8px) rotate(1deg); }
    60%  { transform: translateX(-6px) rotate(-1deg); }
    80%  { transform: translateX(4px) rotate(0.5deg); }
}

.emoji-big {
    font-size: 4.5rem;
    margin-bottom: 12px;
    display: inline-block;
}

.bounce { animation: bounce 1.5s ease-in-out infinite; }
@keyframes bounce {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50%      { transform: translateY(-16px) rotate(6deg); }
}

.spin-heart { animation: heartbeat 1.1s ease-in-out infinite; }
@keyframes heartbeat {
    0%, 100% { transform: scale(1) rotate(0deg); }
    25%      { transform: scale(1.28) rotate(-4deg); }
    50%      { transform: scale(1) rotate(0deg); }
    75%      { transform: scale(1.18) rotate(4deg); }
}

.title {
    font-family: 'Pacifico', cursive;
    font-size: 2.4rem;
    background: linear-gradient(90deg, var(--pink-dark), var(--pink), var(--purple), var(--pink-dark));
    background-size: 300% auto;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: titleShine 6s linear infinite;
    margin-bottom: 10px;
    line-height: 1.2;
}
@keyframes titleShine {
    to { background-position: 300% center; }
}

.subtitle {
    font-size: 1.05rem;
    color: var(--text);
    margin-bottom: 26px;
    opacity: 0.85;
    animation: fadeUp 0.6s ease both;
    animation-delay: 0.15s;
}
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 0.85; transform: translateY(0); }
}

.question-text {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--pink-dark);
    margin-bottom: 30px;
    line-height: 1.35;
    min-height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: questionIn 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
@keyframes questionIn {
    from { opacity: 0; transform: translateY(14px) scale(0.95); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ============================================================
   Buttons
   ============================================================ */
.btn {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    border: none;
    border-radius: 50px;
    padding: 14px 30px;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.2s ease;
    outline: none;
    position: relative;
}

.btn:active { transform: scale(0.93); }

.btn-primary {
    background: linear-gradient(135deg, var(--pink) 0%, var(--pink-dark) 100%);
    color: #fff;
    box-shadow: 0 8px 20px rgba(230, 62, 115, 0.4);
    animation: pulseGlow 2.2s ease-in-out infinite;
}
@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 8px 20px rgba(230, 62, 115, 0.4); }
    50%      { box-shadow: 0 10px 30px rgba(230, 62, 115, 0.65); }
}
.btn-primary:hover { transform: translateY(-3px) scale(1.03); }

.answers {
    display: flex;
    gap: 18px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    position: relative;
    min-height: 60px;
}

.btn-yes {
    background: linear-gradient(135deg, #ff6f9c, #ff3d76);
    color: #fff;
    box-shadow: 0 8px 20px rgba(230, 62, 115, 0.4);
    animation: yesWiggle 2.4s ease-in-out infinite;
}
@keyframes yesWiggle {
    0%, 100% { transform: rotate(0deg) scale(var(--yes-scale, 1)); }
    5%       { transform: rotate(-4deg) scale(var(--yes-scale, 1)); }
    10%      { transform: rotate(4deg) scale(var(--yes-scale, 1)); }
    15%      { transform: rotate(0deg) scale(var(--yes-scale, 1)); }
}
.btn-yes:hover { transform: translateY(-3px) scale(1.08); }

.btn-no {
    background: #fff;
    color: #b06;
    border: 2px solid var(--pink-light);
    box-shadow: 0 6px 16px rgba(230, 62, 115, 0.15);
    position: relative;
    z-index: 5;
    will-change: left, top, transform;
}

/* When No runs away it is appended to <body> as position:fixed
   so it can roam the ENTIRE viewport and is always visible */
.btn-no.running {
    position: fixed;
    z-index: 200;
    transition: left 0.16s cubic-bezier(.2,.8,.3,1.3), top 0.16s cubic-bezier(.2,.8,.3,1.3), transform 0.16s ease;
}

.btn-no.wobble { animation: noWobble 0.4s ease; }
@keyframes noWobble {
    0%, 100% { transform: rotate(0deg) scale(var(--no-scale, 1)); }
    25%      { transform: rotate(-14deg) scale(var(--no-scale, 1)); }
    75%      { transform: rotate(14deg) scale(var(--no-scale, 1)); }
}

.progress-dots {
    margin-top: 26px;
    display: flex;
    justify-content: center;
    gap: 8px;
}
.progress-dots .dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--pink-light);
    transition: all 0.3s ease;
}
.progress-dots .dot.active {
    background: var(--pink-dark);
    transform: scale(1.3);
    box-shadow: 0 0 0 4px rgba(230,62,115,0.15);
}
.progress-dots .dot.done { background: var(--pink); }

.final-details {
    background: var(--cream);
    border-radius: 18px;
    padding: 20px;
    margin: 6px 0 26px;
    text-align: left;
    font-size: 1rem;
    line-height: 1.9;
    animation: fadeUp 0.5s ease 0.2s both;
}
.final-details p { margin: 0; }

/* Message + date inputs */
.message-input,
.date-input {
    width: 100%;
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    color: var(--text);
    background: var(--cream);
    border: 2px solid var(--pink-light);
    border-radius: 16px;
    padding: 14px 16px;
    margin-bottom: 18px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
    -webkit-appearance: none;
    appearance: none;
}
.message-input { resize: vertical; min-height: 90px; margin-bottom: 22px; }

.message-input:focus,
.date-input:focus {
    border-color: var(--pink);
    box-shadow: 0 0 0 4px rgba(255, 92, 138, 0.15);
    transform: scale(1.01);
}

.field-label {
    display: block;
    text-align: left;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--pink-dark);
    margin: 4px 4px 8px;
    opacity: 0.85;
}

.error-msg {
    color: var(--pink-dark);
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 14px;
    animation: cardShake 0.4s ease;
}
.error-msg[hidden] { display: none; }

.btn.loading { opacity: 0.7; pointer-events: none; }

/* ============================================================
   Tease bubble that follows the dodging No button
   ============================================================ */
.tease {
    position: fixed;
    background: var(--pink-dark);
    color: #fff;
    padding: 8px 16px;
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 600;
    z-index: 210;
    pointer-events: none;
    animation: teasePop 1.1s ease forwards;
    box-shadow: 0 6px 16px rgba(0,0,0,0.2);
    white-space: nowrap;
}
@keyframes teasePop {
    0%   { transform: scale(0) translateY(0); opacity: 0; }
    20%  { transform: scale(1) translateY(-6px); opacity: 1; }
    80%  { opacity: 1; }
    100% { transform: translateY(-26px); opacity: 0; }
}

@media (max-width: 480px) {
    .card { padding: 36px 22px; }
    .title { font-size: 2rem; }
    .question-text { font-size: 1.35rem; }
    .btn { font-size: 1rem; padding: 12px 24px; }
    .sound-toggle { width: 44px; height: 44px; top: 12px; right: 12px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
