/* sc.css — app chrome. Dark sidebar, light stage, so the tiling reads as artwork. */

:root {
  --bg: #16181c;
  --panel: #1d2026;
  --panel-2: #24282f;
  --line: #2f343c;
  --ink: #e9e7e3;
  --dim: #939aa5;
  --accent: #4bb3a6;
  --accent-ink: #06231f;
  --warn: #e0a83c;
  --bad: #e85d5d;
  --good: #5fb36b;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font: 13px/1.5 -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

#app {
  display: grid;
  grid-template-columns: 308px 1fr;
  height: 100%;
}

/* ------------------------------------------------------------------ sidebar */

#side {
  background: var(--panel);
  border-right: 1px solid var(--line);
  overflow-y: auto;
  overscroll-behavior: contain;
}

header {
  padding: 16px 18px 14px;
  border-bottom: 1px solid var(--line);
}
header h1 {
  margin: 0;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: 0.01em;
}
header p {
  margin: 5px 0 0;
  color: var(--dim);
  font-size: 11.5px;
  line-height: 1.45;
}
header a { color: var(--accent); text-decoration: none; }
header a:hover { text-decoration: underline; }

.grp {
  padding: 14px 18px 16px;
  border-bottom: 1px solid var(--line);
}
.grp h2 {
  margin: 0 0 11px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--dim);
}

.row { margin-bottom: 11px; }
.row:last-child { margin-bottom: 0; }
.row > label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 12px;
  margin-bottom: 5px;
  color: #c9ced6;
}
.num {
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  font-size: 11.5px;
  background: var(--panel-2);
  padding: 1px 6px;
  border-radius: 4px;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 18px;
  background: transparent;
  margin: 0;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 3px;
  background: #3a4048;
  border-radius: 2px;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  margin-top: -5.5px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--panel);
}
input[type="range"]::-moz-range-track { height: 3px; background: #3a4048; border-radius: 2px; }
input[type="range"]::-moz-range-thumb {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--accent); border: 2px solid var(--panel);
}

/* segmented control */
.seg { display: flex; gap: 3px; background: var(--panel-2); padding: 3px; border-radius: 7px; }
.seg button {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--dim);
  font: inherit;
  font-size: 11.5px;
  padding: 5px 4px;
  border-radius: 5px;
  cursor: pointer;
  white-space: nowrap;
}
.seg button:hover { color: var(--ink); }
.seg button.on { background: var(--accent); color: var(--accent-ink); font-weight: 620; }

/* checkboxes */
.chks { display: grid; grid-template-columns: 1fr 1fr; gap: 5px 10px; }
.chk { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: #c9ced6; cursor: pointer; }
.chk input { accent-color: var(--accent); margin: 0; }

/* palettes */
.pals { display: flex; gap: 6px; margin-bottom: 11px; flex-wrap: wrap; }
.pal {
  display: flex;
  border: 1.5px solid transparent;
  border-radius: 5px;
  padding: 2px;
  background: var(--panel-2);
  cursor: pointer;
  gap: 1px;
}
.pal i { width: 9px; height: 18px; display: block; }
.pal:first-child i:first-child { border-radius: 2px 0 0 2px; }
.pal i:last-child { border-radius: 0 2px 2px 0; }
.pal.on { border-color: var(--accent); }

/* buttons */
.btns { display: flex; flex-wrap: wrap; gap: 6px; }
.btn {
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: #d6dae0;
  font: inherit;
  font-size: 11.5px;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
}
.btn:hover { border-color: #4a515b; color: #fff; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 620; }
.btn.primary:hover { filter: brightness(1.08); }

/* catalogue presets: a dense grid, since there are nine and they are the
   fastest route to seeing what the app is for */
.presets { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 5px; }
.btn.preset { padding: 6px 4px; font-size: 11px; text-align: center; }
.btn.preset.on {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  font-weight: 620;
}

/* readout */
.readout .r {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  padding: 4px 0;
  font-size: 11.5px;
  color: var(--dim);
  border-bottom: 1px dotted #2a2e35;
}
.readout .r:last-of-type { border-bottom: 0; }
.val {
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  font-family: ui-monospace, Consolas, monospace;
  font-size: 11px;
  text-align: right;
}
.val.big { font-size: 15px; font-weight: 650; }
.val.good { color: var(--good); }
.val.bad { color: var(--bad); }

.note {
  margin: 9px 0 0;
  font-size: 11px;
  line-height: 1.5;
  color: var(--dim);
}
.note b { color: #c2c8d0; font-weight: 600; }
#rWarn:not(:empty) { color: var(--warn); }

/* -------------------------------------------------------------------- stage */

#stage-wrap { position: relative; overflow: hidden; }
#stage { width: 100%; height: 100%; display: block; touch-action: none; }

#hint {
  position: absolute;
  left: 14px;
  bottom: 12px;
  background: rgba(22, 24, 28, 0.82);
  color: #c8ccd3;
  font-size: 11px;
  line-height: 1.6;
  padding: 8px 11px;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(6px);
  pointer-events: none;
  max-width: 340px;
}
#hint kbd {
  background: #31363e;
  border-radius: 3px;
  padding: 0 4px;
  font: inherit;
  font-size: 10.5px;
  color: #e6e9ee;
}

@media (max-width: 760px) {
  #app { grid-template-columns: 1fr; grid-template-rows: 1fr 46vh; }
  #side { order: 2; border-right: 0; border-top: 1px solid var(--line); }
  #stage-wrap { order: 1; }
}
