/* =====================================================
   Dot Waves β — раскладка: верхняя строка + вкладки справа.
   Подключается только в beta.html, оригинал (index.html) не трогает.
   ===================================================== */

:root { --nl-red: #F7343D; --bar-h: 52px; --line: #222; --muted: #8a8a8a; }

/* ---------- верхняя строка ---------- */
#topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 10px;
  height: var(--bar-h); padding: 0 16px;
  background: #0d0d0d; border-bottom: 1px solid var(--line);
}
#topbar .brand { display: flex; align-items: baseline; gap: 6px; flex: 0 0 auto; margin-right: 4px; }
#topbar .brand svg.nl { display: block; height: 15px; width: auto; color: var(--nl-red); align-self: center; }
#topbar .brand:has(svg.nl) { align-items: center; gap: 8px; }
#topbar .brand b { color: var(--nl-red); font: 900 18px/1 'Arial Black', Arial, sans-serif; letter-spacing: -1px; }
#topbar .brand span { font-size: 12px; color: var(--muted); }
#topbar .grp { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
#topbar .sep { width: 1px; height: 26px; background: var(--line); flex: 0 0 auto; }
#topbar button, #topbar select { width: auto; padding: 6px 10px; font-size: 12px; border-radius: 7px; }
#topbar select { padding-right: 26px; }
#topbar .btn-play { min-width: 38px; font-size: 14px; padding: 4px 10px; }
#topbar .timeline { flex: 1 1 160px; min-width: 120px; display: flex; flex-direction: column; gap: 3px; }
#topbar .timeline input[type=range] { width: 100%; }
#topbar .timeline .frame { font-size: 10px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#topbar .tempo-row { margin: 0; gap: 8px; }
#topbar .tempo-row button { flex: 0 0 auto !important; }
#topbar .beat-dots { gap: 5px; flex: 0 0 auto; }
#topbar .beat-dot { width: 12px; height: 12px; }
#topbar .bpm { width: 64px; padding: 5px 6px; border-radius: 7px; border: 1px solid #2a2a2a; background: #151515;
  color: #fff; font: 700 15px system-ui, -apple-system, sans-serif; text-align: center; }
#topbar .bpm:focus { outline: none; border-color: #00ff2b; }
#topbar .bpm-unit { font-size: 10px; color: var(--muted); margin-left: -4px; }
#topbar .chip { padding: 5px 9px; border-radius: 7px; font-size: 11px; font-weight: 600; cursor: pointer; user-select: none;
  border: 1px solid #2a2a2a; color: var(--muted); background: #151515; white-space: nowrap; }
#topbar .chip::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #444; margin-right: 6px; vertical-align: 1px; }
#topbar .chip.wait { color: #e8c15a; border-color: #4a3c14; } #topbar .chip.wait::before { background: #e8c15a; }
#topbar .chip.on { color: #7be08f; border-color: #1f4a28; } #topbar .chip.on::before { background: #39d25a; }
#topbar .export-btn { background: #4a1a1a; border-color: #6b2828; }
#topbar .icon-btn { min-width: 34px; }
/* плеер в строке */
#topbar .chip.pm-play { max-width: 190px; overflow: hidden; text-overflow: ellipsis; }
#topbar .chip.pm-next::before { display: none; }
#topbar .chip[hidden] { display: none; }

/* меню экспорта */
#export-pop {
  position: absolute; right: 60px; top: calc(var(--bar-h) - 4px); width: 320px; z-index: 30;
  background: #111; border: 1px solid #2a2a2a; border-radius: 12px; padding: 14px 16px;
  box-shadow: 0 12px 40px rgba(0,0,0,.6);
}
#export-pop[hidden] { display: none; }
#export-pop h3 { font-size: 11px; letter-spacing: .6px; text-transform: uppercase; color: #fff; margin: 0 0 6px; }

