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

:root {
  --pink: #ff4d8d;
  --light-pink: #ff85b3;
  --purple: #9b5de5;
  --yellow: #ffe45e;
  --white: #fff;
  --soft: #fff0f6;
}

body {
  min-height: 100vh;
  background: var(--soft);
  font-family: 'Quicksand', sans-serif;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---- Animated background ---- */
.bg {
  position: fixed; inset: 0; z-index: 0;
  background: linear-gradient(160deg, #ffe0ef 0%, #f3d5ff 50%, #ffd6ec 100%);
}

.bubble {
  position: absolute;
  border-radius: 50%;
  opacity: 0.18;
  animation: drift linear infinite;
}

@keyframes drift {
  0%   { transform: translateY(110vh) scale(0.8); opacity: 0; }
  10%  { opacity: 0.18; }
  90%  { opacity: 0.18; }
  100% { transform: translateY(-20vh) scale(1.1); opacity: 0; }
}

/* ---- Floating hearts ---- */
.heart-float {
  position: fixed;
  font-size: 1.4rem;
  pointer-events: none;
  z-index: 0;
  animation: floatHeart linear infinite;
}

@keyframes floatHeart {
  0%   { transform: translateY(110vh) rotate(-15deg); opacity: 0; }
  8%   { opacity: 0.7; }
  92%  { opacity: 0.7; }
  100% { transform: translateY(-10vh) rotate(15deg); opacity: 0; }
}

/* ---- Card ---- */
.card {
  position: relative; z-index: 10;
  background: white;
  border-radius: 36px;
  padding: 3.5rem 3rem 3rem;
  width: min(480px, 92vw);
  text-align: center;
  box-shadow:
    0 4px 0 #f9b8d4,
    0 8px 0 #f3a5c8,
    0 20px 60px rgba(155,93,229,0.18),
    0 2px 0 0 rgba(255,255,255,0.9) inset;
  border: 2.5px solid #ffd6ec;
  animation: cardIn 0.6s cubic-bezier(0.34,1.56,0.64,1) both;
}

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

/* ---- Screen management ---- */
.screen { display: none; }
.screen.active { display: block; animation: fadeSlide 0.45s ease both; }

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

/* ---- Big emoji ---- */
.main-emoji {
  font-size: 5rem;
  display: block;
  margin-bottom: 1.2rem;
  animation: wiggle 2s ease-in-out infinite;
  filter: drop-shadow(0 4px 8px rgba(255,77,141,0.25));
}

@keyframes wiggle {
  0%,100% { transform: rotate(-6deg) scale(1); }
  50%      { transform: rotate(6deg) scale(1.08); }
}

/* ---- Text ---- */
.question {
  font-family: 'Pacifico', cursive;
  font-size: clamp(1.4rem, 5vw, 1.9rem);
  color: var(--pink);
  line-height: 1.35;
  margin-bottom: 0.6rem;
}

.sub {
  color: #c084b8;
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 2.2rem;
}

/* ---- Progress dots ---- */
.dots {
  display: flex; justify-content: center; gap: 8px;
  margin-bottom: 2rem;
}
.dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: #f9d0e8;
  transition: background 0.3s, transform 0.3s;
}
.dot.done   { background: var(--pink); transform: scale(1.2); }
.dot.active { background: var(--purple); transform: scale(1.35); }

/* ---- Buttons area ---- */
.btns {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

.btn-yes {
  background: linear-gradient(135deg, #ff6faa, #ff4d8d);
  color: white;
  border: none;
  border-radius: 100px;
  padding: 0.9rem 2.6rem;
  font-size: 1.1rem;
  font-weight: 700;
  font-family: 'Quicksand', sans-serif;
  cursor: pointer;
  box-shadow: 0 4px 0 #cc2b66, 0 8px 24px rgba(255,77,141,0.35);
  
  /* Use CSS variable to allow scaling from JS without breaking hover effects */
  --base-scale: 1;
  transform: scale(var(--base-scale));
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.12s;
  
  letter-spacing: 0.3px;
}

.btn-yes:hover {
  transform: translateY(-3px) scale(calc(var(--base-scale) + 0.04));
  box-shadow: 0 7px 0 #cc2b66, 0 14px 32px rgba(255,77,141,0.4);
}

.btn-yes:active {
  transform: translateY(2px) scale(calc(var(--base-scale) - 0.03));
  box-shadow: 0 2px 0 #cc2b66, 0 4px 12px rgba(255,77,141,0.2);
}

.btn-no {
  background: white;
  color: #c084b8;
  border: 2.5px solid #f0aacd;
  border-radius: 100px;
  padding: 0.9rem 2.2rem;
  font-size: 1.05rem;
  font-weight: 700;
  font-family: 'Quicksand', sans-serif;
  cursor: pointer;
  z-index: 9999;
  white-space: nowrap;
}

.btn-no.fleeing {
  position: fixed;
  transition: left 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), 
              top 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ---- Hint text ---- */
.hint {
  margin-top: 1.4rem;
  color: #d8a0c8;
  font-size: 0.85rem;
  font-weight: 600;
  min-height: 1.2em;
}

/* ---- Final screen ---- */
#sfinal .main-emoji { animation: popBounce 0.6s cubic-bezier(0.34,1.56,0.64,1) both; }

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

.final-title {
  font-family: 'Pacifico', cursive;
  font-size: 2rem;
  color: var(--pink);
  margin-bottom: 0.6rem;
}

.final-msg {
  color: #9b5de5;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.6;
  margin-bottom: 1.4rem;
}

.hearts-row {
  font-size: 1.6rem;
  letter-spacing: 6px;
  animation: pulse 1.2s ease-in-out infinite;
}

@keyframes pulse {
  0%,100% { transform: scale(1); }
  50%      { transform: scale(1.1); }
}

/* ---- Confetti pieces ---- */
.confetti {
  position: fixed;
  width: 10px; height: 10px;
  border-radius: 2px;
  pointer-events: none;
  z-index: 9999;
  animation: confettiFall linear forwards;
}

@keyframes confettiFall {
  0%   { transform: translateY(-20px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(110vh) rotate(720deg); opacity: 0; }
}

/* ---- Cursor Trail ---- */
.cursor-trail {
  position: fixed;
  pointer-events: none;
  z-index: 99999;
  font-size: 1.4rem;
  animation: floatTrail 1s ease-out forwards;
  transform: translate(-50%, -50%); /* center on cursor */
}

@keyframes floatTrail {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, calc(-50% - 40px)) scale(0.4);
  }
}