:root {
  --ink: #11100f;
  --muted: #807a74;
  --paper: #f7f3ee;
  --paper-2: #fffaf4;
  --red: #ef332b;
  --red-deep: #b91618;
  --gold: #f3b64f;
  --green: #16b06d;
  --line: rgba(17, 16, 15, .1);
  --shadow: 0 32px 90px rgba(32, 23, 14, .22);
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  font-family: Inter, Arial, sans-serif;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(239, 51, 43, .08) 1px, transparent 1px),
    linear-gradient(180deg, rgba(239, 51, 43, .06) 1px, transparent 1px),
    radial-gradient(circle at 18% 12%, rgba(239, 51, 43, .18), transparent 24%),
    radial-gradient(circle at 82% 18%, rgba(243, 182, 79, .18), transparent 22%),
    linear-gradient(135deg, #fff 0%, var(--paper) 48%, #efe7df 100%);
  background-size: 88px 88px, 88px 88px, auto, auto, auto;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

body::before,
body::after {
  content: "";
  position: fixed;
  pointer-events: none;
  z-index: 0;
}

body::before {
  inset: 0;
  background:
    linear-gradient(110deg, transparent 0 24%, rgba(255, 255, 255, .58) 24% 27%, transparent 27% 100%),
    linear-gradient(250deg, transparent 0 62%, rgba(255, 255, 255, .5) 62% 64%, transparent 64% 100%);
  opacity: .72;
}

body::after {
  width: 280px;
  height: 280px;
  right: -90px;
  top: 120px;
  border-radius: 50%;
  border: 1px solid rgba(239, 51, 43, .16);
  box-shadow: inset 0 0 0 32px rgba(255, 255, 255, .34);
}

.app-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  align-items: start;
  justify-items: center;
  padding: max(18px, env(safe-area-inset-top)) 14px max(18px, env(safe-area-inset-bottom));
}

.scene {
  width: min(100%, 455px);
  position: relative;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, .78);
  border-radius: 34px;
  background:
    linear-gradient(150deg, rgba(255, 255, 255, .88), rgba(255, 249, 242, .72)),
    linear-gradient(180deg, rgba(255, 255, 255, .58), rgba(255, 255, 255, .2));
  box-shadow: var(--shadow);
  overflow: hidden;
  isolation: isolate;
}

.scene::before {
  content: "";
  position: absolute;
  inset: 9px;
  border-radius: 27px;
  border: 1px solid rgba(17, 16, 15, .06);
  pointer-events: none;
}

.scene::after {
  content: "UPGRADE";
  position: absolute;
  left: -18px;
  top: 180px;
  font-size: 96px;
  font-weight: 900;
  letter-spacing: 0;
  color: rgba(17, 16, 15, .035);
  transform: rotate(-8deg);
  z-index: -1;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 66px;
}

