/* Колесо RubUP (tasks.css): пин сверху, крутится .tk-wheel__disc */

.rb-battle-wheel .tk-wbox__stage {
  container-type: inline-size;
}

.rb-wheel-wa {
  position: relative;
  aspect-ratio: 1;
  isolation: isolate;
  width: 100%;
}

.rb-wheel-wa .tk-wheel__sway,
.rb-wheel-wa .tk-wheel__disc {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.rb-wheel-wa .tk-wheel__disc {
  border-radius: 50%;
  transform: rotate(var(--tk-rot, 0deg));
  will-change: transform;
}

.rb-wheel-wa .wheel-disc canvas {
  display: block;
  width: 100%;
  height: auto;
}

.rb-wheel-wa::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 1%;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0.55;
  box-shadow:
    0 0 0 1px rgba(150, 160, 255, 0.22),
    0 10px 40px rgba(91, 116, 254, 0.28),
    0 0 70px rgba(123, 92, 240, 0.2);
  transition: opacity 0.35s ease;
}

.rb-battle-wheel.is-ready .rb-wheel-wa::before {
  animation: rb-tk-halo 2.4s ease-in-out infinite alternate;
}

.rb-battle-wheel.is-spinning .rb-wheel-wa::before {
  opacity: 1;
}

@keyframes rb-tk-halo {
  from {
    opacity: 0.45;
  }
  to {
    opacity: 1;
  }
}

.rb-battle-wheel.is-ready:not(.is-spinning) .tk-wheel__sway {
  animation: rb-tk-sway 3.2s ease-in-out infinite alternate;
}

@keyframes rb-tk-sway {
  from {
    transform: rotate(-4deg);
  }
  to {
    transform: rotate(4deg);
  }
}

.rb-battle-wheel.is-spinning .tk-wheel__sway {
  animation: none;
  transform: none;
}

.rb-wheel-wa .tk-wheel__pin {
  position: absolute;
  z-index: 12;
  top: -2%;
  left: 50%;
  width: 13%;
  aspect-ratio: 32 / 42;
  transform: translateX(-50%);
  transform-origin: 50% 32%;
  filter: drop-shadow(0 4px 8px rgba(4, 6, 30, 0.55));
  pointer-events: none;
}

.rb-wheel-wa .tk-wheel__pin svg {
  display: block;
  width: 100%;
  height: 100%;
}

.rb-battle-wheel.is-ready:not(.is-spinning) .tk-wheel__pin {
  animation: rb-tk-nod 1.6s ease-in-out infinite;
}

@keyframes rb-tk-nod {
  0%,
  70%,
  100% {
    transform: translateX(-50%) rotate(0deg);
  }
  80% {
    transform: translateX(-50%) rotate(-8deg);
  }
  90% {
    transform: translateX(-50%) rotate(4deg);
  }
}

.rb-wheel-wa .wheel-stake-preview {
  z-index: 6;
}

.rb-battle-wheel.is-spinning .wheel-stake-preview {
  opacity: 0.92;
}

@media (prefers-reduced-motion: reduce) {
  .rb-battle-wheel.is-ready .tk-wheel__sway,
  .rb-battle-wheel.is-ready .tk-wheel__pin,
  .rb-battle-wheel.is-ready .rb-wheel-wa::before {
    animation: none !important;
  }

  .rb-wheel-wa .tk-wheel__disc {
    transition: none !important;
  }
}
