:root {
  --ink: #332b2d;
  --muted: #8d7e80;
  --paper: #fffaf6;
  --blush: #fff0ee;
  --pink: #f06191;
  --pink-deep: #d94678;
  --coral: #ff8d85;
  --lavender: #bda6df;
  --line: rgba(81, 51, 58, 0.1);
  --shadow: 0 18px 45px rgba(127, 72, 84, 0.12);
  --radius: 28px;
}

* { box-sizing: border-box; }

html { min-height: 100%; background: #f8e9e8; }

body {
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

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

.app-shell {
  position: relative;
  width: min(100%, 540px);
  min-height: 100svh;
  margin: 0 auto;
  overflow: hidden;
  background:
    radial-gradient(circle at 6% 18%, rgba(255, 214, 193, 0.55), transparent 23%),
    radial-gradient(circle at 95% 25%, rgba(212, 193, 242, 0.42), transparent 25%),
    linear-gradient(160deg, #fffaf6 0%, #fff5f2 58%, #fffaf6 100%);
  box-shadow: 0 0 90px rgba(70, 31, 43, 0.16);
  isolation: isolate;
}

.app-shell::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.14;
  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)' opacity='.18'/%3E%3C/svg%3E");
}

.ambient { position: fixed; border-radius: 50%; filter: blur(26px); pointer-events: none; opacity: 0.65; }
.ambient-one { width: 150px; height: 150px; left: -85px; bottom: 7%; background: #ffd7cd; }
.ambient-two { width: 170px; height: 170px; right: -100px; top: 15%; background: #ddd0f1; }

.sparkles { position: fixed; inset: 0; z-index: 0; pointer-events: none; color: #ef789b; }
.sparkles span { position: absolute; opacity: .55; animation: twinkle 3.8s ease-in-out infinite; }
.sparkles span:nth-child(1) { left: 7%; top: 20%; font-size: 25px; }
.sparkles span:nth-child(2) { right: 9%; top: 35%; font-size: 38px; color: #c7afd9; animation-delay: .9s; }
.sparkles span:nth-child(3) { left: 10%; bottom: 18%; font-size: 22px; color: #f7c65a; animation-delay: 1.6s; }
.sparkles span:nth-child(4) { right: 4%; bottom: 10%; font-size: 46px; animation-delay: 2.1s; }
.sparkles span:nth-child(5) { right: 11%; top: 11%; font-size: 15px; color: #f3b940; animation-delay: 1.2s; }

.topbar {
  position: relative;
  z-index: 5;
  height: 82px;
  padding: max(18px, env(safe-area-inset-top)) 22px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand { position: absolute; left: 50%; transform: translateX(-50%); display: grid; justify-items: center; gap: 5px; }
.brand span { font: 600 12px/1.1 Georgia, serif; letter-spacing: .23em; text-transform: uppercase; color: #6c5b5e; white-space: nowrap; }
.brand i { display: block; width: 38px; height: 1px; background: var(--pink); position: relative; }
.brand i::after { content: ""; position: absolute; width: 3px; height: 3px; border-radius: 50%; background: var(--pink); top: -1px; left: 50%; }

.icon-button, .sound-button {
  border: 1px solid rgba(91, 61, 67, .1);
  background: rgba(255, 255, 255, .65);
  color: #65585a;
  box-shadow: 0 8px 24px rgba(101, 57, 69, .08);
  backdrop-filter: blur(12px);
}
.icon-button { width: 42px; height: 42px; border-radius: 50%; font-size: 22px; cursor: pointer; }
.sound-button { margin-left: auto; width: 44px; height: 44px; border-radius: 50%; font-size: 19px; cursor: pointer; transition: .2s ease; }
.sound-button[aria-pressed="true"] { background: #fff; color: var(--pink-deep); }
.sound-icon { display: inline-block; }
.sound-button[aria-pressed="false"] .sound-icon { text-decoration: line-through; opacity: .5; }

.progress-wrap { position: relative; z-index: 4; padding: 4px 30px 0; display: flex; align-items: center; justify-content: space-between; }
.progress-dots { display: flex; gap: 7px; align-items: center; }
.progress-dots span { width: 23px; height: 4px; border-radius: 4px; background: rgba(76, 53, 57, .12); transition: .35s ease; }
.progress-dots span.active { width: 36px; background: linear-gradient(90deg, var(--pink), var(--coral)); }
.progress-text { font: 600 10px/1.2 Georgia, serif; color: #a28d91; letter-spacing: .13em; }

#invite-form { position: relative; z-index: 2; }

.screen {
  display: none;
  min-height: calc(100svh - 132px);
  padding: 26px 28px calc(48px + env(safe-area-inset-bottom));
  text-align: center;
  animation: screenIn .5s cubic-bezier(.22,.7,.22,1) both;
}
.screen.active { display: flex; flex-direction: column; align-items: center; }
.screen-intro { justify-content: center; padding-top: 10px; }

.eyebrow, .step-kicker {
  margin: 0 0 13px;
  color: #b49299;
  font: 600 10px/1.2 Georgia, serif;
  letter-spacing: .22em;
}

h1, h2 { margin: 0; color: var(--ink); font-weight: 600; letter-spacing: -.045em; }
h1 { font-size: clamp(37px, 10vw, 52px); line-height: 1.24; }
h2 { font-size: clamp(32px, 8.3vw, 43px); line-height: 1.25; }
h1 span, h2 span { color: var(--pink-deep); position: relative; display: inline-block; }
h1 span::after { content: ""; position: absolute; height: 8px; border-radius: 50%; background: rgba(240, 97, 145, .12); left: -4px; right: -4px; bottom: 3px; z-index: -1; }

.intro-subtitle, .subtitle { margin: 18px 0 0; color: var(--muted); font-size: 14px; line-height: 1.8; }

.love-letter { position: relative; width: 250px; height: 220px; margin: 27px auto 12px; filter: drop-shadow(0 23px 22px rgba(121, 63, 79, .14)); }
.envelope { position: absolute; width: 210px; height: 135px; left: 20px; bottom: 15px; border-radius: 5px 5px 18px 18px; background: linear-gradient(145deg, #f59db1, #e66b90); transform: rotate(-2deg); box-shadow: inset 0 -10px 22px rgba(180, 53, 91, .12); }
.envelope::before, .envelope::after { content: ""; position: absolute; bottom: 0; width: 0; height: 0; border-style: solid; }
.envelope::before { left: 0; border-width: 67px 0 0 105px; border-color: transparent transparent transparent #f8b4c1; }
.envelope::after { right: 0; border-width: 67px 105px 0 0; border-color: transparent #ef8eaa transparent transparent; }
.envelope-flap { position: absolute; inset: 0; z-index: 1; clip-path: polygon(0 0, 100% 0, 50% 72%); background: #ffc6cf; transform-origin: top; animation: flap 1.5s .4s cubic-bezier(.2,.65,.25,1) both; }
.wax-seal { position: absolute; z-index: 4; left: 82px; top: 49px; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; color: #fff3f5; background: linear-gradient(145deg, #ef668b, #ce3669); box-shadow: 0 5px 0 #bd2e5e, inset 0 1px 4px rgba(255,255,255,.5); font-size: 18px; }
.letter-paper { position: absolute; z-index: -1; width: 175px; height: 130px; bottom: 70px; left: 38px; padding: 24px 10px; border-radius: 10px; background: linear-gradient(#fffdfb, #fff1ec); transform: rotate(3deg); animation: paperUp 1.5s .4s cubic-bezier(.2,.65,.25,1) both; box-shadow: 0 3px 14px rgba(83,44,53,.08); }
.letter-paper span { display: block; font: 500 13px/1.5 Georgia, serif; color: #8c686e; }
.letter-paper b { display: block; margin-top: 9px; color: var(--pink); font-size: 24px; }
.floating-heart, .floating-star { position: absolute; color: var(--pink); animation: float 2.7s ease-in-out infinite; }
.heart-a { right: 1px; top: 46px; font-size: 22px; }
.heart-b { left: 5px; top: 74px; color: #f699af; font-size: 14px; animation-delay: .6s; }
.floating-star { right: 33px; top: 7px; color: #f3c559; font-size: 20px; animation-delay: 1s; }

.primary-button, .secondary-button {
  min-height: 60px;
  border-radius: 999px;
  padding: 0 28px;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease;
}
.primary-button { border: 0; color: white; background: linear-gradient(135deg, #f5799e, #ec4d86); box-shadow: 0 8px 0 #d73d72, 0 17px 28px rgba(218, 62, 116, .2); font-size: 16px; font-weight: 600; letter-spacing: .08em; }
.primary-button:not(:disabled):active { transform: translateY(5px); box-shadow: 0 3px 0 #d73d72, 0 9px 18px rgba(218, 62, 116, .16); }
.primary-button:disabled { opacity: .38; cursor: not-allowed; box-shadow: 0 5px 0 #cbbcc0; filter: grayscale(.5); }
.primary-button b { margin-left: 18px; font-size: 23px; font-weight: 400; }
.secondary-button { border: 1px solid rgba(94, 69, 74, .12); background: rgba(255,255,255,.7); color: #7e6d70; box-shadow: 0 7px 0 rgba(99, 75, 80, .08); }
.secondary-button:active { transform: translateY(3px); }
.intro-button { width: min(270px, 76vw); }
.tiny-note { color: #b3a3a5; font-size: 11px; margin: 22px 0 0; }

.screen-ask { justify-content: center; padding-bottom: 90px; }
.mascot { position: relative; width: 140px; height: 108px; margin-bottom: 28px; border-radius: 60% 47% 48% 55% / 58% 54% 50% 46%; background: linear-gradient(145deg, #cbb6ee, #aa88d5); box-shadow: inset 10px 10px 20px rgba(255,255,255,.34), 0 14px 0 #9274be, 0 25px 35px rgba(121, 90, 162, .2); transform: rotate(-2deg); animation: mascotBob 3s ease-in-out infinite; }
.mascot::before, .mascot::after { content: ""; position: absolute; top: 58px; width: 13px; height: 8px; border-radius: 50%; background: #e59ab9; opacity: .75; }
.mascot::before { left: 27px; }.mascot::after { right: 27px; }
.mascot-face { position: absolute; left: 50%; top: 42px; transform: translateX(-50%); font: 700 25px/1 monospace; color: #4c3c6f; white-space: nowrap; }
.mascot-leg { position: absolute; bottom: -25px; width: 3px; height: 28px; background: #9978c5; transform-origin: top; }
.mascot-leg::after { content: "♥"; position: absolute; left: -7px; bottom: -12px; color: #9978c5; font-size: 16px; }
.leg-one { left: 32px; transform: rotate(9deg); }.leg-two { left: 69px; }.leg-three { right: 32px; transform: rotate(-9deg); }
.screen-ask .subtitle { margin-top: 15px; }
.ask-actions { width: 100%; display: grid; grid-template-columns: 1.25fr 1fr; gap: 13px; margin-top: 38px; }
.accept-button, .ask-actions .secondary-button { width: 100%; padding-inline: 14px; }
.privacy-note { margin: 25px 0 0; color: #ac999d; font-size: 11px; }
.privacy-note span { color: var(--pink); }

.screen-options { justify-content: flex-start; padding-top: 34px; }
.step-kicker { color: var(--pink-deep); margin-bottom: 12px; }
.screen-options > .subtitle { margin-top: 9px; }
.option-grid { width: 100%; margin-top: 26px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.option-card, .time-card {
  position: relative;
  border: 1px solid rgba(93, 68, 75, .08);
  background: rgba(255, 255, 255, .78);
  color: #5f5053;
  box-shadow: 0 10px 25px rgba(122, 78, 89, .07);
  cursor: pointer;
  transition: .22s cubic-bezier(.2,.7,.3,1);
}
.option-card { min-height: 114px; border-radius: 22px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 11px; font-size: 14px; }
.option-card .emoji { font-size: 33px; filter: drop-shadow(0 7px 6px rgba(57, 31, 39, .13)); transition: transform .22s ease; }
.option-card:hover .emoji { transform: translateY(-3px) rotate(-3deg); }
.option-card.selected, .time-card.selected { border: 2px solid var(--pink); color: #b73767; background: rgba(255, 234, 241, .83); box-shadow: 0 9px 0 rgba(221, 65, 118, .1), 0 18px 32px rgba(196, 63, 105, .12); transform: translateY(-3px); }
.option-card.selected::after, .time-card.selected::after { content: "✓"; position: absolute; right: 10px; top: 10px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--pink); font-size: 13px; }
.option-wide { grid-column: 1 / -1; min-height: 82px; flex-direction: row; }
.option-wide .emoji { font-size: 30px; }

.other-field, .message-field { width: 100%; text-align: left; color: #746367; }
.other-field { margin-top: 14px; }
.other-field span, .message-field > span { display: block; margin: 0 0 9px 6px; font-size: 12px; }
.other-field input, .message-field textarea {
  width: 100%; border: 1px solid rgba(89, 64, 70, .13); border-radius: 18px; outline: none; color: var(--ink); background: rgba(255,255,255,.76); transition: .2s ease; box-shadow: inset 0 2px 6px rgba(80,48,56,.03);
}
.other-field input { height: 54px; padding: 0 18px; }
.other-field input:focus, .message-field textarea:focus { border-color: rgba(240, 97, 145, .6); box-shadow: 0 0 0 4px rgba(240, 97, 145, .08); }
.field-error { min-height: 17px; margin: 9px 0 1px; color: #c43e68; font-size: 12px; }
.next-button, .submit-button { width: min(270px, 78vw); margin-top: 10px; flex: 0 0 auto; }

.time-grid { width: 100%; margin-top: 25px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.time-card { min-height: 105px; border-radius: 22px; display: grid; place-items: center; align-content: center; gap: 9px; }
.time-card > span { font-size: 30px; filter: drop-shadow(0 6px 5px rgba(74,42,50,.12)); }
.time-card b { font-weight: 500; font-size: 14px; }
.time-card.time-wide { grid-column: 1 / -1; min-height: 74px; display: flex; justify-content: center; }
.message-field { position: relative; margin-top: 26px; }
.message-field small { color: #afa0a3; }
.message-field textarea { min-height: 105px; padding: 15px 17px 28px; resize: vertical; line-height: 1.6; }
.message-field i { position: absolute; right: 13px; bottom: 11px; color: #b8a9ac; font-style: normal; font-size: 10px; }
.quick-replies { width: 100%; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 11px; }
.quick-replies button { border: 1px solid rgba(95,67,74,.12); border-radius: 999px; background: rgba(255,255,255,.58); color: #907b7f; padding: 7px 11px; font-size: 11px; cursor: pointer; }
.quick-replies button:active { background: #ffe6ed; }

.screen-success, .screen-decline { justify-content: center; padding-bottom: 105px; }
.success-art { position: relative; width: 188px; height: 188px; margin-bottom: 25px; }
.success-heart { position: absolute; z-index: 2; inset: 35px; display: grid; place-items: center; border-radius: 42% 58% 50% 50%; color: white; background: linear-gradient(145deg, #ff92a9, #ed4b7f); box-shadow: inset 9px 8px 16px rgba(255,255,255,.35), 0 12px 0 #cf396b, 0 28px 40px rgba(205, 49, 103, .22); font-size: 58px; animation: heartbeat 1.8s ease-in-out infinite; }
.orbit { position: absolute; border: 1px solid rgba(221,73,123,.22); border-radius: 50%; animation: orbitSpin 8s linear infinite; }
.orbit::after { content: ""; position: absolute; width: 9px; height: 9px; border-radius: 50%; background: #f5bc53; top: 14px; left: 23px; box-shadow: 0 0 0 5px rgba(245,188,83,.12); }
.orbit-one { inset: 8px; transform: rotate(18deg); }.orbit-two { inset: 0 25px; transform: rotate(80deg); animation-direction: reverse; animation-duration: 6s; }
.success-spark { position: absolute; color: #f5bc53; font-size: 22px; animation: twinkle 2s infinite; }.spark-one { right: 2px; top: 28px; }.spark-two { left: 6px; bottom: 24px; color: #c2a5dc; animation-delay: .8s; }
.screen-success .subtitle { margin-top: 16px; }
.summary-card { width: 100%; margin-top: 28px; padding: 5px 20px; border: 1px solid rgba(90,58,66,.08); border-radius: 22px; background: rgba(255,255,255,.65); box-shadow: var(--shadow); }
.summary-card div { min-height: 49px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px dashed rgba(89,60,67,.1); font-size: 13px; }
.summary-card div:last-child { border: 0; }
.summary-card span { color: #a08c90; }.summary-card b { color: #665457; font-weight: 600; }
.restart-button { margin-top: 25px; min-height: 49px; }
.decline-moon { width: 130px; height: 130px; display: grid; place-items: center; margin-bottom: 30px; border-radius: 50%; color: #8b74a9; background: linear-gradient(145deg, #eee6fa, #d7c6ed); box-shadow: inset 8px 8px 18px rgba(255,255,255,.65), 0 12px 0 #c4b0dd, 0 26px 36px rgba(95,65,127,.15); font: 400 73px/1 Georgia, serif; }
.screen-decline .secondary-button { margin-top: 30px; }

footer { position: absolute; z-index: 3; left: 0; right: 0; bottom: max(14px, env(safe-area-inset-bottom)); text-align: center; color: #b5a5a8; font: 600 8px/1.2 Georgia, serif; letter-spacing: .18em; }
footer span { color: var(--pink); }

.toast { position: fixed; z-index: 20; left: 50%; bottom: max(28px, env(safe-area-inset-bottom)); width: max-content; max-width: calc(100% - 50px); padding: 11px 17px; border-radius: 999px; color: #fff; background: rgba(57,43,47,.9); font-size: 12px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; transition: .25s ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.honeypot { position: absolute !important; left: -9999px !important; opacity: 0 !important; }
.hidden { display: none !important; }

@keyframes screenIn { from { opacity: 0; transform: translateY(14px) scale(.99); } to { opacity: 1; transform: none; } }
@keyframes twinkle { 0%,100% { transform: scale(.75) rotate(0); opacity: .25; } 50% { transform: scale(1.15) rotate(18deg); opacity: .75; } }
@keyframes flap { from { transform: rotateX(155deg); } to { transform: rotateX(0); } }
@keyframes paperUp { from { transform: translateY(45px) rotate(3deg); } to { transform: translateY(0) rotate(3deg); } }
@keyframes float { 0%,100% { transform: translateY(0) rotate(-5deg); } 50% { transform: translateY(-10px) rotate(8deg); } }
@keyframes mascotBob { 0%,100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-8px) rotate(1deg); } }
@keyframes heartbeat { 0%,100% { transform: scale(1); } 12% { transform: scale(1.055); } 24% { transform: scale(1); } }
@keyframes orbitSpin { to { transform: rotate(378deg); } }

@media (min-width: 541px) {
  body { padding: 24px 0; }
  .app-shell { min-height: calc(100svh - 48px); border-radius: 36px; }
  .screen { min-height: calc(100svh - 180px); }
  footer { position: absolute; }
}

@media (max-height: 760px) {
  .screen { padding-top: 12px; }
  .love-letter { transform: scale(.8); margin: 0 auto -12px; }
  .intro-subtitle { margin-top: 10px; }
  .mascot { transform: scale(.82); margin-bottom: 13px; }
  .screen-ask { justify-content: flex-start; padding-top: 38px; }
}

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