.brand-mark {
  position: relative;
  width: 66px;
  height: 66px;
  display: grid;
  place-items: center;
  border-radius: 22px;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .88), rgba(255, 255, 255, .16) 28%, transparent 29%),
    radial-gradient(circle at 28% 20%, #ffd4cf, transparent 23%),
    radial-gradient(circle at 68% 78%, rgba(58, 0, 0, .36), transparent 34%),
    linear-gradient(145deg, #ff5d54 0%, #ed211d 45%, #790709 100%);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, .7),
    inset -10px -15px 20px rgba(67, 0, 0, .36),
    inset 10px 10px 20px rgba(255, 255, 255, .2),
    0 20px 34px rgba(239, 51, 43, .28),
    0 8px 0 rgba(116, 8, 10, .18),
    0 0 0 1px rgba(136, 7, 8, .22);
  transform: rotate(-5deg) translateZ(0) perspective(600px) rotateY(-6deg);
  transform-style: preserve-3d;
  overflow: hidden;
  animation: logo4d 4.8s ease-in-out infinite;
}

.brand-mark span {
  position: relative;
  z-index: 2;
  font-weight: 900;
  font-size: 23px;
  letter-spacing: 0;
  transform: rotate(5deg) translateZ(18px);
  -webkit-text-stroke: .45px rgba(255, 255, 255, .5);
  text-shadow:
    0 1px 0 #ffd2ce,
    0 2px 0 #df1e1c,
    0 3px 0 #991012,
    0 6px 10px rgba(61, 0, 0, .38),
    0 0 20px rgba(255, 255, 255, .42);
}

.brand-mark span::before {
  content: attr(data-text);
  position: absolute;
  z-index: -1;
  left: 3px;
  top: 3px;
  color: rgba(58, 0, 0, .34);
  filter: blur(.15px);
}

.brand-mark::before {
  content: "";
  position: absolute;
  inset: -22px;
  background: linear-gradient(110deg, transparent 0 36%, rgba(255, 255, 255, .94) 44%, transparent 53% 100%);
  transform: translateX(-74%) rotate(8deg);
  animation: logoShine 2.9s ease-in-out infinite;
}

.brand-mark::after {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: 17px;
  border: 1px solid rgba(255, 255, 255, .42);
  box-shadow:
    inset 0 0 16px rgba(255, 255, 255, .28),
    0 0 18px rgba(239, 51, 43, .22);
}

.brand-mark i {
  position: absolute;
  z-index: 1;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 32%, rgba(255, 255, 255, .62), transparent 28%),
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, .16), transparent 58%);
  transform: translate(5px, -5px);
  filter: blur(.2px);
  opacity: .9;
}

.brand-kicker {
  font-size: 13px;
  font-weight: 900;
  color: var(--red);
  letter-spacing: 0;
}

h1 {
  margin: 1px 0 0;
  font-size: clamp(25px, 7vw, 38px);
  line-height: .92;
  font-weight: 900;
  letter-spacing: 0;
}

.stats-strip {
  display: block;
  margin-top: 16px;
}

.stats-strip article {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, .78);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, .92), rgba(255, 255, 255, .45)),
    radial-gradient(circle at 8% 0, rgba(239, 51, 43, .11), transparent 32%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .92),
    inset 0 -12px 24px rgba(190, 177, 164, .12),
    0 16px 32px rgba(37, 25, 15, .08);
  padding: 14px 16px;
  backdrop-filter: blur(14px);
}

.stats-strip article::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(115deg, transparent 0 18%, rgba(255, 255, 255, .62) 24%, transparent 31% 100%);
  opacity: .8;
  pointer-events: none;
}

.stats-strip span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.stats-strip strong {
  display: block;
  margin-top: 5px;
  font-size: 22px;
  font-weight: 900;
  white-space: nowrap;
}

.wheel-stage {
  position: relative;
  width: min(100%, 372px);
  aspect-ratio: 1;
  margin: 10px auto 8px;
  display: grid;
  place-items: center;
  perspective: 1100px;
}

.status-line {
  min-height: 20px;
  margin: 10px auto 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.buy-spin-button {
  width: min(100%, 372px);
  margin: 0 auto 8px;
  min-height: 48px;
  border: 1px solid rgba(20, 18, 16, .1);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .92), rgba(255, 255, 255, .48)),
    radial-gradient(circle at 12% 0, rgba(239, 51, 43, .16), transparent 34%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .92),
    0 16px 34px rgba(37, 25, 15, .12);
  color: var(--ink);
  font: 900 14px/1 Inter, Arial, sans-serif;
  cursor: pointer;
  transition: transform .16s ease, filter .16s ease;
}

.buy-spin-button:hover {
  transform: translateY(-1px);
}

.buy-spin-button:active {
  transform: translateY(1px);
}

.buy-spin-button:disabled {
  cursor: default;
  filter: saturate(.75);
  opacity: .68;
}

