*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
  background: #0d1117;
}

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* PC frame: 1440×830, wheel 396×396 centered */
.demo {
  width: 100%;
  min-height: 100dvh;
  margin: 0 auto;
}

.game {
  position: relative;
  width: 100%;
  min-height: 100dvh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.game__bg {
  position: absolute;
  inset: -24px;
  background: url("assets/bg.png") center / cover no-repeat;
  filter: blur(12px);
  transform: scale(1.06);
}

.game__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

/* Figma wheel 380px: disc/rim at left=25.91 top=26.87 size=326.263 */
.wheel {
  --wheel-size: min(27.5vw, 396px);
  --disc-size: 85.86%;
  position: relative;
  z-index: 1;
  width: var(--wheel-size);
  height: var(--wheel-size);
  flex-shrink: 0;
  overflow: hidden;
}

.wheel__disc {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  transform-origin: center center;
  will-change: transform;
  z-index: 1;
}

.wheel__disc-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: fill;
  pointer-events: none;
  user-select: none;
}

/* Tire (Subtract) — full wheel size */
.wheel__tire {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: fill;
  pointer-events: none;
  user-select: none;
  z-index: 2;
}

/* Metallic rim (обод) — centered, 85.86% per Figma */
.wheel__rim {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--disc-size);
  height: var(--disc-size);
  transform: translate(-50%, -50%);
  display: block;
  object-fit: fill;
  pointer-events: none;
  user-select: none;
  z-index: 3;
}

/* Hub group — Figma "arrow": 59.495×87.323 at (159.77, 132.9) in 380px wheel */
.wheel__hub-group {
  position: absolute;
  left: 42.05%;
  top: 34.97%;
  width: 15.66%;
  height: 22.98%;
  z-index: 5;
}

/* Pointer — top of group, behind the hub circle */
.wheel__pointer {
  position: absolute;
  top: 0;
  left: 27.42%;
  right: 27.42%;
  bottom: 63.74%;
  width: auto;
  height: auto;
  pointer-events: none;
  user-select: none;
  z-index: 1;
}

/* Click target over the hub (center) */
.wheel__btn {
  position: absolute;
  top: 31.87%;
  left: 0;
  right: 0;
  bottom: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  z-index: 2;
  outline: none;
  transition: transform 0.2s cubic-bezier(0.17, 0.67, 0.83, 0.67);
  -webkit-tap-highlight-color: transparent;
  transform-origin: center center;
}

.wheel__btn:hover {
  transform: scale(1.1);
}

.wheel__btn:active {
  transform: scale(0.95);
}

.wheel.is-spinning .wheel__btn {
  cursor: wait;
  pointer-events: none;
  transform: scale(1);
}

.wheel__hub {
  width: 100%;
  height: 100%;
  display: block;
}

@keyframes arrows-move {
  0% { transform: translateX(-2px); opacity: 0.7; }
  50% { transform: translateX(2px); opacity: 1; }
  100% { transform: translateX(-2px); opacity: 0.7; }
}

.wheel__arrows {
  animation: arrows-move 1.5s infinite ease-in-out;
}

/* Mobile frame: 390×844, wheel 380×380 — horizontal center in Figma */
@media (max-width: 767px) {
  .wheel {
    --wheel-size: min(97.4vw, 380px);
  }
}
