:root {
  --bg1: #ff9a9e;
  --bg2: #fad0c4;
  --bg3: #fbc2eb;
  --ink: #3b1d2e;
  --pink: #ff4d8d;
  --pink-dark: #d92d6f;
  --card: rgba(255, 255, 255, .75);
}

* { box-sizing: border-box; }

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

body {
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  color: var(--ink);
  background: linear-gradient(135deg, var(--bg1), var(--bg2), var(--bg3));
  background-size: 300% 300%;
  animation: drift 14s ease infinite;
  overflow-x: hidden;
}

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

main {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 24px;
  position: relative;
  z-index: 1;
}

.step {
  display: none;
  width: min(520px, 100%);
  padding: 36px 28px;
  text-align: center;
  background: var(--card);
  backdrop-filter: blur(10px);
  border-radius: 28px;
  box-shadow: 0 20px 60px rgba(217, 45, 111, .25);
}
.step.active { display: block; animation: pop .5s cubic-bezier(.2, 1.4, .4, 1); }

@keyframes pop {
  from { transform: scale(.85); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

h1 { font-size: clamp(1.7rem, 5vw, 2.3rem); margin: 8px 0 12px; line-height: 1.2; }
.emoji { font-size: 4.5rem; transition: transform .3s; }
.emoji.bounce { animation: bounce .4s; }
@keyframes bounce { 50% { transform: scale(1.3) rotate(-8deg); } }

.hint { min-height: 1.4em; opacity: .75; margin: 0 0 20px; }

.buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  min-height: 70px;
}

.btn {
  font: inherit;
  font-weight: 700;
  font-size: 1.15rem;
  border: 0;
  border-radius: 999px;
  padding: 14px 32px;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s, left .25s, top .25s;
}
.btn.yes {
  background: var(--pink);
  color: #fff;
  box-shadow: 0 8px 20px rgba(255, 77, 141, .45);
}
.btn.yes:hover { background: var(--pink-dark); transform: scale(1.06); }
.btn.no { background: #fff; color: var(--ink); box-shadow: 0 4px 12px rgba(0, 0, 0, .15); }
.btn.no.dodging { position: fixed; z-index: 10; }
.btn.ghost { background: transparent; color: var(--ink); border: 2px solid var(--ink); text-decoration: none; display: inline-block; }
.btn.big { width: 100%; margin-top: 8px; }

form { text-align: left; display: grid; gap: 14px; }
label { display: grid; gap: 6px; font-weight: 600; font-size: .95rem; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

input[type="text"], input:not([type]), input[type="date"], input[type="time"], textarea {
  font: inherit;
  padding: 10px 12px;
  border: 2px solid transparent;
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
}
input:focus, textarea:focus { outline: none; border-color: var(--pink); }

fieldset { border: 0; padding: 0; margin: 0; }
legend { font-weight: 600; font-size: .95rem; margin-bottom: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips label { display: block; }
.chips input { position: absolute; opacity: 0; }
.chips span {
  display: inline-block;
  padding: 8px 14px;
  background: #fff;
  border: 2px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
}
.chips input:checked + span { background: var(--pink); color: #fff; }
.chips input:focus-visible + span { border-color: var(--ink); }

.summary {
  white-space: pre-line;
  background: #fff;
  border-radius: 18px;
  padding: 18px;
  text-align: left;
  line-height: 1.7;
  margin: 12px 0 20px;
}

/* floating stars & flowers background */
.drift { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
.drift-item {
  position: absolute;
  bottom: -30px;
  color: #fff;
  opacity: 0;
  animation: rise linear forwards;
}
@keyframes rise {
  10% { opacity: .35; }
  80% { opacity: .2; }
  to { transform: translateY(-110vh) translateX(20px); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  body, .step.active, .drift-item { animation: none; }
  .btn { transition: none; }
}

/* jumpscare */
.scare {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: #000;
  animation: scare-in .12s ease-out, shake .5s .12s;
}
.scare[hidden] { display: none; }
.scare img { max-width: 100%; max-height: 100%; object-fit: contain; }
.scare-fallback { font-size: min(60vw, 60vh); line-height: 1; }
.scare-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .85);
  color: #000;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s;
}
.scare-close.ready { opacity: 1; pointer-events: auto; }
@keyframes scare-in { from { transform: scale(.3); } to { transform: scale(1); } }
@keyframes shake {
  0%, 100% { transform: translate(0); }
  20% { transform: translate(-14px, 8px); }
  40% { transform: translate(12px, -10px); }
  60% { transform: translate(-10px, -6px); }
  80% { transform: translate(8px, 10px); }
}
@media (prefers-reduced-motion: reduce) { .scare { animation: none; } }
