:root {
  --bg-top: #2a090f;
  --bg-mid: #4e0f1d;
  --bg-bottom: #f0d7c9;
  --card: rgba(34, 10, 16, 0.44);
  --card-border: rgba(255, 225, 221, 0.22);
  --text-main: #fff5f1;
  --text-soft: rgba(255, 240, 235, 0.78);
  --yes-start: #ff8ea9;
  --yes-end: #ffd0dc;
  --yes-shadow: rgba(255, 125, 164, 0.42);
  --no-bg: rgba(255, 241, 238, 0.12);
  --no-border: rgba(255, 224, 220, 0.26);
  --trail: rgba(255, 196, 208, 0.22);
}

* {
  box-sizing: border-box;
}

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

body {
  overflow: hidden;
  font-family: "Manrope", sans-serif;
  color: var(--text-main);
  background:
    radial-gradient(circle at top, rgba(255, 183, 194, 0.12), transparent 30%),
    linear-gradient(180deg, var(--bg-top) 0%, var(--bg-mid) 48%, var(--bg-bottom) 100%);
}

button {
  font: inherit;
}

.scene {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  isolation: isolate;
}

.gradient-orb,
.particles,
.hearts,
.cursor-glow,
.final-screen {
  pointer-events: none;
}

.gradient-orb {
  position: absolute;
  width: 34vmax;
  height: 34vmax;
  border-radius: 999px;
  filter: blur(38px);
  opacity: 0.45;
  z-index: -3;
}

.orb-left {
  left: -10vmax;
  top: 8%;
  background: radial-gradient(circle, rgba(255, 168, 187, 0.7), rgba(255, 168, 187, 0));
  animation: drift 14s ease-in-out infinite alternate;
}

.orb-right {
  right: -10vmax;
  bottom: 2%;
  background: radial-gradient(circle, rgba(255, 215, 196, 0.52), rgba(255, 215, 196, 0));
  animation: drift 18s ease-in-out infinite alternate-reverse;
}

.particles,
.hearts {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.particle,
.heart {
  position: absolute;
  bottom: -10%;
  opacity: 0;
  animation: floatUp linear forwards;
}

.particle {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 236, 226, 0.65);
  box-shadow: 0 0 12px rgba(255, 236, 226, 0.35);
}

.heart {
  width: 18px;
  height: 18px;
  transform: rotate(45deg);
  background: rgba(255, 199, 213, 0.18);
  filter: blur(0.2px);
}

.heart::before,
.heart::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: inherit;
}

.heart::before {
  left: -9px;
}

.heart::after {
  top: -9px;
}

.card {
  position: relative;
  width: min(100%, 860px);
  min-height: 540px;
  padding: 56px 44px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 28px;
  border: 1px solid var(--card-border);
  border-radius: 36px;
  background: linear-gradient(180deg, rgba(47, 16, 24, 0.74), var(--card));
  box-shadow:
    0 28px 60px rgba(13, 3, 6, 0.34),
    inset 0 1px 0 rgba(255, 246, 244, 0.18);
  backdrop-filter: blur(16px);
  overflow: hidden;
}

.card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top, rgba(255, 224, 229, 0.13), transparent 40%);
  z-index: -1;
}

h1,
h2 {
  margin: 0;
  font-family: "Cormorant Garamond", serif;
  font-weight: 600;
  line-height: 0.95;
}

h1 {
  max-width: 100%;
  font-size: clamp(3.2rem, 8vw, 5.4rem);
  line-height: 1;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.play-area {
  position: relative;
  width: 100%;
  min-height: 230px;
  margin-top: auto;
  border-radius: 26px;
  overflow: visible;
}

.btn {
  position: absolute;
  top: 50%;
  min-width: 132px;
  border: 0;
  border-radius: 999px;
  padding: 15px 26px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition:
    transform 380ms ease,
    box-shadow 380ms ease,
    background 380ms ease,
    opacity 320ms ease,
    filter 380ms ease;
  will-change: transform;
}

.btn-yes {
  left: calc(50% - 152px);
  transform: translate(-50%, -50%) scale(var(--yes-scale, 1));
  color: #5f1027;
  background: linear-gradient(135deg, var(--yes-start), var(--yes-end));
  box-shadow: 0 14px 38px var(--yes-shadow);
  z-index: 3;
}

.btn-yes.is-winning {
  box-shadow:
    0 18px 45px rgba(255, 144, 177, 0.48),
    0 0 32px rgba(255, 194, 210, 0.32);
  filter: brightness(1.08);
}

.btn-no {
  left: calc(50% + 76px);
  transform: translate(-50%, -50%) scale(var(--no-scale, 1));
  color: #fff4f0;
  background: var(--no-bg);
  border: 1px solid var(--no-border);
  box-shadow: 0 14px 30px rgba(16, 4, 7, 0.18);
}

.btn:focus-visible {
  outline: 2px solid rgba(255, 245, 242, 0.84);
  outline-offset: 3px;
}

.pulse {
  animation: pulse 1.8s ease-in-out infinite;
}

.cursor-glow {
  position: fixed;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--trail), rgba(255, 196, 208, 0));
  mix-blend-mode: screen;
  opacity: 0.75;
  transform: translate(-50%, -50%);
  z-index: 2;
}

