:root {
  --bg: #10131a;
  --fg: #f4f6fb;
  --accent: #f2a03d;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 50% 20%, #1b2130, var(--bg));
  color: var(--fg);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

.stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  padding: 1.5rem;
}

.wheel-wrap {
  position: relative;
  width: min(86vw, 74vh, 900px);
  aspect-ratio: 1;
}

#wheel { width: 100%; height: 100%; display: block; }

.pointer {
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 16px solid transparent;
  border-right: 16px solid transparent;
  border-top: 30px solid var(--accent);
  z-index: 2;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

.hub-hit {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 14%;
  height: 14%;
  border-radius: 50%;
  border: none;
  background: transparent;
  cursor: default;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

.spin-button {
  padding: 0.9rem 3.5rem;
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #10131a;
  background: var(--accent);
  border: none;
  border-radius: 999px;
  cursor: pointer;
  touch-action: manipulation;
}

/* Double-tap-to-zoom would otherwise fight the hub's triple-tap gesture and
   leave the operator staring at a zoomed wheel mid-event. */
#wheel {
  touch-action: manipulation;
}

.spin-button[disabled] { opacity: 0.45; cursor: not-allowed; }

.footer-text { margin: 0; opacity: 0.6; font-size: 0.9rem; max-width: min(90vw, 800px); overflow-wrap: anywhere; }
.notice { margin: 0; min-height: 1.2rem; color: #ff9d9d; font-size: 0.9rem; max-width: min(90vw, 800px); overflow-wrap: anywhere; }

.result-card {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(6, 8, 12, 0.9);
  z-index: 10;
}

.result-card[hidden] { display: none; }
.result-label { margin: 0; text-transform: uppercase; letter-spacing: 0.3em; opacity: 0.6; }
.result-inner { text-align: center; padding: 2rem; max-width: min(92vw, 1200px); }

.result-name {
  margin: 0.5rem 0 2rem;
  font-size: clamp(2.5rem, 9vw, 6rem);
  max-width: min(90vw, 1100px);
  overflow-wrap: anywhere;
}

.result-dismiss {
  padding: 0.7rem 2.5rem;
  font-size: 1rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: transparent;
  color: var(--fg);
  cursor: pointer;
}

@media (max-width: 480px) {
  .spin-button { padding: 0.8rem 2.5rem; font-size: 1.15rem; }
}

.admin-panel[hidden] { display: none; }

.admin-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 6, 10, 0.82);
  display: grid;
  place-items: center;
  z-index: 20;
}

.admin-sheet {
  width: min(92vw, 520px);
  max-height: 88vh;
  overflow-y: auto;
  padding: 1.5rem;
  border-radius: 14px;
  background: #171b24;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

/* Checkboxes are excluded: the blanket width rule stretches them into
   full-width bars, wrapping their label onto its own line so the operator
   cannot tell which square belongs to which setting. */
.admin-sheet input:not([type="checkbox"]),
.admin-sheet select,
.admin-sheet textarea {
  width: 100%;
  padding: 0.55rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: #0f131a;
  color: var(--fg);
  font: inherit;
}

.admin-sheet button {
  padding: 0.55rem 1rem;
  border-radius: 8px;
  border: none;
  background: var(--accent);
  color: #10131a;
  font-weight: 600;
  cursor: pointer;
}

.admin-toggle {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.admin-toggle input[type="checkbox"] {
  width: 1.05rem;
  height: 1.05rem;
  flex: none;
  margin: 0;
}

.admin-error { color: #ff9d9d; min-height: 1.2rem; margin: 0; }
.admin-hint { opacity: 0.6; font-size: 0.85rem; margin: 0; }
#admin-history { max-height: 180px; overflow-y: auto; padding-left: 1.2rem; }

/* Deliberately quiet: this sits on a projector behind a live audience and must
   not compete with SPIN. */
.install-button {
  padding: 0.4rem 1rem;
  font-size: 0.85rem;
  color: var(--fg);
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  cursor: pointer;
  opacity: 0.7;
  touch-action: manipulation;
}

.install-button[hidden] { display: none; }
.install-button:hover { opacity: 1; }

.install-help {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(6, 8, 12, 0.9);
  z-index: 15;
  padding: 1.5rem;
}

.install-help[hidden] { display: none; }

.install-help-inner {
  width: min(92vw, 460px);
  padding: 1.75rem;
  border-radius: 14px;
  background: #171b24;
}

.install-help-inner h2 { margin: 0 0 1rem; font-size: 1.3rem; }
.install-help-inner ol { margin: 0 0 1rem; padding-left: 1.3rem; line-height: 1.7; }
.install-help-inner p { margin: 0 0 1.5rem; opacity: 0.7; font-size: 0.9rem; }

.install-help-inner button {
  padding: 0.6rem 1.6rem;
  border: none;
  border-radius: 999px;
  background: var(--accent);
  color: #10131a;
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
}
