:root {
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: "Mitr", system-ui, sans-serif;
  color: #fff;
  -webkit-font-smoothing: antialiased;
  position: relative;
  background: #1a1426;
}

/* ---------- background particles ---------- */
.bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.particle {
  position: absolute;
  bottom: -40px;
  font-size: var(--size, 20px);
  opacity: var(--op, 0.6);
  animation: rise var(--dur, 12s) linear infinite;
  animation-delay: var(--delay, 0s);
  will-change: transform;
}
@keyframes rise {
  0%   { transform: translateY(0) rotate(0deg); opacity: 0; }
  10%  { opacity: var(--op, 0.6); }
  90%  { opacity: var(--op, 0.6); }
  100% { transform: translateY(-115vh) rotate(360deg); opacity: 0; }
}

/* ---------- screens ---------- */
#app { position: relative; z-index: 1; height: 100%; }

.screen {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transform: scale(1.04);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease), visibility 0.6s;
}
.screen.active {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
}

.card {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 520px;
  text-align: center;
  padding: 40px 28px;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
}

.kicker {
  font-size: 14px;
  letter-spacing: 2px;
  opacity: 0.7;
  margin-bottom: 14px;
  font-weight: 300;
}

.question {
  font-size: clamp(28px, 7vw, 48px);
  font-weight: 500;
  line-height: 1.35;
  margin-bottom: 36px;
  text-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
}
.question.small { font-size: clamp(24px, 6vw, 38px); margin-bottom: 22px; }

/* ---------- buttons ---------- */
.btns {
  display: flex;
  gap: 18px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}

.btn {
  font-family: inherit;
  font-size: 18px;
  font-weight: 500;
  padding: 14px 30px;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  color: #fff;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), filter 0.2s;
  touch-action: manipulation;
}
.btn:active { transform: scale(0.96); }

.btn-yes {
  background: linear-gradient(135deg, #ff5e8a, #ff2d6f);
  box-shadow: 0 10px 26px rgba(255, 45, 111, 0.45);
}
.btn-yes:hover { transform: translateY(-3px) scale(1.05); box-shadow: 0 16px 34px rgba(255, 45, 111, 0.55); }

.btn-no {
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.3);
  /* set to fixed positioning by JS when it starts fleeing */
  transition: left 0.35s var(--ease), top 0.35s var(--ease),
              transform 0.2s var(--ease), opacity 0.3s;
}
.btn-no.fleeing {
  position: fixed;
  z-index: 50;
  margin: 0;
}

