:root {
  --bonus-wheel-launcher-resting-right: -36px;
  --bonus-wheel-launcher-active-right: 12px;
  --bonus-wheel-duration: 4200ms;
  --bonus-wheel-launcher-attract-cycle: 11200ms;
  --bonus-wheel-launcher-spin-sync-cycle: 22400ms;
  --bonus-wheel-launcher-roam-cycle: 38000ms;
  --bonus-wheel-launcher-roam-top: 156px;
  --bonus-wheel-launcher-roam-bottom: 654px;
}

html.x-bonus-wheel-open,
html.x-bonus-wheel-open body { overflow: hidden !important; }

.x-bonus-wheel-launcher {
  position: fixed;
  z-index: 805;
  top: calc(50% - 36px);
  right: var(--bonus-wheel-launcher-active-right);
  display: grid;
  place-items: center;
  box-sizing: border-box;
  width: 72px;
  height: 72px;
  min-height: 0;
  padding: 0;
  color: var(--menu-burger-text);
  background: transparent;
  border: 0;
  appearance: none;
  -webkit-appearance: none;
  font: inherit;
  cursor: pointer;
  isolation: isolate;
  -webkit-tap-highlight-color: transparent;
}
.x-bonus-wheel-launcher__visual {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  box-sizing: border-box;
  background: transparent;
  border: 2px solid var(--menu-burger-accent);
  border-radius: 50%;
  box-shadow:
    0 7px 20px rgb(0 0 0 / 46%),
    0 0 0 2px rgb(0 0 0 / 32%),
    inset 0 0 0 1px rgb(255 255 255 / 28%);
  transform: translate3d(calc(var(--bonus-wheel-launcher-active-right) - var(--bonus-wheel-launcher-resting-right)), 0, 0);
  transition: transform 220ms cubic-bezier(.2, .8, .2, 1);
  will-change: transform;
}
.x-bonus-wheel-launcher__disc {
  position: absolute;
  z-index: 0;
  inset: 0;
  background: var(--bonus-wheel-launcher-gradient);
  border-radius: 50%;
  will-change: transform;
}
.x-bonus-wheel-launcher__visual::before {
  position: absolute;
  z-index: 2;
  top: -8px;
  left: 50%;
  width: 0;
  height: 0;
  border-right: 5px solid transparent;
  border-top: 10px solid var(--menu-burger-accent);
  border-left: 5px solid transparent;
  filter: drop-shadow(0 1px 1px rgb(0 0 0 / 55%));
  transform: translateX(-50%);
  content: "";
}