.final-screen {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at center, rgba(255, 169, 192, 0.26), transparent 34%),
    linear-gradient(180deg, rgba(37, 8, 13, 0.2), rgba(37, 8, 13, 0.74));
  opacity: 0;
  transition: opacity 500ms ease-in-out;
}

.final-screen.is-visible {
  opacity: 1;
}

.final-screen::before,
.final-screen::after {
  content: "";
  position: absolute;
  inset: -18%;
  background:
    radial-gradient(circle at 18% 30%, rgba(255, 205, 221, 0.9), transparent 12%),
    radial-gradient(circle at 82% 24%, rgba(255, 182, 202, 0.82), transparent 14%),
    radial-gradient(circle at 30% 78%, rgba(255, 224, 205, 0.76), transparent 12%),
    radial-gradient(circle at 72% 74%, rgba(255, 189, 209, 0.86), transparent 15%),
    radial-gradient(circle at 52% 50%, rgba(255, 240, 231, 0.72), transparent 18%);
  opacity: 0;
  transform: scale(0.82);
}

.final-screen.is-visible::before {
  animation: burstGlow 780ms ease-out forwards;
}

.final-screen.is-visible::after {
  animation: burstGlow 980ms ease-out 80ms forwards;
}

.final-inner {
  text-align: center;
  transform: scale(0.9);
  opacity: 0;
  transition: transform 450ms ease, opacity 450ms ease;
}

.final-screen.is-visible .final-inner {
  transform: scale(1);
  opacity: 1;
}

h2 {
  font-size: clamp(3rem, 8vw, 5.8rem);
}

body.is-accepted .card {
  transform: scale(0.98);
  opacity: 0.18;
  transition: transform 500ms ease, opacity 500ms ease;
}

body.is-accepted .hearts .heart {
  opacity: 0.34;
}

body.yes-engulfing .card {
  overflow: visible;
}

body.yes-engulfing .btn-yes {
  position: fixed;
  left: 50% !important;
  top: 50% !important;
  transform: translate(-50%, -50%) scale(var(--yes-scale, 1));
  transition:
    transform 420ms ease,
    box-shadow 380ms ease,
    background 380ms ease,
    filter 380ms ease;
}

@keyframes floatUp {
  0% {
    transform: translate3d(0, 0, 0) scale(0.8) rotate(45deg);
    opacity: 0;
  }
  10% {
    opacity: var(--float-opacity, 0.4);
  }
  100% {
    transform: translate3d(var(--drift-x, 0px), -120vh, 0) scale(var(--scale-end, 1.1)) rotate(45deg);
    opacity: 0;
  }
}

@keyframes drift {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(0, 20px, 0);
  }
}

@keyframes pulse {
  0%,
  100% {
    transform: translate(-50%, -50%) scale(var(--yes-scale, 1));
  }
  50% {
    transform: translate(-50%, -50%) scale(calc(var(--yes-scale, 1) * 1.04));
  }
}

@keyframes burstGlow {
  0% {
    opacity: 0;
    transform: scale(0.72);
    filter: blur(10px);
  }
  45% {
    opacity: 1;
  }
  100% {
    opacity: 0.82;
    transform: scale(1.08);
    filter: blur(0);
  }
}

@media (max-width: 640px) {
  .scene {
    padding: 16px;
  }

  .card {
    min-height: 590px;
    padding: 40px 22px 32px;
    border-radius: 28px;
  }

  .play-area {
    min-height: 300px;
    margin-top: auto;
  }

  .btn {
    min-width: 118px;
    padding: 14px 20px;
  }

  .btn-yes {
    left: 34%;
  }

  .btn-no {
    left: 67%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  body {
    overflow: auto;
  }
}
