:root {
  --ink: #6b2a4d;
  --pink-bg: #ffe4ee;
  --yes-a: #ff9ec9;
  --yes-b: #ff5fa2;
  --no-ink: #8a4a76;
}

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

html, body { height: 100%; margin: 0; }

body {
  font-family: ui-rounded, "SF Pro Rounded", "Segoe UI Variable Display", "Nunito", "Quicksand", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--pink-bg);
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  -webkit-font-smoothing: antialiased;
}

/* ---------- background ---------- */
.bg {
  position: fixed;
  inset: -12%;
  z-index: 0;
  background: radial-gradient(120% 120% at 22% 12%, #fff4f9 0%, #ffe4ee 48%, #ffdcec 100%);
}

body.celebrating .bg {
  background: linear-gradient(135deg, #ffe0ef 0%, #f7e3ff 20%, #e6e9ff 42%, #ffe9f2 66%, #ffe0ef 100%);
  background-size: 280% 280%;
  animation: gradientShift 9s ease-in-out infinite alternate;
}

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

/* ---------- initial screen ---------- */
.stage {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: clamp(26px, 7vh, 54px);
  padding: clamp(20px, 6vw, 48px);
  text-align: center;
}

.stage[hidden] { display: none; }

.question {
  margin: 0;
  font-size: clamp(2.1rem, 8.6vw, 4.6rem);
  line-height: 1.04;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: #6b2a4d;
  text-shadow: 0 5px 0 rgba(255, 255, 255, 0.65), 0 18px 42px rgba(199, 64, 120, 0.16);
}

.answers {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(18px, 6vw, 44px);
}

.btn {
  -webkit-appearance: none;
  appearance: none;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-weight: 800;
  font-size: clamp(1.05rem, 4.6vw, 1.4rem);
  padding: 0.9em 1.75em;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  transition: transform 0.24s cubic-bezier(0.2, 0.9, 0.25, 1), box-shadow 0.24s ease;
}

.btn:focus-visible {
  outline: 3px solid #b06bff;
  outline-offset: 4px;
}

.yes {
  background: linear-gradient(160deg, var(--yes-a), var(--yes-b));
  color: #fff;
  box-shadow: 0 14px 30px rgba(255, 95, 162, 0.35), inset 0 -4px 0 rgba(160, 20, 80, 0.16);
  transform: scale(var(--g, 1));
  transform-origin: center;
}

.yes:active { transform: scale(calc(var(--g, 1) * 0.96)); }

.ic {
  display: inline-block;
  width: 1.05em;
  height: 1.05em;
  fill: currentColor;
  vertical-align: -0.16em;
}

.yes .ic { margin-left: 0.34em; }

.no {
  background: #fff;
  color: var(--no-ink);
  border: 2px solid #f7d6e8;
  box-shadow: 0 10px 24px rgba(150, 90, 140, 0.18);
}

.no.is-free {
  position: fixed;
  left: 0;
  top: 0;
  margin: 0;
  z-index: 6;
  transition: transform 0.42s cubic-bezier(0.22, 0.9, 0.24, 1), box-shadow 0.24s ease;
  box-shadow: 0 12px 26px rgba(150, 90, 140, 0.22);
}

.no-ghost {
  display: inline-block;
  visibility: hidden;
  pointer-events: none;
}

/* ---------- celebration ---------- */
.celebration {
  position: fixed;
  inset: 0;
  z-index: 4;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: clamp(12px, 2.6vh, 26px);
  padding: clamp(16px, 5vw, 40px);
  text-align: center;
  overflow: hidden;
}

.celebration[hidden] { display: none; }

.love-msg {
  margin: 0;
  font-size: clamp(1.7rem, 7.4vw, 4rem);
  line-height: 1.08;
  font-weight: 900;
  letter-spacing: -0.02em;
  background: linear-gradient(95deg, #ff4f9a, #b06bff 42%, #ff7fb4 74%, #ff4f9a);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 8px 18px rgba(255, 95, 162, 0.28));
  animation: popIn 0.75s cubic-bezier(0.18, 1.5, 0.4, 1) both, msgShimmer 4.5s linear 0.9s infinite;
}

@keyframes popIn {
  0%   { opacity: 0; transform: scale(0.55) rotate(-4deg); }
  62%  { opacity: 1; transform: scale(1.09) rotate(1.5deg); }
  100% { opacity: 1; transform: scale(1) rotate(0deg); }
}

@keyframes msgShimmer {
  to { background-position: 220% 0; }
}

.cat-wrap {
  animation: catBob 1.7s ease-in-out infinite;
  filter: drop-shadow(0 20px 40px rgba(160, 90, 150, 0.28));
}

.cat {
  display: block;
  width: min(58vw, 30vh, 320px);
  height: auto;
  border-radius: 26px;
  background: #fff;
}

@keyframes catBob {
  0%, 100% { transform: translateY(0) rotate(-1.2deg); }
  50%      { transform: translateY(-10px) rotate(1.2deg); }
}

.cat-caption {
  margin: 0;
  font-size: clamp(0.85rem, 3.4vw, 1.05rem);
  font-weight: 700;
  color: #a2598c;
  letter-spacing: 0.02em;
}

.msg-ic {
  width: 0.95em;
  height: 0.95em;
  margin-left: 0.2em;
  fill: #ff4f9a;
  vertical-align: -0.02em;
  animation: heartPulse 1.4s ease-in-out infinite;
}

.cap-ic {
  width: 0.9em;
  height: 0.9em;
  margin-left: 0.25em;
  fill: #ff8fb8;
}

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

/* ---------- confetti + floaters ---------- */
.confetti {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 3;
  pointer-events: none;
  display: none;
}

body.celebrating .confetti { display: block; }

.floaters {
  position: fixed;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  overflow: hidden;
}

.floater {
  position: absolute;
  bottom: -10vh;
  line-height: 0;
  animation-name: floatUp;
  animation-timing-function: linear;
  animation-fill-mode: forwards;
  will-change: transform, opacity;
}

@keyframes floatUp {
  0%   { transform: translate3d(0, 0, 0) scale(0.8) rotate(0deg); opacity: 0; }
  12%  { opacity: 1; }
  100% { transform: translate3d(var(--drift, 0px), -120vh, 0) scale(1.15) rotate(var(--spin, 20deg)); opacity: 0; }
}

/* ---------- audio fallback ---------- */
.sound-hint {
  position: fixed;
  left: 50%;
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 7;
  border: 0;
  border-radius: 999px;
  padding: 0.7em 1.2em;
  font: inherit;
  font-weight: 800;
  background: #fff;
  color: #8a4a76;
  box-shadow: 0 10px 24px rgba(150, 90, 140, 0.25);
  cursor: pointer;
}

.sound-hint[hidden] { display: none; }

.hint-ic { margin-right: 0.35em; }

@media (prefers-reduced-motion: reduce) {
  .love-msg, .cat-wrap, body.celebrating .bg { animation: none; }
  .floater { animation-duration: 6s; }
}

.floater svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: currentColor;
}
