:root {
  --bg-top: #fff4d8;
  --bg-bottom: #ffdcb8;
  --ink-strong: #25143a;
  --ink-soft: rgba(37, 20, 58, 0.72);
  --shadow-strong: 0 24px 80px rgba(66, 24, 111, 0.16);
  --wheel-size: min(78vw, 420px);
  --font-display: "Trebuchet MS", "Avenir Next Condensed", "Gill Sans", sans-serif;
  --font-body: "Verdana", "Tahoma", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font-body);
  color: var(--ink-strong);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.9), transparent 34%),
    radial-gradient(circle at 85% 20%, rgba(255, 139, 61, 0.25), transparent 22%),
    linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: auto;
  width: 36vmax;
  height: 36vmax;
  border-radius: 50%;
  filter: blur(18px);
  opacity: 0.55;
  pointer-events: none;
}

body::before {
  top: -12vmax;
  right: -10vmax;
  background: rgba(255, 126, 95, 0.28);
}

body::after {
  bottom: -18vmax;
  left: -12vmax;
  background: rgba(17, 138, 178, 0.18);
}

.page-shell {
  display: grid;
  place-items: center;
  min-height: 100vh;
  width: 100%;
  padding: 24px 16px;
}

.wheel-stage {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 18px;
  z-index: 1;
}

.wheel-frame {
  position: relative;
  display: grid;
  place-items: center;
}

.glow {
  position: absolute;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  filter: blur(16px);
  opacity: 0.5;
}

.glow-left {
  top: 40px;
  left: 12%;
  background: rgba(255, 208, 99, 0.36);
}

.glow-right {
  right: 6%;
  bottom: 90px;
  background: rgba(123, 97, 255, 0.22);
}

.wheel-shell {
  position: relative;
  width: var(--wheel-size);
  height: var(--wheel-size);
  padding: 14px;
  border-radius: 50%;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(255, 233, 203, 0.92));
  box-shadow: var(--shadow-strong);
}

.wheel-shell::before {
  content: "";
  position: absolute;
  inset: 14px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.74);
}

.pointer {
  position: absolute;
  top: -8px;
  width: 0;
  height: 0;
  border-left: 20px solid transparent;
  border-right: 20px solid transparent;
  border-top: 38px solid #25143a;
  filter: drop-shadow(0 12px 14px rgba(37, 20, 58, 0.18));
  z-index: 3;
}

.wheel {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  transform: rotate(0deg);
  transition: transform 5.4s cubic-bezier(0.12, 0.85, 0.11, 1);
  overflow: hidden;
}

.wheel::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, rgba(255, 255, 255, 0.2), transparent 42%),
    conic-gradient(from -90deg, var(--wheel-colors));
}

.wheel::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  box-shadow:
    inset 0 0 0 10px rgba(255, 255, 255, 0.28),
    inset 0 0 0 14px rgba(37, 20, 58, 0.1);
}

.wheel-labels {
  position: absolute;
  inset: 0;
}

.wheel-label {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 40%;
  transform-origin: left center;
  text-align: right;
  font-family: var(--font-display);
  font-size: clamp(0.74rem, 1vw, 0.96rem);
  font-weight: 800;
  color: rgba(255, 255, 255, 0.96);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.18);
}

.wheel-label span {
  display: inline-flex;
  max-width: 108px;
  padding-right: 18px;
}

.wheel-center {
  position: absolute;
  inset: 50%;
  display: grid;
  place-items: center;
  width: 112px;
  height: 112px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background:
    linear-gradient(145deg, #fffef6, #ffd783);
  color: #5d2b00;
  box-shadow:
    0 18px 24px rgba(255, 132, 53, 0.18),
    inset 0 2px 0 rgba(255, 255, 255, 0.72);
  z-index: 2;
}

.wheel-center span {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.spin-button {
  margin-top: 22px;
  padding: 16px 28px;
  border: 0;
  border-radius: 999px;
  background:
    linear-gradient(135deg, #25143a 0%, #6c2bd9 100%);
  color: #fff;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  cursor: pointer;
  box-shadow: 0 18px 32px rgba(67, 29, 116, 0.24);
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    opacity 180ms ease;
}

.spin-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 38px rgba(67, 29, 116, 0.28);
}

.spin-button:disabled {
  cursor: wait;
  opacity: 0.72;
  transform: none;
}

.spin-status {
  margin: 0;
  min-height: 1.25em;
  color: rgba(37, 20, 58, 0.7);
  font-size: 0.82rem;
  text-align: center;
}

@media (max-width: 980px) {
  .wheel-stage {
    gap: 16px;
  }
}

@media (max-width: 640px) {
  .page-shell {
    padding: 16px 12px;
  }

  .wheel-shell {
    padding: 10px;
  }

  .pointer {
    top: -4px;
    border-left-width: 16px;
    border-right-width: 16px;
    border-top-width: 30px;
  }

  .wheel-center {
    width: 88px;
    height: 88px;
  }

  .wheel-label span {
    max-width: 76px;
    padding-right: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .wheel,
  .spin-button {
    transition: none;
  }
}
