:root {
  --ink: #30232a;
  --muted: #947684;
  --rose: #ff6fa5;
  --rose-deep: #e84f8b;
  --rose-soft: #ffe0eb;
  --blush: #fff8fb;
  --plum: #4b2836;
  --gold: #f6c978;
  --white: #fff;
  --shadow: 0 24px 60px rgba(105, 45, 72, .16);
  --radius: 28px;
}

* { box-sizing: border-box; }

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

body {
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 18%, rgba(255, 192, 214, .75) 0, rgba(255, 192, 214, 0) 27%),
    radial-gradient(circle at 88% 78%, rgba(255, 224, 235, .8) 0, rgba(255, 224, 235, 0) 30%),
    linear-gradient(145deg, #f9e7ef 0%, #fff8fb 52%, #f6dce7 100%);
  font-family: Arial, Helvetica, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button { font: inherit; }

.ambient {
  position: fixed;
  z-index: -1;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  filter: blur(2px);
  opacity: .55;
  pointer-events: none;
  animation: drift 12s ease-in-out infinite alternate;
}

.ambient-one {
  top: 8%;
  left: 5%;
  background: radial-gradient(circle, rgba(255, 132, 178, .32), transparent 68%);
}

.ambient-two {
  right: 4%;
  bottom: 5%;
  background: radial-gradient(circle, rgba(255, 218, 231, .7), transparent 68%);
  animation-delay: -5s;
}

.app {
  position: relative;
  width: min(100%, 430px);
  height: 100vh;
  height: 100svh;
  margin: 0 auto;
  overflow: hidden;
  background:
    linear-gradient(rgba(255, 255, 255, .62), rgba(255, 255, 255, .62)),
    var(--blush);
  isolation: isolate;
}

.app::before,
.app::after {
  position: absolute;
  z-index: -1;
  content: "";
  pointer-events: none;
}

.app::before {
  inset: 0;
  opacity: .3;
  background-image: radial-gradient(rgba(231, 129, 166, .22) .7px, transparent .7px);
  background-size: 18px 18px;
  -webkit-mask-image: linear-gradient(to bottom, transparent, black 16%, black 80%, transparent);
  mask-image: linear-gradient(to bottom, transparent, black 16%, black 80%, transparent);
}

.app::after {
  inset: 0;
  border: 1px solid rgba(255, 255, 255, .8);
  box-shadow: 0 0 0 8px rgba(255, 255, 255, .16), var(--shadow);
  pointer-events: none;
}

.topbar {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 66px;
  padding: 0 23px;
  background: rgba(255, 248, 251, .84);
  border-bottom: 1px solid rgba(214, 164, 184, .25);
  backdrop-filter: blur(14px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #5c3d49;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .16em;
}

.brand b { color: var(--rose-deep); }

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--rose-deep);
  box-shadow: 0 0 0 4px rgba(255, 111, 165, .14);
  animation: pulse 2.2s ease-in-out infinite;
}

.progress {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #b08d9b;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .12em;
}

.progress i {
  display: block;
  width: 34px;
  height: 2px;
  background: #f0cfdb;
  border-radius: 9px;
}

.screen {
  position: absolute;
  z-index: 1;
  inset: 66px 0 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 25px 24px 22px;
  overflow-y: auto;
  text-align: center;
  opacity: 0;
  transform: translateX(28px) scale(.985);
  pointer-events: none;
  scrollbar-width: none;
  transition: opacity .42s ease, transform .5s cubic-bezier(.22, .8, .25, 1);
}

.screen::-webkit-scrollbar { display: none; }

.screen.active {
  opacity: 1;
  transform: translateX(0) scale(1);
  pointer-events: auto;
}

.screen.active > *:not(.primary-btn):not(.yes-btn):not(.no-btn):not(.restart-btn) {
  animation: rise .55s both;
}

