:root {
  --bg: #17141c; --panel: #221d29; --line: #3a3244; --text: #f1ebe2; --muted: #a99fb3;
  --accent: #ff5a4e; --teal: #28c2c9; --mustard: #f2b632;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 "Apple SD Gothic Neo", "Noto Sans KR", system-ui, sans-serif; }
header { padding: 14px 20px 6px; }
h1 { margin: 0; font-size: 18px; }
header p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
main { display: grid; grid-template-columns: 1fr 1fr 1.6fr; gap: 12px; padding: 10px 20px; height: calc(100vh - 190px); min-height: 420px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; display: flex; flex-direction: column; overflow: hidden; }
.panel h2 { margin: 0; padding: 8px 12px; font-size: 13px; color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--line); }
.stage { position: relative; flex: 1; min-height: 0; }
.stage video, .stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; display: block; }
#overlay { pointer-events: none; }
#loading { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); }
#hand { position: absolute; left: 10px; bottom: 8px; font-size: 12px; color: var(--muted); }
footer { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 8px 20px 14px; }
footer button, footer select { background: #2e2737; color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 6px 12px; font: inherit; cursor: pointer; }
footer button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
#play { min-width: 92px; font-weight: 600; }
#clock { font-variant-numeric: tabular-nums; min-width: 120px; }
#seek { flex: 1; min-width: 200px; accent-color: var(--accent); }
label { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.cams { display: inline-flex; gap: 4px; }
@media (max-width: 900px) {
  main { grid-template-columns: 1fr 1fr; height: auto; }
  .panel { height: 46vh; }
  .panel.wide { grid-column: 1 / -1; height: 60vh; }
}
.hands { display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; border: 1px solid var(--line); border-radius: 8px; }
#beatNo { min-width: 76px; text-align: center; font-variant-numeric: tabular-nums; }
#saved { color: var(--teal); font-size: 12px; min-width: 40px; }
.cmp { color: var(--muted); font-size: 12px; }

/* 공개판: 졸라맨 + 3D 두 칸 */
body[data-mode="public"] main { grid-template-columns: 1fr 1.6fr; height: calc(100vh - 150px); }
