:root {
  --bg: #0b0f14;
  --panel: #10161e;
  --line: #222c38;
  --text: #e9e3d4;
  --muted: #8d97a3;
  --accent: #f2c14e;
  --btn: #18212c;
  --btn-on: #2a3a2f;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text);
  font: 14px/1.45 Inter, system-ui, sans-serif; }
#app { display: flex; height: 100vh; height: 100dvh; }

#panel { width: 300px; flex: none; overflow-y: auto; background: var(--panel);
  border-right: 1px solid var(--line); padding: 18px 18px 28px; scrollbar-width: none; }
#panel::-webkit-scrollbar { display: none; }
header h1 { font: 600 22px/1.2 Fraunces, Georgia, serif; margin: 0 0 4px; }
.lede { margin: 0; color: var(--muted); }
section { margin-top: 20px; }
h2 { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
  margin: 0 0 8px; font-weight: 600; }
.note { color: var(--muted); font-size: 12.5px; margin: 8px 0 0; }

.seg { display: flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg.wrap { flex-wrap: wrap; }
.seg.wrap button { flex: 1 1 50%; }
.seg button { flex: 1; background: var(--btn); color: var(--text); border: 0; padding: 8px 6px;
  font: inherit; font-size: 13px; cursor: pointer; border-right: 1px solid var(--line); }
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--btn-on); color: var(--accent); font-weight: 600; }
.seg button:disabled { opacity: .35; cursor: not-allowed; }

.row { display: flex; justify-content: space-between; margin-top: 10px; }
output { color: var(--accent); font-variant-numeric: tabular-nums; }
input[type=range] { width: 100%; accent-color: var(--accent); margin: 4px 0 0; }
.check { display: flex; gap: 8px; align-items: center; margin-top: 10px; cursor: pointer; }
.check input { accent-color: var(--accent); }
.check.disabled { opacity: .35; pointer-events: none; }

.buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.btn { flex: 1; background: var(--btn); color: var(--text); border: 1px solid var(--line);
  border-radius: 8px; padding: 9px 8px; font: inherit; font-size: 13px; cursor: pointer; }
.btn:hover, .seg button:hover:not(:disabled) { filter: brightness(1.25); }
.btn.primary { width: 100%; margin-top: 4px; background: var(--btn-on); color: var(--accent);
  font-weight: 600; border-color: #3b5444; }
.btn.primary.active { background: #4a2f2f; color: #ffb4a8; border-color: #6b3f3f; }
.btn:disabled { opacity: .45; cursor: default; filter: none; }

#stage { position: relative; flex: 1; min-width: 0; }
#c { display: block; width: 100%; height: 100%; touch-action: none; cursor: crosshair; }
#hud { position: absolute; left: 16px; top: 14px; color: var(--muted); font-size: 12.5px;
  pointer-events: none; font-variant-numeric: tabular-nums; }
#hud b { color: var(--text); font-weight: 500; }
#hint { position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%);
  background: rgba(16,22,30,.85); border: 1px solid var(--line); padding: 7px 14px;
  border-radius: 20px; font-size: 13px; pointer-events: none; transition: opacity .6s; }
#hint.gone { opacity: 0; }

@media (max-width: 760px) {
  #app { flex-direction: column-reverse; }
  #panel { width: 100%; height: 46vh; border-right: 0; border-top: 1px solid var(--line);
    padding: 14px 16px 24px; }
  #stage { flex: 1; min-height: 0; }
}
