:root {
  color-scheme: dark;
  --black: #0b0b0f;
  --ink: #161015;
  --cream: #fff5df;
  --mint: #20e36d;
  --pink: #ff4fa3;
  --rose: #ff285f;
  --violet: #8b5cf6;
  --yellow: #ffd84d;
  --blue: #43c6ff;
  --shadow: 0 28px 90px rgba(0, 0, 0, 0.42);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background:
    radial-gradient(circle at 18% 14%, rgba(255, 79, 163, 0.28), transparent 28rem),
    radial-gradient(circle at 84% 80%, rgba(32, 227, 109, 0.18), transparent 30rem),
    linear-gradient(135deg, #110d13 0%, #09090c 48%, #191016 100%);
  color: var(--cream);
  overflow: hidden;
}

button {
  color: inherit;
  font: inherit;
}

.shell {
  display: grid;
  min-height: 100dvh;
  place-items: center;
  padding: 18px;
}

.story-frame {
  position: relative;
  width: min(calc(100vw - 36px), calc((100dvh - 36px) * 0.5625), 430px);
  height: auto;
  aspect-ratio: 9 / 16;
  max-height: calc(100dvh - 36px);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: clamp(0px, 3.8vw, 28px);
  background: var(--black);
  box-shadow: var(--shadow);
  isolation: isolate;
}

.story-frame::before {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 28px 28px;
  content: "";
  mask-image: radial-gradient(circle at center, black, transparent 78%);
  pointer-events: none;
}

.progress {
  position: absolute;
  top: max(12px, env(safe-area-inset-top));
  left: 12px;
  right: 12px;
  z-index: 10;
  display: grid;
  gap: 5px;
}

.progress__bar {
  height: 3px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
}

.progress__fill {
  display: block;
  width: 100%;
  height: 100%;
  transform: scaleX(0);
  transform-origin: left;
  border-radius: inherit;
  background: var(--cream);
}

.progress__bar.is-complete .progress__fill {
  transform: scaleX(1);
}

.progress__bar.is-current .progress__fill {
  background: var(--mint);
  animation: pulseLine 1.8s ease-in-out infinite;
}

.story {
  position: relative;
  z-index: 1;
  display: flex;
  height: 100%;
  min-height: 100%;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(56px, 10dvh, 74px) clamp(20px, 6vw, 34px) clamp(24px, 6dvh, 42px);
  background:
    radial-gradient(circle at var(--x, 78%) var(--y, 18%), var(--glow, rgba(255, 79, 163, 0.45)), transparent 35%),
    linear-gradient(145deg, var(--bg1), var(--bg2) 52%, var(--bg3));
  transform: translateX(0);
}

.story.is-entering {
  animation: storyIn 460ms cubic-bezier(0.16, 1, 0.3, 1);
}

.story__top,
.story__bottom,
.question,
.answer {
  position: relative;
  z-index: 6;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  max-width: 100%;
  margin: 0 0 12px;
  padding: 7px 11px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.18);
  color: rgba(255, 245, 223, 0.86);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  backdrop-filter: blur(10px);
}

.title {
  max-width: 9ch;
  margin: 0;
  color: var(--titleColor, var(--cream));
  font-size: clamp(3.1rem, 13vw, 5.6rem);
  font-weight: 950;
  letter-spacing: 0;
  line-height: 0.82;
  text-wrap: balance;
}

.title--small {
  max-width: 12ch;
  font-size: clamp(2rem, 9vw, 3.6rem);
  line-height: 0.9;
}

.title--final {
  max-width: 8ch;
  font-size: clamp(3.4rem, 15vw, 6.2rem);
}

.copy {
  max-width: 25ch;
  margin: 18px 0 0;
  color: rgba(255, 245, 223, 0.88);
  font-size: clamp(1rem, 4.2vw, 1.3rem);
  font-weight: 650;
  line-height: 1.28;
}

.stat {
  display: grid;
  gap: 2px;
  width: fit-content;
  max-width: 100%;
  margin-top: 18px;
}

.stat__value {
  color: var(--statColor, var(--yellow));
  font-size: clamp(3.4rem, 17vw, 6.8rem);
  font-weight: 950;
  line-height: 0.85;
}

