:root {
  --bg-boot: #040406;
  --boot-line: #f6cd7c;
  --boot-panel: #111117;
  --bg-romance: #fff6ef;
  --romance-ink: #2c1d1d;
  --rose: #f06d6d;
  --soft-rose: #ffd3c7;
  --radius: 18px;
  --ease-out: 680ms cubic-bezier(0.22, 1, 0.36, 1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: var(--boot-line);
  background: radial-gradient(circle at 30% 20%, rgba(246, 205, 124, 0.08), transparent 45%), var(--bg-boot);
  font-family: "Space Mono", "IBM Plex Mono", "Courier New", monospace;
  transition: background 1.1s ease, color 800ms ease, font-family 600ms ease;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.02) 0,
    rgba(255, 255, 255, 0.02) 1px,
    transparent 1px,
    transparent 3px
  );
  opacity: 0.8;
  transition: opacity 500ms ease;
}

body.resolved {
  color: var(--romance-ink);
  background:
    radial-gradient(circle at 18% 25%, rgba(240, 109, 109, 0.23), transparent 40%),
    radial-gradient(circle at 85% 18%, rgba(255, 211, 199, 0.45), transparent 42%),
    radial-gradient(circle at 70% 86%, rgba(251, 193, 171, 0.28), transparent 36%),
    var(--bg-romance);
  font-family: "Fraunces", "Cormorant Garamond", "Palatino Linotype", serif;
}

body.resolved::before {
  opacity: 0;
}

.frame {
  width: min(700px, 92vw);
  padding: clamp(18px, 2.5vw, 34px);
  text-align: center;
  position: relative;
  z-index: 5;
}

.hidden {
  display: none;
}

.console {
  width: min(580px, 100%);
  margin: 0 auto;
  min-height: 300px;
  border-radius: var(--radius);
  border: 1px solid rgba(246, 205, 124, 0.28);
  padding: 24px 24px 30px;
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.01));
  box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.4), 0 16px 50px rgba(0, 0, 0, 0.45);
  transform: translateY(0);
  opacity: 1;
  transition: opacity 500ms ease, transform 500ms ease;
}

.console.fading {
  opacity: 0;
  transform: translateY(-18px) scale(0.98);
}

.console-tag {
  margin: 0 0 14px;
  letter-spacing: 0.16em;
  font-size: 0.74rem;
  opacity: 0.8;
}

#lines {
  text-align: left;
  min-height: 124px;
  width: 100%;
}

.line {
  margin: 0 0 8px;
  opacity: 0;
  transform: translateY(7px);
  animation: line-in 450ms ease forwards;
}

.line::before {
  content: ">";
  margin-right: 0.55rem;
  color: rgba(246, 205, 124, 0.7);
}

@keyframes line-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.action {
  margin-top: 12px;
  padding: 0.72rem 1.5rem;
  border-radius: 999px;
  border: 1px solid rgba(246, 205, 124, 0.95);
  color: var(--boot-line);
  background: rgba(246, 205, 124, 0.08);
  font: inherit;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 230ms ease, background 230ms ease;
  box-shadow: 0 0 0 rgba(246, 205, 124, 0);
}

.action:hover {
  transform: translateY(-1px);
  background: rgba(246, 205, 124, 0.17);
  box-shadow: 0 0 22px rgba(246, 205, 124, 0.22);
}

.reveal {
  position: relative;
  display: grid;
  place-items: center;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity var(--ease-out), transform var(--ease-out);
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

.halo {
  position: absolute;
  width: min(280px, 55vw);
  aspect-ratio: 1;
  border-radius: 50%;
  filter: blur(24px);
  pointer-events: none;
}

.halo-left {
  left: -100px;
  top: -72px;
  background: radial-gradient(circle, rgba(255, 182, 174, 0.7), transparent 70%);
}

.halo-right {
  right: -80px;
  bottom: -64px;
  background: radial-gradient(circle, rgba(255, 221, 188, 0.7), transparent 65%);
}

.card {
  position: relative;
  width: min(590px, 100%);
  padding: clamp(22px, 5vw, 38px);
  border-radius: calc(var(--radius) + 6px);
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.82), rgba(255, 245, 238, 0.86));
  border: 1px solid rgba(240, 109, 109, 0.2);
  box-shadow: 0 22px 70px rgba(93, 45, 45, 0.14);
  backdrop-filter: blur(4px);
  transition: transform 400ms ease, box-shadow 400ms ease;
}

