:root {
  --rose: #de4e80;
  --rose-deep: #9f285e;
  --plum: #43213a;
  --ink: #321d2e;
  --muted: #7e5d72;
  --cream: #fff8ef;
  --blush: #ffe0e9;
  --lavender: #eadcff;
  --peach: #ffd4bd;
  --mint: #dff7ee;
  --gold: #d89f3c;
  --glass: rgba(255, 255, 255, 0.54);
  --glass-strong: rgba(255, 255, 255, 0.76);
  --line: rgba(127, 52, 91, 0.16);
  --shadow: 0 24px 80px rgba(126, 47, 89, 0.22);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

* {
  box-sizing: border-box;
}

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

body {
  min-height: 100svh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    linear-gradient(128deg, #fff8ef 0%, #ffe1ea 31%, #eadcff 66%, #fff1df 100%);
  background-size: 150% 150%;
  animation: blushSky 16s var(--ease) infinite;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.24) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.18) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.5), transparent 72%);
}

button,
input,
a {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.ambient {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  color: rgba(159, 40, 94, 0.28);
}

.ambient span {
  position: absolute;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  font-size: 24px;
  animation: ambientDrift 12s var(--ease) infinite;
  transform: translate3d(0, 0, 0);
}

.ambient span:nth-child(1) {
  left: 8%;
  top: 12%;
  animation-delay: -2s;
}

.ambient span:nth-child(2) {
  right: 16%;
  top: 10%;
  color: rgba(216, 159, 60, 0.32);
  animation-delay: -5s;
}

.ambient span:nth-child(3) {
  left: 75%;
  top: 31%;
  animation-delay: -8s;
}

.ambient span:nth-child(4) {
  left: 12%;
  top: 46%;
  color: rgba(159, 40, 94, 0.2);
  animation-delay: -1s;
}

.ambient span:nth-child(5) {
  right: 9%;
  bottom: 25%;
  animation-delay: -7s;
}

.ambient span:nth-child(6) {
  left: 21%;
  bottom: 13%;
  color: rgba(216, 159, 60, 0.26);
  animation-delay: -4s;
}

.ambient span:nth-child(7) {
  right: 28%;
  bottom: 7%;
  animation-delay: -10s;
}

.ambient span:nth-child(8) {
  left: 43%;
  top: 5%;
  color: rgba(67, 33, 58, 0.12);
  animation-delay: -6s;
}

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

.invite-card {
  position: relative;
  display: flex;
  width: min(100%, 456px);
  min-height: calc(100svh - 28px);
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: 30px;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.7), rgba(255, 248, 239, 0.42)),
    var(--glass);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px);
}

.invite-card::before,
.invite-card::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.invite-card::before {
  inset: 0;
  border-radius: inherit;
  background:
    linear-gradient(110deg, rgba(255, 255, 255, 0.72), transparent 32%),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.32), transparent 44%);
}

.invite-card::after {
  right: -28px;
  bottom: 54px;
  width: 120px;
  height: 120px;
  border: 1px solid rgba(222, 78, 128, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  transform: rotate(15deg);
}

.topbar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 18px 18px 10px;
}

.brand {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  color: var(--plum);
  font-size: 0.82rem;
  font-weight: 800;
}

.brand span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-mark {
  display: inline-grid;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(222, 78, 128, 0.18);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.56);
  color: var(--rose);
  font-size: 1.1rem;
  box-shadow: 0 10px 28px rgba(159, 40, 94, 0.1);
}

.link-button {
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  color: var(--rose-deep);
  font-size: 0.78rem;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.progress {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 7px;
  padding: 0 18px;
}

.progress span {
  height: 5px;
  border-radius: 999px;
  background: rgba(159, 40, 94, 0.12);
  overflow: hidden;
}

.progress span::before {
  content: "";
  display: block;
  width: var(--fill, 0%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--rose), var(--gold));
  transition: width 320ms var(--ease);
}

.screen-note {
  position: absolute;
  left: 18px;
  right: 18px;
  top: 72px;
  z-index: 5;
  margin: 0;
  padding: 10px 14px;
  border: 1px solid rgba(222, 78, 128, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 18px 42px rgba(159, 40, 94, 0.12);
  color: var(--rose-deep);
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.35;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px) scale(0.96);
  transition:
    opacity 360ms var(--ease),
    transform 360ms var(--ease);
  overflow-wrap: anywhere;
}

.screen-note.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.story-panel,
.question-panel,
.result-panel {
  position: relative;
  z-index: 2;
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: center;
  padding: 26px 22px 18px;
  animation: softAppear 420ms var(--ease);
}

