:root {
  color-scheme: dark;
  --bg: #0e0f12; --panel: #15171c; --line: #262a33; --ink: #e8eaf0; --muted: #8a90a0;
  --c: #ff5c4d;              /* cor do instrumento ativo, definida por app.js */
  --accent: #c8ff5c;         /* House */
}
body[data-style="nudisco"] { --accent: #ff8fd2; }
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg); color: var(--ink);
  font: 14px/1.3 -apple-system, "Inter", system-ui, sans-serif;
  display: flex; flex-direction: column; overflow: hidden; touch-action: none;
}
.top { display: flex; align-items: center; height: 52px; border-bottom: 1px solid var(--line); background: var(--panel); }
.top h1 { font-size: 17px; font-weight: 700; letter-spacing: .06em; margin: 0 auto 0 20px; }
.engine { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; margin-right: 18px; }
.engine i { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.engine.playing i { background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.play { height: 100%; padding: 0 28px; border: 0; background: var(--accent); color: #0e0f12; font: inherit; font-weight: 700; display: flex; align-items: center; gap: 10px; cursor: pointer; }
.play.playing { background: var(--ink); }
.score { position: relative; flex: 1; min-height: 0; }
#paper { position: absolute; inset: 0; width: 100%; height: 100%; cursor: crosshair; }
.empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); pointer-events: none; text-align: center; padding: 0 40px; transition: opacity .2s; }
.readout { position: absolute; top: 12px; right: 16px; font-variant-numeric: tabular-nums; color: var(--muted); font-size: 13px; pointer-events: none; }
.controls { display: flex; align-items: stretch; border-top: 1px solid var(--line); background: var(--panel); min-height: 72px; overflow-x: auto; }
.group { display: flex; align-items: center; gap: 6px; padding: 8px 14px; border-right: 1px solid var(--line); }
.group:last-child { border-right: 0; margin-left: auto; }
.field { flex-direction: column; align-items: flex-start; justify-content: center; gap: 6px; }
.field.wide { flex: 1; }
.field label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.field label small { text-transform: none; letter-spacing: 0; opacity: .7; margin-left: 4px; }
select { background: transparent; color: var(--ink); border: 0; font: inherit; font-weight: 600; padding: 0; cursor: pointer; }
.segment { display: flex; gap: 4px; }
.segment button, .flat {
  background: transparent; color: var(--muted); border: 1px solid transparent; border-radius: 6px;
  padding: 6px 10px; font: inherit; font-weight: 600; cursor: pointer;
}
.segment button { --c: var(--muted); }
.segment button.on { color: var(--c); border-color: var(--c); background: color-mix(in srgb, var(--c) 12%, transparent); }
#styles button.on { --c: var(--accent); }
.flat:hover, .segment button:hover { color: var(--ink); }
.flat.on { color: var(--ink); border-color: var(--line); }
.row { display: flex; align-items: center; gap: 10px; }
input[type="range"] { accent-color: var(--accent); width: 110px; }
output { min-width: 3ch; font-variant-numeric: tabular-nums; font-weight: 600; }
.check { flex-direction: row; align-items: center; gap: 8px; }
.check input { accent-color: var(--accent); width: 16px; height: 16px; }
.fx { display: none; gap: 20px; align-items: center; padding: 10px 16px; border-top: 1px solid var(--line); background: var(--panel); flex-wrap: wrap; }
.fx.open { display: flex; }
.fx label { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.fx output { color: var(--ink); }
.fxBtns { margin-left: auto; display: flex; gap: 6px; }
.dl .hint { font-size: 12px; color: var(--muted); }
.dlList { display: flex; gap: 6px; flex-wrap: wrap; color: var(--muted); font-size: 12px; }
.dlList button { border-color: var(--line); color: var(--ink); }
.dlList button:disabled { opacity: .6; cursor: progress; }
@media (max-width: 900px) { .group { padding: 8px 10px; } input[type="range"] { width: 80px; } }