body.accepted .card {
  animation: card-pop 580ms cubic-bezier(0.2, 0.9, 0.2, 1);
}

@keyframes card-pop {
  0% { transform: scale(1); }
  45% { transform: scale(1.025); }
  100% { transform: scale(1); }
}

.status {
  margin: 0 0 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.75rem;
  color: rgba(110, 55, 55, 0.66);
}

.message {
  margin: 0;
  font-size: clamp(1.65rem, 5vw, 2.3rem);
  line-height: 1.1;
}

.sub-message {
  margin: 10px 0 0;
  font-family: "Space Mono", "IBM Plex Mono", "Courier New", monospace;
  font-size: 0.85rem;
  color: rgba(54, 34, 34, 0.68);
  letter-spacing: 0.05em;
}

.photo-stage {
  margin: 18px auto 14px;
}

.photo-shell {
  position: relative;
  width: min(260px, 66vw);
  aspect-ratio: 3 / 4;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(75, 41, 41, 0.2);
  box-shadow: 0 14px 36px rgba(111, 52, 52, 0.18);
}

.photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 650ms ease, transform 850ms cubic-bezier(0.22, 1, 0.36, 1), filter 600ms ease;
}

.photo-sad {
  opacity: 1;
  transform: scale(1);
  filter: saturate(0.88) contrast(0.94);
}

.photo-happy {
  opacity: 0;
  transform: scale(1.08);
  filter: saturate(1.15);
}

body.accepted .photo-sad {
  opacity: 0;
  transform: scale(0.95);
  filter: blur(2px) saturate(0.7);
}

body.accepted .photo-happy {
  opacity: 1;
  transform: scale(1);
}

.accept-flash {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 249, 245, 0.95), rgba(255, 169, 169, 0.32));
  opacity: 0;
  transform: scale(0.1);
  pointer-events: none;
}

body.accepted .accept-flash {
  animation: accept-burst 560ms ease-out;
}

@keyframes accept-burst {
  0% {
    opacity: 0.7;
    transform: scale(0.1);
  }
  100% {
    opacity: 0;
    transform: scale(20);
  }
}

.photo-caption {
  margin: 8px 0 0;
  font-family: "Space Mono", "IBM Plex Mono", "Courier New", monospace;
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(80, 47, 47, 0.68);
  transition: color 300ms ease, letter-spacing 300ms ease;
}

body.accepted .photo-caption {
  color: rgba(184, 72, 87, 0.9);
  letter-spacing: 0.1em;
}

.question {
  margin: 16px 0 22px;
  font-size: clamp(1.15rem, 3.3vw, 1.42rem);
}

.choices {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
}

.choice {
  padding: 0.7rem 1.46rem;
  min-width: 112px;
  border-radius: 999px;
  border: 1px solid rgba(66, 38, 38, 0.16);
  background: rgba(255, 255, 255, 0.92);
  color: #301f1f;
  font: inherit;
  cursor: pointer;
  box-shadow: 0 10px 26px rgba(232, 137, 117, 0.18);
  transition: transform 180ms ease, box-shadow 260ms ease, border-color 260ms ease;
}

.choice:hover {
  transform: translateY(-2px);
  border-color: rgba(232, 111, 111, 0.46);
  box-shadow: 0 12px 28px rgba(232, 137, 117, 0.26);
}

