:root {
  --bg: #07070c;
  --panel: #0b0d14;
  --line: #1c1f2b;
  --ink: #f4f5fa;
  --dim: #8b90a2;
  --faint: #5d6273;
  --coin: #31e0c8;
  --wheel: #ff4fd8;
  --warn: #ffb300;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 15px;
  line-height: 1.65;
}
.sheet { max-width: 1080px; margin: 0 auto; padding: 0 24px 120px; }
section.first { border-top: 0; padding-top: 84px; }
h1, h2, h3 { font-family: "Space Grotesk", Verdana, sans-serif; font-weight: 700; letter-spacing: 0.01em; }
h1 { font-size: clamp(48px, 9vw, 104px); line-height: 0.95; margin: 0; letter-spacing: 0.02em; }
h2 { font-size: 28px; margin: 0 0 6px; }
h3 { font-size: 17px; margin: 28px 0 10px; color: var(--dim); font-weight: 700; }
p { margin: 0 0 14px; max-width: 68ch; }
a { color: var(--coin); text-decoration: none; border-bottom: 1px solid #1e4d47; }
a:hover { border-bottom-color: var(--coin); }
section { border-top: 1px solid var(--line); padding: 64px 0 8px; }
header.hero { padding: 72px 0 40px; text-align: center; }
.hero p { margin: 18px auto 0; color: var(--dim); }
.cap { color: var(--faint); font-size: 13px; }
.dim { color: var(--dim); }
.coin { color: var(--coin); }
.wheelc { color: var(--wheel); }
.num { font-variant-numeric: tabular-nums; }

.stage { width: min(420px, 74vw); margin: 0 auto 28px; aspect-ratio: 1; }
.stage { overflow: hidden; border-radius: 3px; }
.stage svg, .stage img { width: 100%; height: 100%; display: block; }

.links { display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; margin: 26px 0 8px; font-size: 13px; letter-spacing: 0.08em; }
.links a { border: 0; color: var(--dim); }
.links a:hover { color: var(--ink); }

button {
  font-family: inherit; font-size: 14px; letter-spacing: 0.04em;
  background: transparent; color: var(--ink);
  border: 1px solid var(--line); border-radius: 2px;
  padding: 11px 18px; cursor: pointer;
}
button:hover:not(:disabled) { border-color: var(--ink); }
button:disabled { color: var(--faint); cursor: not-allowed; }
button.primary { background: var(--ink); color: var(--bg); border-color: var(--ink); font-weight: 600; }
button.primary:hover:not(:disabled) { background: #fff; }
button.primary:disabled { background: #1a1d27; color: var(--faint); border-color: var(--line); }
button.coinb { border-color: #1e4d47; color: var(--coin); }
button.wheelb { border-color: #5b1c4e; color: var(--wheel); }

.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin: 14px 0; }
input[type="range"] { flex: 1; min-width: 180px; accent-color: var(--ink); }
input[type="number"], input[type="text"] {
  font-family: inherit; background: var(--panel); color: var(--ink);
  border: 1px solid var(--line); border-radius: 2px; padding: 10px 12px; width: 140px;
}

table { width: 100%; border-collapse: collapse; margin: 8px 0 4px; font-size: 14px; }
th, td { text-align: left; padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--dim); font-weight: 400; width: 168px; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 12px; margin: 16px 0; }
.tile { border-radius: 2px; overflow: hidden; }
/* the wheel's own background is part of the palette, so it frames itself -
   no second border, and anything that bleeds past the frame is clipped */
.tile .art { position: relative; aspect-ratio: 1; overflow: hidden; border-radius: 2px; outline: 1px solid var(--line); outline-offset: -1px; }
.tile .art svg, .tile .art img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.tile .id { font-size: 11px; color: var(--faint); margin-top: 6px; display: flex; justify-content: space-between; }
.tile.on .art { outline: 2px solid var(--coin); }
.tile label { display: block; cursor: pointer; }
.tile input { position: absolute; top: 6px; left: 6px; z-index: 2; }

.strip { display: flex; gap: 10px; overflow-x: auto; padding: 4px 0 12px; }
.strip .tile { min-width: 116px; }
.strip .tile:first-child { border-color: var(--wheel); }

.stat { display: flex; gap: 34px; flex-wrap: wrap; margin: 18px 0 8px; }
.stat div { min-width: 132px; }
.stat b { display: block; font-family: "Space Grotesk", sans-serif; font-size: 26px; font-weight: 700; }
.stat span { font-size: 12px; color: var(--faint); letter-spacing: 0.06em; }

.status { min-height: 22px; font-size: 13px; color: var(--dim); margin: 10px 0; }
.status.err { color: var(--warn); }
.status.ok { color: var(--coin); }

.diagram { width: 100%; margin: 8px 0 24px; }
.diagram svg { width: 100%; height: auto; display: block; }

.chartwrap { border: 1px solid var(--line); border-radius: 2px; overflow: hidden; margin: 8px 0 20px; }
.chartwrap iframe { width: 100%; height: 400px; border: 0; display: block; }

dialog { background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: 3px; max-width: 460px; font-family: inherit; }
dialog::backdrop { background: rgba(0,0,0,0.72); }

@media (max-width: 640px) {
  .sheet { padding: 0 16px 80px; }
  section { padding: 44px 0 8px; }
  th { width: 116px; }
}

.lanes { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 22px 0 8px; }
.lane { border: 1px solid var(--line); border-radius: 3px; padding: 20px; background: var(--panel); display: flex; flex-direction: column; gap: 10px; }
.lane .lab { font-size: 11px; letter-spacing: 0.22em; color: var(--faint); }
.lane b { font-family: "Space Grotesk", sans-serif; font-size: 24px; font-weight: 700; line-height: 1.15; }
.lane .row { margin: 0; }
.lanefoot { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: auto; padding-top: 6px; }
@media (max-width: 640px) { .lanes { grid-template-columns: 1fr; } }

.corner {
  position: fixed; top: 0; right: 0; z-index: 50;
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px;
}
.corner .status { margin: 0; min-height: 0; }
@media (max-width: 640px) {
  .corner { padding: 10px 12px; }
  .corner button { padding: 8px 12px; font-size: 13px; }
  section.first { padding-top: 64px; }
}