.wheel-stage::before,
.wheel-stage::after {
  content: "";
  position: absolute;
  z-index: 4;
  pointer-events: none;
  border-radius: 50%;
}

.wheel-stage::before {
  width: 86%;
  height: 86%;
  background:
    radial-gradient(circle at 33% 22%, rgba(255, 255, 255, .62), transparent 20%),
    radial-gradient(circle at 72% 80%, rgba(255, 255, 255, .2), transparent 24%),
    linear-gradient(132deg, rgba(255, 255, 255, .54), transparent 24% 63%, rgba(255, 255, 255, .24));
  mix-blend-mode: screen;
  opacity: .82;
  transform: rotate(-13deg);
  animation: glassPulse 4.4s ease-in-out infinite;
}

.wheel-stage.is-spinning::before {
  animation: none;
  opacity: .82;
  transform: rotate(-13deg);
}

.wheel-stage::after {
  width: 91%;
  height: 91%;
  border: 1px solid rgba(255, 255, 255, .78);
  box-shadow:
    inset 0 0 0 9px rgba(255, 255, 255, .09),
    inset 0 0 34px rgba(255, 255, 255, .28),
    inset 0 -28px 50px rgba(255, 255, 255, .12);
}

#wheelCanvas {
  position: relative;
  z-index: 3;
  width: 100%;
  height: 100%;
  filter: none;
  transform-origin: 50% 50%;
  will-change: transform;
  backface-visibility: hidden;
}

.wheel-shadow {
  position: absolute;
  z-index: 1;
  width: 74%;
  height: 18%;
  bottom: 1%;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(38, 24, 14, .26), transparent 70%);
  filter: blur(6px);
}

.halo {
  position: absolute;
  z-index: 0;
  border-radius: 50%;
  border: 1px solid rgba(239, 51, 43, .16);
  animation: breathe 4.8s ease-in-out infinite;
}

.halo-a {
  inset: 5%;
}

.halo-b {
  inset: 13%;
  animation-delay: -1.8s;
  border-color: rgba(243, 182, 79, .22);
}

.ticker {
  position: absolute;
  z-index: 5;
  top: -3px;
  width: 58px;
  height: 72px;
  display: grid;
  place-items: start center;
  filter: drop-shadow(0 10px 18px rgba(116, 18, 14, .24));
}

.ticker span {
  width: 42px;
  height: 58px;
  display: block;
  clip-path: polygon(50% 100%, 0 0, 100% 0);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .72), transparent 38%),
    linear-gradient(180deg, #ff4d45, #b60f12);
  border-radius: 12px 12px 18px 18px;
}

.spin-button {
  position: absolute;
  z-index: 6;
  width: 30%;
  aspect-ratio: 1;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  color: #fff;
  background:
    radial-gradient(circle at 35% 22%, rgba(255, 255, 255, .72), transparent 27%),
    radial-gradient(circle at 50% 64%, rgba(255, 255, 255, .18), transparent 42%),
    linear-gradient(145deg, #ff4a42, #b70e10);
  box-shadow:
    inset 0 3px 0 rgba(255, 255, 255, .4),
    inset 0 -13px 20px rgba(65, 0, 0, .3),
    0 14px 26px rgba(202, 21, 19, .26),
    0 0 0 9px rgba(255, 255, 255, .86),
    0 0 0 11px rgba(17, 16, 15, .09);
  transition: transform .18s ease, filter .18s ease;
}

.spin-button:hover {
  transform: translateY(-2px) scale(1.02);
}

.spin-button:active {
  transform: translateY(1px) scale(.98);
}

.spin-button:disabled {
  cursor: wait;
  filter: saturate(.72);
}

.spin-button span {
  display: block;
  font-size: clamp(19px, 5vw, 30px);
  font-weight: 900;
  letter-spacing: 0;
}

.spin-button small {
  display: block;
  margin-top: 2px;
  font-size: 9px;
  font-weight: 900;
  opacity: .78;
}

.sheet-card button {
  border: 0;
  border-radius: 20px;
  padding: 0 18px;
  color: white;
  font-weight: 900;
  font-size: 14px;
  cursor: pointer;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .24), transparent 32%),
    linear-gradient(135deg, #191716, #050505);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .24),
    0 16px 28px rgba(17, 16, 15, .18);
}

