:root {
  --purple-950: #230b42;
  --purple-900: #38135f;
  --purple-700: #6731a5;
  --purple-500: #9955d9;
  --pink-600: #ed2f91;
  --pink-500: #fa4ca6;
  --pink-300: #ff9fd0;
  --cream: #fff8f4;
  --white: #ffffff;
  --ink: #28123f;
  --success: #1f7a62;
  --danger: #9f245f;
  --shadow: rgba(28, 7, 48, .28);
  --display-font: "Avenir Next Condensed", "Futura Condensed ExtraBold", "Arial Narrow", sans-serif;
  --body-font: "Avenir Next", "Trebuchet MS", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  background: var(--purple-900);
  font-family: var(--body-font);
  -webkit-tap-highlight-color: transparent;
}

button,
input,
a {
  font: inherit;
}

button,
a {
  touch-action: manipulation;
}

button:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 4px solid var(--pink-300);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.app-shell {
  position: relative;
  min-height: 100dvh;
  isolation: isolate;
  overflow: hidden;
}

.start-screen,
.fallback {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding:
    max(22px, env(safe-area-inset-top))
    22px
    max(22px, env(safe-area-inset-bottom));
  text-align: center;
  background:
    radial-gradient(circle at 18% 14%, rgba(255, 159, 208, .52), transparent 27%),
    radial-gradient(circle at 84% 80%, rgba(153, 85, 217, .62), transparent 31%),
    linear-gradient(145deg, #f544a0 0%, #8c45c7 52%, #38135f 100%);
}

.start-screen::before,
.fallback::before {
  content: "";
  position: absolute;
  inset: 14px;
  z-index: -1;
  border: 1px solid rgba(255, 255, 255, .42);
  border-radius: 32px;
  pointer-events: none;
}

.cover-card {
  position: relative;
  width: min(82vw, 360px);
  aspect-ratio: 1280 / 745;
  margin: 4px auto 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .7);
  border-radius: 14px;
  background: #151e2b;
  box-shadow: 0 22px 54px rgba(24, 6, 42, .38);
  transform: rotate(-1deg);
}

.cover-card img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.cover-scan {
  position: absolute;
  top: -10%;
  bottom: -10%;
  left: -45%;
  width: 24%;
  transform: rotate(12deg);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .66), transparent);
  animation: scan-cover 2.8s ease-in-out infinite;
}

.eyebrow,
.result-kicker {
  margin: 0;
  color: var(--cream);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .2em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  font-family: var(--display-font);
  font-weight: 1000;
}

h1 {
  color: var(--white);
  font-size: clamp(42px, 13vw, 72px);
  line-height: .9;
  letter-spacing: -.055em;
  text-transform: uppercase;
  text-shadow: 0 8px 24px rgba(35, 11, 66, .28);
}

.start-copy {
  max-width: 360px;
  margin: 0 0 4px;
  color: rgba(255, 255, 255, .92);
  font-size: 16px;
  line-height: 1.42;
}

.privacy-copy {
  max-width: 340px;
  margin: 2px 0 0;
  color: rgba(255, 255, 255, .72);
  font-size: 12px;
  line-height: 1.4;
}

.primary-button,
.spin-button,
.second-spin-button,
#unlock-button,
.website-button {
  appearance: none;
  border: 0;
  cursor: pointer;
  text-decoration: none;
}

.primary-button {
  position: relative;
  min-width: 210px;
  min-height: 54px;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, .88);
  border-radius: 999px;
  color: var(--purple-900);
  background: var(--white);
  box-shadow: 0 16px 34px rgba(35, 11, 66, .28);
  font-weight: 900;
}

.primary-button::after,
.spin-button::after,
.second-spin-button::after,
#unlock-button::after {
  content: "";
  position: absolute;
  inset: 2px;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, .38), transparent 55%);
  pointer-events: none;
}

.primary-button:active,
.spin-button:active,
.second-spin-button:active,
#unlock-button:active,
.website-button:active {
  transform: translateY(2px) scale(.985);
}

