:root {
  color-scheme: dark;
  --bg: #000;
  --ink: #f5f5f7;
  --muted: #a1a1aa;
  --panel: #1c1c1f;
  --line: rgba(255, 255, 255, 0.12);
  font-family: "Avenir Next", "PingFang SC", "Helvetica Neue", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
}

body {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

button, input { font: inherit; }

.bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  padding: 12px 16px 8px;
}

.brand {
  font-weight: 700;
  letter-spacing: 0.04em;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

button {
  border: 0;
  border-radius: 999px;
  padding: 8px 16px;
  background: #f4f4f5;
  color: #111;
  font-weight: 650;
  cursor: pointer;
}

button:active { transform: scale(0.97); }

button.ghost {
  background: transparent;
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line);
}

button.on {
  background: #ff4a2a;
  color: white;
}

button.gas {
  background: #ff4a2a;
  color: white;
  min-width: 7.5rem;
}

button:disabled { opacity: 0.45; cursor: default; }

.status {
  flex-basis: 100%;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

main {
  flex: 1;
  min-height: 0;
  display: grid;
  place-items: center;
  padding: 8px 16px 16px;
}

#stage {
  position: relative;
  width: min(100%, calc((100dvh - 108px) * 16 / 9));
  aspect-ratio: 1280 / 720;
  border-radius: 28px;
  overflow: hidden;
  background: #6f8ea3;
  user-select: none;
}

#world, #bg, #wheel, #hud, .face {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

#bg, #wheel, .face { object-fit: fill; pointer-events: none; }

.face { opacity: 0; }

.face.on { opacity: 1; }

.face {
  left: 31.09375%;
  top: 11.6667%;
  width: 45.15625%;
  height: 65.6944%;
  right: auto;
  bottom: auto;
}

#wheel {
  transform-origin: 57.03125% 136.3889%;
  animation: wobble var(--dur, 3.4s) ease-in-out infinite;
  animation-play-state: var(--play, paused);
}

@keyframes wobble {
  0%, 100% { transform: rotate(calc(var(--amp, 1.5) * -1deg)); }
  50% { transform: rotate(calc(var(--amp, 1.5) * 1deg)); }
}

#hud {
  pointer-events: none;
  font-family: "Avenir Next", "Helvetica Neue", sans-serif;
}

