:root {
  --bg1: #ffd6df;
  --bg2: #ffeaf0;
  --card: rgba(255, 255, 255, 0.55);
  --card2: rgba(255, 255, 255, 0.38);
  --text: #3b2b2b;
  --muted: rgba(59, 43, 43, 0.72);
  --shadow: 0 30px 80px rgba(31, 18, 18, 0.25);
  --radius: 26px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  color: var(--text);
  background: radial-gradient(1200px 600px at 50% 40%, var(--bg2) 0%, var(--bg1) 65%, #ffc3d3 100%);
  overflow: hidden;
}

/* Floating emojis background */
#hearts-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

/* Center stage */
.stage {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 24px;
}

/* Card */
.card {
  width: min(520px, 92vw);
  background: linear-gradient(180deg, var(--card), var(--card2));
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  position: relative; /* No button will float relative to this */
  overflow: hidden;   /* keep No inside card */
}

.card-inner {
  padding: 28px 28px 22px 28px;
  text-align: center;
}

.hidden { display: none; }

.emoji-row {
  display: flex;
  justify-content: center;
  gap: 10px;
  font-size: 40px;
  margin-bottom: 8px;
}

.name {
  margin: 10px 0 8px 0;
  font-size: 34px;
  letter-spacing: 0.2px;
}

.question {
  margin: 0 0 18px 0;
  font-size: 20px;
  color: var(--muted);
}

/* Buttons row: MUST center both buttons in one line at start */
.buttons {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  padding: 14px 0 6px 0;
  min-height: 56px;
}

.btn {
  appearance: none;
  border: none;
  border-radius: 999px;
  padding: 12px 18px;
  font-size: 15px;
  cursor: pointer;
  user-select: none;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
  transition: transform 140ms ease, box-shadow 140ms ease;
  white-space: nowrap;
}

.btn:active { transform: translateY(1px) scale(0.99); }

.btn-yes {
  background: linear-gradient(180deg, #ff6b93, #ff3d78);
  color: white;
}

.btn-no {
  background: rgba(255, 255, 255, 0.85);
  color: rgba(59, 43, 43, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.7);

  /* IMPORTANT: at start it is NORMAL INLINE BUTTON */
  position: static;
  transform: none;
  left: auto;
  top: auto;
}

/* When JS activates dodge: it becomes absolute inside .card */
.btn-no.is-floating {
  position: absolute;
  transform: translate(-50%, -50%);
  transition: left 120ms ease, top 120ms ease;
  z-index: 10;
}

/* Yay state */
.yay-top { margin-bottom: 14px; }

.yay-title {
  margin: 6px 0 4px 0;
  font-size: 30px;
}

.yay-sub {
  margin: 0;
  font-size: 15px;
  color: var(--muted);
}

.photo-frame {
  width: 100%;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.16);
  margin: 16px 0 18px 0;
  background: rgba(255, 255, 255, 0.3);
}

.photo-frame img {
  display: block;
  width: 100%;
  height: auto;
}

/* Background emoji element */
.heart {
  position: absolute;
  left: 0;
  top: 0;
  font-size: 18px;
  opacity: 0.85;
  filter: drop-shadow(0 10px 14px rgba(0, 0, 0, 0.12));
  animation-name: floatUp;
  animation-timing-function: linear;
  animation-fill-mode: forwards;
}

@keyframes floatUp {
  0% {
    transform: translate3d(0, 20px, 0) scale(1);
    opacity: 0;
  }
  10% { opacity: 0.9; }
  100% {
    transform: translate3d(var(--drift, 0px), calc(-1 * var(--travel, 520px)), 0) scale(var(--scale, 1));
    opacity: 0;
  }
}

.btn-placeholder {
  display: inline-block;
  height: 44px;
}

/* Mobile: allow scrolling when content is taller than the viewport */
@media (max-width: 520px) {
  body {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* keep background fixed and not expanding layout */
  #hearts-layer {
    position: fixed;
    inset: 0;
    overflow: hidden;
  }

  .stage {
    min-height: auto;
    padding: 18px;
    padding-bottom: 36px;
  }
}