.ar-mount {
  position: fixed;
  inset: 0;
  z-index: 1;
}

.ar-mount canvas,
.ar-mount video {
  width: 100% !important;
  height: 100% !important;
}

.status {
  position: fixed;
  top: max(14px, env(safe-area-inset-top));
  left: 50%;
  z-index: 12;
  width: min(90vw, 520px);
  margin: 0;
  padding: 11px 16px;
  transform: translateX(-50%);
  border: 1px solid rgba(255, 255, 255, .42);
  border-radius: 999px;
  color: var(--white);
  background: rgba(35, 11, 66, .82);
  box-shadow: 0 12px 32px rgba(0, 0, 0, .18);
  backdrop-filter: blur(14px);
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.28;
}

.status[data-mode="found"] {
  background: rgba(31, 122, 98, .88);
}

.status[data-mode="lost"],
.status[data-mode="error"] {
  background: rgba(159, 36, 95, .9);
}

.interaction-hud {
  position: fixed;
  inset: 0;
  z-index: 15;
  pointer-events: none;
}

.spin-button {
  position: absolute;
  bottom: max(30px, env(safe-area-inset-bottom));
  left: 50%;
  min-width: min(68vw, 270px);
  min-height: 68px;
  transform: translateX(-50%);
  border: 3px solid var(--white);
  border-radius: 999px;
  color: var(--white);
  background: linear-gradient(135deg, var(--pink-600), var(--purple-700));
  box-shadow:
    0 18px 44px rgba(35, 11, 66, .4),
    0 0 0 7px rgba(255, 255, 255, .15);
  font-family: var(--display-font);
  font-size: 30px;
  font-weight: 1000;
  letter-spacing: .08em;
  pointer-events: auto;
  animation: pop-button 520ms cubic-bezier(.2, 1.45, .3, 1) both;
}

.spin-button:disabled {
  cursor: wait;
  opacity: .78;
}

.result-panel {
  position: absolute;
  right: max(14px, env(safe-area-inset-right));
  bottom: max(14px, env(safe-area-inset-bottom));
  left: max(14px, env(safe-area-inset-left));
  max-width: 520px;
  max-height: calc(100dvh - 28px);
  margin: 0 auto;
  overflow: auto;
  padding: 22px 18px 18px;
  border: 1px solid rgba(255, 255, 255, .76);
  border-radius: 28px;
  color: var(--ink);
  background: rgba(255, 248, 244, .96);
  box-shadow: 0 26px 70px rgba(27, 5, 47, .42);
  backdrop-filter: blur(18px);
  text-align: center;
  pointer-events: auto;
  animation: result-up 480ms cubic-bezier(.18, .86, .24, 1.12) both;
}

.close-button {
  position: absolute;
  top: 10px;
  right: 11px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  color: var(--purple-900);
  background: rgba(103, 49, 165, .1);
  font-size: 27px;
  line-height: 1;
}

.result-kicker {
  color: var(--purple-700);
}

.result-panel h2 {
  margin-top: 2px;
  color: var(--pink-600);
  font-size: clamp(56px, 18vw, 84px);
  line-height: .9;
  letter-spacing: .02em;
}

#result-copy {
  margin: 9px auto 16px;
  max-width: 390px;
  color: rgba(40, 18, 63, .78);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.38;
}

#mobile-form {
  margin: 0;
}

#mobile-form label {
  display: block;
  margin-bottom: 8px;
  color: var(--purple-900);
  font-size: 14px;
  font-weight: 900;
}

.mobile-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

#mobile-number {
  width: 100%;
  min-height: 50px;
  border: 2px solid rgba(103, 49, 165, .24);
  border-radius: 14px;
  padding: 0 14px;
  color: var(--ink);
  background: var(--white);
  font-size: 17px;
}

#mobile-number[aria-invalid="true"] {
  border-color: var(--danger);
}

#unlock-button,
.second-spin-button {
  position: relative;
  min-height: 50px;
  border-radius: 14px;
  color: var(--white);
  background: linear-gradient(135deg, var(--pink-600), var(--purple-700));
  font-weight: 900;
}