.choice.selected {
  border-color: rgba(232, 111, 111, 0.62);
  background: linear-gradient(160deg, #fffaf8, #ffe9df);
  box-shadow: 0 12px 30px rgba(232, 113, 121, 0.33);
}

body.accepted .choice {
  opacity: 0.88;
}

.confirmation {
  margin: 16px 0 0;
  opacity: 0;
  transform: translateY(10px);
  color: #be4d54;
  letter-spacing: 0.04em;
  transition: opacity 320ms ease, transform 320ms ease, text-shadow 400ms ease;
}

.confirmation.show {
  opacity: 1;
  transform: translateY(0);
  text-shadow: 0 0 20px rgba(233, 89, 104, 0.24);
}

.roulette {
  margin-top: 16px;
  width: min(420px, 100%);
  padding: 14px 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(200, 105, 105, 0.22);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.78), rgba(255, 240, 235, 0.86));
  opacity: 0;
  transform: translateY(8px) scale(0.985);
  transition: opacity 340ms ease, transform 340ms ease;
}

.roulette.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.roulette-title {
  margin: 0 0 10px;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(105, 48, 48, 0.78);
  font-family: "Space Mono", "IBM Plex Mono", "Courier New", monospace;
}

.roulette-window {
  position: relative;
  border-radius: 14px;
  border: 1px solid rgba(105, 48, 48, 0.16);
  background: rgba(255, 255, 255, 0.74);
  min-height: 58px;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.roulette-display {
  margin: 0;
  padding: 0.75rem 0.85rem;
  font-size: clamp(1rem, 2.5vw, 1.18rem);
  line-height: 1.2;
  transition: letter-spacing 160ms ease, opacity 180ms ease;
}

.roulette-display.spinning {
  letter-spacing: 0.03em;
  opacity: 0.94;
}

.spin-btn {
  margin-top: 10px;
  padding: 0.62rem 1.3rem;
  border-radius: 999px;
  border: 1px solid rgba(174, 82, 82, 0.34);
  background: linear-gradient(160deg, #fff4ef, #ffe3d8);
  color: #5c2f2f;
  font: inherit;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 220ms ease, opacity 220ms ease;
  box-shadow: 0 10px 24px rgba(232, 137, 117, 0.2);
}

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

.spin-btn:disabled {
  opacity: 0.66;
  cursor: wait;
}

.roulette-result {
  margin: 10px 0 0;
  min-height: 1.2em;
  font-family: "Space Mono", "IBM Plex Mono", "Courier New", monospace;
  font-size: 0.84rem;
  letter-spacing: 0.04em;
  color: rgba(166, 53, 86, 0.95);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 260ms ease, transform 260ms ease;
}

.roulette-result.show {
  opacity: 1;
  transform: translateY(0);
}

.petal-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 600ms ease;
}

body.resolved .petal-layer {
  opacity: 1;
}

.petal {
  position: absolute;
  top: -14vh;
  width: 14px;
  height: 10px;
  border-radius: 100% 85% 100% 72%;
  background: linear-gradient(160deg, #ffd5cf 0%, #f9b8b7 100%);
  opacity: 0.72;
  transform: translateX(0) rotate(0deg) scale(var(--scale, 1));
  animation:
    fall var(--duration, 10s) linear var(--delay, 0s) infinite,
    drift 3.1s ease-in-out var(--delay, 0s) infinite alternate;
}

@keyframes fall {
  to {
    top: 110vh;
    transform: translateX(var(--drift, 24px)) rotate(360deg) scale(var(--scale, 1));
  }
}

@keyframes drift {
  from {
    margin-left: -7px;
  }
  to {
    margin-left: 7px;
  }
}

@media (max-width: 520px) {
  .console {
    min-height: 275px;
    padding: 20px 16px 24px;
  }

  .message {
    letter-spacing: -0.01em;
  }

  .sub-message {
    font-size: 0.77rem;
  }

  .photo-shell {
    width: min(220px, 70vw);
  }

  .roulette {
    padding: 12px 10px 14px;
  }
}

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