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

:root {
  --pink: #ff4d8d;
  --pink-dark: #e0326f;
  --rose: #ffd6e7;
  --text: #5a1032;
}

html, body { height: 100%; }

html {
  -webkit-text-size-adjust: 100%;
  overscroll-behavior: none;
}

body {
  /* Pin the page so iOS/Android can't scroll, bounce or pull-to-refresh it */
  position: fixed;
  inset: 0;
  height: 100vh;
  height: 100dvh;
  overscroll-behavior: none;
  touch-action: none;           /* keep finger moves for the game, no scroll/zoom */
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;  /* no iOS long-press popup */
  font-family: "Poppins", system-ui, sans-serif;
  color: var(--text);
  background: linear-gradient(135deg, #ffe1ec 0%, #ffc2d9 50%, #ffb3c7 100%);
  overflow: hidden;
  display: grid;
  place-items: center;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right))
           max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}

body.celebrate {
  background: radial-gradient(circle at center, #ff7aa8 0%, #d81b60 60%, #880e4f 100%);
  transition: background 1s ease;
}

/* ---------- Background floating hearts ---------- */
#bg-hearts { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
.float-heart {
  position: absolute;
  bottom: -40px;
  opacity: 0.7;
  animation: floatUp linear forwards;
  user-select: none;
}
@keyframes floatUp {
  0%   { transform: translateY(0) translateX(0) rotate(0deg); opacity: 0; }
  10%  { opacity: 0.8; }
  50%  { transform: translateY(-55vh) translateX(20px) rotate(15deg); }
  100% { transform: translateY(-110vh) translateX(-20px) rotate(-15deg); opacity: 0; }
}

#fx { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 5; }

/* ---------- Card ---------- */
.card {
  position: relative;
  z-index: 2;
  width: min(440px, 100%);
  background: rgba(255, 255, 255, 0.85);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-radius: 28px;
  padding: 40px 28px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(216, 27, 96, 0.25);
}
.card.final-card { background: rgba(255, 255, 255, 0.15); box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }

.step { display: none; animation: pop 0.5s ease; }
.step.active { display: block; }
@keyframes pop {
  from { opacity: 0; transform: scale(0.85) translateY(20px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.emoji { font-size: 64px; margin-bottom: 12px; display: inline-block; }
.bounce { animation: bounce 1.6s ease-in-out infinite; }
.beat { animation: beat 1s ease-in-out infinite; }
@keyframes bounce { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
@keyframes beat { 0%,100% { transform: scale(1); } 15% { transform: scale(1.2); } 30% { transform: scale(1); } 45% { transform: scale(1.15); } }

h1 {
  font-family: "Dancing Script", cursive;
  font-size: 2.4rem;
  color: var(--pink-dark);
  margin-bottom: 8px;
}
.question { font-size: 1.15rem; margin-bottom: 28px; }

/* ---------- Buttons ---------- */
.buttons { display: flex; gap: 16px; justify-content: center; align-items: center; min-height: 60px; }

.btn {
  font: 600 1.05rem "Poppins", sans-serif;
  border: none;
  border-radius: 999px;
  padding: 12px 32px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;   /* taps register instantly, no double-tap zoom */
  -webkit-appearance: none;
  appearance: none;
}
.btn.yes {
  background: var(--pink);
  color: #fff;
  box-shadow: 0 8px 20px rgba(255, 77, 141, 0.45);
}
.btn.yes:hover { background: var(--pink-dark); transform: scale(1.06); }

.btn.no {
  background: #fff;
  color: var(--pink-dark);
  border: 2px solid var(--pink);
  white-space: nowrap;
}
.btn.no.fleeing {
  position: fixed;
  z-index: 10;
  transition: left 0.15s ease-out, top 0.15s ease-out, transform 0.2s ease;
}

.btn.replay {
  margin-top: 28px;
  background: #fff;
  color: var(--pink-dark);
}
.btn.replay:hover { transform: scale(1.06); }

/* ---------- Final ---------- */
.big-heart {
  font-size: 120px;
  display: inline-block;
  animation: bigBeat 1.1s ease-in-out infinite, zoomIn 0.9s cubic-bezier(.2,1.6,.4,1);
  filter: drop-shadow(0 0 25px rgba(255, 255, 255, 0.8));
}
@keyframes bigBeat { 0%,100% { transform: scale(1); } 15% { transform: scale(1.18); } 30% { transform: scale(1); } 45% { transform: scale(1.12); } }
@keyframes zoomIn { from { transform: scale(0) rotate(-30deg); } to { transform: scale(1) rotate(0); } }

.final-title { color: #fff; font-size: 3.2rem; text-shadow: 0 4px 20px rgba(0,0,0,0.2); margin-top: 10px; }
.final-text { color: #fff; font-size: 1.2rem; opacity: 0; animation: fadeIn 1s ease 0.8s forwards; }
@keyframes fadeIn { to { opacity: 1; } }

@media (max-width: 420px) {
  .card { padding: 32px 20px; }
  h1 { font-size: 2rem; }
  .question { font-size: 1.05rem; }
  .btn { padding: 12px 26px; }
  .final-title { font-size: 2.6rem; }
  .big-heart { font-size: 96px; }
}