.x-bonus-wheel-launcher__icon {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  box-sizing: border-box;
  width: 24px;
  height: 24px;
  color: var(--menu-burger-accent-text);
  background: var(--menu-burger-accent);
  border: 2px solid color-mix(in srgb, var(--menu-burger-accent) 35%, white);
  border-radius: 50%;
  box-shadow: 0 2px 5px rgb(0 0 0 / 42%);
  font-size: 0;
}
.x-bonus-wheel-launcher__copy {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@keyframes x-bonus-wheel-idle-spin {
  0% {
    transform: rotate(0deg);
    animation-timing-function: linear;
  }
  34% {
    transform: rotate(900deg);
    animation-timing-function: cubic-bezier(.55, 0, 1, .45);
  }
  36% {
    transform: rotate(1080deg);
    animation-timing-function: linear;
  }
  38% {
    transform: rotate(1440deg);
    animation-timing-function: linear;
  }
  40% {
    transform: rotate(2160deg);
    animation-timing-function: linear;
  }
  42% {
    transform: rotate(2770deg);
    animation-timing-function: linear;
  }
  44% {
    transform: rotate(3340deg);
    animation-timing-function: linear;
  }
  46% {
    transform: rotate(3870deg);
    animation-timing-function: linear;
  }
  47% {
    transform: rotate(4110deg);
    animation-timing-function: linear;
  }
  48% {
    transform: rotate(4300deg);
    animation-timing-function: linear;
  }
  49% {
    transform: rotate(4430deg);
    animation-timing-function: linear;
  }
  49.5% {
    transform: rotate(4475deg);
    animation-timing-function: linear;
  }
  50% {
    transform: rotate(4490deg);
    animation-timing-function: linear;
  }
  84% {
    transform: rotate(3590deg);
    animation-timing-function: cubic-bezier(.55, 0, 1, .45);
  }
  86% {
    transform: rotate(3410deg);
    animation-timing-function: linear;
  }
  88% {
    transform: rotate(3050deg);
    animation-timing-function: linear;
  }
  90% {
    transform: rotate(2330deg);
    animation-timing-function: linear;
  }
  92% {
    transform: rotate(1720deg);
    animation-timing-function: linear;
  }
  94% {
    transform: rotate(1150deg);
    animation-timing-function: linear;
  }
  96% {
    transform: rotate(620deg);
    animation-timing-function: linear;
  }
  97% {
    transform: rotate(380deg);
    animation-timing-function: linear;
  }
  98% {
    transform: rotate(190deg);
    animation-timing-function: linear;
  }
  99% {
    transform: rotate(60deg);
    animation-timing-function: linear;
  }
  99.5% {
    transform: rotate(15deg);
    animation-timing-function: linear;
  }
  100% { transform: rotate(0deg); }
}

@keyframes x-bonus-wheel-edge-peek {
  0%, 68% { transform: translate3d(calc(var(--bonus-wheel-launcher-active-right) - var(--bonus-wheel-launcher-resting-right)), 0, 0) rotate(0deg); }
  72% { transform: translate3d(42px, 0, 0) rotate(0deg); }
  76% { transform: translate3d(24px, 0, 0) rotate(-3deg); }
  80% { transform: translate3d(18px, 0, 0) rotate(2deg); }
  84% { transform: translate3d(22px, 0, 0) rotate(-1.5deg); }
  88% { transform: translate3d(18px, 0, 0) rotate(.8deg); }
  92% { transform: translate3d(24px, 0, 0) rotate(0deg); }
  96% { transform: translate3d(36px, 0, 0) rotate(0deg); }
  100% { transform: translate3d(calc(var(--bonus-wheel-launcher-active-right) - var(--bonus-wheel-launcher-resting-right)), 0, 0) rotate(0deg); }
}

@keyframes x-bonus-wheel-vertical-roam {
  0%, 100% { top: calc(50% - 36px); }
  14% { top: var(--bonus-wheel-launcher-roam-top); }
  33% { top: var(--bonus-wheel-launcher-roam-bottom); }
  49% { top: 31dvh; }
  64% { top: calc(var(--bonus-wheel-launcher-roam-bottom) - 48px); }
  81% { top: calc(var(--bonus-wheel-launcher-roam-top) + 50px); }
}

@media (prefers-reduced-motion: no-preference) {
  .x-bonus-wheel-launcher[data-bonus-wheel-motion="idle-attract"] {
    animation: x-bonus-wheel-vertical-roam var(--bonus-wheel-launcher-roam-cycle) cubic-bezier(.42, 0, .2, 1) infinite;
  }
  .x-bonus-wheel-launcher[data-bonus-wheel-motion="idle-attract"] .x-bonus-wheel-launcher__visual {
    animation: x-bonus-wheel-edge-peek var(--bonus-wheel-launcher-attract-cycle) ease-in-out 900ms infinite;
  }
  .x-bonus-wheel-launcher[data-bonus-wheel-motion="idle-attract"] .x-bonus-wheel-launcher__disc {
    animation: x-bonus-wheel-idle-spin var(--bonus-wheel-launcher-spin-sync-cycle) ease-in-out 900ms infinite both;
  }
}

@media (hover: hover) {
  .x-bonus-wheel-launcher:hover {
    animation-play-state: paused;
  }
  .x-bonus-wheel-launcher:hover .x-bonus-wheel-launcher__visual {
    transform: translate3d(0, 0, 0);
    animation: none !important;
  }
}

.x-bonus-wheel-launcher:focus-visible {
  animation-play-state: paused;
  outline: none;
}
.x-bonus-wheel-launcher:focus-visible .x-bonus-wheel-launcher__visual {
  transform: translate3d(0, 0, 0);
  animation: none !important;
}

.x-bonus-wheel {
  box-sizing: border-box;
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  color: var(--menu-burger-text);
  background: var(--menu-burger-bg);
  border: 0;
  overflow: hidden;
}

.x-bonus-wheel::backdrop { background: var(--menu-burger-backdrop); }
.x-bonus-wheel:not([open]) { display: none; }

.x-bonus-wheel__panel {
  box-sizing: border-box;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: 100%;
  height: 100%;
  padding: max(12px, env(safe-area-inset-top)) 14px max(16px, env(safe-area-inset-bottom));
  background:
    radial-gradient(circle at 50% 36%, color-mix(in srgb, var(--menu-burger-accent) 18%, transparent), transparent 45%),
    linear-gradient(180deg, var(--menu-burger-bg-elevated), var(--menu-burger-bg));
}

.x-bonus-wheel__header { position: relative; padding: 2px 44px 8px 2px; }
.x-bonus-wheel__header h2 { margin: 0; color: var(--menu-burger-text); font-size: 24px; line-height: 1.1; }
.x-bonus-wheel__header p { margin: 7px 0 0; color: var(--menu-burger-text-muted); font-size: 12px; line-height: 1.35; }

.x-bonus-wheel__close {
  position: absolute;
  top: 0;
  right: 0;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  color: var(--menu-burger-text);
  background: var(--menu-burger-surface);
  border: 1px solid var(--menu-burger-border);
  border-radius: 50%;
  font-size: 24px;
  cursor: pointer;
}

.x-bonus-wheel__stage {
  display: grid;
  align-content: center;
  justify-items: center;
  min-height: 0;
  padding: 8px 0;
}

.x-bonus-wheel__wheel-wrap {
  position: relative;
  width: min(82vw, 350px);
  aspect-ratio: 1;
}

.x-bonus-wheel__pointer {
  position: absolute;
  z-index: 3;
  top: -8px;
  left: 50%;
  width: 34px;
  height: 44px;
  transform: translateX(-50%);
  filter: drop-shadow(0 5px 4px rgb(0 0 0 / 42%));
}
.x-bonus-wheel__pointer::before {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--menu-burger-accent);
  clip-path: polygon(50% 100%, 0 0, 100% 0);
  content: "";
}

