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

.wheel-bolt {
  position: absolute;
  top: -5%;
  left: 53%;
  width: 10.8%;
  height: 32%;
  overflow: visible;
  opacity: 0;
  transform: translateY(-10%);
  transform-origin: 50% 100%;
  filter: drop-shadow(0 3px 2px rgba(0, 0, 0, 0.6));
  transition: transform 300ms cubic-bezier(0.3, 1.4, 0.6, 1), opacity 200ms ease-out, scale 700ms cubic-bezier(0.22, 1, 0.36, 1);
}

.wheel-bolt.flip {
  left: auto;
  right: 53%;
  transform: translateY(-10%) scaleX(-1);
}

.wheel.spinning .wheel-bolt,
.wheel.won .wheel-bolt {
  opacity: 1;
  transform: none;
}

.wheel.cosmic .wheel-bolt {
  scale: 0.625;
}

.wheel.spinning .wheel-bolt.flip,
.wheel.won .wheel-bolt.flip {
  transform: scaleX(-1);
}

.wheel-pointer-chevrons {
  position: absolute;
  left: 50%;
  top: 29%;
  width: 6%;
  height: 6%;
  margin-left: -3%;
  opacity: 0.6;
  transition: opacity 200ms ease-out;
}

.wheel-pointer-chevrons::before,
.wheel-pointer-chevrons::after {
  content: "";
  position: absolute;
  left: 22%;
  width: 56%;
  height: 56%;
  border: solid var(--muted);
  border-width: 2px 0 0 2px;
  transform: rotate(45deg);
}

.wheel-pointer-chevrons::before {
  top: 10%;
}

.wheel-pointer-chevrons::after {
  top: 45%;
  opacity: 0.6;
}

.wheel.spinning .wheel-pointer-chevrons,
.wheel.won .wheel-pointer-chevrons {
  opacity: 0;
}

.wheel-go {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 3;
  width: max(26%, 56px);
  aspect-ratio: 1;
  margin: calc(max(26%, 56px) / -2) 0 0 calc(max(26%, 56px) / -2);
  padding: 0;
  border: 4px solid transparent;
  border-radius: 50%;
  background:
    radial-gradient(ellipse 72% 44% at 50% 24%, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0.08) 75%, transparent 78%) padding-box,
    radial-gradient(circle at 50% 62%, var(--go-light) 30%, var(--go-dark) 100%) padding-box,
    var(--gold-rim) border-box;
  box-shadow: 0 0 0 1px var(--gold-deep), 0 0 0 3px rgba(255, 255, 255, 0.45), 0 0 0 4px var(--red-dark), 0 5px 0 3px rgba(0, 0, 0, 0.55), inset 0 -5px 8px rgba(0, 0, 0, 0.35), inset 0 0 0 1px var(--gold-deep);
  color: var(--wheel-light);
  font-family: var(--display);
  font-size: max(1.1rem, calc(var(--stage) * 0.075));
  line-height: 1;
  letter-spacing: 0.04em;
  -webkit-text-stroke: 1px var(--red-dark);
  paint-order: stroke fill;
  text-shadow: 0 2px 0 var(--red-dark);
  cursor: pointer;
  transition: padding-top 420ms cubic-bezier(0.22, 1, 0.36, 1), font-size 420ms cubic-bezier(0.22, 1, 0.36, 1);
}

.wheel-go:disabled {
  filter: saturate(0.55) brightness(0.8);
  cursor: default;
}

.wheel.spinning .wheel-go:disabled,
.wheel.won .wheel-go:disabled {
  filter: none;
  cursor: default;
}

.wheel-go.collect {
  background:
    radial-gradient(ellipse 72% 44% at 50% 24%, rgba(255, 255, 255, 0.5), transparent 78%) padding-box,
    var(--gold-bevel) padding-box,
    var(--gold-rim) border-box;
  color: var(--gold-deep);
  font-size: max(0.8rem, calc(var(--stage) * 0.05));
  -webkit-text-stroke: 0;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
}

.wheel-go.locked {
  padding-top: calc(max(26%, 56px) * 0.4);
  font-size: max(0.8rem, calc(var(--stage) * 0.06));
}

