:root {
  --bg: #050909;
  --panel: #0b1314;
  --panel2: #0f1a1c;
  --line: #1b2b2e;
  --text: #d6e6e5;
  --dim: #7d9596;
  --acc: #05dbd2;
  --acc-d: #0a6f6b;
  --acc2: #b45ac0;
  --danger: #ff5a5a;
}
* { box-sizing: border-box; }
html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font: 13px/1.45 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
button, select, input { font: inherit; color: inherit; }
#app { display: flex; height: 100vh; overflow: hidden; }
#stageCol { flex: 1; display: flex; flex-direction: column; min-width: 0; }
#stageArea {
  flex: 1; min-height: 0; position: relative;
  display: flex; align-items: center; justify-content: center;
  padding: 18px;
  background: radial-gradient(ellipse at 50% 40%, #0c1d1e 0%, #050909 70%);
}
#stage { position: relative; background: #000; box-shadow: 0 12px 50px rgba(0, 0, 0, 0.7), 0 0 0 1px #12201f; }
#stage canvas { display: block; width: 100%; height: 100%; }
#stage:fullscreen { width: 100vw !important; height: 100vh !important; background: #000; }
#stage:fullscreen canvas { object-fit: contain; }
#overlay {
  position: absolute; inset: 0; display: flex; flex-direction: column; gap: 14px;
  align-items: center; justify-content: center; background: rgba(0, 8, 8, 0.72);
  color: var(--text); font-size: 14px; text-align: center; padding: 20px;
}
#dropHint {
  position: absolute; inset: 10px; border: 2px dashed var(--acc); border-radius: 10px;
  display: flex; align-items: center; justify-content: center; background: rgba(0, 30, 30, 0.75);
  font-size: 16px; color: var(--acc); text-align: center; padding: 20px;
}
.hidden { display: none !important; }
.spinner {
  width: 34px; height: 34px; border-radius: 50%;
  border: 3px solid rgba(5, 219, 210, 0.2); border-top-color: var(--acc);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

#transport {
  display: flex; align-items: center; gap: 10px; padding: 10px 16px 14px;
  background: var(--panel); border-top: 1px solid var(--line);
}
#tl { flex: 1; height: 46px; position: relative; cursor: pointer; border-radius: 6px; overflow: hidden; background: #071011; }
#tl canvas { width: 100%; height: 100%; display: block; }
#timeLbl { font-variant-numeric: tabular-nums; color: var(--dim); min-width: 92px; text-align: right; }
.iconbtn {
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--panel2); cursor: pointer; font-size: 15px; display: flex; align-items: center; justify-content: center;
}
.iconbtn:hover { border-color: var(--acc); color: var(--acc); }
#btnPlay { background: var(--acc); color: #001414; border: none; font-size: 16px; }
#btnPlay:hover { filter: brightness(1.1); color: #001414; }