.result-sheet {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: end center;
  padding: 16px;
  background: rgba(14, 11, 9, .42);
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease;
}

.result-sheet.show {
  opacity: 1;
  pointer-events: auto;
}

.sheet-card {
  width: min(100%, 430px);
  position: relative;
  overflow: hidden;
  text-align: center;
  border-radius: 32px;
  padding: 30px 22px 22px;
  background:
    radial-gradient(circle at 50% 0, rgba(239, 51, 43, .16), transparent 34%),
    linear-gradient(180deg, #fff, #f7eee5);
  box-shadow: 0 32px 80px rgba(0, 0, 0, .3);
  transform: translateY(28px) scale(.96);
  transition: transform .28s cubic-bezier(.2, .9, .25, 1.1);
}

.result-sheet.show .sheet-card {
  transform: translateY(0) scale(1);
}

.result-orbit {
  width: 94px;
  height: 94px;
  margin: 0 auto 12px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background:
    conic-gradient(from 0deg, #ef332b, #f3b64f, #16b06d, #ef332b);
  animation: orbit 3s linear infinite;
  box-shadow: 0 18px 35px rgba(239, 51, 43, .24);
}

.result-orbit span {
  width: 66px;
  height: 66px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 25%, rgba(255, 255, 255, .8), transparent 32%),
    linear-gradient(145deg, #1b1a18, #050505);
}

.sheet-card p {
  margin: 0;
  color: var(--red);
  font-size: 12px;
  font-weight: 900;
}

.sheet-card h2 {
  margin: 5px 0 10px;
  font-size: 30px;
  line-height: 1;
  font-weight: 900;
}

.result-amount {
  margin-bottom: 18px;
  font-size: 42px;
  line-height: 1;
  font-weight: 900;
}

.sheet-card button {
  width: 100%;
  height: 54px;
}

.confetti {
  position: fixed;
  z-index: 30;
  width: 9px;
  height: 16px;
  border-radius: 3px;
  pointer-events: none;
  animation: fall 950ms ease-out forwards;
}

@keyframes breathe {
  0%,
  100% {
    transform: scale(.96);
    opacity: .45;
  }
  50% {
    transform: scale(1.03);
    opacity: .9;
  }
}

@keyframes logo4d {
  0%,
  100% {
    transform: rotate(-5deg) translateY(0) scale(1) perspective(600px) rotateY(-6deg);
  }
  45% {
    transform: rotate(-2deg) translateY(-3px) scale(1.04) perspective(600px) rotateY(8deg);
  }
  70% {
    transform: rotate(-7deg) translateY(1px) scale(.995) perspective(600px) rotateY(-12deg);
  }
}

@keyframes logoShine {
  0%,
  48% {
    transform: translateX(-74%) rotate(8deg);
  }
  72%,
  100% {
    transform: translateX(74%) rotate(8deg);
  }
}

@keyframes glassPulse {
  0%,
  100% {
    opacity: .68;
    transform: rotate(-13deg) scale(.985);
  }
  50% {
    opacity: .94;
    transform: rotate(-9deg) scale(1.018);
  }
}

@keyframes orbit {
  to {
    transform: rotate(1turn);
  }
}

@keyframes fall {
  to {
    transform: translate(var(--dx), var(--dy)) rotate(var(--rot));
    opacity: 0;
  }
}

@media (max-width: 430px) {
  .scene {
    padding: 14px;
    border-radius: 28px;
  }

  .wheel-stage {
    width: min(100%, 340px);
    margin-top: 10px;
  }
}
