/* WK | GTA-style radial link wheel (shared component)
   - Auto-spreads any number of links
   - Idle rotation (subtle)
   - Hover expands + shows labels
*/

.wk-wheel-wrap {
  --wheel-size: 420px;
  --radius: 150px;
  --radius-hover: 175px;
  --count: 12;
  --spin-seconds: 28s;

  display: grid;
  place-items: center;
  margin: 3rem auto 4rem;
  padding: 0 1rem;
}

.wk-wheel {
  width: min(var(--wheel-size), 92vw);
  aspect-ratio: 1 / 1;
  position: relative;
  border-radius: 999px;
}

/* optional soft ring */
.wk-wheel::before {
  content: "";
  position: absolute;
  inset: 8%;
  border-radius: 999px;
  border: 1px solid rgba(10, 26, 47, 0.14);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(6px);
}

.wk-wheel-ring {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  animation: wkWheelSpin var(--spin-seconds) linear infinite;
  transform-origin: center;
}

.wk-wheel:hover .wk-wheel-ring,
.wk-wheel:focus-within .wk-wheel-ring {
  animation-play-state: paused;
}

.wk-wheel-center {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 104px;
  height: 104px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  z-index: 3;
}

.wk-wheel-center::before {
  content: "";
  position: absolute;
  inset: -10px;
  border-radius: 999px;
  border: 1px solid rgba(10, 26, 47, 0.18);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.14);
  background: #ffffff;
}

.wk-wheel-center img {
  width: 74px;
  height: 74px;
  border-radius: 16px;
  z-index: 1;
}

.wk-wheel-center .wk-wheel-hint {
  position: absolute;
  top: -54px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.85rem;
  background: #0A1A2F;
  color: #F1F5F8;
  padding: 8px 12px;
  border-radius: 999px;
  white-space: nowrap;
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.18);
}

.wk-wheel-center .wk-wheel-hint::after {
  content: "";
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 7px;
  border-style: solid;
  border-color: #0A1A2F transparent transparent transparent;
}

.wk-wheel:hover .wk-wheel-hint,
.wk-wheel:focus-within .wk-wheel-hint {
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
}

.wk-wheel-item {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 58px;
  height: 58px;
  margin: -29px;
  border-radius: 999px;
  z-index: 2;
  display: grid;
  place-items: center;
  text-decoration: none;
  outline: none;

  transform:
    rotate(calc(360deg / var(--count) * var(--i)))
    translate(var(--radius))
    rotate(calc(-360deg / var(--count) * var(--i)));

  transition:
    transform 260ms ease,
    filter 220ms ease,
    box-shadow 220ms ease;
}

.wk-wheel:hover .wk-wheel-item,
.wk-wheel:focus-within .wk-wheel-item {
  transform:
    rotate(calc(360deg / var(--count) * var(--i)))
    translate(var(--radius-hover))
    rotate(calc(-360deg / var(--count) * var(--i)));
}

.wk-wheel-item img {
  width: 38px;
  height: 38px;
}

.wk-wheel-item {
  background: #ffffff;
  border: 1px solid rgba(10, 26, 47, 0.14);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.10);
}

.wk-wheel-item:hover,
.wk-wheel-item:focus-visible {
  box-shadow: 0 12px 22px rgba(0, 0, 0, 0.16);
  filter: brightness(1.02);
  transform:
    rotate(calc(360deg / var(--count) * var(--i)))
    translate(calc(var(--radius-hover) + 8px))
    rotate(calc(-360deg / var(--count) * var(--i)))
    scale(1.06);
}

/* labels */
.wk-wheel-item::after {
  content: attr(data-label);
  position: absolute;
  left: 50%;
  top: 100%;
  transform: translate(-50%, 10px);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #0A1A2F;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(10, 26, 47, 0.14);
  padding: 6px 10px;
  border-radius: 999px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.14);
}

.wk-wheel-item:hover::after,
.wk-wheel-item:focus-visible::after,
.wk-wheel:focus-within .wk-wheel-item:focus-visible::after {
  opacity: 1;
}

@keyframes wkWheelSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@media (max-width: 520px) {
  .wk-wheel-wrap {
    --wheel-size: 360px;
    --radius: 125px;
    --radius-hover: 145px;
  }
  .wk-wheel-center {
    width: 92px;
    height: 92px;
  }
  .wk-wheel-center img {
    width: 66px;
    height: 66px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .wk-wheel-ring {
    animation: none;
  }
}
