:root {
  --bg: #05060c;
  --panel: #0d1020;
  --line: #262c4a;
  --ink: #e8eaf6;
  --dim: #8b91b5;
  --accent: #8f7bff;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
}
main {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: flex-start;
  padding: 24px;
  max-width: 1060px;
  margin: 0 auto;
}
.stage { flex: 1 1 600px; min-width: 320px; }
.panel {
  flex: 0 1 320px;
  min-width: 280px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
}
h1 { font-size: 18px; margin: 0 0 4px; }
.note { color: var(--dim); margin: 0 0 16px; font-size: 12px; }

.tally {
  display: flex;
  justify-content: center;
  gap: 28px;
  font-size: 22px;
  font-variant-numeric: tabular-nums;
  margin-bottom: 12px;
  min-height: 34px;
}
.tally span { opacity: .35; }
.tally span.alive { opacity: 1; }

.board {
  border: 2px solid #b9c0ff;
  border-radius: 6px;
  box-shadow: 0 0 24px rgba(143, 123, 255, .35);
  line-height: 0;
  overflow: hidden;
}
canvas { width: 100%; height: auto; display: block; background: #07080f; }
.status { text-align: center; color: var(--dim); margin-top: 10px; min-height: 20px; }

fieldset {
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 0 0 14px;
  padding: 10px 12px 12px;
}
legend { color: var(--dim); font-size: 12px; padding: 0 4px; }
label { display: block; margin: 8px 0; color: var(--dim); font-size: 12px; }
output { color: var(--ink); float: right; font-variant-numeric: tabular-nums; }
input[type=range] { width: 100%; accent-color: var(--accent); }
input[type=number] {
  width: 100%;
  background: #0a0d1a;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  padding: 6px 8px;
  font: inherit;
}
.row { display: flex; gap: 8px; align-items: center; }
.row > * { flex: 1; }

button {
  background: var(--accent);
  color: #0b0716;
  border: 0;
  border-radius: 6px;
  padding: 9px 12px;
  font: 600 13px/1 inherit;
  cursor: pointer;
}
button:hover { filter: brightness(1.1); }
button.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
button.sm { flex: 0 0 auto; padding: 7px 10px; }
#rotate { width: 100%; margin-top: 8px; }

.slots { display: flex; flex-direction: column; gap: 8px; }
.slot { display: flex; align-items: center; gap: 8px; }
.slot b { flex: 1; font-weight: 500; color: var(--dim); font-size: 12px; }
.slot button {
  background: #0a0d1a;
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 18px;
  padding: 4px 10px;
}

.results { margin-top: 10px; font-size: 12px; color: var(--dim); }
.progress { margin-top: 6px; }
.cmp { border-collapse: collapse; margin-top: 8px; width: 100%; font-variant-numeric: tabular-nums; }
.cmp th, .cmp td { padding: 3px 6px; text-align: right; border-bottom: 1px solid var(--line); }
.cmp th { color: var(--dim); font-weight: 500; }
.cmp td:first-child, .cmp th:first-child { text-align: left; }
.bar { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.bar i { flex: 0 0 20px; font-style: normal; font-size: 15px; }
.bar u { flex: 1; height: 8px; background: #0a0d1a; border-radius: 4px; text-decoration: none; }
.bar u s { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.bar em { flex: 0 0 68px; text-align: right; font-style: normal; font-variant-numeric: tabular-nums; }