.screen.active > *:nth-child(2) { animation-delay: .06s; }
.screen.active > *:nth-child(3) { animation-delay: .12s; }
.screen.active > *:nth-child(4) { animation-delay: .18s; }
.screen.active > *:nth-child(5) { animation-delay: .24s; }
.screen.active > *:nth-child(6) { animation-delay: .3s; }
.screen.active > *:nth-child(7) { animation-delay: .36s; }

.eyebrow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0 0 13px;
  color: #b37e93;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.eyebrow i {
  display: block;
  width: 24px;
  height: 1px;
  background: currentColor;
  opacity: .65;
}

h1, h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
  letter-spacing: -.055em;
}

h1 {
  font-size: clamp(44px, 14vw, 58px);
  line-height: .98;
}

h2 {
  font-size: clamp(35px, 11vw, 45px);
  line-height: 1.02;
}

h2 em {
  color: var(--rose-deep);
  font-style: normal;
}

.lead {
  max-width: 330px;
  margin: 18px auto 24px;
  color: #806572;
  font-size: 14px;
  line-height: 1.65;
}

.lead b, .soft-copy b { color: var(--rose-deep); }

.lead.compact { margin: 14px auto 18px; }

.soft-copy {
  max-width: 290px;
  margin: 11px auto 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.primary-btn,
.yes-btn,
.restart-btn {
  width: 100%;
  min-height: 54px;
  border: 0;
  border-radius: 16px;
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
}

.primary-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding: 0 18px;
  color: #fff;
  background: var(--ink);
  box-shadow: 0 12px 25px rgba(48, 35, 42, .18);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .09em;
}

.primary-btn b {
  color: #ff9bbd;
  font-size: 20px;
  line-height: 1;
}

.primary-btn.pink {
  margin-top: 14px;
  background: var(--rose-deep);
  box-shadow: 0 12px 25px rgba(232, 79, 139, .25);
}

.primary-btn.pink b { color: #ffe0eb; }

.primary-btn:hover,
.yes-btn:hover,
.restart-btn:hover,
.no-btn:hover { transform: translateY(-2px); filter: saturate(1.08); }

.primary-btn:active,
.yes-btn:active,
.restart-btn:active,
.no-btn:active { transform: translateY(1px) scale(.99); }

.primary-btn:focus-visible,
.yes-btn:focus-visible,
.restart-btn:focus-visible,
.no-btn:focus-visible,
.gift:focus-visible {
  outline: 3px solid rgba(255, 111, 165, .45);
  outline-offset: 3px;
}

.photo-card {
  position: relative;
  width: min(100%, 330px);
  margin: 2px 0 21px;
  padding: 9px 9px 12px;
  overflow: hidden;
  background: #fff;
  border: 1px solid rgba(231, 183, 202, .55);
  border-radius: 24px;
  box-shadow: 0 18px 35px rgba(112, 53, 78, .14);
}

.photo-card::after {
  position: absolute;
  inset: 9px;
  border: 1px solid rgba(255, 255, 255, .6);
  border-radius: 17px;
  content: "";
  pointer-events: none;
}

.photo-card img:first-child {
  display: block;
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-radius: 17px;
}

.hero-card { transform: rotate(-2.2deg); }
.proposal-card { transform: rotate(2.2deg); }

.photo-card figcaption,
.memory-card figcaption {
  position: absolute;
  z-index: 2;
  right: 16px;
  bottom: 12px;
  left: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: #fff;
  font-family: Georgia, serif;
  font-size: 11px;
  font-style: italic;
  letter-spacing: .04em;
  text-shadow: 0 1px 8px rgba(48, 35, 42, .6);
}

.photo-card figcaption::before,
.memory-card figcaption::before {
  width: 15px;
  height: 1px;
  background: currentColor;
  content: "";
  opacity: .8;
}

.bow-sticker {
  position: absolute;
  z-index: 3;
  top: -24px;
  right: 17px;
  width: 83px;
  filter: drop-shadow(0 5px 5px rgba(111, 46, 73, .18));
  transform: rotate(13deg);
}

.kitty-sticker {
  position: absolute;
  z-index: 3;
  right: -15px;
  bottom: -16px;
  width: 103px;
  filter: drop-shadow(0 6px 5px rgba(48, 35, 42, .16));
  transform: rotate(-8deg);
}

.letter {
  position: relative;
  width: 100%;
  max-width: 350px;
  margin: 0 auto 13px;
  padding: 27px 22px 20px;
  background: #fff;
  border: 1px solid #f0d9e2;
  border-radius: 19px;
  box-shadow: 0 18px 40px rgba(111, 54, 79, .1);
  text-align: left;
}

.letter::before {
  position: absolute;
  inset: 8px;
  border: 1px dashed rgba(231, 148, 178, .34);
  border-radius: 13px;
  content: "";
  pointer-events: none;
}

.letter-bow {
  position: absolute;
  top: -27px;
  right: 13px;
  width: 78px;
  transform: rotate(14deg);
  filter: drop-shadow(0 5px 5px rgba(111, 46, 73, .16));
}

.letter h2 {
  margin: 0 0 16px;
  font-size: 31px;
}

.letter p {
  margin: 0 0 12px;
  color: #6e5862;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 14px;
  line-height: 1.65;
}

.letter p strong { color: var(--rose-deep); }

.memory-card {
  position: relative;
  height: 132px;
  margin: 0 0 17px;
  overflow: hidden;
  border-radius: 12px;
  box-shadow: 0 7px 18px rgba(111, 54, 79, .12);
}

.memory-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 45%;
}

