:root {
  color-scheme: dark;
  --bg: #09090b;
  --ink: #f6f3ee;
  --muted: #b7b7c2;
  --gold: #f5c16c;
  --gold-deep: #f0a202;
  --line: rgba(255, 255, 255, 0.08);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: Manrope, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
}

body::before {
  content: "";
  position: fixed;
  z-index: -1;
  inset: -10vh -20vw auto;
  height: 70vh;
  background:
    radial-gradient(closest-side at 50% 40%, rgba(245, 193, 108, 0.2), transparent 75%),
    radial-gradient(closest-side at 82% 80%, rgba(120, 90, 255, 0.12), transparent 70%);
  pointer-events: none;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
  touch-action: manipulation;
}

button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

.ticker {
  display: flex;
  align-items: stretch;
  gap: 0;
  padding: calc(8px + env(safe-area-inset-top)) 0 8px;
  border-bottom: 1px solid var(--line);
  background: #0c0c10;
  position: sticky;
  top: 0;
  z-index: 5;
}

.ticker__live {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 14px 0 12px;
  color: #ff5d73;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  background: #0c0c10;
  box-shadow: 10px 0 18px 6px #0c0c10;
  z-index: 2;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff3b57;
  box-shadow: 0 0 0 0 rgba(255, 59, 87, 0.7);
  animation: pulse 1.6s infinite;
}

.ticker__viewport {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  height: 76px;
  display: flex;
  align-items: center;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 20px, #000 calc(100% - 36px), transparent);
  mask-image: linear-gradient(90deg, transparent, #000 20px, #000 calc(100% - 36px), transparent);
}

.ticker__track {
  display: flex;
  align-items: center;
  gap: 10px;
  width: max-content;
  visibility: hidden;
  will-change: transform;
}

.ticker.is-ready .ticker__track {
  visibility: visible;
}

.drop {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 62px;
  padding: 0 14px 0 8px;
  border-radius: 14px;
  background: #16161a;
  border: 1px solid var(--line);
  flex: 0 0 auto;
  user-select: none;
}

.drop--win {
  background: linear-gradient(180deg, #4a3414, #2a1d0c);
  border-color: #ffd78a;
  box-shadow: 0 0 18px rgba(245, 193, 108, 0.28);
}

.drop--you {
  box-shadow: 0 0 0 1px #ffd78a, 0 0 18px rgba(245, 193, 108, 0.28);
}

.drop__avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #2a2a32;
  color: #eee;
  font-size: 13px;
  font-weight: 800;
  flex: 0 0 auto;
}

.drop--win .drop__avatar {
  background: var(--gold);
  color: #1a1203;
}

.drop__name,
.drop__prize {
  display: block;
  white-space: nowrap;
}

.drop__name {
  font-size: 13px;
  font-weight: 700;
}

.drop__prize {
  margin-top: 2px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.drop--win .drop__prize {
  color: var(--gold);
}

.stage {
  width: min(980px, 100%);
  margin: 0 auto;
  min-height: calc(100dvh - 92px);
  display: flex;
  flex-direction: column;
  justify-content: safe center;
  gap: 14px;
  padding: 18px 16px calc(20px + env(safe-area-inset-bottom));
}

.eyebrow {
  margin: 0;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 11px;
  font-weight: 800;
  color: var(--gold);
}

h1 {
  margin: 0;
  text-align: center;
}

.page-spin .stage h1 {
  font-family: Unbounded, Manrope, sans-serif;
  font-weight: 700;
  font-size: clamp(32px, 10vw, 60px);
  line-height: 1.02;
  letter-spacing: -0.03em;
}

.lede,
.status {
  margin: 0;
  text-align: center;
}

.lede {
  color: var(--muted);
  font-size: 15px;
}

.status {
  min-height: 1.4em;
  color: var(--gold);
  font-weight: 700;
}

.reel {
  position: relative;
  visibility: hidden;
  border-radius: 28px;
  padding: 22px 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.02));
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 20px 50px rgba(0, 0, 0, 0.35);
  user-select: none;
}

.reel.is-ready {
  visibility: visible;
}

.reel.is-spinning {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 0 0 1px rgba(245, 193, 108, 0.35), 0 20px 50px rgba(0, 0, 0, 0.35);
}

.reel.is-spinning .card__title,
.reel.is-spinning .card__icon {
  filter: blur(1.4px);
}

