:root {
  --cream: #fffaf5;
  --paper: rgba(255, 255, 255, 0.88);
  --ink: #3b2c32;
  --muted: #836e75;
  --rose: #df647c;
  --rose-dark: #c84e69;
  --rose-pale: #fbe4e7;
  --peach: #f6b69f;
  --sage: #b9c8b3;
  --shadow: 0 28px 70px rgba(117, 69, 78, 0.14);
}

* { box-sizing: border-box; }

html { min-height: 100%; background: var(--cream); }

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: "Noto Sans TC", sans-serif;
  background:
    radial-gradient(circle at 8% 12%, rgba(246, 182, 159, 0.27), transparent 26rem),
    radial-gradient(circle at 92% 85%, rgba(185, 200, 179, 0.28), transparent 26rem),
    linear-gradient(135deg, #fff8f2 0%, #fffdf9 52%, #f9f6ef 100%);
  overflow-x: hidden;
}

button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }

.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.035;
  z-index: 10;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.shell {
  position: relative;
  z-index: 2;
  width: min(100% - 32px, 710px);
  min-height: 100vh;
  margin: 0 auto;
  padding: clamp(28px, 6vh, 58px) 0 24px;
  display: grid;
  align-content: center;
}

.eyebrow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 17px;
  color: #b48a91;
  font-size: 10px;
  letter-spacing: 0.26em;
  font-weight: 700;
}