#unlock-button {
  padding: 0 17px;
}

.field-help,
.field-error {
  margin: 8px 2px 0;
  font-size: 11px;
  line-height: 1.36;
}

.field-help {
  color: rgba(40, 18, 63, .64);
}

.field-error {
  color: var(--danger);
  font-weight: 900;
}

.second-spin-button {
  width: 100%;
  margin-top: 4px;
  font-family: var(--display-font);
  font-size: 20px;
  letter-spacing: .05em;
}

.website-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 50px;
  margin-top: 10px;
  border: 2px solid var(--purple-700);
  border-radius: 14px;
  color: var(--purple-900);
  background: transparent;
  font-weight: 900;
}

.preview-stage {
  position: fixed;
  inset: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 56px 20px 132px;
  background:
    radial-gradient(circle at 50% 42%, rgba(250, 76, 166, .42), transparent 33%),
    linear-gradient(150deg, #130722, #38135f 55%, #6b2b93);
}

.preview-stage::before {
  content: "INTERACTION PREVIEW";
  position: absolute;
  top: max(18px, env(safe-area-inset-top));
  color: rgba(255, 255, 255, .7);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .2em;
}

.preview-wheel-shell {
  position: relative;
  width: min(87vw, 560px);
  aspect-ratio: 1;
  transform: scale(.02) translateZ(0);
  opacity: 0;
  filter: drop-shadow(0 24px 30px rgba(10, 2, 20, .48));
}

.preview-wheel-shell.is-revealed {
  animation: wheel-grow 900ms cubic-bezier(.16, .94, .26, 1.2) forwards;
}

.preview-depth {
  position: absolute;
  inset: 4%;
  z-index: -1;
  border-radius: 50%;
  transform: translate(0, 16px) scale(.98);
  background: #2b0b4d;
  box-shadow:
    0 10px 0 #19052f,
    0 22px 34px rgba(9, 1, 16, .46);
}

#preview-wheel {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  will-change: transform;
}

.preview-pointer {
  position: absolute;
  top: 4.5%;
  left: 50%;
  width: 15%;
  height: 18%;
  transform: translateX(-50%);
  clip-path: polygon(5% 0, 95% 0, 50% 100%);
  border-radius: 8px;
  background: linear-gradient(135deg, var(--pink-300), var(--pink-600));
  filter: drop-shadow(0 7px 0 #35104f);
  pointer-events: none;
}

.fallback {
  color: var(--white);
}

.fallback h2 {
  max-width: 480px;
  color: var(--white);
  font-size: clamp(38px, 11vw, 60px);
  line-height: .94;
}

.fallback p {
  max-width: 370px;
  margin: 0 0 10px;
  color: rgba(255, 255, 255, .86);
  line-height: 1.45;
}

@keyframes scan-cover {
  0%,
  20% {
    left: -45%;
  }
  78%,
  100% {
    left: 125%;
  }
}

@keyframes wheel-grow {
  0% {
    opacity: 0;
    transform: scale(.02) translateZ(0);
  }
  72% {
    opacity: 1;
    transform: scale(1.04) translateZ(0);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateZ(0);
  }
}

@keyframes pop-button {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(24px) scale(.72);
  }
  100% {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
}

@keyframes result-up {
  0% {
    opacity: 0;
    transform: translateY(40px) scale(.94);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-height: 740px) {
  .start-screen {
    gap: 8px;
  }

  .cover-card {
    width: min(24vw, 104px);
  }

  h1 {
    font-size: clamp(36px, 10vw, 54px);
  }

  .start-copy {
    font-size: 14px;
  }

  .result-panel {
    padding-top: 18px;
  }

  .result-panel h2 {
    font-size: 54px;
  }

  #result-copy {
    margin-bottom: 11px;
  }
}

@media (max-width: 370px) {
  .mobile-row {
    grid-template-columns: 1fr;
  }

  #unlock-button {
    width: 100%;
  }
}

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