.wheel-go.locked::before,
.wheel-go.locked::after {
  content: "";
  position: absolute;
  left: 50%;
  pointer-events: none;
  animation: wheel-lock-in 460ms cubic-bezier(0.22, 1, 0.36, 1) 160ms backwards;
}

.wheel-go.locked::before {
  top: 12%;
  width: 22%;
  height: 24%;
  margin-left: -11%;
  border: max(2px, calc(var(--stage) * 0.008)) solid var(--wheel-light);
  border-bottom: 0;
  border-radius: 50% 50% 0 0 / 70% 70% 0 0;
  filter: drop-shadow(0 1px 0 var(--red-dark));
}

.wheel-go.locked::after {
  top: 30%;
  width: 36%;
  height: 24%;
  margin-left: -18%;
  border-radius: 3px;
  background:
    radial-gradient(circle at 50% 42%, var(--gold-deep) 0 12%, transparent 13%),
    var(--gold-bevel);
  box-shadow: 0 0 0 1px var(--gold-deep), 0 2px 0 rgba(0, 0, 0, 0.45);
}

.wheel-foot {
  position: relative;
  z-index: 1;
  display: grid;
  flex: none;
  width: 100%;
  justify-items: center;
}

.wheel-foot > * {
  grid-area: 1 / 1;
}

.wheel-result {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  width: 100%;
}

.wheel-result {
  transition: opacity 320ms ease-out 120ms, visibility 320ms 120ms;
}

.wheel.offering .wheel-result {
  visibility: hidden;
  opacity: 0;
  transition: opacity 200ms ease-in, visibility 200ms;
}

.wheel-offer {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: end;
  gap: 12px;
  width: 100%;
  max-width: 360px;
  visibility: hidden;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 200ms ease-in, transform 200ms ease-in, visibility 200ms;
}

.wheel.offering .wheel-offer {
  visibility: visible;
  opacity: 1;
  transform: none;
  transition: opacity 400ms ease-out 260ms, transform 640ms cubic-bezier(0.22, 1, 0.36, 1) 260ms, visibility 400ms 260ms;
}

.wheel-offer-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.wheel-offer-label {
  color: var(--text);
  font-family: var(--display);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-shadow: 0 1px 0 #000;
}

.wheel-offer-amount {
  display: flex;
  align-items: center;
  min-height: 1lh;
  gap: 6px;
  margin-bottom: 4px;
  font-family: var(--display);
  font-size: 1.6rem;
  line-height: 1.1;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.wheel-offer-amount .wheel-coin {
  width: 22px;
  height: 22px;
}

.wheel-offer-value {
  background-image: var(--gold-bevel);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 0 var(--gold-deep));
}

.wheel-offer-planets {
  display: flex;
}

.wheel-offer-planets:empty {
  display: none;
}

.wheel-offer-planets .pearl {
  width: 22px;
  height: 22px;
  font-size: 22px;
}

.wheel-offer-planets .pearl + .pearl {
  margin-left: -4px;
}

.wheel-continue,
.wheel-unlock {
  width: 100%;
  max-width: 240px;
  min-height: 56px;
  padding: 0 8px;
  border-radius: var(--radius);
  font-family: var(--display);
  font-size: 1.15rem;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.wheel-continue {
  border: 1px solid var(--wheel-skip-rim);
  border-top: 2px solid var(--wheel-skip-rim-top);
  border-bottom: 2px solid var(--wheel-skip-rim-bottom);
  background:
    linear-gradient(180deg, var(--wheel-skip-sheen), transparent 42%, var(--wheel-skip-shade) 48%),
    linear-gradient(180deg, var(--wheel-skip-fill-top), var(--wheel-skip-fill-middle) 55%, var(--wheel-skip-fill-bottom));
  box-shadow: inset 0 1px 3px var(--wheel-skip-highlight), inset 0 -3px 6px var(--wheel-skip-inset-shadow), 0 3px 0 var(--wheel-skip-lip);
  color: var(--wheel-light);
  text-shadow: 0 2px 1px var(--wheel-skip-label-shadow);
}

.wheel-unlock {
  border: 3px solid var(--gold);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.4), transparent 50%),
    linear-gradient(180deg, var(--go-light), var(--go) 60%, var(--go-dark));
  box-shadow: 0 0 0 1px var(--gold-deep), 0 4px 0 rgba(0, 0, 0, 0.6);
  color: var(--wheel-light);
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.5);
}

