:root {
  --controls-height: 64px;
  --border-color: #ffffff;
}

html, body {
  height: 100%;
  margin: 0;
  background: #111;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  color: white;
}

.app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  box-sizing: border-box;
  padding: 12px;
  gap: 8px;
}

.canvas-wrap {
  flex: 1 1 auto;
  min-height: 0;
  display: block;
  border: 1px solid var(--border-color);
  background: black;
  border-radius: 6px;
  overflow: hidden;
  position: relative;
}

canvas#mainCanvas {
  display: block;
  width: 100%;
  height: 100%;
  background: black;
}

.controls {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding-top: 6px;
  width: 100%;
  margin: 0;
}

.buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.btn {
  appearance: none;
  background: #222;
  color: #fff;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 8px 12px;
  cursor: pointer;
  position: relative;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn:hover {
  background: #2a2a2a;
}

.btn.active {
  background: #4caf50;   /* color the whole box */
  border-color: #4caf50;
  color: #111;
}

.sliders {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.slider {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  gap: 8px;
  align-items: center;
}

.slider input[type="range"] {
  width: 100%;
}

.slider-value {
  min-width: 3.5ch;
  text-align: right;
  color: #4caf50; /* green text */
  font-variant-numeric: tabular-nums;
}

.selection {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-self: end; /* stick to the right column */
}

.selected-box {
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: #1a1a1a;
  padding: 4px 8px;
  min-height: 20px;
  font-size: 0.9em;
  white-space: nowrap;
  display: inline-block;
}