.reel__viewport {
  overflow: hidden;
}

.reel__track {
  position: relative;
  display: flex;
  gap: 8px;
  width: max-content;
  will-change: transform;
}

.reel__fade,
.reel__pointer {
  position: absolute;
  pointer-events: none;
}

.reel__fade {
  top: 0;
  bottom: 0;
  width: 28px;
  z-index: 3;
}

.reel__fade--left {
  left: 0;
  background: linear-gradient(90deg, #101014, transparent);
  border-radius: 28px 0 0 28px;
}

.reel__fade--right {
  right: 0;
  background: linear-gradient(270deg, #101014, transparent);
  border-radius: 0 28px 28px 0;
}

.reel__pointer {
  top: 8px;
  bottom: 8px;
  left: 50%;
  width: 18px;
  transform: translateX(-50%);
  z-index: 4;
}

.reel__pointer::before,
.reel__pointer::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
}

.reel__pointer::before {
  top: 0;
  border-top: 9px solid #ffd78a;
}

.reel__pointer::after {
  bottom: 0;
  border-bottom: 9px solid #ffd78a;
}

.card {
  flex: 0 0 auto;
  width: 152px;
  height: 136px;
  padding: 12px;
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  overflow: hidden;
}

.card__icon {
  display: grid;
  place-items: center;
}

.card svg {
  width: 28px;
  height: 28px;
}

.card__title {
  font-size: 14px;
  font-weight: 800;
  line-height: 1.25;
}

.card--lose {
  color: #d5d5de;
  background: linear-gradient(180deg, #1c1d24, #121318);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.card--lose .card__icon {
  color: #8d93a3;
}

.card--win {
  color: #fff6e4;
  background:
    radial-gradient(120px 80px at 50% 0%, rgba(255, 214, 140, 0.38), transparent 70%),
    linear-gradient(180deg, #2c2216, #14110e);
  border: 1px solid rgba(245, 193, 108, 0.75);
}

.card--win .card__icon {
  color: var(--gold);
}

.card.is-chosen {
  box-shadow: 0 0 0 2px #ffd78a, 0 0 32px rgba(255, 190, 70, 0.45);
  animation: prize-pop 0.55s ease;
}

.banner {
  display: none;
  width: min(100%, 440px);
  align-self: center;
  text-align: center;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(245, 193, 108, 0.1);
  border: 1px solid rgba(245, 193, 108, 0.45);
  color: #ffe7bf;
}

.banner.is-visible {
  display: block;
}

.banner strong {
  display: block;
  font-size: 16px;
}

.banner span {
  display: block;
  margin-top: 4px;
  color: #d9d2c5;
  font-size: 13px;
  font-weight: 600;
}

.cta {
  width: min(100%, 440px);
  align-self: center;
  height: 56px;
  border: 0;
  border-radius: 16px;
  background: linear-gradient(180deg, #ffd78a, var(--gold-deep));
  color: #1a1203;
  font-weight: 800;
  font-size: 17px;
  box-shadow: 0 10px 30px rgba(240, 162, 2, 0.35);
}

.cta:active:not(:disabled) {
  transform: scale(0.985);
}

.cta:disabled {
  cursor: default;
  opacity: 0.6;
  box-shadow: none;
}

.win-wrap {
  width: min(480px, 100%);
  margin: 0 auto;
  padding: calc(28px + env(safe-area-inset-top)) 16px calc(32px + env(safe-area-inset-bottom));
}

.medal {
  width: 72px;
  height: 72px;
  margin: 0 auto 16px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #1a1203;
  background: radial-gradient(circle at 35% 30%, #ffe7b0, var(--gold-deep));
  box-shadow: 0 10px 40px rgba(240, 162, 2, 0.35);
}

.medal svg {
  width: 36px;
  height: 36px;
}

.page-win h1 {
  font-size: clamp(24px, 7vw, 36px);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.page-win .lede {
  margin-top: 12px;
  font-size: 15px;
  line-height: 1.45;
}

.form {
  margin-top: 22px;
  display: grid;
  gap: 14px;
  padding: 16px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
}

.field {
  display: grid;
}

.field label {
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 700;
}

.field__hint {
  margin: -2px 0 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.field input {
  width: 100%;
  height: 52px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #101014;
  color: white;
  font-size: 16px;
  appearance: none;
  -webkit-appearance: none;
}

.field input::placeholder {
  color: #6f6f7a;
}

.field input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(245, 193, 108, 0.2);
}

.field input[aria-invalid="true"] {
  border-color: #ff8d8d;
}

.phone {
  display: flex;
  align-items: center;
  height: 52px;
  padding-left: 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #101014;
}

.phone__code {
  flex: 0 0 auto;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.phone input {
  border: 0;
  background: transparent;
  height: 100%;
  padding-left: 8px;
  box-shadow: none;
}

.phone input:focus {
  border-color: transparent;
  box-shadow: none;
}

.phone:focus-within {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(245, 193, 108, 0.2);
}

.phone:has(input[aria-invalid="true"]) {
  border-color: #ff8d8d;
}

.field__error,
.form-error {
  margin: 6px 0 0;
  color: #ffb4b4;
  font-size: 12px;
  font-weight: 600;
}

.form .cta {
  width: 100%;
  margin-top: 2px;
}

.thanks {
  text-align: center;
  padding-top: 12px;
}

.thanks .lede {
  margin-top: 8px;
}

.back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  margin-top: 18px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--gold);
  font-weight: 700;
  text-decoration: none;
}

.sheet {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  align-items: end;
  justify-items: center;
}

.sheet__backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(0, 0, 0, 0.66);
}

.sheet__panel {
  position: relative;
  width: min(440px, 100%);
  max-height: min(94dvh, 680px);
  overflow: auto;
  padding: 16px 14px calc(10px + env(safe-area-inset-bottom));
  border-radius: 24px 24px 0 0;
  background: #121218;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 -24px 70px rgba(0, 0, 0, 0.5);
  animation: sheet-in 0.35s ease;
}

.sheet .medal {
  width: 46px;
  height: 46px;
  margin: 0 auto 8px;
}

.sheet .medal svg {
  width: 24px;
  height: 24px;
}

.sheet h2 {
  margin: 0;
  text-align: center;
  font-size: clamp(18px, 4.6vw, 24px);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.sheet .lede {
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.35;
}

.sheet .form {
  margin-top: 10px;
  gap: 8px;
  padding: 10px;
}

.sheet .field label {
  margin-bottom: 3px;
  font-size: 12px;
}

.sheet .field__hint {
  margin: 0 0 4px;
  font-size: 11px;
}

.sheet .field input {
  height: 42px;
}

.sheet .phone {
  height: 42px;
}

.sheet .phone input {
  height: 100%;
  border: 0;
  box-shadow: none;
}

.sheet .form .cta {
  height: 46px;
  margin-top: 0;
}

.sheet .thanks {
  padding-top: 4px;
}

.salute {
  position: fixed;
  inset: 0;
  z-index: 50;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.sheet__x {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-size: 26px;
  line-height: 1;
}

body.sheet-open {
  overflow: hidden;
}

@keyframes sheet-in {
  from {
    transform: translateY(28px);
    opacity: 0.4;
  }
  to {
    transform: none;
    opacity: 1;
  }
}

@keyframes ticker-scroll {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(-50%, 0, 0);
  }
}

@keyframes pulse {
  70% {
    box-shadow: 0 0 0 6px rgba(255, 59, 87, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 59, 87, 0);
  }
}

@keyframes prize-pop {
  0% {
    transform: scale(0.96);
  }
  45% {
    transform: scale(1.04);
  }
  100% {
    transform: scale(1);
  }
}

@media (min-width: 800px) {
  .stage {
    gap: 18px;
    padding-top: 28px;
  }

  .lede {
    font-size: 17px;
  }

  .reel__track {
    gap: 12px;
  }

  .reel__fade {
    width: 48px;
  }

  .card {
    width: 220px;
    height: 164px;
  }

  .card__title {
    font-size: 18px;
  }

  .card svg {
    width: 32px;
    height: 32px;
  }
}

@media (max-width: 360px) {
  .card {
    width: 142px;
    height: 128px;
  }

  .card__title {
    font-size: 13px;
  }

  .page-spin .stage h1 {
    font-size: 30px;
  }
}

@media (min-width: 800px) {
  .sheet {
    align-items: center;
    padding: 24px;
  }

  .sheet__panel {
    border-radius: 28px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .live-dot,
  .card.is-chosen {
    animation: none;
  }
}