.eyebrow span { width: 34px; height: 1px; background: #d9bfc0; }

.card {
  position: relative;
  min-height: min(690px, calc(100vh - 135px));
  display: grid;
  place-items: center;
  padding: clamp(42px, 7vw, 70px) clamp(22px, 8vw, 78px);
  background: var(--paper);
  border: 1px solid rgba(205, 159, 163, 0.28);
  border-radius: 36px 10px 36px 10px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  overflow: hidden;
}

.card::before, .card::after {
  content: "";
  position: absolute;
  width: 170px;
  height: 170px;
  border: 1px solid rgba(223, 100, 124, 0.14);
  border-radius: 50%;
}
.card::before { left: -115px; top: -90px; }
.card::after { right: -110px; bottom: -100px; }

.card-stamp {
  position: absolute;
  right: 22px;
  top: 20px;
  width: 50px;
  height: 58px;
  display: grid;
  place-items: center;
  border: 1px solid #e0b9bd;
  color: #bd7b85;
  font-family: "Playfair Display", serif;
  font-style: italic;
  font-size: 12px;
  line-height: 1.05;
  text-align: center;
  transform: rotate(5deg);
}

.step { display: none; width: 100%; text-align: center; }
.step.is-active { display: block; animation: reveal 0.55s cubic-bezier(.2,.8,.2,1) both; }

@keyframes reveal {
  from { opacity: 0; transform: translateY(12px) scale(.985); }
  to { opacity: 1; transform: none; }
}

.kicker {
  margin: 0 0 13px;
  color: var(--rose);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .17em;
}

h1 {
  margin: 0;
  font-size: clamp(35px, 7vw, 54px);
  line-height: 1.24;
  letter-spacing: -0.045em;
  font-weight: 800;
}

h1 em {
  color: var(--rose-dark);
  font-family: "Playfair Display", "Noto Sans TC", serif;
  font-weight: 600;
}

.supporting-text {
  min-height: 28px;
  margin: 20px auto 28px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.8;
  transition: color .25s, transform .25s;
}
.supporting-text.is-pleading { color: var(--rose-dark); transform: scale(1.03); font-weight: 600; }
.supporting-text.compact { margin-bottom: 22px; }

.heart-envelope { height: 114px; display: grid; place-items: center; }
.envelope {
  position: relative;
  width: 100px;
  height: 68px;
  display: grid;
  place-items: center;
  background: #f6cec8;
  border-radius: 4px;
  box-shadow: 0 12px 25px rgba(198, 104, 115, .16);
  transform: rotate(-3deg);
}
.envelope::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(32deg, #efb9b5 49%, transparent 50%), linear-gradient(-32deg, #f4c5c0 49%, transparent 50%);
}
.envelope::after {
  content: "";
  position: absolute;
  top: -1px;
  border-left: 50px solid transparent;
  border-right: 50px solid transparent;
  border-top: 39px solid #f9ddd8;
}
.envelope span { position: relative; z-index: 2; color: var(--rose-dark); font-size: 28px; transform: translateY(-19px); animation: heartbeat 1.8s infinite; }
@keyframes heartbeat { 50% { transform: translateY(-19px) scale(1.15); } }

.ask-actions { min-height: 96px; display: flex; align-items: center; justify-content: center; gap: 12px; }
.button {
  border: 0;
  border-radius: 999px;
  padding: 15px 25px;
  cursor: pointer;
  font-weight: 700;
  transition: transform .24s cubic-bezier(.2,.8,.2,1), box-shadow .24s, opacity .24s, background .24s;
}
.button:hover:not(:disabled) { transform: translateY(-2px); }
.button:focus-visible, .activity:focus-visible, input:focus-visible { outline: 3px solid rgba(223, 100, 124, .25); outline-offset: 3px; }
.button-primary { color: white; background: var(--rose); box-shadow: 0 10px 24px rgba(207, 76, 103, .25); }
.button-primary:hover:not(:disabled) { background: var(--rose-dark); box-shadow: 0 13px 28px rgba(207, 76, 103, .3); }
.button-ghost { color: #9b7e84; background: #f9eeeb; border: 1px solid #ead8d4; }
.button:disabled { cursor: not-allowed; opacity: .42; box-shadow: none; }
.full-width { width: 100%; margin-top: 18px; }
.next-button { min-width: 205px; }
.button span { margin-left: 7px; }

#yes-button, #no-button { transform-origin: center; }
#yes-button:hover { transform: scale(var(--yes-scale, 1)) translateY(-2px); }
#yes-button { transform: scale(var(--yes-scale, 1)); }
#no-button { transform: scale(var(--no-scale, 1)); }
#no-button.is-tiny { pointer-events: none; opacity: 0.08; }

.celebration { margin: 0 0 23px; color: #f1a764; font-size: 31px; }
.celebration b { display: inline-block; margin: 0 19px; color: var(--rose); font-size: 65px; animation: heartbeat2 1.2s infinite; }
@keyframes heartbeat2 { 50% { transform: scale(1.12) rotate(3deg); } }

.progress { width: 94px; margin: 0 auto 32px; display: flex; gap: 8px; }
.progress span { flex: 1; height: 4px; border-radius: 99px; background: #eee3de; }
.progress .is-filled { background: var(--rose); }

.date-field { display: block; text-align: left; margin: 30px 0 2px; }
.date-field > span { display: block; margin: 0 0 8px 5px; color: #80696f; font-size: 12px; font-weight: 700; }
.date-field div { position: relative; }
.date-field input {
  width: 100%;
  padding: 17px 48px 17px 18px;
  color: var(--ink);
  background: #fffaf7;
  border: 1px solid #e7d3d0;
  border-radius: 15px;
  font-weight: 600;
  color-scheme: light;
}
.date-field div > span { position: absolute; pointer-events: none; right: 17px; top: 15px; color: var(--rose); }
.field-error { min-height: 21px; margin: 7px 3px 0; color: #b43f55; font-size: 12px; text-align: left; }

.activity-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.activity {
  min-height: 119px;
  padding: 14px 10px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 3px;
  color: var(--ink);
  background: #fffaf7;
  border: 1px solid #eadbd6;
  border-radius: 17px;
  cursor: pointer;
  transition: transform .2s, border .2s, background .2s, box-shadow .2s;
}
.activity:hover { transform: translateY(-2px); border-color: #dfa8ae; }
.activity[aria-checked="true"] { background: #fff0f1; border: 2px solid var(--rose); box-shadow: 0 8px 19px rgba(198, 78, 105, .12); }
.activity > span { font-size: 25px; }
.activity b { font-size: 13px; }
.activity small { color: #957c82; font-size: 10px; }
.honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; }

.date-ticket { position: relative; width: 112px; height: 82px; margin: 0 auto 23px; border: 2px solid #e7acb4; border-radius: 12px; transform: rotate(-4deg); }
.date-ticket::before, .date-ticket::after { content: ""; position: absolute; top: -8px; width: 3px; height: 16px; background: #ca6477; border-radius: 99px; }
.date-ticket::before { left: 25px; }.date-ticket::after { right: 25px; }
.ticket-heart { display: block; color: var(--rose); font-size: 31px; margin-top: 15px; }
.ticket-line { display: block; width: 45px; height: 3px; margin: 4px auto; background: #f3c7ca; border-radius: 99px; }
.summary-card { margin: 28px auto 17px; padding: 8px 18px; background: #fff8f5; border: 1px solid #ecd9d4; border-radius: 17px; text-align: left; }
.summary-card div { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 12px 2px; }
.summary-card div + div { border-top: 1px dashed #e3cbc7; }
.summary-card span { color: #947a80; font-size: 12px; }
.summary-card strong { font-size: 14px; }
.save-note { margin: 15px 0 0; color: var(--muted); font-size: 12px; }

.footer-note { margin: 17px 0 0; color: #b19398; text-align: center; font-family: "Playfair Display", serif; font-size: 12px; font-style: italic; letter-spacing: .06em; }
.footer-note span { color: var(--rose); }

.floating-hearts span { position: fixed; z-index: 1; color: rgba(204, 100, 118, .2); animation: drift 8s ease-in-out infinite; }
.floating-hearts span:nth-child(1) { left: 6%; top: 20%; font-size: 26px; }
.floating-hearts span:nth-child(2) { right: 8%; top: 11%; font-size: 18px; animation-delay: -2s; }
.floating-hearts span:nth-child(3) { left: 12%; bottom: 13%; font-size: 17px; animation-delay: -5s; }
.floating-hearts span:nth-child(4) { right: 5%; bottom: 25%; font-size: 31px; animation-delay: -3.5s; }
.floating-hearts span:nth-child(5) { right: 17%; top: 52%; font-size: 13px; animation-delay: -6s; }
@keyframes drift { 50% { transform: translateY(-15px) rotate(10deg); opacity: .55; } }

#confetti { position: fixed; inset: 0; z-index: 20; pointer-events: none; overflow: hidden; }
.confetti-piece { position: absolute; top: -25px; animation: fall 2.4s ease-in forwards; }
@keyframes fall { to { transform: translate(var(--wind), 110vh) rotate(540deg); opacity: .2; } }

@media (max-width: 520px) {
  .shell { width: min(100% - 20px, 710px); padding: 17px 0 14px; }
  .eyebrow { margin-bottom: 10px; }
  .card { min-height: calc(100vh - 92px); padding: 47px 22px 35px; border-radius: 28px 8px 28px 8px; }
  .card-stamp { right: 15px; top: 14px; transform: rotate(5deg) scale(.85); }
  .heart-envelope { height: 102px; }
  .supporting-text { margin: 16px auto 22px; }
  .ask-actions { gap: 8px; }
  .activity-grid { gap: 8px; }
  .activity { min-height: 104px; padding: 10px 5px; }
  .activity > span { font-size: 22px; }
}

@media (max-height: 760px) and (min-width: 521px) {
  .card { min-height: 620px; padding-top: 42px; padding-bottom: 42px; }
  .heart-envelope { height: 92px; transform: scale(.85); }
}

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