:root {
  color-scheme: dark;
  --ink: #fffaf0;
  --muted: #d7d2e8;
  --velvet: #30183e;
  --gold: #ffd166;
  --rose: #ff6b9a;
  --teal: #54d6c2;
  --blue: #7aa7ff;
  --line: rgba(255, 255, 255, 0.2);
  --glass: rgba(22, 19, 39, 0.72);
  --shadow: 0 34px 90px rgba(4, 2, 18, 0.44);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100svh;
  margin: 0;
  overflow-x: hidden;
  overflow-y: auto;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  color: var(--ink);
  background:
    repeating-linear-gradient(
      115deg,
      rgba(255, 209, 102, 0.1) 0 1px,
      transparent 1px 46px
    ),
    linear-gradient(135deg, #0f1228 0%, var(--velvet) 52%, #1b3142 100%);
}

button {
  font: inherit;
}

#ambientCanvas,
#confettiCanvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

#ambientCanvas {
  z-index: 0;
}

#confettiCanvas {
  z-index: 4;
}

.app-shell {
  position: relative;
  z-index: 1;
  display: grid;
  min-height: 100svh;
  place-items: center;
  padding: 28px;
}

.dance-couple {
  position: absolute;
  right: clamp(18px, 4vw, 44px);
  bottom: 18px;
  z-index: 1;
  display: none;
  width: min(258px, 34%);
  opacity: 0.97;
  pointer-events: none;
  transform-origin: 50% 88%;
  animation: slowDanceImage 8.4s ease-in-out infinite;
  filter: drop-shadow(0 28px 34px rgba(3, 2, 16, 0.38));
}

body[data-state="success"] .dance-couple {
  display: block;
}

.dance-couple::before {
  position: absolute;
  right: 9%;
  bottom: 1%;
  width: 78%;
  height: 12%;
  border-radius: 50%;
  content: "";
  background: radial-gradient(ellipse, rgba(255, 209, 102, 0.26), transparent 68%);
  transform: rotate(-2deg);
}

.dance-frame {
  position: relative;
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 306 / 460;
  border-radius: 8px;
}

.invite {
  position: relative;
  width: min(820px, 100%);
  min-height: 560px;
  padding: 58px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.11), transparent 35%),
    var(--glass);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
}

.invite::before,
.invite::after {
  position: absolute;
  width: 240px;
  height: 12px;
  content: "";
  background:
    repeating-linear-gradient(
      90deg,
      var(--gold) 0 18px,
      transparent 18px 30px,
      var(--teal) 30px 48px,
      transparent 48px 60px,
      var(--rose) 60px 78px,
      transparent 78px 90px
    );
  opacity: 0.82;
}

.invite::before {
  top: 28px;
  left: 28px;
}

.invite::after {
  right: 28px;
  bottom: 28px;
}

.anniversary-mark {
  position: absolute;
  top: 38px;
  right: 42px;
  display: grid;
  width: 94px;
  height: 94px;
  place-items: center;
  border: 1px solid rgba(255, 209, 102, 0.54);
  border-radius: 50%;
  color: var(--gold);
  font-size: 2.15rem;
  font-weight: 950;
  box-shadow:
    0 0 0 8px rgba(255, 209, 102, 0.06),
    0 0 44px rgba(255, 209, 102, 0.18);
}

.anniversary-mark::after {
  position: absolute;
  bottom: -24px;
  color: var(--muted);
  content: "years";
  font-size: 0.74rem;
  font-weight: 850;
  text-transform: uppercase;
}

.question-panel,
.success-panel {
  position: relative;
  z-index: 2;
  max-width: 630px;
}

.eyebrow {
  margin: 0 0 18px;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  max-width: 620px;
  font-weight: 950;
  line-height: 0.96;
  letter-spacing: 0;
}

h1 {
  font-size: 4.5rem;
}

h2 {
  font-size: 3.55rem;
}

.note {
  max-width: 560px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 1.16rem;
  line-height: 1.62;
}

.choice-field {
  position: relative;
  width: min(540px, 100%);
  height: 176px;
  margin-top: 34px;
}

.choice-button {
  position: absolute;
  display: inline-grid;
  min-width: 150px;
  height: 60px;
  place-items: center;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 900;
  letter-spacing: 0;
  transform-origin: center;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    background-color 180ms ease,
    left 220ms ease,
    top 220ms ease;
}