.wheel-continue:active,
.wheel-unlock:active {
  transform: translateY(2px);
}

.wheel-prize {
  display: flex;
  flex: none;
  flex-wrap: wrap;
  align-items: center;
  align-content: center;
  justify-content: center;
  gap: 2px 8px;
  min-height: 40px;
  font-family: var(--display);
  line-height: 1.1;
}

.wheel:has(#wheel-next:not([hidden])) .wheel-prize:empty {
  display: none;
}

.wheel-prize:not(:empty) {
  animation: pearl-prize 300ms ease-out;
}

.wheel-coin {
  flex: none;
  width: 30px;
  height: 30px;
  background: url("../art/ui/coin-gold.webp") center / contain no-repeat;
  filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.5));
}

.wheel-prize-text {
  font-size: 1.8rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  background-image: var(--gold-bevel);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 0 var(--gold-deep)) drop-shadow(0 0 6px rgba(255, 211, 77, 0.45));
}

.wheel-prize .pearl {
  width: 32px;
  height: 32px;
}

.wheel.cashback .wheel-prize {
  min-height: 64px;
}

.wheel.cosmic .wheel-prize { min-height: 64px; }

html:not(.landscape) .wheel.cosmic:not(.cashback) .wheel-result > .wheel-prize { min-height: 0; }
html:not(.landscape) .wheel.boosted .wheel-result { justify-content: flex-start; }
html:not(.landscape) .wheel.boosted:not(.cashback) .wheel-keys { display: none; }
html:not(.landscape) .wheel.cashback.boosted .wheel-keys { visibility: hidden; }

.wheel.cashback .wheel-stage {
  --stage: min(92vw, 360px, 46vh, calc(100vh - var(--safe-top) - var(--safe-bottom) - 364px));
}

.wheel-cashback {
  display: flex;
  flex-basis: 100%;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
}

.wheel-cashback-label {
  color: var(--text);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-shadow: 0 1px 0 #000;
}

.wheel-cashback-value {
  font-size: 1.2rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.03em;
  background-image: var(--gold-bevel);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 1px 0 var(--gold-deep));
}

.wheel-next {
  flex: none;
  padding: 5px 12px;
  border: 1px solid var(--gold-deep);
  border-radius: 8px;
  background: var(--bg-deep);
  color: var(--text);
  font-family: var(--display);
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-shadow: 0 1px 0 #000;
  white-space: nowrap;
}

.wheel-next[hidden] {
  display: none;
}

.wheel-keys {
  display: flex;
  flex: none;
  justify-content: center;
  width: 100%;
  min-height: 52px;
}

.wheel-skip {
  display: none;
  width: min(100%, 240px);
  min-height: 52px;
  border: 1px solid var(--wheel-skip-rim);
  border-top: 2px solid var(--wheel-skip-rim-top);
  border-bottom: 2px solid var(--wheel-skip-rim-bottom);
  border-radius: 10px;
  background:
    linear-gradient(180deg, var(--wheel-skip-sheen), transparent 42%, var(--wheel-skip-shade) 48%),
    linear-gradient(180deg, var(--wheel-skip-fill-top), var(--wheel-skip-fill-middle) 55%, var(--wheel-skip-fill-bottom));
  box-shadow: inset 0 1px 3px var(--wheel-skip-highlight), inset 0 -3px 6px var(--wheel-skip-inset-shadow), 0 3px 0 var(--wheel-skip-lip);
  color: var(--wheel-light);
  font-family: var(--display);
  font-size: 1.2rem;
  letter-spacing: 0.08em;
  text-shadow: 0 2px 1px var(--wheel-skip-label-shadow);
}

.wheel-skip:active {
  transform: translateY(2px);
}

.wheel.spinning .wheel-skip,
.wheel.boosting .wheel-skip {
  display: block;
}

.wheel.won:not(.boosting):not(.boosted) .wheel-keys {
  visibility: hidden;
}

.wheel.spinning .wheel-x,
.wheel.boosting .wheel-x,
.wheel.won:not(.boosting):not(.boosted) .wheel-x {
  visibility: hidden;
}

