:root {
  --rim: #f0d8a8;
  --rim-shadow: rgba(0, 0, 0, 0.5);
  --hud-bg: rgba(10, 14, 20, 0.54);
  --hud-border: rgba(255, 255, 255, 0.18);
  --text-main: #f7f1df;
  --text-muted: #b2c2d1;
  --winner: #ffe28a;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: transparent;
  font-family: 'Trebuchet MS', 'Segoe UI', sans-serif;
}

.stage {
  width: min(84vw, 1450px);
  margin: 0 auto;
  height: 100%;
  display: grid;
  grid-template-columns: 1fr minmax(260px, 18vw);
  align-items: center;
  justify-items: center;
  padding: 2vh 2vw;
  gap: 1.2vw;
}

.wheel-shell {
  position: relative;
  width: min(76vh, 58vw);
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  border: 10px solid var(--rim);
  box-shadow:
    0 18px 35px var(--rim-shadow),
    inset 0 0 0 8px rgba(255, 255, 255, 0.07);
  background:
    radial-gradient(circle at 25% 20%, rgba(255, 214, 146, 0.2), transparent 44%),
    radial-gradient(circle at 75% 80%, rgba(73, 174, 183, 0.2), transparent 50%);
}

#wheelCanvas {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 50%;
}

.pointer {
  position: absolute;
  top: -20px;
  left: 50%;
  width: 0;
  height: 0;
  transform: translateX(-50%);
  border-left: 24px solid transparent;
  border-right: 24px solid transparent;
  border-top: 48px solid #ff9a5b;
  filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.45));
  z-index: 20;
}

.hud {
  align-self: stretch;
  width: min(360px, 100%);
  padding: 18px 16px;
  border-radius: 18px;
  background: var(--hud-bg);
  border: 1px solid var(--hud-border);
  color: var(--text-main);
  display: flex;
  flex-direction: column;
  gap: 12px;
  backdrop-filter: blur(4px);
}

.pill {
  align-self: flex-start;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  font-size: 14px;
}

.metric {
  font-size: 20px;
  color: var(--text-muted);
}

.metric span {
  color: var(--text-main);
  font-weight: 700;
}

.winner {
  margin-top: 8px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 226, 138, 0.42);
  background: rgba(255, 205, 93, 0.15);
  color: var(--winner);
  font-weight: 700;
  min-height: 48px;
}

@media (max-width: 1000px) {
  .stage {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr auto;
    gap: 1.2vh;
    padding: 1.2vh 1vw;
  }

  .wheel-shell {
    width: min(72vh, 92vw);
  }

  .hud {
    width: min(92vw, 640px);
    flex-direction: row;
    flex-wrap: wrap;
    gap: 10px 14px;
  }

  .winner {
    width: 100%;
  }
}
