
.wheel {
  position: fixed;
  inset: 0;
  z-index: 46;
  display: none;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  overflow: clip;
  padding: calc(var(--safe-top) + 8px) 16px calc(var(--safe-bottom) + 12px);
  background: radial-gradient(ellipse 95% 70% at 50% 58%, var(--bg) 35%, var(--bg-deep));
}

.wheel::before,
.wheel::after {
  content: "";
  position: absolute;
  top: -10%;
  height: 120%;
  background: linear-gradient(180deg, var(--violet), transparent 70%);
  opacity: 0.22;
  pointer-events: none;
}

.wheel::before {
  left: 4%;
  width: 26%;
  transform: skewX(-16deg);
}

.wheel::after {
  right: 8%;
  width: 14%;
  transform: skewX(12deg);
  opacity: 0.16;
}

.wheel.open {
  display: flex;
  animation: wheel-in 260ms ease-out;
}

.wheel.open .wheel-panel {
  animation: wheel-panel-in 480ms cubic-bezier(0.22, 1, 0.36, 1);
}

/* Opened in full (body.wheel-covering: its fade in has ended), the opaque hall
   keeps the contents of the floor or machine under it, still laid out,
   from painting: WebKit repainted them every frame of the turning wheel. */
body.wheel-covering > :is(#lobby, #app) > * {
  visibility: hidden;
}

.wheel.closing {
  display: flex;
  pointer-events: none;
  animation: wheel-out 220ms ease-in forwards;
}

.wheel-panel {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: 400px;
  max-height: 100%;
}

.wheel-sign {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
  margin-bottom: 8px;
  padding: 2px 14px 7px;
  border: 2px solid var(--neon-pink);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--lacquer), var(--red-dark));
  box-shadow: 0 0 0 1px var(--red-dark), 0 0 12px var(--magenta), inset 0 0 8px var(--magenta), 0 4px 0 rgba(0, 0, 0, 0.5);
}

.wheel-sign-bolt {
  flex: none;
  width: 11px;
  height: 32px;
  filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.6));
}

.wheel-sign-bolt.flip {
  transform: scaleX(-1);
}

.wheel-title {
  font-family: var(--display);
  font-size: 1.9rem;
  line-height: 1.15;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  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 var(--magenta));
}

.wheel-day-plate {
  position: absolute;
  left: 50%;
  bottom: -12px;
  padding: 1px 10px;
  transform: translateX(-50%);
  border: 1px solid var(--gold-deep);
  border-radius: 6px;
  background: var(--bg-deep);
  color: var(--text);
  font-family: var(--display);
  font-size: 0.75rem;
  line-height: 1.3;
  letter-spacing: 0.08em;
  text-shadow: 0 1px 0 #000;
  white-space: nowrap;
}

.wheel-day-plate:empty {
  display: none;
}

.wheel.cosmic .wheel-day-plate {
  transition: opacity 220ms ease-in, visibility 220ms;
}

.wheel-head {
  display: grid;
  flex: none;
  width: 100%;
  max-width: 360px;
  justify-items: center;
}

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

.wheel-ladder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.wheel-offer-note {
  align-self: center;
  max-width: 300px;
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.3;
  text-align: center;
}

.wheel.cosmic.boosted .wheel-offer-note {
  visibility: hidden;
}

#wheel-prize-status {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.wheel-receipt {
  align-self: center;
  width: 100%;
  padding: 3px 10px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  background: var(--bg-deep);
  font-family: var(--display);
  font-size: 0.9rem;
  line-height: 1.2;
}

.wheel:not(.boosted) .wheel-receipt { visibility: hidden; }

.wheel-receipt-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  padding: 1px 0;
  border-bottom: 1px solid var(--hairline);
}

