:root {
  color-scheme: dark;
  --gold: #f5c518;
  --ink: #fff8ef;
  --bg: #120c09;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
}

button, input { font: inherit; }

.audience {
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  overflow: hidden;
  padding: 16px;
  background: radial-gradient(ellipse at center, #3a2418 0%, #120c09 58%);
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 3.2rem);
  letter-spacing: -0.03em;
}

.wheel-slot { width: min(88vw, 58vh, 640px); }

.wheel-wrap {
  position: relative;
  aspect-ratio: 1;
  width: 100%;
  container-type: size;
}

.pointer {
  position: absolute;
  left: 50%;
  top: 0;
  z-index: 30;
  transform: translate(-50%, -4px);
  border-left: 18px solid transparent;
  border-right: 18px solid transparent;
  border-top: 34px solid var(--gold);
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.45));
}

.bezel {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: #3b2414;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.ring {
  position: absolute;
  inset: 2.2%;
  border-radius: 50%;
  background: var(--gold);
}

.disc {
  position: absolute;
  inset: 4.6%;
  overflow: hidden;
  border-radius: 50%;
  background: #1a120c;
}

.rotor {
  position: absolute;
  inset: 0;
  border-radius: 50%;
}

.label-arm {
  position: absolute;
  left: 50%;
  top: 0;
  height: 50%;
  width: 0;
  transform-origin: bottom center;
}

.label-arm span {
  position: absolute;
  left: 0;
  top: 16%;
  transform: translateX(-50%);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 900;
  color: white;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.75);
}

.hub {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 20;
  width: 22%;
  height: 22%;
  transform: translate(-50%, -50%);
  border: 0;
  border-radius: 50%;
  background: #1a120c;
  color: var(--gold);
  font-size: 3.2cqw;
  font-weight: 900;
  box-shadow: 0 0 0 4px var(--gold);
}

.hub:disabled { opacity: 0.9; }

.spin-btn, .primary, .danger, .add-btn {
  border: 0;
  border-radius: 999px;
  font-weight: 900;
  cursor: pointer;
}

.spin-btn, .primary {
  background: var(--gold);
  color: #1a120c;
  padding: 12px 28px;
  font-size: 1.1rem;
}

.spin-btn:disabled, .primary:disabled, .danger:disabled, .add-btn:disabled, .chip:disabled {
  cursor: default;
  opacity: 0.5;
}

.result {
  min-height: 1.2em;
  margin: 0;
  text-align: center;
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 900;
}

.error { min-height: 1em; margin: 0; color: #ffb4a8; font-size: 0.95rem; }

.booth {
  min-height: 100vh;
  padding: 24px 16px 40px;
}

.booth-grid {
  display: grid;
  gap: 28px;
  max-width: 1100px;
  margin: 0 auto;
}

@media (min-width: 980px) {
  .booth-grid { grid-template-columns: minmax(0, 1fr) 420px; align-items: start; }
  .booth-wheel { order: 0; }
  .booth-controls { order: 0; }
}

.booth-wheel { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.booth-wheel .wheel-slot { width: min(100%, 520px); }

.landing { margin: 0; font-size: 1.25rem; font-weight: 900; color: var(--gold); }

.top-row { display: flex; justify-content: space-between; gap: 12px; align-items: start; }
.note { color: #f6e7c1; line-height: 1.45; }
.lock {
  background: none;
  border: 0;
  color: #f6e7c1;
  text-decoration: underline;
  cursor: pointer;
}

.audience-link {
  display: inline-flex;
  margin-top: 14px;
  padding: 8px 14px;
  border: 1px solid var(--gold);
  border-radius: 999px;
  color: var(--gold);
  font-weight: 800;
  text-decoration: none;
}

.pinned { color: var(--gold); font-weight: 800; }

.add-row { display: flex; gap: 8px; margin: 14px 0; }
.add-row input, .gate input, .rename {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.3);
  color: white;
  padding: 12px;
}

.add-btn {
  background: var(--gold);
  color: #1a120c;
  padding: 0 16px;
}

.names { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.name {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.05);
  padding: 12px;
}
.name.chosen, .name.landing { border-color: var(--gold); background: rgba(245, 197, 24, 0.1); }
.name.out { opacity: 0.7; }
.name-row, .chips { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.swatch { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.rename { flex: 1; min-width: 0; padding: 6px 8px; font-weight: 800; }
.odds { color: var(--gold); font-weight: 800; font-size: 0.9rem; }
.remove {
  background: none;
  border: 0;
  color: #ffb4a8;
  cursor: pointer;
}
.chips { margin-top: 10px; }
.chip {
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  padding: 6px 12px;
  font-weight: 700;
  cursor: pointer;
}
.chip.on { background: white; color: #1a120c; }
.chip.win { background: var(--gold); color: #1a120c; }

.danger {
  width: 100%;
  margin-top: 14px;
  background: #e10600;
  color: white;
  padding: 12px;
}

.gate-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.gate {
  width: min(100%, 420px);
  background: #24180f;
  border-radius: 24px;
  padding: 24px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}
.gate p { color: #f6e7c1; line-height: 1.45; }
.gate .primary { width: 100%; margin-top: 14px; }
