* { box-sizing: border-box; }
body {
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  max-width: 1000px;
  margin: 32px auto;
  padding: 0 16px;
  color: #111;
  text-align: center;
}

h1 { margin: 0 0 16px; }

.controls {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
}
.controls input, .controls select, .controls button {
  padding: 8px 12px; border: 1px solid #ccc; border-radius: 8px;
  background: #f9fafb; font-size: 16px; cursor: pointer;
}
.controls .check { display: flex; align-items: center; gap: 8px; justify-content: center; }
.controls .spread { display: flex; align-items: center; gap: 8px; justify-content: center; }
.controls .leapWrap { margin-left: 170px !important; }
.controls .notesWrap { margin-left: 100px !important; }

.stage {
  display: grid;
  place-items: center;
  gap: 10px;
  min-height: 220px;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 24px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.06);
  background: #fff;
}

canvas {
  width: 100%;
  height: auto;
  border-radius: 12px;
  background: #fff;
}

.error { color: #b91c1c; min-height: 1.2em; font-weight: 600; }

/* Responsive */
@media (max-width: 860px) {
  .controls .leapWrap { margin-left: 0 !important; }
  .controls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .controls .leapWrap { margin-left: 0 !important; }
  .controls .notesWrap { margin-left: 0 !important; }
}


/* --- Anti-jank for slider rows --- */
.controls .spread, .controls .leapWrap { white-space: nowrap; }
#spreadLabel, #leapLabel { display: inline-block; min-width: 80px; text-align: left; }
N0px; flex: 0 0 auto; }

@media (max-width: 860px) {
  .controls .spread, .controls .leapWrap { white-space: normal; }
  .controls .spread input[type=range], .controls .leapWrap input[type=range] { width: 100%; }
  #spreadLabel, #leapLabel { min-width: 64px; }
}