.wheel-receipt-label { color: var(--muted); text-shadow: 0 1px 0 #000; }
.wheel-receipt-value { color: var(--gold-light); font-variant-numeric: tabular-nums; white-space: nowrap; }
.wheel-receipt-value:has(.pearl) { display: flex; gap: 3px; }
.wheel-receipt-value .pearl { width: 16px; height: 16px; font-size: 16px; }

.wheel-receipt-row:last-child {
  border-bottom: 0;
}

.wheel-receipt-row:last-child .wheel-receipt-value {
  font-size: 1.2rem;
  line-height: 1.1;
}

.wheel-purchase-label {
  flex-basis: 100%;
  color: var(--text);
  font-size: 0.85rem;
  text-align: center;
  letter-spacing: 0.08em;
}

.wheel-offer-note,
.wheel.cosmic .wheel-ladder,
.wheel.cosmic .wheel-day-plate {
  visibility: hidden;
  opacity: 0;
}

.wheel.cosmic .wheel-ladder {
  transition: opacity 220ms ease-in, visibility 220ms;
}

.wheel-offer-note {
  transform: translateY(8px);
  transition: opacity 200ms ease-in, transform 200ms ease-in, visibility 200ms;
}

.wheel.cosmic .wheel-offer-note {
  visibility: visible;
  opacity: 1;
  transform: none;
  transition: opacity 380ms ease-out 180ms, transform 560ms cubic-bezier(0.22, 1, 0.36, 1) 180ms, visibility 380ms 180ms;
}

.wheel-days {
  position: relative;
  display: grid;
  flex: none;
  grid-auto-columns: 1fr;
  grid-auto-flow: column;
  gap: 8px;
  width: 100%;
  margin-top: 4px;
}

.wheel-day {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.wheel-day::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 32px;
  border: 1px solid var(--gold-deep);
  border-radius: 8px;
  background: linear-gradient(180deg, var(--lacquer), var(--bg-deep));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 2px 0 rgba(0, 0, 0, 0.5);
}

.wheel-day-prize {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 32px;
}

.wheel-day-prize .pearl {
  width: 22px;
  height: 22px;
  font-size: 22px;
}

.wheel-day-prize .pearl + .pearl {
  margin-left: -4px;
}

.wheel-day-name {
  position: relative;
  order: 1;
  color: var(--text);
  font-family: var(--display);
  font-size: 0.75rem;
  line-height: 1.2;
  letter-spacing: 0.04em;
  text-shadow: 0 1px 0 #000;
}

.wheel-day.done .wheel-day-prize .pearl {
  opacity: 0.35;
  filter: saturate(0.4);
}

.wheel-day.done .wheel-day-prize::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 9px;
  height: 18px;
  margin: -12px 0 0 -5px;
  border: solid var(--jade);
  border-width: 0 4px 4px 0;
  border-radius: 1px;
  transform: rotate(40deg);
  filter: drop-shadow(1px 1px 0 rgba(0, 0, 0, 0.8));
}

.wheel-day.today {
  z-index: 1;
}

.wheel-day.today::before,
.wheel-day.today .wheel-day-prize {
  transform: scale(1.12);
}

.wheel-day.today::before {
  border: 2px solid var(--wheel-light);
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.75), inset 0 0 6px rgba(255, 255, 255, 0.25);
}

.wheel-day.today .wheel-day-name {
  color: var(--gold-light);
  text-shadow: 0 1px 1px var(--bg-deep), 0 0 4px #000;
}

.wheel-track {
  position: absolute;
  left: 0;
  right: 0;
  top: 35px;
  z-index: 2;
  height: 6px;
  overflow: hidden;
  border-radius: 3px;
  background: var(--bg-deep);
  box-shadow: inset 0 1px 2px #000, 0 0 0 1px rgba(255, 211, 77, 0.18);
}

.wheel-track-fill {
  display: block;
  width: var(--fill, 0%);
  height: 100%;
  border-radius: 3px;
  background:
    repeating-linear-gradient(115deg, rgba(255, 255, 255, 0.45) 0 2px, transparent 2px 6px),
    var(--neon-cyan);
  box-shadow: 0 0 6px var(--neon-cyan);
}

.wheel-streak {
  flex: none;
  min-height: 1.25em;
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.25;
  text-align: center;
}

