.welcome-wheel {
  --wheel-art: min(100%, 321px, 44dvh);
  width: min(416px, calc(100% - 19px));
  max-width: none;
  max-height: calc(100dvh - 20px);
  margin: auto;
  overflow-y: auto;
  scrollbar-width: thin;
  color: #f4f3ff;
  background:
    radial-gradient(ellipse at 62% 42%, #383358d9, transparent 72%),
    linear-gradient(150deg, #20263c, #151a2b 65%, #202039);
  border: 1px solid #a6aceb90;
  border-radius: 23px;
  padding: 17px 17px 14px;
  box-shadow:
    inset 0 1px #e5e1ff71,
    0 25px 87px #030817c5;
}
.welcome-wheel::backdrop {
  background: #050717c3;
  backdrop-filter: blur(8px);
}
.welcome-wheel[open] {
  animation: wheel-open 0.38s var(--snap);
}
@keyframes wheel-open {
  from {
    opacity: 0.27;
    transform: translateY(17px) scale(0.96);
  }
}

.wheel-head {
  position: relative;
  text-align: center;
}
.wheel-head h2 {
  margin: 9px 26px 6px;
  font: italic 800 clamp(33px, 11vw, 55px)/0.91 var(--display);
  letter-spacing: -0.014em;
  color: #f5f7ff;
  text-shadow: 0 4px 22px #9b9af274;
}
.wheel-head h2 em {
  color: #b6f5ed;
}
.wheel-head p {
  color: #d2cbea;
  font-size: 12px;
}
.wheel-close {
  display: grid;
  place-items: center;
  position: absolute;
  top: -6px;
  right: -6px;
  width: 34px;
  height: 34px;
  border: 1px solid #c3b8f450;
  border-radius: 10px;
  color: #ece2ff;
  background: #43395d9e;
}
.wheel-close .icon {
  width: 18px;
  height: 18px;
}

.wheel-stage {
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  margin: 7px auto;
  padding: 6px 4px 3px;
}
.wheel-glow,
.wheel-stars {
  position: absolute;
  z-index: -1;
  inset: -4px -7px;
  pointer-events: none;
}
.wheel-glow {
  background:
    radial-gradient(ellipse at 45% 52%, #c48af76b, transparent 55%),
    radial-gradient(ellipse at 56% 47%, #73dcf470, transparent 69%);
  opacity: 0.64;
  border-radius: 100%;
  animation: wheel-glow 4s ease-in-out infinite alternate;
}
@keyframes wheel-glow {
  to {
    opacity: 1;
    transform: scale(1.06);
  }
}
.wheel-stars {
  background:
    radial-gradient(circle, #eae9ff 0 1.5px, transparent 2.3px) 7% 22% / 73px
      93px no-repeat,
    radial-gradient(circle, #d8b1ff 0 1px, transparent 1.8px) 100% 20% / 36px
      98px no-repeat,
    radial-gradient(circle, #a3ebee 0 2px, transparent 2.5px) 7% 76% / 33px 49px
      no-repeat,
    radial-gradient(circle, #ffe2fa 0 1px, transparent 1.8px) 86% 87% / 40px
      35px no-repeat,
    radial-gradient(circle, #c9e8ff 0 1px, transparent 1.8px) 13% 90% / 72px
      66px no-repeat,
    radial-gradient(circle, #af99ff 0 2px, transparent 2.9px) 95% 74% / 25px
      43px no-repeat;
  animation: stars-drift 4s ease-in-out infinite alternate;
}
@keyframes stars-drift {
  to {
    transform: translateY(-6px);
    opacity: 0.54;
  }
}

.wheel-rig {
  position: relative;
  width: var(--wheel-art);
  aspect-ratio: 1;
}
.wheel-rotor {
  position: absolute;
  inset: 0;
  will-change: transform;
  border-radius: 50%;
  box-shadow:
    0 5px #5f739e,
    0 9px 18px #080c1b85;
}
.wheel-rotor canvas {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
}
.wheel-sectors {
  position: absolute;
  inset: 0;
}
.wheel-slot {
  position: absolute;
  transform: translate(-50%, -50%) rotate(var(--counter-turn, 0deg));
  min-width: 36px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 0;
  color: #100f25;
  text-align: center;
  text-shadow: none;
  font-weight: 850;
}
.wheel-slot b {
  font: italic 800 clamp(17px, 5vw, 26px)/1 var(--display);
}
.wheel-slot small {
  font:
    850 8px/1.02 system-ui,
    sans-serif;
  letter-spacing: 0.09em;
}
.wheel-slot img {
  width: clamp(25px, 9vw, 39px);
  height: clamp(25px, 9vw, 39px);
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 1px 1px #34265150);
}
.wheel-hub {
  position: absolute;
  inset: 41.8%;
  border-radius: 50%;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: linear-gradient(150deg, #b7caef, #8092c7);
  border: 2px solid #eceaff;
  box-shadow:
    0 3px #53668f,
    inset 0 1px #ffffffd9;
}
.wheel-hub img {
  width: 73%;
  height: auto;
  border-radius: 50%;
}
.wheel-pointer {
  position: absolute;
  z-index: 2;
  top: -1%;
  left: calc(50% - 13px);
  width: 26px;
  height: 32px;
  filter: drop-shadow(0 1px 4px #110e31bb);
  transform-origin: 50% 17%;
}
.wheel-pointer i {
  display: block;
  height: 100%;
  clip-path: polygon(8% 5%, 92% 5%, 98% 25%, 50% 100%, 2% 25%);
  background: linear-gradient(130deg, #fffff6, #cbbdfa 52%, #7766cc);
}
.wheel-stage[data-phase="spinning"] .wheel-glow {
  animation-duration: 0.64s;
}
.wheel-stage[data-phase="prize"] .wheel-pointer i {
  background: linear-gradient(115deg, #effffb, #9bf6de, #63bdba);
}
.wheel-winning {
  position: absolute;
  inset: 2.4%;
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
  background: conic-gradient(
    from -15deg,
    #ffffff50 0deg,
    color-mix(in srgb, var(--win, #b5efea) 42%, transparent) 16deg,
    #ffffff65 29deg,
    transparent 30deg
  );
  mask-image: radial-gradient(circle, transparent 18%, #000 40%);
  mix-blend-mode: screen;
}
.wheel-stage[data-phase="prize"] .wheel-winning {
  opacity: 1;
  animation: prize-sweep 0.67s ease-out;
}
@keyframes prize-sweep {
  0% {
    opacity: 0;
  }
  30% {
    opacity: 1;
    filter: brightness(1.7);
  }
}
.wheel-sparks {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}
.wheel-sparks i {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: rotate(var(--bearing));
  animation: spark-flight 0.86s var(--twinkle) ease-out both;
}
.wheel-sparks i::before {
  content: "";
  position: absolute;
  top: 47%;
  left: 49%;
  width: 5%;
  height: 2%;
  border-radius: 60%;
  transform: translateY(-1800%) rotate(58deg);
  background: #f6fbff;
  box-shadow: 0 0 12px 3px var(--win, #b3f8eb);
  animation: spark-thrust 0.8s var(--twinkle) ease-out both;
}
.wheel-sparks i:nth-child(even)::before {
  width: 2.6%;
  height: 2.6%;
}
@keyframes spark-flight {
  15%,
  37% {
    opacity: 1;
  }
}
@keyframes spark-thrust {
  from {
    transform: translateY(-250%) scale(0.3) rotate(38deg);
  }
  to {
    transform: translateY(-2340%) scale(0.15) rotate(95deg);
  }
}

.wheel-showcase {
  margin: 3px 0 6px;
}
.wheel-showcase h3 {
  margin-bottom: 4px;
  color: #c9c6e8;
  font-size: 11px;
}
.wheel-gifts {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 4px;
  padding: 0;
  margin: 0;
  list-style: none;
}
.wheel-gift {
  display: grid;
  place-items: center;
  min-height: 49px;
}
.wheel-gift .motion-art {
  width: min(100%, 43px);
  height: auto;
  aspect-ratio: 1;
}
.wheel-status {
  margin: 7px 0;
  min-height: 16px;
  color: #d4cdeb;
  font-size: 11px;
  font-weight: 740;
  text-align: center;
}
.spin-wheel {
  min-height: 43px;
  width: 100%;
  justify-content: center;
  border-color: #e3d3ff;
  color: #181737;
  background: linear-gradient(112deg, #cdd3ff, #bfa3ff 56%, #a0edec);
  box-shadow:
    inset 0 1px #ffffffb9,
    0 5px 20px #9c85e45f;
}
.spin-wheel:hover:not(:disabled) {
  background: #cdc7ff;
}
.wheel-result {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  gap: 7px;
  overflow: hidden;
  border-radius: 12px;
  min-height: 47px;
  padding: 4px 8px;
  border: 1px solid color-mix(in srgb, var(--prize) 71%, #b3a1e9);
  background: linear-gradient(
    118deg,
    color-mix(in srgb, var(--prize) 32%, #232445),
    #29314b 67%
  );
  box-shadow: 0 0 21px color-mix(in srgb, var(--prize) 28%, transparent);
  animation: wheel-prize 0.52s var(--snap);
}
.wheel-result::after {
  position: absolute;
  content: "";
  z-index: -1;
  inset: -15%;
  background: linear-gradient(
    112deg,
    transparent 19%,
    #f4f3ff67 50%,
    transparent 69%
  );
  animation: reward-spark 0.92s var(--snap) both;
}
.wheel-result .motion-art {
  height: 40px;
  width: 40px;
}
#wheel-result-art:empty {
  display: none;
}
.wheel-result strong,
.wheel-result span {
  display: block;
}
.wheel-result strong {
  font: italic 800 22px/1.06 var(--display);
  color: #f9fbff;
}
.wheel-result span {
  color: #dedafa;
  font-size: 11px;
  margin-top: 2px;
}
@keyframes wheel-prize {
  from {
    opacity: 0.31;
    transform: translateY(7px) scale(0.96);
  }
  63% {
    transform: translateY(-1px) scale(1.015);
  }
}
.motion-paused .wheel-glow,
.motion-paused .wheel-stars {
  animation-play-state: paused;
}

.gift-collection {
  margin-top: 13px;
}
.gift-collection .ranks-head {
  margin-bottom: 7px;
}
.gift-list {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(105px, 1fr));
  gap: 7px;
}
.gift-list:empty {
  margin: 0;
}
.gift-list li {
  min-height: 89px;
  display: grid;
  place-items: center;
  position: relative;
  text-align: center;
  padding: 5px;
  background: radial-gradient(
    ellipse at 50% 28%,
    color-mix(in srgb, var(--gift) 22%, #203045),
    #162132 87%
  );
  border: 1px solid #b6cff339;
  border-radius: 10px;
}
.gift-list span {
  font-size: 11px;
  color: #e1ecff;
}
.gift-list b {
  position: absolute;
  right: 5px;
  top: 4px;
  font-size: 11px;
  color: var(--gift);
}
#wheel-points:empty {
  display: none;
}

@media (max-width: 400px) {
  .welcome-wheel {
    padding: 13px 12px 11px;
  }
  .wheel-gift {
    min-height: 43px;
  }
}
@media (max-height: 655px) {
  .wheel-head h2 {
    font-size: 39px;
  }
  .wheel-showcase {
    margin-block: 2px 4px;
  }
  .wheel-gift {
    min-height: 36px;
  }
  .wheel-gift .motion-art {
    width: min(100%, 34px);
  }
  .wheel-result {
    min-height: 42px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .wheel-glow,
  .wheel-stars,
  .wheel-winning,
  .wheel-sparks * {
    animation: none !important;
  }
}
