:root {
  --bg-1: #fff4e6;
  --bg-2: #ffd7c2;
  --card: rgba(255, 255, 255, 0.76);
  --text: #2f1e1b;
  --muted: #6c4a44;
  --brand: #dc3d6a;
  --brand-2: #8a2c5d;
  --ok: #1a9a67;
  --ring: rgba(220, 61, 106, 0.35);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Manrope, "Segoe UI", sans-serif;
  color: var(--text);
  background: radial-gradient(circle at 18% 12%, #fff8ee 0%, var(--bg-1) 35%, var(--bg-2) 100%);
  overflow-x: hidden;
}

.bg-orb {
  position: fixed;
  width: 42vmax;
  height: 42vmax;
  border-radius: 999px;
  filter: blur(40px);
  opacity: 0.4;
  pointer-events: none;
  z-index: 0;
}

.orb-1 {
  background: #ff8fab;
  top: -12vmax;
  left: -9vmax;
}

.orb-2 {
  background: #ffbf69;
  right: -13vmax;
  bottom: -12vmax;
}

.container {
  max-width: 980px;
  margin: 0 auto;
  padding: 2rem 1rem 3rem;
  position: relative;
  z-index: 1;
}

.centered {
  display: grid;
  place-items: center;
  min-height: 100vh;
}

.card {
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.55);
  background: var(--card);
  border-radius: 24px;
  box-shadow: 0 24px 40px rgba(88, 32, 34, 0.12);
}

.hero {
  text-align: center;
  padding: 3rem 1.25rem;
  animation: rise 0.7s ease-out both;
}

.hero.centered {
  gap: 0.75rem;
}

.microcopy {
  margin: 0.25rem 0 0;
  color: rgba(108, 74, 68, 0.85);
  font-weight: 700;
  font-size: 0.95rem;
}

.ready-doodles {
  display: flex;
  justify-content: center;
  gap: 0.6rem;
  margin-top: 0.75rem;
  opacity: 0.35;
  user-select: none;
}

.ready-doodles span {
  display: inline-block;
  color: var(--brand);
  font-size: 1.05rem;
  transform-origin: center;
  animation: floaty 1.9s ease-in-out infinite;
}

.ready-doodles span:nth-child(2) {
  animation-delay: 0.15s;
  opacity: 0.8;
}

.ready-doodles span:nth-child(3) {
  animation-delay: 0.3s;
  opacity: 0.65;
}

.ready-doodles span:nth-child(4) {
  animation-delay: 0.45s;
  opacity: 0.8;
}

.ready-doodles span:nth-child(5) {
  animation-delay: 0.6s;
  opacity: 0.65;
}

h1,
h2 {
  margin: 0;
  font-family: "DM Serif Display", Georgia, serif;
  line-height: 1.1;
}

h1 {
  font-size: clamp(2rem, 4.6vw, 3.5rem);
}

h2 {
  font-size: clamp(1.5rem, 3vw, 2.2rem);
}

.kicker {
  margin: 0 0 0.75rem;
  color: var(--brand-2);
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  font-weight: 800;
}

.kicker.signature {
  margin: 1.45rem 0 0.55rem;
}

.lead {
  margin: 1rem auto 0;
  max-width: 58ch;
  color: var(--muted);
  line-height: 1.65;
}

.btn {
  margin-top: 1.3rem;
  border: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--brand), #ef6a8b);
  color: #fff;
  font-weight: 800;
  padding: 0.85rem 1.2rem;
  line-height: 1;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 14px 24px rgba(220, 61, 106, 0.25);
}

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

.btn-large {
  padding: 1rem 2.5rem;
  font-size: 1.25rem;
}

.yes-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 1.5rem;
}

.yes-buttons .btn {
  margin-top: 0;
}

.photo-grid {
  width: min(720px, 100%);
  margin: 1.25rem auto 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.photo {
  margin: 0;
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.55);
  box-shadow: 0 18px 30px rgba(88, 32, 34, 0.14);
  aspect-ratio: 4 / 5;
  min-height: 220px;
}

.photo::after {
  content: "❤  ❤  ❤\A❤  ❤  ❤\A❤  ❤  ❤";
  position: absolute;
  inset: -8% -8% -8% -8%;
  display: grid;
  place-items: center;
  pointer-events: none;
  font-size: clamp(1.2rem, 3.2vw, 2.2rem);
  line-height: 1.65;
  letter-spacing: 0.5em;
  white-space: pre;
  color: rgba(255, 255, 255, 0.55);
  opacity: 0.28;
  transform: rotate(-10deg);
  text-shadow: 0 12px 24px rgba(20, 10, 12, 0.18);
}

.photo img {
  display: block;
  width: 100%;
  height: 100%;
  max-height: 60vh;
  object-fit: cover;
}