.memory-card figcaption {
  bottom: 9px;
  font-size: 10px;
}

.letter blockquote {
  margin: 18px 0 12px;
  padding: 12px 0 12px 14px;
  color: var(--rose-deep);
  border-left: 3px solid var(--rose);
  font-family: Georgia, serif;
  font-size: 18px;
  line-height: 1.35;
}

.signature {
  text-align: right;
  font-family: Arial, sans-serif !important;
  font-size: 11px !important;
  letter-spacing: .05em;
}

.signature span { color: var(--rose-deep); }

.gift-stage {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 230px;
  margin: 4px 0 2px;
  perspective: 900px;
}

.gift {
  position: relative;
  width: 230px;
  height: 185px;
  cursor: pointer;
  transform-style: preserve-3d;
  transition: transform .25s ease;
}

.gift:hover { transform: translateY(-3px); }

.gift-base {
  position: absolute;
  right: 8px;
  bottom: 0;
  left: 8px;
  height: 102px;
  overflow: hidden;
  background: linear-gradient(145deg, #7b3151, #4b2031);
  border: 3px solid #37202a;
  border-radius: 8px 8px 25px 25px;
  box-shadow: 0 17px 25px rgba(75, 32, 49, .24), inset 0 8px 14px rgba(255, 255, 255, .08);
}

.gift-base::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 47%, rgba(255, 255, 255, .1) 48%, rgba(255, 255, 255, .1) 52%, transparent 53%);
  content: "";
}

.velvet {
  position: absolute;
  inset: 12px 12px 12px;
  overflow: hidden;
  background: #a9496e;
  border-radius: 5px 5px 19px 19px;
  box-shadow: inset 0 8px 16px rgba(255, 255, 255, .12);
}

.velvet::before {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 30%, rgba(255, 255, 255, .28) 0, transparent 55%);
  content: "";
}

.velvet img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 47%;
  filter: saturate(1.08) contrast(1.05);
}

.gift-lid {
  position: absolute;
  z-index: 4;
  top: 46px;
  left: 0;
  width: 100%;
  height: 78px;
  overflow: hidden;
  background: linear-gradient(145deg, #ff9ec1, #ff6fa5 58%, #e85b94);
  border: 3px solid #37202a;
  border-radius: 15px 15px 9px 9px;
  box-shadow: 0 12px 19px rgba(111, 46, 73, .22), inset 0 5px 10px rgba(255, 255, 255, .22);
  transform-origin: 50% 100%;
  transition: transform .7s cubic-bezier(.2, .8, .2, 1);
}

.gift-lid::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, rgba(255, 255, 255, .2), transparent 35%, transparent 65%, rgba(156, 43, 91, .12));
  content: "";
}