.story-panel::before,
.question-panel::before,
.result-panel::before {
  content: "🎬";
  position: absolute;
  right: 22px;
  top: 24px;
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 1px solid rgba(222, 78, 128, 0.12);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.46);
  font-size: 1.25rem;
  opacity: 0.68;
  box-shadow: 0 14px 34px rgba(159, 40, 94, 0.1);
  animation: sceneCue 3.8s var(--ease) infinite;
}

.result-panel::before {
  content: "🎞️";
}

.step-label {
  margin: 0 0 14px;
  color: var(--rose-deep);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.story-title {
  max-width: 100%;
  margin: 0;
  color: var(--plum);
  font-family: "Playfair Display", Georgia, "Times New Roman", serif;
  font-size: 2.35rem;
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.story-text {
  max-width: 34rem;
  margin: 18px 0 0;
  color: var(--ink);
  font-size: 1.03rem;
  font-weight: 600;
  line-height: 1.62;
  overflow-wrap: anywhere;
}

.story-note,
.no-hint,
.modal-note,
.message-preview,
.plan-note {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.story-note {
  margin: 16px 0 0;
}

.story-actions,
.question-buttons,
.result-actions {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 10px;
}

.story-actions {
  grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr);
  padding: 0 18px 18px;
}

.question-buttons {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 28px;
}

.result-actions {
  margin-top: 24px;
}

.button {
  position: relative;
  display: inline-flex;
  min-width: 0;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 13px 18px;
  font-size: 0.94rem;
  font-weight: 900;
  line-height: 1.18;
  text-align: center;
  text-decoration: none;
  white-space: normal;
  overflow-wrap: anywhere;
  transition:
    transform 220ms var(--ease),
    box-shadow 220ms var(--ease),
    background 220ms var(--ease),
    border-color 220ms var(--ease);
}

.button:focus-visible,
.link-button:focus-visible,
.idea-option:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(216, 159, 60, 0.38);
  outline-offset: 3px;
}

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

.button:active {
  transform: translateY(0) scale(0.99);
}

.primary-button {
  background: linear-gradient(135deg, var(--rose), #f47f9c 48%, #f0a663);
  color: white;
  box-shadow: 0 16px 38px rgba(222, 78, 128, 0.3);
}

.soft-button {
  border-color: rgba(216, 159, 60, 0.22);
  background: linear-gradient(135deg, rgba(255, 244, 219, 0.92), rgba(223, 247, 238, 0.9));
  color: var(--plum);
}

.ghost-button {
  border-color: rgba(159, 40, 94, 0.15);
  background: rgba(255, 255, 255, 0.52);
  color: var(--rose-deep);
}

.ghost-button:disabled {
  cursor: default;
  opacity: 0.46;
  transform: none;
}

.no-button {
  will-change: transform;
}

.no-button.is-playful {
  transform: translate(var(--run-x, 0), var(--run-y, 0)) rotate(var(--run-r, 0));
}

.no-button.is-respectful {
  border-color: rgba(216, 159, 60, 0.35);
  background: rgba(255, 248, 239, 0.7);
  color: var(--plum);
}

.no-hint {
  min-height: 1.5em;
  margin: 16px 0 0;
  text-align: center;
}

.idea-picker {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.idea-title {
  margin: 0 0 12px;
  color: var(--plum);
  font-size: 0.92rem;
  font-weight: 900;
}

.idea-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.idea-option {
  display: grid;
  min-height: 66px;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  border: 1px solid rgba(159, 40, 94, 0.14);
  border-radius: 20px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.52);
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 900;
  text-align: left;
  transition:
    transform 220ms var(--ease),
    border-color 220ms var(--ease),
    background 220ms var(--ease),
    box-shadow 220ms var(--ease);
}

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

.idea-option[aria-pressed="true"] {
  border-color: rgba(222, 78, 128, 0.38);
  background: linear-gradient(135deg, rgba(255, 224, 233, 0.86), rgba(255, 248, 239, 0.9));
  box-shadow: 0 14px 28px rgba(159, 40, 94, 0.12);
}

.idea-emoji {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.66);
  font-size: 1.12rem;
}

.idea-label {
  min-width: 0;
  overflow-wrap: anywhere;
}

.message-preview {
  margin: 14px 0 0;
}

.plan-card {
  margin-top: 20px;
  border: 1px solid rgba(159, 40, 94, 0.14);
  border-radius: 22px;
  padding: 15px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.6), rgba(255, 244, 248, 0.44)),
    rgba(255, 255, 255, 0.38);
  box-shadow: 0 16px 34px rgba(159, 40, 94, 0.1);
}