.btn:focus-visible,
.tile:focus-visible {
  outline: 3px solid var(--ring);
  outline-offset: 2px;
}

.captcha {
  margin-top: 1.2rem;
  padding: 1.3rem;
  transform-origin: top center;
  animation: rise 0.5s ease-out both;
}

.hidden {
  display: none;
}

.grid {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.tile {
  position: relative;
  border: 0;
  border-radius: 18px;
  overflow: hidden;
  cursor: pointer;
  padding: 0;
  background: #f7eeec;
  min-height: clamp(120px, 22vw, 175px);
}

.tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease, filter 0.3s ease;
}

.tile:hover img {
  transform: scale(1.03);
}

.tile.selected img {
  filter: brightness(0.7) saturate(0.85);
}

.check {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ok);
  display: grid;
  place-items: center;
  font-weight: 900;
  transform: scale(0);
  transition: transform 0.15s ease;
}

.tile.selected .check {
  transform: scale(1);
}

.status {
  margin: 0.8rem 0 0;
  font-weight: 700;
  color: var(--brand-2);
}

.btn-secondary {
  background: linear-gradient(135deg, #3d2a2f, #5f3f46);
  box-shadow: 0 14px 24px rgba(58, 35, 38, 0.2);
}

.disabled {
  pointer-events: none;
  opacity: 0.45;
}

.valentine-page {
  background: radial-gradient(circle at 50% 5%, #fff6ef 0%, #ffe0cf 45%, #ffc6d0 100%);
}

.message {
  text-align: center;
  padding: 2.4rem 1.2rem;
  animation: rise 0.7s ease both;
}

.name-line {
  margin: 0.65rem 0 0;
  font-family: "DM Serif Display", Georgia, serif;
  font-size: clamp(1.35rem, 2.6vw, 2rem);
  letter-spacing: 0.02em;
  color: var(--brand-2);
}

.message .lead {
  margin-top: 1.1rem;
}

.flower,
.heart {
  position: fixed;
  z-index: 0;
  user-select: none;
  opacity: 0.82;
  animation: drift 7s ease-in-out infinite alternate;
}

.flower {
  font-size: clamp(1.7rem, 4vw, 2.7rem);
}

.heart {
  font-size: clamp(1.9rem, 4.8vw, 3rem);
  color: #d62f5a;
}

.flower-a {
  top: 12%;
  left: 8%;
}

.flower-b {
  top: 72%;
  left: 14%;
  animation-delay: 0.8s;
}

.flower-c {
  top: 24%;
  right: 9%;
  animation-delay: 0.6s;
}

.heart-a {
  top: 20%;
  right: 18%;
}

.heart-b {
  top: 72%;
  right: 11%;
  animation-delay: 1.2s;
}

.heart-c {
  top: 58%;
  left: 46%;
  animation-delay: 0.4s;
}

@keyframes rise {
  from {
    transform: translateY(14px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes drift {
  from {
    transform: translateY(0) rotate(-2deg);
  }
  to {
    transform: translateY(-18px) rotate(3deg);
  }
}

@keyframes floaty {
  0% {
    transform: translateY(0) rotate(-6deg);
  }
  50% {
    transform: translateY(-8px) rotate(6deg);
  }
  100% {
    transform: translateY(0) rotate(-6deg);
  }
}

.confetti {
  position: fixed;
  top: -12vh;
  left: var(--x);
  width: var(--w);
  height: var(--h);
  background: var(--c);
  border-radius: 3px;
  opacity: 0;
  z-index: 3;
  pointer-events: none;
  transform: translate3d(var(--dx), 0, 0) rotate(0deg);
  animation: confetti-fall var(--dur) ease-out var(--delay) forwards;
  box-shadow: 0 14px 30px rgba(20, 10, 12, 0.12);
}

@keyframes confetti-fall {
  0% {
    opacity: 0;
    transform: translate3d(var(--dx), 0, 0) rotate(0deg);
  }
  10% {
    opacity: 0.95;
  }
  100% {
    opacity: 0;
    transform: translate3d(var(--dx), 125vh, 0) rotate(var(--rot));
  }
}

@media (prefers-reduced-motion: reduce) {
  .confetti {
    display: none;
  }
}

@media (max-width: 700px) {
  .grid {
    grid-template-columns: 1fr;
  }

  .hero,
  .message {
    padding: 2rem 1rem;
  }

  .hero .btn,
  .captcha .btn {
    width: min(360px, 100%);
  }

  .captcha {
    padding: 1.1rem;
  }

  .photo-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
  }

  .photo {
    min-height: 150px;
    aspect-ratio: 1 / 1;
  }

  .photo img {
    max-height: 34vh;
  }
}
