:root {
  --ink: #161616;
  --muted: #8a8a8a;
  color-scheme: light;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: #fff;
  color: var(--ink);
  font-family: Inconsolata, ui-monospace, monospace;
}

html.dark {
  --ink: #f2f2f2;
  --muted: #9b9b9b;
  color-scheme: dark;
}

html.dark,
html.dark body { background: #111; }

html.dark .panel {
  background: #1b1b1b;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}

html.dark input[type="range"]::-webkit-slider-runnable-track { background: #3a3a3a; }

html.dark #pause { border-color: #444; }

button { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
button:focus { outline: none; }
button:focus-visible { outline: 1px solid #bbb; outline-offset: 3px; }

.bar {
  position: fixed;
  z-index: 3;
  top: 22px;
  left: 28px;
  right: 28px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.wordmark {
  margin: 0;
  font-family: Heebo, "Avenir Next", sans-serif;
  font-size: 28px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.tools {
  display: flex;
  align-items: center;
  gap: 18px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 12px;
}

.count { margin: 0; }
.count span { display: inline-block; min-width: 1ch; }

#pause {
  width: 36px;
  height: 36px;
  border: 1px solid #d5d5d5;
  border-radius: 50%;
  display: grid;
  place-items: center;
}

.bars,
#pause[aria-pressed="true"] .bars {
  width: 8px;
  height: 10px;
  border-left: 2px solid var(--ink);
  border-right: 2px solid var(--ink);
}

#pause[aria-pressed="true"] .bars {
  width: 0;
  height: 0;
  border: 0;
  border-left: 8px solid var(--ink);
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
}

#random { letter-spacing: 0.18em; }

.stage {
  min-height: 100%;
  display: grid;
  place-items: center;
}

.panel {
  position: fixed;
  z-index: 4;
  top: 84px;
  left: 28px;
  width: 220px;
  padding: 16px 14px 20px;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 12px 28px rgba(22, 22, 22, 0.08);
}

.field { display: block; padding: 8px 2px 6px; }

.field-top {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
  font-size: 12px;
  letter-spacing: 0.04em;
}

.val { color: var(--muted); }

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 16px;
  margin: 0;
  background: transparent;
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 1px;
  background: #ddd;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 10px;
  height: 10px;
  margin-top: -4.5px;
  border-radius: 50%;
  background: var(--ink);
}

.wheel {
  position: relative;
  width: min(88vh, calc(100vw - 80px));
  aspect-ratio: 1;
}

.wheel canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.foot {
  position: fixed;
  z-index: 3;
  left: 32px;
  right: 32px;
  bottom: 26px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

#theme {
  margin: 0;
  padding: 0 0 2px;
  font-size: 12px;
  letter-spacing: 0.04em;
}

.hint {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 11px;
  text-align: center;
}

.hint svg { width: 28px; height: 28px; }

@media (max-width: 720px) {
  .wordmark { font-size: 22px; }
  .wheel { width: min(78vh, calc(100vw - 32px)); }
  .foot { left: 16px; right: 16px; }
  .bar { left: 16px; right: 16px; }
  .panel { left: 16px; width: 180px; }
}
