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

:root {
  color-scheme: light;
  --bg: #fbe9ef;
  --bg-deep: #f7d5e2;
  --ink: #1f1a1c;
  --muted: #5e4b52;
  --accent: #ff4f8a;
  --accent-2: #ff9ab5;
  --accent-3: #ffe06f;
  --card: rgba(255, 255, 255, 0.7);
  --shadow: 0 18px 60px rgba(31, 26, 28, 0.18);
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at top left, #fff3f7 0%, var(--bg) 45%, var(--bg-deep) 100%);
  overflow-x: hidden;
}

img {
  max-width: 100%;
  display: block;
}

.page {
  min-height: 100%;
  padding: 28px 18px 48px;
  display: grid;
  place-items: center;
  gap: 16px;
  position: relative;
}

.bg-blur {
  position: absolute;
  border-radius: 999px;
  filter: blur(0px);
  opacity: 0.7;
  z-index: 0;
  animation: float 12s ease-in-out infinite;
}

.bg-blur-a {
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, rgba(255, 79, 138, 0.45), rgba(255, 79, 138, 0));
  top: -60px;
  left: -40px;
}

.bg-blur-b {
  width: 360px;
  height: 360px;
  background: radial-gradient(circle, rgba(255, 224, 111, 0.5), rgba(255, 224, 111, 0));
  bottom: -100px;
  right: -60px;
  animation-delay: -4s;
}

.hero {
  text-align: center;
  z-index: 1;
  max-width: 720px;
  padding: 0 6px;
}

.kicker {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 8px;
}

h1 {
  font-family: "Playfair Display", "Times New Roman", serif;
  font-size: clamp(1.9rem, 2.2vw + 1.2rem, 3.1rem);
  margin: 0 0 8px;
}

.sub {
  margin: 0;
  font-size: 1rem;
  color: var(--muted);
}

.card {
  width: min(820px, 100%);
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: var(--shadow);
  border-radius: 28px;
  padding: 22px clamp(16px, 3.5vw, 36px) 26px;
  display: grid;
  gap: 16px;
  z-index: 1;
  position: relative;
  backdrop-filter: blur(14px);
}

.photo-frame {
  margin: 0;
  border-radius: 22px;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.6));
  padding: 10px;
  display: grid;
  place-items: center;
  max-height: min(55vh, 720px);
}

.photo-frame img {
  border-radius: 16px;
  width: 100%;
  height: auto;
  max-height: min(55vh, 720px);
  object-fit: contain;
  background: #fff;
}

.buttons {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  min-height: 88px;
}

.btn {
  border: none;
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  font-size: 1.1rem;
  padding: 14px 28px;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
}

.btn:focus-visible {
  outline: 3px solid rgba(255, 79, 138, 0.6);
  outline-offset: 3px;
}

.btn-yes {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  box-shadow: 0 10px 25px rgba(255, 79, 138, 0.35);
}

.btn-yes:hover {
  transform: translateY(-2px) scale(1.02);
}

.btn-no {
  background: #fff;
  color: var(--ink);
  border: 2px dashed rgba(31, 26, 28, 0.2);
  box-shadow: 0 8px 20px rgba(31, 26, 28, 0.12);
  position: relative;
  right: auto;
  top: auto;
  left: auto;
}

.buttons.tricky .btn-no {
  position: absolute;
}

.btn-ghost {
  background: transparent;
  border: 1px solid rgba(31, 26, 28, 0.25);
  color: var(--muted);
  font-size: 0.95rem;
  padding: 10px 18px;
}

.tease {
  text-align: center;
  margin: 0;
  font-size: 0.98rem;
  color: var(--muted);
}

.result {
  text-align: center;
  padding: 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(255, 79, 138, 0.2);
  animation: pop 0.4s ease;
  margin-top: 6px;
}

.result-title {
  font-family: "Playfair Display", "Times New Roman", serif;
  font-size: 1.6rem;
  margin: 0 0 6px;
}

.result-text {
  margin: 0;
  color: var(--muted);
}

.music {
  display: flex;
  justify-content: center;
}

.accepted .btn-no {
  display: none;
}

.accepted .btn-yes {
  transform: scale(1.06);
}

.accepted .buttons {
  display: none;
}

.hearts {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 2;
}

.heart {
  position: absolute;
  font-size: 24px;
  animation: fly 3s ease-in forwards;
}

.confetti {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 3;
}

.confetti-piece {
  position: absolute;
  width: 10px;
  height: 16px;
  opacity: 0;
  border-radius: 3px;
  animation: confetti-fall 2.8s ease-in forwards;
}

.spark {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  opacity: 0;
  animation: spark 0.8s ease-out forwards;
}

.streak {
  position: absolute;
  width: 70px;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(255, 79, 138, 0.7), transparent);
  opacity: 0;
  transform-origin: center;
  animation: streak 0.6s ease-out forwards;
}
@keyframes float {
  0%,
  100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(18px);
  }
}

@keyframes fly {
  0% {
    transform: translateY(0) scale(0.8);
    opacity: 0;
  }
  20% {
    opacity: 1;
  }
  100% {
    transform: translateY(-180px) scale(1.4);
    opacity: 0;
  }
}

@keyframes pop {
  0% {
    transform: scale(0.9);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes confetti-fall {
  0% {
    transform: translateY(-20px) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  100% {
    transform: translateY(420px) rotate(280deg);
    opacity: 0;
  }
}

@keyframes spark {
  0% {
    transform: translateY(0) scale(0.6);
    opacity: 0;
  }
  30% {
    opacity: 1;
  }
  100% {
    transform: translateY(-28px) scale(1.1);
    opacity: 0;
  }
}

@keyframes streak {
  0% {
    opacity: 0;
    transform: scaleX(0.4) translateY(0);
  }
  30% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: scaleX(1.3) translateY(-18px);
  }
}

@media (max-width: 640px) {
  .card {
    padding: 18px 14px 22px;
  }

  .buttons {
    min-height: 120px;
  }

  .btn {
    font-size: 1rem;
    padding: 12px 22px;
  }

  .kicker {
    font-size: 0.7rem;
  }

  h1 {
    font-size: clamp(1.6rem, 5vw, 2.2rem);
  }

  .sub {
    font-size: 0.95rem;
  }

  .photo-frame,
  .photo-frame img {
    max-height: min(50vh, 520px);
  }
}