.stat__label {
  color: rgba(255, 245, 223, 0.82);
  font-size: 0.82rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.blob,
.record,
.heart-field,
.sticker {
  position: absolute;
  pointer-events: none;
}

.blob {
  right: -18%;
  bottom: 8%;
  width: min(62vw, 270px);
  aspect-ratio: 1;
  border-radius: 38% 62% 56% 44% / 46% 38% 62% 54%;
  background:
    radial-gradient(circle at 38% 32%, rgba(255, 255, 255, 0.52), transparent 12%),
    linear-gradient(135deg, var(--accent), var(--accent2));
  filter: drop-shadow(0 22px 40px rgba(0, 0, 0, 0.22));
  opacity: 0.94;
  animation: blobFloat 6s ease-in-out infinite;
}

.record {
  right: -42px;
  bottom: 66px;
  width: min(54vw, 230px);
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle, var(--cream) 0 9%, transparent 9.5%),
    radial-gradient(circle, var(--rose) 0 22%, transparent 22.5%),
    repeating-radial-gradient(circle, #131318 0 9px, #292331 10px 12px);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.34);
  animation: spin 11s linear infinite;
}

.record::after {
  position: absolute;
  inset: 18%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: inherit;
  content: "";
}

.heart-field {
  inset: 0;
  z-index: 1;
  overflow: hidden;
}

.heart {
  position: absolute;
  left: var(--left);
  top: var(--top);
  color: var(--heartColor, rgba(255, 255, 255, 0.58));
  font-size: var(--size);
  font-weight: 900;
  line-height: 1;
  opacity: 0;
  transform: rotate(var(--rotate));
  animation: heartPop var(--speed) ease-in-out infinite;
  animation-delay: var(--delay);
}

.sticker {
  right: 24px;
  top: 18%;
  display: grid;
  width: min(27vw, 118px);
  aspect-ratio: 1;
  place-items: center;
  border: 2px solid rgba(11, 11, 15, 0.88);
  border-radius: 50%;
  background: var(--yellow);
  color: #171014;
  font-size: clamp(0.76rem, 3vw, 0.98rem);
  font-weight: 950;
  line-height: 0.95;
  text-align: center;
  text-transform: uppercase;
  transform: rotate(9deg);
  box-shadow: 0 12px 0 rgba(0, 0, 0, 0.2);
  animation: stickerKick 1.8s ease-in-out infinite;
}

.photo-card {
  position: relative;
  z-index: 6;
  width: min(100%, 330px);
  margin: 18px auto;
  padding: 8px;
  border: 2px solid rgba(255, 245, 223, 0.88);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.04)),
    rgba(0, 0, 0, 0.24);
  box-shadow:
    10px 10px 0 rgba(0, 0, 0, 0.26),
    0 22px 45px rgba(0, 0, 0, 0.24);
  transform: rotate(-1.3deg);
}

.photo-card::before {
  position: absolute;
  top: -12px;
  right: 16px;
  z-index: 2;
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--mint);
  color: #101014;
  content: "wrapped";
  font-size: 0.62rem;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.photo-card img {
  display: block;
  width: 100%;
  max-height: min(37dvh, 320px);
  border-radius: 5px;
  object-fit: cover;
  object-position: center;
}

.question {
  display: grid;
  min-height: 100%;
  align-content: center;
}