.choice-button:focus-visible,
.surprise-button:focus-visible,
.replay-button:focus-visible {
  outline: 3px solid rgba(84, 214, 194, 0.38);
  outline-offset: 4px;
}

.primary {
  left: 0;
  top: 54px;
  z-index: 2;
  color: #241225;
  background: var(--gold);
  box-shadow:
    0 18px 34px rgba(255, 209, 102, 0.25),
    0 0 34px rgba(255, 209, 102, 0.18);
  transform: scale(var(--yes-scale, 1));
}

.primary:hover {
  background: #ffe29b;
  transform: translateY(-2px) scale(var(--yes-scale, 1));
}

.secondary {
  left: 194px;
  top: 54px;
  z-index: 1;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 14px 26px rgba(5, 3, 20, 0.22);
  transform: rotate(var(--no-rotate, 0deg)) scale(var(--no-scale, 1));
}

.secondary:hover {
  background: rgba(255, 255, 255, 0.22);
}

.status-line {
  min-height: 28px;
  margin: 4px 0 0;
  color: var(--teal);
  font-weight: 850;
}

.success-panel {
  display: grid;
  gap: 24px;
}

.success-panel[hidden] {
  display: none;
}

.surprise-button,
.replay-button {
  display: inline-grid;
  width: max-content;
  min-width: 166px;
  min-height: 58px;
  place-items: center;
  padding: 0 28px;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 900;
  letter-spacing: 0;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    background-color 180ms ease;
}

.surprise-button {
  color: #241225;
  background: var(--gold);
  box-shadow:
    0 18px 34px rgba(255, 209, 102, 0.26),
    0 0 48px rgba(255, 209, 102, 0.22);
}

.surprise-button:hover,
.replay-button:hover {
  transform: translateY(-2px);
}

.replay-button {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.surprise-message {
  max-width: 620px;
  padding: 24px;
  border: 1px solid rgba(255, 209, 102, 0.46);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 209, 102, 0.16), rgba(84, 214, 194, 0.11)),
    rgba(255, 255, 255, 0.08);
  color: var(--ink);
  font-size: 1.24rem;
  font-weight: 850;
  line-height: 1.48;
  box-shadow: 0 20px 46px rgba(4, 2, 18, 0.26);
}

.surprise-message[hidden] {
  display: none;
}

body[data-state="success"] .anniversary-mark {
  animation: happyMark 700ms ease both;
}

@keyframes happyMark {
  0% {
    transform: rotate(0) scale(1);
  }

  45% {
    transform: rotate(-7deg) scale(1.12);
  }

  100% {
    transform: rotate(4deg) scale(1);
  }
}

@keyframes slowDanceImage {
  0%,
  100% {
    transform: translateX(-3px) rotate(-1deg) scale(0.995);
  }

  50% {
    transform: translateX(4px) rotate(1deg) scale(1.01);
  }
}

@media (max-width: 720px) {
  .app-shell {
    padding: 18px;
    align-items: start;
  }

  .invite {
    min-height: 620px;
    padding: 88px 24px 46px;
  }

  .invite::before {
    top: 22px;
    left: 22px;
    width: 180px;
  }

  .invite::after {
    right: 22px;
    bottom: 22px;
    width: 180px;
  }

  .anniversary-mark {
    top: 30px;
    right: 22px;
    width: 66px;
    height: 66px;
    font-size: 1.52rem;
  }

  .anniversary-mark::after {
    bottom: -20px;
    font-size: 0.66rem;
  }

  h1 {
    font-size: 3rem;
  }

  h2 {
    font-size: 2.48rem;
  }

  .note {
    font-size: 1rem;
    line-height: 1.55;
  }

  .choice-field {
    height: 198px;
  }

  .choice-button {
    min-width: 128px;
    height: 54px;
  }

  .secondary {
    left: 154px;
  }

  .surprise-button,
  .replay-button {
    width: 100%;
  }
}

@media (max-width: 980px) {
  .dance-couple {
    display: none;
  }
}

@media (max-width: 410px) {
  .invite {
    padding-inline: 18px;
  }

  h1 {
    font-size: 2.42rem;
  }

  h2 {
    font-size: 2.08rem;
  }

  .choice-button {
    min-width: 112px;
  }

  .secondary {
    left: 132px;
  }
}

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

  .dance-couple {
    display: none;
  }
}
