.spinner-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  padding-bottom: 24px;
  position: relative;
  z-index: 1;
}

.title { margin: 0; }

body { transition: background-color 0.4s ease; }

.stage {
  position: relative;
  width: min(80vw, 44vh, 420px);
  aspect-ratio: 1;
  margin-top: 14px;
}

.pointer {
  position: absolute;
  top: -22px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 22px solid transparent;
  border-right: 22px solid transparent;
  border-top: 40px solid var(--ink);
  z-index: 3;
  filter: drop-shadow(0 3px 0 rgba(0,0,0,0.15));
}

.wheel {
  all: unset;
  cursor: pointer;
  position: absolute;
  inset: 0;
  border-radius: 50%;
  touch-action: manipulation;
  box-shadow: 0 10px 0 rgba(43,33,24,0.15), 0 20px 40px rgba(43,33,24,0.15);
}
.wheel:focus-visible { outline: 5px solid var(--lava); outline-offset: 6px; }

.wheel-face {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 8px solid var(--ink);
  will-change: transform;
  overflow: hidden;
}

.wheel-face .seg-label {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0;
  height: 50%;
  transform-origin: 0 0;
}
.wheel-face .seg-label span {
  position: absolute;
  top: 62%;
  left: 0;
  transform: translateX(-50%);
  font-weight: 800;
  font-size: clamp(0.85rem, 3.6vw, 1.3rem);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #fff;
  text-shadow: 0 2px 0 rgba(0,0,0,0.25);
  white-space: nowrap;
}

.hub {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 26%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: #fff;
  border: 6px solid var(--ink);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: clamp(0.9rem, 3.5vw, 1.3rem);
  z-index: 2;
  transition: transform 0.15s ease;
}
.wheel:active .hub { transform: translate(-50%, -50%) scale(0.92); }

.result {
  font-size: clamp(1.3rem, 5vw, 2rem);
  font-weight: 800;
  min-height: 2.6rem;
  display: flex;
  align-items: center;
  margin: 8px 0 0;
}
.result .swatch {
  display: inline-block;
  font-size: clamp(2rem, 8vw, 2.8rem);
  padding: 2px 28px;
  border-radius: 999px;
  color: #fff;
  text-shadow: 0 2px 0 rgba(0,0,0,0.25);
  animation: pop 0.45s cubic-bezier(.2,1.6,.4,1);
}
@keyframes pop {
  from { transform: scale(0.4); }
  to { transform: scale(1); }
}

.spin-btn {
  font: inherit;
  font-size: 1.6rem;
  font-weight: 800;
  color: #fff;
  background: var(--lava);
  border: none;
  border-radius: 999px;
  padding: 16px 56px;
  min-width: 220px;
  cursor: pointer;
  box-shadow: 0 6px 0 var(--lava-dark);
  touch-action: manipulation;
  transition: transform 0.08s ease, box-shadow 0.08s ease, opacity 0.2s;
}
.spin-btn:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--lava-dark); }
.spin-btn:disabled { opacity: 0.6; cursor: default; }
.spin-btn:focus-visible { outline: 4px solid var(--ink); outline-offset: 4px; }

.sound-toggle {
  font: inherit;
  font-weight: 700;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 8px 12px;
}

/* Wavy lava along the bottom of the screen */
.lava {
  position: relative;
  flex-shrink: 0;
  height: 60px;
  pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='60' viewBox='0 0 160 60'%3E%3Cpath d='M0 20 Q20 0 40 20 T80 20 T120 20 T160 20 V60 H0Z' fill='%23ff5a1f'/%3E%3Ccircle cx='60' cy='8' r='5' fill='%23ff5a1f'/%3E%3Ccircle cx='132' cy='5' r='3' fill='%23ff5a1f'/%3E%3C/svg%3E") 0 0 / 160px 60px repeat-x;
  animation: flow 5s linear infinite;
}
.lava::after {
  content: "";
  position: absolute;
  inset: 34px 0 0;
  background: linear-gradient(var(--lava), var(--lava-dark));
}
@keyframes flow {
  to { background-position: 160px 0; }
}

@media (prefers-reduced-motion: reduce) {
  .lava { animation: none; }
  .result .swatch { animation: none; }
}