#panel {
  width: 370px; flex: none; overflow-y: auto; background: var(--panel); border-left: 1px solid var(--line);
  padding: 10px 0 40px;
}
#panel::-webkit-scrollbar { width: 8px; }
#panel::-webkit-scrollbar-thumb { background: #1e3133; border-radius: 4px; }
.brand { padding: 6px 18px 12px; display: flex; align-items: baseline; gap: 8px; }
.brand b { font-size: 15px; letter-spacing: 0.02em; }
.brand span { color: var(--dim); font-size: 12px; }
details { border-top: 1px solid var(--line); }
summary {
  list-style: none; cursor: pointer; padding: 11px 18px; font-weight: 600; letter-spacing: 0.02em;
  display: flex; align-items: center; justify-content: space-between; user-select: none;
}
summary::-webkit-details-marker { display: none; }
summary::after { content: '▸'; color: var(--dim); transition: transform 0.15s; }
details[open] summary::after { transform: rotate(90deg); }
.grp { padding: 2px 18px 14px; display: flex; flex-direction: column; gap: 9px; }
.row { display: flex; align-items: center; gap: 10px; justify-content: space-between; }
.row > label { color: var(--dim); flex: none; max-width: 52%; }
.row select, .row input[type='number'] { flex: 1; min-width: 0; }
select, input[type='number'] {
  background: var(--panel2); border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; outline: none;
}
select:focus, input:focus { border-color: var(--acc-d); }
input[type='range'] { flex: 1; accent-color: var(--acc); min-width: 0; }
input[type='checkbox'] { accent-color: var(--acc); width: 16px; height: 16px; }
.chk { display: flex; align-items: center; gap: 8px; cursor: pointer; color: var(--text); }
.btn {
  background: var(--panel2); border: 1px solid var(--line); border-radius: 7px; padding: 7px 12px; cursor: pointer;
}
.btn:hover { border-color: var(--acc); color: var(--acc); }
.btn.primary { background: var(--acc); color: #001414; border-color: var(--acc); font-weight: 600; }
.btn.primary:hover { filter: brightness(1.1); color: #001414; }
.btn.rec { background: #3a0d10; border-color: #6a1c22; color: #ffb0b0; }
.btn.rec.on { background: var(--danger); color: #fff; }
.btns { display: flex; gap: 8px; flex-wrap: wrap; }
.seg { display: flex; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.seg button { flex: 1; background: var(--panel2); border: none; padding: 7px 4px; cursor: pointer; border-right: 1px solid var(--line); }
.seg button:last-child { border-right: none; }
.seg button.on { background: var(--acc); color: #001414; font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; cursor: pointer; background: var(--panel2);
  font-size: 12px;
}
.chip.on { border-color: var(--acc); color: var(--acc); background: rgba(5, 219, 210, 0.08); }
.drop {
  border: 1px dashed #26403f; border-radius: 9px; padding: 12px; text-align: center; color: var(--dim);
  display: flex; flex-direction: column; gap: 8px; align-items: center;
}
.drop .btns { justify-content: center; }
.info { color: var(--dim); font-size: 12px; }
.info b { color: var(--text); font-weight: 600; }
.hint { color: var(--dim); font-size: 11.5px; line-height: 1.4; }
.swatches { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.sw {
  height: 38px; border-radius: 7px; cursor: pointer; border: 2px solid transparent; position: relative; overflow: hidden;
}
.sw.on { border-color: #fff; }
.sw span {
  position: absolute; left: 4px; bottom: 2px; font-size: 9.5px; color: #fff; text-shadow: 0 1px 2px #000;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; right: 4px;
}
.colors { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.colors label { display: flex; flex-direction: column; gap: 3px; font-size: 10.5px; color: var(--dim); align-items: center; }
.colors input[type='color'] {
  width: 100%; height: 28px; border: 1px solid var(--line); border-radius: 6px; background: none; padding: 0; cursor: pointer;
}
.react { display: grid; grid-template-columns: 1fr; gap: 10px; }
.rrow { background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.rrow .rt { font-size: 12px; font-weight: 600; }
.rrow .rc { display: flex; gap: 6px; }
.rrow .rc select { flex: 1; min-width: 0; padding: 4px 6px; font-size: 12px; }
.val { color: var(--acc); font-variant-numeric: tabular-nums; min-width: 38px; text-align: right; font-size: 12px; }
.kbd { color: var(--dim); font-size: 11px; padding: 10px 18px 0; line-height: 1.6; }
.kbd code { background: var(--panel2); border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; color: var(--text); }

@media (max-width: 920px) {
  #app { flex-direction: column; height: auto; overflow: visible; }
  #stageCol { height: 78vh; flex: none; }
  #panel { width: 100%; border-left: none; }
  #stageArea { padding: 10px; }
}

#bigPlay {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 92px; height: 92px; border-radius: 50%; border: 2px solid rgba(5, 219, 210, 0.9);
  background: rgba(0, 20, 20, 0.55); color: var(--acc); font-size: 34px; padding-left: 8px;
  cursor: pointer; box-shadow: 0 0 40px rgba(5, 219, 210, 0.35); backdrop-filter: blur(2px);
  transition: transform 0.15s, background 0.15s;
}
#bigPlay:hover { transform: translate(-50%, -50%) scale(1.06); background: rgba(5, 219, 210, 0.2); }
