.wheel-stage {
  --stage: min(92vw, 360px, 46vh, calc(100vh - var(--safe-top) - var(--safe-bottom) - 340px));
  position: relative;
  isolation: isolate;
  flex: none;
  width: var(--stage);
  aspect-ratio: 1;
  margin: 18px 0 8px;
}

.wheel-core {
  position: absolute;
  inset: 0;
  z-index: 2;
  transition: transform 700ms cubic-bezier(0.22, 1, 0.36, 1);
}

.wheel.cosmic .wheel-core {
  transform: scale(0.76);
}

.wheel-core::after {
  content: "";
  position: absolute;
  inset: 14%;
  z-index: 1;
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.1), transparent 40%, rgba(0, 0, 0, 0.25));
  pointer-events: none;
}

.wheel-ring {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: 50%;
  visibility: hidden;
  opacity: 0;
  scale: 1.08;
  -webkit-mask-image: radial-gradient(closest-side, transparent 68.6%, #000 69%, #000 95.6%, transparent 96%);
  mask-image: radial-gradient(closest-side, transparent 68.6%, #000 69%, #000 95.6%, transparent 96%);
  transition: opacity 500ms ease-out 80ms, scale 700ms cubic-bezier(0.22, 1, 0.36, 1) 80ms, visibility 500ms 80ms;
  will-change: transform;
}

.wheel.cosmic .wheel-ring {
  visibility: visible;
  opacity: 1;
  scale: 1;
}

.wheel-ring::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: 50%;
  background:
    radial-gradient(closest-side, transparent 69%, var(--gold-light) 69.4%, var(--gold-deep) 71%, transparent 71.4%,
      transparent 93.6%, var(--gold-deep) 94%, var(--gold-light) 95.6%),
    radial-gradient(closest-side, transparent 69%, rgba(0, 0, 0, 0.35) 72%, transparent 80%);
  pointer-events: none;
}

.wheel-ring-label {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.wheel-ring-text {
  position: absolute;
  left: 50%;
  top: 8.6%;
  transform: translate(-50%, -50%);
  color: var(--gold);
  font-family: var(--display);
  font-size: max(0.8rem, calc(var(--stage) * 0.058));
  line-height: 1;
  letter-spacing: 0.02em;
  white-space: nowrap;
  text-shadow: 0 1px 0 #000, 0 -1px 0 #000, 1px 0 0 #000, -1px 0 0 #000, 0 2px 1px rgba(0, 0, 0, 0.6);
}

.wheel-ring-label.flipped .wheel-ring-text {
  transform: translate(-50%, -50%) rotate(180deg);
}

.wheel-ring-label.grand .wheel-ring-text {
  color: var(--gold-light);
}

.wheel.boosted .wheel-ring-label:not(.hit) .wheel-ring-text {
  opacity: 0.6;
}

.wheel-ring-label.hit .wheel-ring-text {
  color: var(--gold-light);
  text-shadow: 0 1px 0 #000, 0 -1px 0 #000, 1px 0 0 #000, -1px 0 0 #000, 0 0 8px var(--gold), 0 0 14px var(--gold);
}

.wheel-ring-hit {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
  background: conic-gradient(from 0deg,
    rgba(255, 211, 77, 0.95) 0 1deg, rgba(255, 255, 255, 0.2) 2deg calc(var(--wedge, 36deg) - 2deg),
    rgba(255, 211, 77, 0.95) calc(var(--wedge, 36deg) - 1deg) var(--wedge, 36deg),
    rgba(0, 0, 0, 0.32) var(--wedge, 36deg));
}

.wheel.boosted .wheel-ring-hit {
  opacity: 1;
  animation: wheel-hit 700ms ease-out;
}

.wheel-ring-arcs {
  position: absolute;
  inset: -4%;
  z-index: 3;
  visibility: hidden;
  opacity: 0;
  color: var(--wheel-light);
  pointer-events: none;
  filter: drop-shadow(0 0 1px var(--neon-pink)) drop-shadow(0 0 3px var(--violet));
}

.wheel-ring-arcs svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  animation: wheel-arc-flicker 330ms steps(3) infinite, wheel-arc-turn 8s linear infinite reverse;
}

.wheel.offering .wheel-ring-arcs {
  visibility: visible;
  animation: wheel-arcs-out 1.4s forwards;
}

.wheel.boosting .wheel-ring-arcs {
  visibility: visible;
  opacity: 1;
}

.wheel.boosted .wheel-ring-arcs {
  visibility: visible;
  animation: wheel-arcs-out 1.2s forwards;
}

.wheel-ring-pointer {
  position: absolute;
  inset: 0;
  z-index: 4;
  visibility: hidden;
  opacity: 0;
  translate: 0 -5%;
  pointer-events: none;
  transition: opacity 400ms ease-out 300ms, translate 600ms cubic-bezier(0.22, 1, 0.36, 1) 300ms, visibility 400ms 300ms;
}

.wheel.cosmic .wheel-ring-pointer {
  visibility: visible;
  opacity: 1;
  translate: 0 0;
}

.wheel-ring-bolt {
  position: absolute;
  top: 0.5%;
  left: 59.8%;
  width: 6%;
  height: 18%;
  overflow: visible;
  transform: rotate(18deg);
  filter: drop-shadow(0 3px 2px rgba(0, 0, 0, 0.6));
}

.wheel-ring-bolt.flip {
  left: 34.2%;
  transform: rotate(-18deg) scaleX(-1);
}

.wheel-floor {
  position: absolute;
  left: -12.5%;
  bottom: 4%;
  width: 125%;
  height: 20%;
  transform: translateY(45%);
  border: 2px solid var(--neon-cyan);
  border-radius: 50%;
  background: radial-gradient(closest-side, var(--navy), var(--navy-deep) 80%, transparent);
  box-shadow: 0 0 16px var(--neon-cyan), inset 0 0 12px var(--neon-cyan);
}

.wheel-floor::before,
.wheel-floor::after {
  content: "";
  position: absolute;
  border: 1px solid var(--neon-cyan);
  border-radius: 50%;
}

.wheel-floor::before {
  inset: 16% 9%;
  opacity: 0.55;
}

.wheel-floor::after {
  inset: -24% -7%;
  opacity: 0.3;
}

.wheel-halo {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(closest-side,
    transparent 81%,
    var(--magenta) 81.6%, var(--wheel-light) 82.3%, var(--magenta) 83%,
    var(--lacquer) 84%, var(--red-dark) 90%, var(--lacquer) 94.3%,
    var(--magenta) 95%, var(--wheel-light) 95.7%, var(--magenta) 96.4%,
    transparent 97.4%);
}

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

.wheel-halo::before {
  inset: 2.2%;
  box-shadow: 0 0 14px var(--magenta), 0 0 34px var(--violet);
}

.wheel-halo::after {
  inset: -3.5%;
  border: 1px solid var(--muted);
  box-shadow: 0 0 0 9px rgba(0, 0, 0, 0), 0 0 0 10px var(--violet);
  opacity: 0.3;
}

.wheel-halo svg,
.wheel-lights svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.wheel-halo-dots {
  fill: none;
  stroke: var(--gold);
  stroke-width: 0.9;
  stroke-linecap: round;
  stroke-dasharray: 0 8.757;
  opacity: 0.75;
}

.wheel-halo svg path,
.wheel-halo svg use {
  fill: var(--wheel-light);
  filter: drop-shadow(0 0 1px var(--wheel-light));
}

.wheel-lights {
  position: absolute;
  inset: 9%;
  border-radius: 50%;
  background:
    radial-gradient(closest-side, transparent 87.5%, rgba(0, 0, 0, 0.7) 88.2%, rgba(0, 0, 0, 0.45) 92.5%, transparent 93.6%, rgba(255, 255, 255, 0.5) 95.5%, transparent 97.5%, rgba(0, 0, 0, 0.5) 99.6%),
    var(--gold-rim);
  -webkit-mask-image: radial-gradient(closest-side, transparent 87%, #000 87.5%);
  mask-image: radial-gradient(closest-side, transparent 87%, #000 87.5%);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.6);
}

.wheel-lamps {
  fill: none;
  stroke: var(--gold-light);
  stroke-width: 2.3;
  stroke-linecap: round;
  stroke-dasharray: 0 16.004;
  filter: drop-shadow(0 0 1px var(--gold));
  animation: wheel-lamp-blink 1.6s steps(1) infinite;
}

.wheel-lamps.alt {
  stroke: var(--neon-pink);
  stroke-dashoffset: -8.002;
  filter: drop-shadow(0 0 1px var(--magenta));
  animation-delay: -0.8s;
}

.wheel.spinning .wheel-lights svg {
  animation: wheel-chase 400ms linear infinite;
}

.wheel.spinning .wheel-lamps {
  animation: none;
}

.wheel-disc {
  position: absolute;
  inset: 14%;
  border-radius: 50%;
  box-shadow: 0 0 0 2px var(--gold-deep), inset 0 0 0 1px rgba(255, 211, 77, 0.45), inset 0 0 18px rgba(0, 0, 0, 0.6);
  will-change: transform;
}

.wheel-label {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.wheel-label-inner {
  position: absolute;
  left: 50%;
  top: 15.75%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 3px;
  width: 28.5%;
  margin-left: -14.25%;
  padding-left: 3%;
  transform: translateY(-50%) rotate(90deg);
  color: var(--gold);
  font-family: var(--display);
  font-size: clamp(0.78rem, 4vw, 1.05rem);
  line-height: 1;
  letter-spacing: 0.02em;
  text-shadow: 0 1px 0 #000, 0 -1px 0 #000, 1px 0 0 #000, -1px 0 0 #000, 0 2px 1px rgba(0, 0, 0, 0.6);
}

.wheel-label-text {
  white-space: nowrap;
}

.wheel-label.flipped .wheel-label-inner {
  justify-content: flex-end;
  padding: 0 3% 0 0;
  transform: translateY(-50%) rotate(-90deg);
}

.wheel.cosmic .wheel-label:not(.hit) .wheel-label-inner {
  visibility: hidden;
}

.wheel-label.grand .wheel-label-inner {
  color: var(--gold-light);
}

.wheel-label.grand::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(from calc(var(--wedge, 30deg) / -2),
    var(--gold-light) 0 1deg, transparent 1deg calc(var(--wedge, 30deg) - 1deg),
    var(--gold-light) calc(var(--wedge, 30deg) - 1deg) var(--wedge, 30deg), transparent var(--wedge, 30deg));
  -webkit-mask-image: repeating-radial-gradient(circle, #000 0 0.9%, transparent 1.1% 2.2%);
  mask-image: repeating-radial-gradient(circle, #000 0 0.9%, transparent 1.1% 2.2%);
  filter: drop-shadow(0 0 2px var(--gold));
}

.wheel.won .wheel-label:not(.hit) .wheel-label-inner {
  opacity: 0.6;
}

.wheel-label.hit .wheel-label-inner {
  color: var(--gold-light);
  text-shadow: 0 1px 0 #000, 0 -1px 0 #000, 1px 0 0 #000, -1px 0 0 #000, 0 0 8px var(--gold), 0 0 14px var(--gold);
}

.wheel-hit {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
  background: conic-gradient(from 0deg,
    rgba(255, 211, 77, 0.95) 0 0.8deg, rgba(255, 255, 255, 0.16) 1.6deg calc(var(--wedge, 30deg) - 1.6deg),
    rgba(255, 211, 77, 0.95) calc(var(--wedge, 30deg) - 0.8deg) var(--wedge, 30deg),
    rgba(0, 0, 0, 0.32) var(--wedge, 30deg));
}

.wheel-hit::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(closest-side, transparent 45%, rgba(255, 211, 77, 0.3) 100%);
  -webkit-mask-image: conic-gradient(from 0deg, #000 0 var(--wedge, 30deg), transparent var(--wedge, 30deg));
  mask-image: conic-gradient(from 0deg, #000 0 var(--wedge, 30deg), transparent var(--wedge, 30deg));
}

.wheel.won .wheel-hit {
  opacity: 1;
  animation: wheel-hit 700ms ease-out;
}

.wheel-arcs {
  position: absolute;
  inset: -2%;
  z-index: 2;
  visibility: hidden;
  opacity: 0;
  color: var(--wheel-light);
  pointer-events: none;
  filter: drop-shadow(0 0 1px var(--neon-pink)) drop-shadow(0 0 3px var(--violet));
}

.wheel-arcs svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  animation: wheel-arc-flicker 360ms steps(3) infinite, wheel-arc-turn 7s linear infinite;
}

.wheel-arcs svg + svg {
  scale: -1 1;
  animation-duration: 290ms, 9s;
  animation-direction: normal, reverse;
}

.wheel.spinning .wheel-arcs {
  visibility: visible;
  opacity: 1;
}

.wheel.won .wheel-arcs {
  visibility: visible;
  animation: wheel-arcs-out 1.2s forwards;
}

