.lucky-wheel-console {
  width: min(100%, 660px);
  margin: 18px auto 0;
}

.lucky-wheel-shell {
  position: relative;
  width: min(100%, 610px);
  aspect-ratio: 1;
  margin: 0 auto;
  border: 1px solid rgba(117, 216, 233, .2);
  border-radius: 28px;
  background:
    radial-gradient(circle at 50% 47%, rgba(117, 216, 233, .13), transparent 26%),
    radial-gradient(circle at 50% 50%, rgba(26, 85, 109, .22), transparent 64%),
    linear-gradient(155deg, rgba(13, 39, 57, .92), rgba(5, 17, 28, .96));
  box-shadow: inset 0 0 50px rgba(62, 163, 192, .08), 0 24px 60px rgba(0, 0, 0, .24);
  overflow: hidden;
  isolation: isolate;
}

.lucky-wheel-shell::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 4%;
  border: 1px solid rgba(117, 216, 233, .12);
  border-radius: 50%;
  background:
    repeating-conic-gradient(from 0deg, rgba(117, 216, 233, .15) 0 1deg, transparent 1deg 10deg);
  mask: radial-gradient(circle, transparent 0 77%, #000 78%);
}

.wheel-disk {
  position: absolute;
  z-index: 1;
  inset: 8%;
  width: 84%;
  height: 84%;
  filter: drop-shadow(0 18px 30px rgba(0, 0, 0, .34));
  transform: rotate(0deg);
  transform-origin: 50% 50%;
  will-change: transform;
}