.question__label {
  margin: 0 0 14px;
  color: var(--mint);
  font-size: 0.82rem;
  font-weight: 950;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.question__title {
  margin: 0 0 24px;
  color: var(--cream);
  font-size: clamp(1.78rem, 7.8vw, 3.2rem);
  font-weight: 950;
  letter-spacing: 0;
  line-height: 0.92;
  text-wrap: balance;
}

.question .photo-card {
  width: min(76%, 250px);
  margin: 0 auto 18px;
  transform: rotate(1.4deg);
}

.question .photo-card img {
  max-height: min(24dvh, 190px);
}

.options {
  display: grid;
  gap: 10px;
  width: 100%;
}

.option {
  --dropDelay: 0ms;
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 10px 14px 10px 10px;
  border: 2px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
  cursor: pointer;
  opacity: 0;
  transform: translateY(-28px) rotate(-1deg);
  animation: optionDrop 620ms cubic-bezier(0.22, 1.2, 0.36, 1) forwards;
  animation-delay: var(--dropDelay);
  backdrop-filter: blur(14px);
}

.option:hover,
.option:focus-visible {
  border-color: rgba(255, 255, 255, 0.62);
  background: rgba(255, 255, 255, 0.16);
  outline: none;
  transform: translateY(-2px);
}

.option.is-selected {
  border-color: var(--cream);
  background: rgba(255, 245, 223, 0.22);
  box-shadow: 0 0 0 4px rgba(255, 245, 223, 0.12), 0 14px 30px rgba(0, 0, 0, 0.24);
}

.option:disabled {
  cursor: default;
}

.option__letter {
  display: grid;
  width: 34px;
  aspect-ratio: 1;
  place-items: center;
  border-radius: 50%;
  background: var(--cream);
  color: #101014;
  font-size: 0.86rem;
  font-weight: 950;
}

.option__text {
  color: var(--cream);
  font-size: clamp(0.96rem, 3.9vw, 1.15rem);
  font-weight: 780;
  line-height: 1.15;
  text-align: left;
}

.answer {
  display: flex;
  min-height: 100%;
  flex-direction: column;
  justify-content: center;
}

.answer__body {
  position: relative;
  z-index: 6;
}

.answer__badge {
  display: grid;
  width: clamp(94px, 30vw, 140px);
  aspect-ratio: 1;
  place-items: center;
  margin-bottom: 22px;
  border-radius: 50%;
  background: var(--badgeBg, var(--mint));
  color: #101014;
  font-size: clamp(2.2rem, 9vw, 4rem);
  font-weight: 950;
  box-shadow: 0 16px 0 rgba(0, 0, 0, 0.18);
  animation: badgePop 540ms cubic-bezier(0.16, 1, 0.3, 1);
}

.answer__kicker {
  margin: 0 0 10px;
  color: rgba(255, 245, 223, 0.78);
  font-size: 0.82rem;
  font-weight: 950;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.answer__title {
  margin: 0;
  color: var(--cream);
  font-size: clamp(2rem, 9vw, 3.8rem);
  font-weight: 950;
  letter-spacing: 0;
  line-height: 0.88;
  text-wrap: balance;
}

.answer__copy {
  margin: 18px 0 0;
  color: rgba(255, 245, 223, 0.88);
  font-size: clamp(1rem, 4vw, 1.2rem);
  font-weight: 700;
  line-height: 1.28;
}

.answer .photo-card {
  width: min(78%, 260px);
  margin: 20px auto 0;
  transform: rotate(-1deg);
}

.answer .photo-card img {
  max-height: min(24dvh, 210px);
}

.start-screen {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 18px;
  padding: 28px;
  background:
    radial-gradient(circle at 28% 18%, rgba(255, 216, 77, 0.42), transparent 32%),
    radial-gradient(circle at 78% 72%, rgba(32, 227, 109, 0.28), transparent 34%),
    linear-gradient(145deg, rgba(255, 40, 95, 0.96), rgba(17, 13, 19, 0.98));
  text-align: center;
}

.start-screen.is-hidden {
  display: none;
}

.start-screen__mark {
  max-width: 8ch;
  color: var(--cream);
  font-size: clamp(3.7rem, 16vw, 6.2rem);
  font-weight: 950;
  letter-spacing: 0;
  line-height: 0.82;
  text-transform: uppercase;
}

.start-screen__button {
  min-height: 52px;
  min-width: 148px;
  border: 0;
  border-radius: 999px;
  background: var(--cream);
  color: #121014;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 950;
  text-transform: uppercase;
  box-shadow: 0 12px 0 rgba(0, 0, 0, 0.22);
}

.start-screen__button:hover,
.start-screen__button:focus-visible {
  outline: 3px solid rgba(32, 227, 109, 0.8);
  outline-offset: 4px;
}

.tap-zone {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 4;
  width: 28%;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.tap-zone--left {
  left: 0;
}

.tap-zone--right {
  right: 0;
}

.controls {
  position: absolute;
  right: 16px;
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 12;
  display: flex;
  gap: 10px;
}

.icon-button {
  display: grid;
  width: 42px;
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.24);
  color: var(--cream);
  cursor: pointer;
  backdrop-filter: blur(14px);
}

.icon-button:hover,
.icon-button:focus-visible {
  border-color: rgba(255, 255, 255, 0.58);
  background: rgba(255, 255, 255, 0.13);
  outline: none;
}

.icon-button span {
  margin-top: -2px;
  font-size: 2rem;
  line-height: 1;
}

@media (max-width: 520px) {
  .shell {
    padding: 0;
  }

  .story-frame {
    width: 100vw;
    height: 100dvh;
    max-height: none;
    border: 0;
    border-radius: 0;
  }

  .controls {
    display: none;
  }

  .story {
    padding: clamp(52px, 8dvh, 66px) 18px clamp(20px, 4dvh, 34px);
  }

  .photo-card {
    width: min(94%, 330px);
  }

  .photo-card img {
    max-height: 34dvh;
  }

  .question .photo-card,
  .answer .photo-card {
    width: min(76%, 250px);
  }
}

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

@keyframes storyIn {
  from {
    opacity: 0;
    transform: translateX(18px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes pulseLine {
  0%,
  100% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(1.45);
  }
}

@keyframes blobFloat {
  0%,
  100% {
    transform: translate3d(0, 0, 0) rotate(0deg);
  }
  50% {
    transform: translate3d(-16px, -20px, 0) rotate(8deg);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes heartPop {
  0% {
    opacity: 0;
    transform: translateY(18px) scale(0.5) rotate(var(--rotate));
  }
  22% {
    opacity: 0.8;
  }
  70% {
    opacity: 0.38;
  }
  100% {
    opacity: 0;
    transform: translateY(-60px) scale(1.1) rotate(calc(var(--rotate) + 18deg));
  }
}

@keyframes stickerKick {
  0%,
  100% {
    transform: rotate(9deg) scale(1);
  }
  45% {
    transform: rotate(4deg) scale(1.04);
  }
}

@keyframes optionDrop {
  0% {
    opacity: 0;
    transform: translateY(-34px) rotate(-2deg) scale(0.96);
  }
  70% {
    opacity: 1;
    transform: translateY(4px) rotate(0.6deg) scale(1.01);
  }
  100% {
    opacity: 1;
    transform: translateY(0) rotate(0deg) scale(1);
  }
}

@keyframes badgePop {
  from {
    opacity: 0;
    transform: scale(0.62) rotate(-12deg);
  }
  to {
    opacity: 1;
    transform: scale(1) rotate(0);
  }
}