.btn-send {
  background: linear-gradient(135deg, #ff8fb1, #ff4d8d);
  box-shadow: 0 10px 26px rgba(255, 77, 141, 0.4);
  width: 100%;
  margin-top: 4px;
}
.btn-send:hover { transform: translateY(-2px); }

/* ---------- per-theme backgrounds ---------- */
.theme-drift  { background: radial-gradient(120% 120% at 50% 0%, #4a3a6b 0%, #241a3a 55%, #140f24 100%); }
.theme-love   { background: radial-gradient(120% 120% at 50% 10%, #ff8fb1 0%, #ff4d7d 45%, #c81e5b 100%); }
.theme-dine   { background: radial-gradient(120% 120% at 50% 8%, #4a2f1d 0%, #2a1a12 50%, #100a07 100%); }
.theme-night  { background: radial-gradient(120% 120% at 70% 15%, #2a3a6b 0%, #161a3a 55%, #0a0d1f 100%); }
.theme-final  { background: radial-gradient(120% 120% at 50% 0%, #ffd6e6 0%, #ff9cc0 45%, #ff6fa3 100%); }
.theme-final .card { color: #6a1b3d; background: rgba(255,255,255,0.35); border-color: rgba(255,255,255,0.5); }
.theme-final .kicker { color: #a13a63; }

/* ---------- screen 3: luxury fine dining ---------- */
.theme-dine .card {
  background: rgba(30, 20, 13, 0.55);
  border: 1px solid rgba(212, 175, 55, 0.45);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5), inset 0 0 60px rgba(212, 175, 55, 0.06);
}
.theme-dine .kicker { color: #d4af37; letter-spacing: 5px; }
.theme-dine .question {
  font-family: "Charm", "Mitr", cursive;
  font-weight: 700;
  color: #f6e7c4;
  text-shadow: 0 2px 18px rgba(212, 175, 55, 0.25);
  margin-bottom: 6px;
}
.theme-dine .subtitle {
  color: #cbb079;
  font-weight: 300;
  font-size: 15px;
  letter-spacing: 1px;
  margin-bottom: 32px;
}
.theme-dine .btn-yes {
  background: linear-gradient(135deg, #e9cd7e, #c69a2e);
  color: #2a1a08;
  box-shadow: 0 10px 26px rgba(201, 151, 31, 0.45);
}
.theme-dine .btn-yes:hover { box-shadow: 0 16px 34px rgba(201, 151, 31, 0.6); }

/* golden cloche / serving dome */
.cloche {
  width: 96px;
  height: 70px;
  margin: 6px auto 22px;
  position: relative;
}
.cloche-dome {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  width: 84px;
  height: 48px;
  border-radius: 84px 84px 0 0;
  background: linear-gradient(160deg, #f4e2a6 0%, #d4af37 45%, #9c7a1e 100%);
  box-shadow: 0 0 34px rgba(212, 175, 55, 0.45);
}
.cloche-dome::before {
  content: "";
  position: absolute;
  top: -9px; left: 50%;
  transform: translateX(-50%);
  width: 12px; height: 12px;
  border-radius: 50%;
  background: linear-gradient(160deg, #f4e2a6, #c69a2e);
  box-shadow: 0 0 14px rgba(212, 175, 55, 0.6);
}
.cloche::after {
  content: "";
  position: absolute;
  left: 50%; bottom: 6px;
  transform: translateX(-50%);
  width: 96px; height: 8px;
  border-radius: 50%;
  background: linear-gradient(90deg, transparent, #d4af37, transparent);
  opacity: 0.8;
}

/* ---------- screen 4: moon ---------- */
.moon {
  position: absolute;
  top: 12%;
  right: 14%;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff7e0, #ffe9a8);
  box-shadow: 0 0 60px 12px rgba(255, 233, 168, 0.5);
  z-index: 1;
}

/* ---------- final form ---------- */
.message-form { display: flex; flex-direction: column; gap: 14px; }
#message-input {
  font-family: inherit;
  font-size: 17px;
  padding: 16px;
  border-radius: 16px;
  border: 1.5px solid rgba(255,255,255,0.6);
  background: rgba(255,255,255,0.65);
  color: #5a1733;
  resize: none;
  outline: none;
}
#message-input::placeholder { color: #b06a88; }
#message-input:focus { border-color: #ff4d8d; background: #fff; }
.form-status { min-height: 20px; font-size: 14px; color: #8a274f; }
.form-status.error { color: #b00020; }
.thanks h2 { font-size: 30px; margin-bottom: 8px; color: #6a1b3d; }
.thanks p { color: #8a274f; }

/* ---------- progress dots ---------- */
.dots {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  z-index: 40;
}
.dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: rgba(255,255,255,0.4);
  transition: all 0.3s var(--ease);
}
.dot.active { background: #fff; transform: scale(1.3); }

/* ---------- yes burst particles ---------- */
.burst {
  position: fixed;
  z-index: 100;
  pointer-events: none;
  font-size: 22px;
  animation: burst-fly 0.9s var(--ease) forwards;
}
@keyframes burst-fly {
  0%   { transform: translate(0,0) scale(0.4); opacity: 1; }
  100% { transform: translate(var(--bx), var(--by)) scale(1.2); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .particle, .burst { animation: none; }
}