.gift-lid img {
  position: absolute;
  top: 11px;
  left: 73px;
  width: 84px;
  transform: rotate(-5deg);
  filter: drop-shadow(0 4px 3px rgba(65, 28, 43, .2));
}

.gift.open { cursor: default; }

.gift.open .gift-lid {
  transform: rotateX(68deg) translateY(-24px);
}

.gift.open .gift-base {
  box-shadow: 0 20px 30px rgba(75, 32, 49, .28), 0 0 35px rgba(255, 111, 165, .2), inset 0 8px 14px rgba(255, 255, 255, .08);
}

.sparkle {
  position: absolute;
  color: var(--gold);
  font-size: 20px;
  text-shadow: 0 0 10px rgba(246, 201, 120, .8);
  animation: twinkle 1.8s ease-in-out infinite;
}

.sparkle-one { top: 31px; left: 26%; }
.sparkle-two { right: 22%; bottom: 38px; animation-delay: -.8s; font-size: 15px; }

.hint {
  margin: 7px 0 0;
  color: #b08d9b;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.proposal-card { margin-bottom: 18px; }
.proposal-card img:first-child { height: 180px; }

.yes-btn {
  margin-top: auto;
  padding: 0 18px;
  color: #fff;
  background: linear-gradient(135deg, var(--rose), var(--rose-deep));
  box-shadow: 0 13px 28px rgba(232, 79, 139, .28);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .1em;
}

.no-btn {
  min-height: 38px;
  margin-top: 10px;
  color: #a3818f;
  background: transparent;
  border: 1px solid #e7c7d4;
  border-radius: 12px;
  cursor: pointer;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .05em;
  transition: transform .25s ease, color .25s ease, border-color .25s ease;
}

.no-btn:hover { color: var(--rose-deep); border-color: var(--rose); }

.success-photo {
  position: relative;
  width: min(100%, 320px);
  height: 145px;
  margin: 0 0 16px;
  overflow: hidden;
  border: 7px solid #fff;
  border-radius: 23px;
  box-shadow: 0 15px 30px rgba(111, 54, 79, .16);
  transform: rotate(-1.5deg);
}

.success-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 43%;
  filter: saturate(1.05);
}

.success-photo figcaption {
  position: absolute;
  right: 12px;
  bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  color: #fff;
  background: rgba(48, 35, 42, .62);
  border-radius: 9px;
  backdrop-filter: blur(6px);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.success-photo figcaption img {
  width: 22px;
  height: auto;
}

.counter {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  width: 100%;
  margin: 17px 0 10px;
  overflow: hidden;
  background: rgba(255, 255, 255, .9);
  border: 1px solid #f0d7e1;
  border-radius: 18px;
  box-shadow: 0 10px 24px rgba(111, 54, 79, .08);
}

.counter div {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 13px 3px;
  border-right: 1px solid #f1dfe6;
}

.counter div:last-child { border-right: 0; }

.counter b {
  color: var(--ink);
  font-size: 21px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.05em;
}

.counter span {
  color: #b08193;
  font-size: 7px;
  font-weight: 900;
  letter-spacing: .12em;
}

.since {
  margin: 0;
  color: #b08193;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .11em;
}

.since strong { color: var(--rose-deep); }

.forever {
  margin: 15px 0 17px;
  color: var(--rose-deep);
  font-family: Georgia, serif;
  font-size: 24px;
  line-height: 1.22;
}

.forever span { padding: 0 4px; color: var(--gold); }
.forever b { color: var(--ink); }

.restart-btn {
  padding: 0 14px;
  color: #7c5967;
  background: #fff;
  border: 1px solid #efd6e0;
  box-shadow: 0 8px 18px rgba(111, 54, 79, .07);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .09em;
}

.credits {
  margin: 13px 0 0;
  color: #c2a4ae;
  font-size: 7px;
  line-height: 1.4;
}

.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity .3s ease, transform .3s ease;
}

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

