:root {
  color-scheme: dark;
  --pink: #f4b4c8;
  --script: #f6c9d8;
  --ink: #f7eef3;
  --muted: rgba(247, 238, 243, 0.5);
  --card: #241428;
  --line: rgba(255, 255, 255, 0.14);
}

* {
  box-sizing: border-box;
}

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

body {
  min-height: 100dvh;
  font-family: Nunito, "Avenir Next", "Trebuchet MS", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(ellipse 70% 50% at 50% 36%, rgba(120, 42, 78, 0.55), transparent 70%),
    radial-gradient(ellipse 45% 35% at 82% 92%, rgba(140, 72, 42, 0.35), transparent 70%),
    linear-gradient(180deg, #140814 0%, #2a1024 42%, #12060f 100%);
}

.float-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.bg-item {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--s);
  animation: drift 7s ease-in-out var(--d) infinite;
}

.bg-emoji {
  display: block;
  font-size: var(--s);
  line-height: 1;
}

@keyframes drift {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
    opacity: 0.35;
  }
  50% {
    transform: translateY(-14px) rotate(16deg);
    opacity: 0.8;
  }
}

.stage {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 28px 16px;
}

.card {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  min-height: min(720px, calc(100dvh - 56px));
  padding: 22px 26px 36px;
  border-radius: 36px;
  background:
    linear-gradient(180deg, rgba(58, 32, 64, 0.55), rgba(22, 10, 24, 0.2) 28%),
    #221226;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
}

.card-top {
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: center;
  gap: 10px;
  margin: 0 0 8px;
}

.progress {
  display: flex;
  gap: 8px;
}

.progress span {
  height: 4px;
  flex: 1;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.12);
}

.progress span.done {
  background: linear-gradient(90deg, #f09ab4, #f3c3a4);
}

.progress span.current {
  background: linear-gradient(90deg, #f6c3a6, #f8dcc8);
}

.back {
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid rgba(244, 180, 200, 0.35);
  border-radius: 50%;
  background: rgba(244, 180, 200, 0.12);
  color: #f4b4c8;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.back svg {
  width: 16px;
  height: 16px;
}

.back:hover {
  background: rgba(244, 180, 200, 0.24);
  border-color: #f4b4c8;
}

.back.is-hidden {
  visibility: hidden;
  pointer-events: none;
}

.screen {
  flex: 1;
  outline: none;
  display: flex;
  flex-direction: column;
}

.screen-body {
  width: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: rise 0.4s ease;
}

@keyframes rise {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.art {
  width: min(168px, 52%);
  height: auto;
  margin: 4px auto 0;
  display: block;
  object-fit: contain;
}

.art-wave {
  width: min(200px, 62%);
}

.art-wide {
  width: min(230px, 72%);
}

.serious-no {
  width: 100%;
  margin-top: 12px;
  padding: 14px 10px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
  color: white;
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}

.serious-no:hover {
  border-color: rgba(244, 180, 200, 0.65);
  background: rgba(244, 180, 200, 0.08);
}

.serious-no.is-hidden {
  display: none;
}

.save {
  width: 100%;
  margin-top: 4px;
}

.kicker {
  margin: 8px 0 0;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.62);
}

.script {
  margin: 4px 0 14px;
  font-family: "Great Vibes", "Segoe Script", "Snell Roundhand", cursive;
  font-size: clamp(42px, 8vw, 54px);
  font-weight: 400;
  line-height: 1.02;
  text-align: center;
  text-wrap: balance;
  color: var(--script);
}

.note,
.place-line,
.lead {
  margin: 0 0 18px;
  text-align: center;
  line-height: 1.45;
}

.note {
  max-width: 30ch;
  color: rgba(255, 236, 244, 0.78);
  font-size: 16px;
}

.place-line,
.lead {
  color: var(--muted);
  font-size: 15px;
}

.choices,
.yesno {
  width: 100%;
  display: grid;
  gap: 12px;
  margin-top: 4px;
}

.choices.cols-3 {
  grid-template-columns: repeat(3, 1fr);
}

.choices.cols-2 {
  grid-template-columns: repeat(2, 1fr);
}

.choices.cols-2 .pill:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}

.yesno {
  grid-template-columns: 1fr 1fr;
  margin-top: 8px;
}

.pill {
  margin: 0;
  padding: 12px 8px 11px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: white;
  font: inherit;
  cursor: pointer;
  text-align: center;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.pill strong,
.pill small {
  display: block;
}

.pill strong {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
}

.pill-emoji {
  font-size: 13px;
  line-height: 1;
}

.pill small {
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.46);
  font-size: 12px;
  font-weight: 600;
}

.pill:hover {
  border-color: rgba(244, 180, 200, 0.65);
  background: rgba(244, 180, 200, 0.08);
  transform: translateY(-1px);
}

.pill.is-selected {
  border-color: #f4b4c8;
  background: rgba(244, 180, 200, 0.16);
}

.yesno .pill {
  padding: 16px 10px;
  border-radius: 18px;
  font-size: 18px;
  font-weight: 700;
}

.pill-yes {
  background: linear-gradient(180deg, #f8cddd, #efa8c0);
  color: #3a2030;
  border-color: transparent;
}

.pill-yes:hover {
  background: linear-gradient(180deg, #ffd7e6, #f3b0c6);
  color: #3a2030;
}

#no-btn {
  touch-action: none;
}

#no-btn.is-running,
#no-btn.is-running:hover {
  position: absolute;
  z-index: 30;
  margin: 0;
  background: #2a1830;
  transform: none;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4);
}

.summary {
  width: 100%;
  margin: 4px 0 16px;
  display: grid;
  gap: 10px;
}

.summary div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: baseline;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.summary dt {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.summary dd {
  margin: 0;
  font-weight: 700;
  text-align: right;
}

.again {
  min-width: 190px;
  margin-top: 6px;
}

.ghost {
  margin-top: auto;
  padding: 12px;
  border: 0;
  background: none;
  color: rgba(255, 255, 255, 0.55);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.pill:focus-visible,
.back:focus-visible,
.ghost:focus-visible,
.serious-no:focus-visible {
  outline: 2px solid #f4b4c8;
  outline-offset: 3px;
}

@media (max-width: 640px) {
  .stage {
    display: flex;
    padding: 10px;
  }

  .card {
    width: 100%;
    min-height: calc(100dvh - 20px);
    border-radius: 28px;
    padding-left: 18px;
    padding-right: 18px;
  }

  .choices.cols-3 .pill {
    padding-left: 4px;
    padding-right: 4px;
  }

  .choices.cols-3 .pill strong {
    font-size: 13px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bg-item,
  .screen-body {
    animation: none;
  }

  .pill:hover {
    transform: none;
  }
}