/* ---------- основная область ---------- */
body.beta main { min-height: calc(100vh - var(--bar-h)); padding: 16px 20px; }
body.beta #canvas-wrap canvas.p5Canvas { max-height: calc(100vh - var(--bar-h) - 34px); }
body.beta .panel { top: calc(var(--bar-h) + 16px); max-height: calc(100vh - var(--bar-h) - 32px); padding: 14px 16px 18px; }

/* пресет — компактно сверху */
.beta-presets { padding-bottom: 10px; border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.beta-presets .row, .beta-presets .row-flex, .beta-presets .check { margin: 6px 0; }
.beta-presets .row-flex button { padding: 6px 8px; font-size: 12px; }

/* вкладки */
.beta-tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin: 0 0 8px; position: sticky; top: -14px;
  background: #111; padding: 8px 0 6px; z-index: 2; }
.beta-tabs button { padding: 7px 4px; font-size: 12px; border-radius: 7px; }
.beta-tabs button.active { background: #fff; color: #000; border-color: #fff; }
.beta-pane[hidden] { display: none; }
.beta-pane h3 { font-size: 11px; letter-spacing: .8px; text-transform: uppercase; color: #fff; margin: 18px 0 2px;
  padding-top: 12px; border-top: 1px solid var(--line); }
.beta-pane h3:first-child { border-top: 0; padding-top: 4px; margin-top: 4px; }

/* «тонкие настройки» */
.beta-more { margin: 10px 0 4px; border: 1px solid #1d1d1d; border-radius: 8px; padding: 0 10px; }
.beta-more > summary { cursor: pointer; list-style: none; font-size: 11px; color: var(--muted); padding: 8px 0; user-select: none; }
.beta-more > summary::-webkit-details-marker { display: none; }
.beta-more > summary::before { content: "▸ "; }
.beta-more[open] > summary::before { content: "▾ "; }
.beta-more[open] { padding-bottom: 6px; }

/* превью Kinect / камеры — миниатюра в углу холста */
#live-thumb { position: absolute; right: 10px; bottom: 10px; width: 150px; z-index: 4; line-height: 0;
  border: 1px solid #333; border-radius: 6px; overflow: hidden; background: #000; pointer-events: none; }
#live-thumb[hidden] { display: none; }
#live-thumb canvas { width: 100% !important; display: block; border-radius: 0 !important; }

/* справка */
#beta-help { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.72); display: flex; align-items: center; justify-content: center; padding: 24px; }
#beta-help[hidden] { display: none; }
#beta-help .card { width: min(720px, 100%); max-height: 86vh; overflow: auto; background: #111; border: 1px solid #2a2a2a; border-radius: 14px; padding: 20px 22px; }
#beta-help h2 { font-size: 15px; margin: 0 0 12px; color: #fff; }
#beta-help .keys { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 13px; margin-bottom: 14px; }
#beta-help kbd { display: inline-block; min-width: 26px; text-align: center; padding: 2px 7px; border-radius: 5px; border: 1px solid #333; background: #1a1a1a; font: 600 12px system-ui; color: #fff; }
#beta-help .hint { opacity: .85; }

/* узкий экран: верхняя строка переносится */
@media (max-width: 1100px) {
  #topbar { height: auto; flex-wrap: wrap; padding: 8px 12px; row-gap: 8px; }
  #topbar .timeline { order: 10; flex-basis: 100%; }
  body.beta .panel { top: 16px; }
}

/* режим проектора — прячем и верхнюю строку */
body.show #topbar, body.show #live-thumb { display: none !important; }
#topbar .icon-btn.on { background: #F7343D; color: #fff; border-color: #F7343D; }

/* логотип NL 4X4 и подпись под ним (подпись — только на телефоне) */
#topbar .brand .nl-lock { display: flex; flex-direction: column; align-items: stretch; }
#topbar .brand .dw-cap { display: none; }
#topbar .brand .dw-ver { font-size: 10px; opacity: .7; margin-left: 4px; font-family: ui-monospace, "SF Mono", Menlo, monospace; }
#m-help .dw-ver { margin-top: 18px; font: 11px ui-monospace, "SF Mono", Menlo, monospace; opacity: .5; text-align: center; }