.wheel-rim-back { fill: #07131f; stroke: rgba(117, 216, 233, .24); stroke-width: 3; }
.wheel-rim { fill: none; stroke: #d0b26d; stroke-width: 4; stroke-dasharray: 3 9; opacity: .72; }
.wheel-core-glow { fill: url("#wheelCoreGlow"); stroke: rgba(117, 216, 233, .55); stroke-width: 2; }
.wheel-segment path { stroke: rgba(117, 216, 233, .3); stroke-width: 1.4; transition: fill .24s ease, filter .24s ease; }
.wheel-segment.segment-a path { fill: #12364b; }
.wheel-segment.segment-b path { fill: #0b273b; }
.wheel-segment.selected path {
  fill: #665526;
  stroke: #f0c979;
  filter: drop-shadow(0 0 12px rgba(240, 201, 121, .8));
}

.segment-icon, .segment-label {
  fill: #edf8fb;
  text-anchor: middle;
  dominant-baseline: central;
  pointer-events: none;
}

.segment-icon { font-size: 23px; }
.segment-label { fill: #bcd3dc; font-size: 11px; font-weight: 800; letter-spacing: .02em; }
.wheel-segment.selected .segment-label { fill: #fff1c5; }

.wheel-pointer {
  position: absolute;
  z-index: 7;
  top: 5.3%;
  left: 50%;
  width: 42px;
  height: 63px;
  transform: translateX(-50%);
  transform-origin: 50% 5%;
  filter: drop-shadow(0 8px 9px rgba(0, 0, 0, .42));
}

.wheel-pointer::before {
  content: "";
  position: absolute;
  inset: 0 5px 19px;
  border: 2px solid #fff0bd;
  background: linear-gradient(145deg, #fff0ba, #b58032 72%);
  clip-path: polygon(50% 0, 100% 36%, 72% 100%, 50% 86%, 28% 100%, 0 36%);
}

.wheel-pointer i {
  position: absolute;
  top: 10px;
  left: 50%;
  width: 13px;
  height: 13px;
  border: 2px solid #d9f8ff;
  background: #2daec6;
  transform: translateX(-50%) rotate(45deg);
}

.wheel-hub {
  position: absolute;
  z-index: 6;
  top: 50%;
  left: 50%;
  display: grid;
  width: 29%;
  aspect-ratio: 1;
  place-items: center;
  align-content: center;
  border: 1px solid rgba(117, 216, 233, .55);
  background:
    linear-gradient(145deg, rgba(26, 70, 95, .97), rgba(4, 18, 29, .98));
  color: var(--text);
  clip-path: polygon(50% 0, 88% 19%, 100% 57%, 73% 92%, 29% 100%, 0 65%, 9% 23%);
  box-shadow: inset 0 0 26px rgba(117, 216, 233, .16);
  transform: translate(-50%, -50%);
}

.wheel-h-mark {
  color: var(--cyan);
  font-size: clamp(24px, 6vw, 38px);
  font-weight: 950;
  line-height: 1;
  text-shadow: 0 0 16px rgba(117, 216, 233, .45);
}

.wheel-hub small { margin: 3px 0 5px; color: var(--muted); font-size: 8px; letter-spacing: .18em; }
.wheel-hub button {
  min-height: 31px;
  border: 1px solid rgba(117, 216, 233, .56);
  border-radius: 9px;
  background: rgba(117, 216, 233, .1);
  color: #dffaff;
  padding: 0 12px;
  font-size: clamp(10px, 2.7vw, 14px);
  font-weight: 900;
  box-shadow: 0 0 18px rgba(117, 216, 233, .12);
}

.wheel-hub button:disabled { cursor: wait; opacity: .78; }
.wheel-landing {
  position: absolute;
  z-index: 6;
  bottom: 5%;
  left: 50%;
  display: flex;
  max-width: 80%;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(117, 216, 233, .2);
  border-radius: 999px;
  background: rgba(4, 18, 29, .78);
  color: var(--muted);
  padding: 7px 12px;
  font-size: 11px;
  transform: translateX(-50%);
  backdrop-filter: blur(8px);
}

.wheel-landing span { color: var(--gold); }
.wheel-landing strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.has-landed .wheel-landing { border-color: rgba(240, 201, 121, .42); color: #fff2c7; }

.wheel-orbit {
  position: absolute;
  z-index: 0;
  border: 1px solid rgba(117, 216, 233, .22);
  border-radius: 50%;
  pointer-events: none;
}

.orbit-one { inset: 4.8%; }
.orbit-two { inset: 2.5%; border-style: dashed; opacity: .56; }
.is-awaiting .orbit-one, .is-spinning .orbit-one { animation: orbit-spin 2.2s linear infinite; border-top-color: var(--cyan); }
.is-awaiting .orbit-two, .is-spinning .orbit-two { animation: orbit-spin 3.3s linear infinite reverse; border-right-color: var(--mint); }
.is-spinning .wheel-pointer { animation: pointer-tick .14s ease-in-out infinite; }

.wheel-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin-top: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--line);
}

.wheel-stats > div { background: rgba(6, 20, 32, .94); padding: 13px; text-align: center; }
.wheel-stats span, .wheel-stats small { display: block; color: var(--muted); font-size: 10px; }
.wheel-stats strong { display: block; margin: 4px 0 2px; font-size: 20px; }
.wheel-controls {
  display: grid;
  grid-template-columns: minmax(180px, 280px) 1fr;
  gap: 14px;
  align-items: end;
  width: min(100%, 660px);
  margin: 14px auto 0;
}

.wheel-controls label { margin-top: 0; }
.wheel-control-note {
  display: grid;
  min-height: 64px;
  align-content: center;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(3, 13, 22, .4);
  color: var(--muted);
  padding: 11px 15px;
  font-size: 12px;
  line-height: 1.6;
}

.wheel-result-panel {
  display: grid;
  gap: 7px;
  width: min(100%, 660px);
  margin: 14px auto 0;
  border: 1px solid rgba(240, 201, 121, .3);
  border-radius: 17px;
  background: linear-gradient(120deg, rgba(89, 63, 22, .2), rgba(12, 39, 55, .72));
  padding: 16px;
}

.wheel-result-panel > div { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.wheel-result-panel span, .wheel-result-panel small { color: var(--muted); }
.wheel-result-panel strong { color: var(--gold); font-size: 23px; }
.wheel-result-panel > span { color: #f5dfaa; font-size: 12px; font-weight: 800; }

.wheel-particles { position: absolute; z-index: 8; inset: 50%; pointer-events: none; }
.wheel-particles i {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold);
  opacity: 0;
  transform: rotate(calc(var(--particle) * 30deg)) translateY(-180px);
}

.rare-hit .wheel-particles i { animation: particle-flare .8s ease-out both; animation-delay: calc(var(--particle) * 25ms); }
.rare-hit .wheel-hub { filter: drop-shadow(0 0 24px rgba(240, 201, 121, .56)); }

@keyframes orbit-spin { to { transform: rotate(360deg); } }
@keyframes pointer-tick {
  0%, 100% { transform: translateX(-50%) rotate(0); }
  50% { transform: translateX(-50%) rotate(7deg); }
}
@keyframes particle-flare {
  0% { opacity: 0; transform: rotate(calc(var(--particle) * 30deg)) translateY(-85px) scale(.4); }
  35% { opacity: 1; }
  100% { opacity: 0; transform: rotate(calc(var(--particle) * 30deg)) translateY(-245px) scale(1.5); }
}

@media (max-width: 560px) {
  .lucky-wheel-shell { border-radius: 21px; }
  .wheel-disk { inset: 6%; width: 88%; height: 88%; }
  .wheel-pointer { top: 3.2%; transform: translateX(-50%) scale(.82); }
  .segment-icon { font-size: 21px; }
  .segment-label { font-size: 10px; }
  .wheel-hub { width: 31%; }
  .wheel-hub button { min-height: 28px; padding: 0 8px; }
  .wheel-landing { bottom: 3%; }
  .wheel-controls { grid-template-columns: 1fr; }
  .wheel-stats > div { padding: 10px 7px; }
  .wheel-stats strong { font-size: 17px; }
}

@media (prefers-reduced-motion: reduce) {
  .wheel-orbit, .wheel-pointer, .wheel-particles i { animation: none !important; }
  .wheel-segment path { transition: none; }
}