.plan-kicker {
  margin: 0 0 10px;
  color: var(--rose-deep);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.plan-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 9px 0;
  border-top: 1px solid rgba(159, 40, 94, 0.1);
}

.plan-row span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.plan-row strong {
  min-width: 0;
  color: var(--plum);
  font-size: 0.9rem;
  font-weight: 900;
  text-align: right;
  overflow-wrap: anywhere;
}

.plan-note {
  margin: 10px 0 0;
}

.reveal-modal {
  position: fixed;
  z-index: 20;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(67, 33, 58, 0.28);
  backdrop-filter: blur(18px);
}

.reveal-dialog {
  position: relative;
  width: min(100%, 420px);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 28px;
  padding: 26px 20px 20px;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.88), rgba(255, 238, 246, 0.72)),
    var(--glass-strong);
  box-shadow: 0 28px 82px rgba(67, 33, 58, 0.26);
}

.reveal-orbit {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.reveal-orbit span {
  position: absolute;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.58);
  box-shadow: 0 16px 34px rgba(159, 40, 94, 0.12);
  animation: revealFloat 4.8s var(--ease) infinite;
}

.reveal-orbit span:nth-child(1) {
  right: 22px;
  top: 22px;
  width: 36px;
  height: 36px;
  color: var(--rose);
  font-size: 1.18rem;
}

.reveal-orbit span:nth-child(2) {
  right: 68px;
  bottom: 74px;
  width: 30px;
  height: 30px;
  color: var(--gold);
  font-size: 1rem;
  animation-delay: -1.4s;
}

.reveal-orbit span:nth-child(3) {
  left: 20px;
  bottom: 22px;
  width: 44px;
  height: 44px;
  font-size: 1.3rem;
  animation-delay: -2.7s;
}

.modal-kiss {
  position: relative;
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  margin: 0 0 16px;
  border: 1px solid rgba(222, 78, 128, 0.16);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.66);
  color: var(--rose);
  font-size: 1.45rem;
  box-shadow: 0 14px 34px rgba(159, 40, 94, 0.14);
}

.reveal-dialog h2 {
  position: relative;
  margin: 0;
  color: var(--plum);
  font-family: "Playfair Display", Georgia, "Times New Roman", serif;
  font-size: 2rem;
  line-height: 1.08;
  letter-spacing: 0;
}

.reveal-dialog h2 span {
  color: var(--rose-deep);
  overflow-wrap: anywhere;
}

.reveal-dialog .button {
  position: relative;
  width: 100%;
  margin-top: 16px;
}

.modal-note {
  position: relative;
  margin: 10px 0 0;
}

.celebration,
.romance-stream {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.celebration {
  z-index: 30;
}

.romance-stream {
  z-index: 0;
}

.celebration span {
  position: absolute;
  bottom: -48px;
  left: var(--x);
  font-size: var(--size);
  animation: riseCelebrate var(--duration) var(--ease) forwards;
  animation-delay: var(--delay);
  transform: translateY(0) rotate(0deg);
}

.celebration span.sad-particle {
  top: -48px;
  bottom: auto;
  animation-name: fallSad;
}

.romance-stream span {
  position: absolute;
  bottom: -42px;
  left: var(--x);
  color: rgba(159, 40, 94, 0.34);
  font-size: var(--size);
  filter: drop-shadow(0 10px 18px rgba(222, 78, 128, 0.12));
  animation: romanceRise var(--duration) linear forwards;
  transform: translate3d(0, 0, 0);
}

.tap-heart {
  position: fixed;
  z-index: 35;
  left: var(--tap-x);
  top: var(--tap-y);
  pointer-events: none;
  color: var(--rose);
  font-size: 1.35rem;
  text-shadow: 0 8px 22px rgba(222, 78, 128, 0.26);
  animation: tapHeart 920ms var(--ease) forwards;
  transform: translate(-50%, -50%) scale(0.8);
}

.status-visual {
  display: grid;
  width: 82px;
  height: 82px;
  place-items: center;
  margin: 0 0 16px;
  border: 1px solid rgba(222, 78, 128, 0.16);
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 24%, rgba(255, 255, 255, 0.94), rgba(255, 224, 233, 0.58) 56%, rgba(255, 248, 239, 0.42));
  box-shadow: 0 18px 42px rgba(159, 40, 94, 0.16);
}