.confetti-piece {
  position: absolute;
  top: -20px;
  width: 8px;
  height: 14px;
  border-radius: 3px;
  animation: confetti-fall 1.8s ease-in forwards;
}

.confetti-piece:nth-child(3n) { border-radius: 50%; }
.confetti-piece:nth-child(4n) { width: 12px; height: 8px; transform: rotate(25deg); }

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(255, 111, 165, .14); }
  50% { box-shadow: 0 0 0 7px rgba(255, 111, 165, .05); }
}

@keyframes drift {
  to { transform: translate3d(22px, 18px, 0) scale(1.08); }
}

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

@keyframes twinkle {
  0%, 100% { opacity: .35; transform: scale(.8) rotate(0); }
  50% { opacity: 1; transform: scale(1.15) rotate(18deg); }
}

@keyframes confetti-fall {
  0% { opacity: 0; transform: translate3d(0, -15px, 0) rotate(0); }
  12% { opacity: 1; }
  100% { opacity: 0; transform: translate3d(var(--fall-x), 105vh, 0) rotate(var(--spin)); }
}

@media (min-width: 480px) {
  body { display: grid; place-items: center; padding: 22px 0; }
  .app { height: min(880px, calc(100svh - 44px)); border-radius: 34px; }
  .app::after { border-radius: 34px; }
}

@media (max-height: 720px) {
  .topbar { height: 58px; }
  .screen { inset: 58px 0 0; padding-top: 18px; padding-bottom: 16px; }
  .photo-card { margin-bottom: 13px; }
  .photo-card img:first-child { height: 175px; }
  .proposal-card img:first-child { height: 130px; }
  .hero-card { margin-top: 0; }
  .lead { margin: 12px auto 17px; }
  .letter { padding-top: 21px; padding-bottom: 14px; }
  .memory-card { height: 100px; margin-bottom: 11px; }
  .letter p { margin-bottom: 8px; font-size: 13px; }
  .letter blockquote { margin: 11px 0 8px; font-size: 16px; }
  .gift-stage { min-height: 190px; margin-top: 0; }
  .gift { transform: scale(.86); transform-origin: center bottom; }
  .gift:hover { transform: scale(.86) translateY(-3px); }
  .success-photo { height: 115px; margin-bottom: 11px; }
  .counter { margin-top: 11px; }
  .counter div { padding: 9px 3px; }
  .counter b { font-size: 18px; }
  .forever { margin: 10px 0 12px; }
}

@media (max-height: 650px) {
  .screen { padding-top: 12px; padding-bottom: 10px; }
  .letter { padding: 17px 16px 11px; }
  .letter h2 { margin-bottom: 8px; font-size: 25px; }
  .letter p { margin-bottom: 5px; font-size: 11.5px; line-height: 1.42; }
  .letter blockquote { margin: 8px 0 5px; padding: 8px 0 8px 11px; font-size: 13px; }
  .memory-card { height: 76px; margin-bottom: 8px; }
  .memory-card figcaption { bottom: 6px; font-size: 8px; }
  .signature { margin-bottom: 0 !important; font-size: 9px !important; }
  .primary-btn, .yes-btn { min-height: 46px; }
}

@media (max-height: 590px) {
  .photo-card img:first-child { height: 135px; }
  .proposal-card img:first-child { height: 100px; }
  .hero-card, .proposal-card { margin-bottom: 9px; }
  .letter p { font-size: 12px; line-height: 1.45; }
  .memory-card { height: 78px; }
  .gift { transform: scale(.72); }
  .gift:hover { transform: scale(.72) translateY(-3px); }
  .gift-stage { min-height: 150px; }
  .success-photo { height: 92px; }
  .forever { font-size: 20px; }
}

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