.x-bonus-wheel__disc {
  position: absolute;
  inset: 9px;
  border: 7px solid var(--menu-burger-accent);
  border-radius: 50%;
  box-shadow: 0 14px 45px rgb(0 0 0 / 44%), inset 0 0 0 4px rgb(255 255 255 / 16%);
  transition: transform var(--bonus-wheel-duration) cubic-bezier(.12,.62,.08,1);
  will-change: transform;
}

.x-bonus-wheel__labels {
  position: absolute;
  inset: 9px;
  z-index: 1;
  pointer-events: none;
  transition: transform var(--bonus-wheel-duration) cubic-bezier(.12,.62,.08,1);
  will-change: transform;
}
.x-bonus-wheel__label {
  position: absolute;
  width: 25%;
  color: #fff;
  font-size: clamp(8px, 2.2vw, 10px);
  font-weight: 800;
  line-height: 1.05;
  text-align: center;
  text-shadow: 0 1px 2px rgb(0 0 0 / 65%);
  transform: translate(-50%, -50%);
  transition: transform var(--bonus-wheel-duration) cubic-bezier(.12,.62,.08,1);
}

.x-bonus-wheel__spin {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 50%;
  display: grid;
  place-items: center;
  width: 92px;
  height: 92px;
  padding: 8px;
  color: var(--menu-burger-accent-text);
  background: var(--menu-burger-accent);
  border: 5px solid color-mix(in srgb, var(--menu-burger-accent) 45%, white);
  border-radius: 50%;
  box-shadow: 0 7px 20px rgb(0 0 0 / 42%);
  font: inherit;
  font-size: 15px;
  font-weight: 900;
  transform: translate(-50%, -50%);
  cursor: pointer;
}
.x-bonus-wheel__spin:disabled { cursor: wait; opacity: .82; }

.x-bonus-wheel__result {
  box-sizing: border-box;
  display: grid;
  width: min(100%, 390px);
  gap: 7px;
  margin-top: 12px;
  padding: 12px;
  background: var(--menu-burger-surface-strong);
  border: 1px solid var(--menu-burger-border);
  border-radius: var(--menu-burger-radius);
  text-align: center;
}
.x-bonus-wheel__result[hidden] { display: none; }
.x-bonus-wheel__result small { color: var(--menu-burger-text-muted); font-size: 10px; text-transform: uppercase; }
.x-bonus-wheel__result strong { color: var(--menu-burger-accent); font-size: 20px; }
.x-bonus-wheel__result-actions { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px; }
.x-bonus-wheel__offers,
.x-bonus-wheel__again {
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 10px;
  font: inherit;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}
.x-bonus-wheel__offers { color: var(--menu-burger-accent-text); background: var(--menu-burger-accent); border: 1px solid var(--menu-burger-accent); text-decoration: none; }
.x-bonus-wheel__again { color: var(--menu-burger-text); background: transparent; border: 1px solid var(--menu-burger-border); }
.x-bonus-wheel__terms { margin: 8px auto 0; max-width: 390px; color: var(--menu-burger-text-muted); font-size: 9px; line-height: 1.35; text-align: center; }

@media (min-width: 768px) {
  .x-bonus-wheel { top: 50%; left: 50%; width: min(430px, calc(100vw - 32px)); height: min(820px, calc(100dvh - 32px)); border: 1px solid var(--menu-burger-border); border-radius: 20px; transform: translate(-50%, -50%); }
}

@media (prefers-reduced-motion: reduce) {
  .x-bonus-wheel-launcher,
  .x-bonus-wheel-launcher__visual,
  .x-bonus-wheel-launcher__disc { animation: none !important; }
  .x-bonus-wheel__disc,
  .x-bonus-wheel__labels,
  .x-bonus-wheel__label { transition-duration: 1ms; }
}