.status-visual span {
  display: inline-block;
  font-size: 2.35rem;
  filter: drop-shadow(0 10px 16px rgba(222, 78, 128, 0.24));
}

.status-visual.is-love span {
  animation: heartbeat 1.1s var(--ease) infinite;
}

.status-visual.is-sad {
  background:
    radial-gradient(circle at 34% 24%, rgba(255, 255, 255, 0.94), rgba(234, 220, 255, 0.66) 56%, rgba(255, 248, 239, 0.42));
}

.status-visual.is-sad span {
  animation: sadWobble 1.5s var(--ease) infinite;
}

.invite-card.is-yes {
  box-shadow:
    0 26px 90px rgba(222, 78, 128, 0.26),
    0 0 0 1px rgba(255, 255, 255, 0.58);
}

.invite-card.is-no {
  box-shadow:
    0 24px 78px rgba(67, 33, 58, 0.18),
    0 0 0 1px rgba(255, 255, 255, 0.58);
}

@keyframes blushSky {
  0%,
  100% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }
}

@keyframes ambientDrift {
  0%,
  100% {
    opacity: 0.35;
    transform: translate3d(0, 0, 0) rotate(0deg);
  }

  50% {
    opacity: 0.8;
    transform: translate3d(8px, -22px, 0) rotate(8deg);
  }
}

@keyframes softAppear {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes revealFloat {
  0%,
  100% {
    opacity: 0.62;
    transform: translate3d(0, 0, 0) rotate(0deg);
  }

  50% {
    opacity: 1;
    transform: translate3d(4px, -12px, 0) rotate(7deg);
  }
}

@keyframes sceneCue {
  0%,
  100% {
    transform: translateY(0) rotate(-4deg);
  }

  50% {
    transform: translateY(-6px) rotate(5deg);
  }
}

@keyframes romanceRise {
  0% {
    opacity: 0;
    transform: translate3d(0, 0, 0) rotate(0deg) scale(0.75);
  }

  12% {
    opacity: 0.92;
  }

  100% {
    opacity: 0;
    transform: translate3d(var(--sway), -112svh, 0) rotate(var(--spin)) scale(1.08);
  }
}

@keyframes tapHeart {
  0% {
    opacity: 0;
    transform: translate(-50%, -30%) scale(0.72);
  }

  18% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    transform: translate(-50%, -128%) scale(1.24);
  }
}

@keyframes heartbeat {
  0%,
  100% {
    transform: scale(1);
  }

  28% {
    transform: scale(1.16);
  }

  42% {
    transform: scale(0.98);
  }

  62% {
    transform: scale(1.1);
  }
}

@keyframes sadWobble {
  0%,
  100% {
    transform: rotate(0deg) translateY(0);
  }

  30% {
    transform: rotate(-6deg) translateY(1px);
  }

  60% {
    transform: rotate(5deg) translateY(-1px);
  }
}

@keyframes riseCelebrate {
  0% {
    opacity: 0;
    transform: translate3d(0, 0, 0) rotate(0deg) scale(0.8);
  }

  14% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    transform: translate3d(var(--sway), -110svh, 0) rotate(var(--spin)) scale(1.12);
  }
}

@keyframes fallSad {
  0% {
    opacity: 0;
    transform: translate3d(0, 0, 0) rotate(0deg) scale(0.9);
  }

  16% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    transform: translate3d(var(--sway), 110svh, 0) rotate(var(--spin)) scale(1.02);
  }
}

@media (max-width: 380px) {
  .app-shell {
    padding: 10px;
  }

  .invite-card {
    min-height: calc(100svh - 20px);
    border-radius: 24px;
  }

  .topbar {
    padding: 15px 15px 9px;
  }

  .progress {
    padding: 0 15px;
  }

  .story-panel,
  .question-panel,
  .result-panel {
    padding: 22px 17px 16px;
  }

  .story-title {
    font-size: 2rem;
  }

  .story-text {
    font-size: 0.98rem;
  }

  .question-buttons,
  .story-actions,
  .idea-grid {
    grid-template-columns: 1fr;
  }

  .button {
    min-height: 50px;
  }
}

@media (min-width: 720px) {
  .app-shell {
    padding: 28px;
  }

  .invite-card {
    min-height: min(780px, calc(100svh - 56px));
  }

  .story-title {
    font-size: 2.62rem;
  }
}

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

  .no-button.is-playful {
    transform: none;
  }

  body {
    animation: none !important;
  }

  .romance-stream {
    display: none;
  }
}
