/* live.css — Live / setlist view */

/* Sticky top block: status + tempo row, then tabs */
.live-sticky {
  position: sticky;
  top: 64px;
  z-index: 10;
  background: var(--bg);
  margin-left: -2rem;
  margin-right: -2rem;
  padding-left: 2rem;
  padding-right: 2rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1rem;
}

.live-topbar {
  display: flex;
  align-items: stretch;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.65rem 0;
}

/* Tabs */
.live-tabs {
  display: flex;
  gap: 0;
}

.live-tab {
  padding: 0.6rem 1.5rem;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.live-tab.active {
  color: var(--accent2);
  border-bottom-color: var(--accent);
}
@media (hover: hover) {
  .live-tab:hover:not(.active) { color: var(--text); }
}
.live-tab:focus-visible { outline: 2px solid var(--accent2); outline-offset: -2px; }

/* Panels */
.live-panel {
  padding-top: 0.5rem;
}

/* Setlist row inside RIG panel */
.live-setlist-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

/* Preset bar inside DRUMS panel */
.drums-preset-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

/* Status badge — shared, see shared-controls.css */

/* .info-card supplies the background/border/padding — .topbar-box only adds
   the sizing/layout behavior specific to the sticky top bar (twice the
   height of the original single-line bar, tempo box stretches to fill the
   row up to the status box). */
.topbar-box {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.6rem;
  min-height: 112px;
  box-sizing: border-box;
}
.tempo-box { flex: 1; }
.status-box { flex-shrink: 0; }

/* Higher specificity than drums.css's plain .tempo-group (margin-left:auto;
   padding-left:2rem, for drums.html's own standalone top bar) — live.html
   loads drums.css too for the DRUMS tab panel, and since it's loaded after
   live.css, its .tempo-group rule would otherwise win and push the tempo
   controls to the right of their own box instead of filling it. */
.topbar-box .tempo-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: 0;
  padding-left: 0;
}


/* .live-label — shared, see shared-controls.css */

.live-select {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 0.9rem;
  padding: 0.5rem 0.85rem;
  cursor: pointer;
  transition: border-color 0.15s;
  min-width: 240px;
  flex: 1;
}
.live-select:focus { outline: none; border-color: var(--accent); }
.live-select:focus-visible { outline: 2px solid var(--accent2); outline-offset: 0; }

/* .tempo-btn / .tempo-tap / .tempo-input — shared, see shared-controls.css */

/* Rig list */
.rig-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.rig-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 1.1rem;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  user-select: none;
}
.rig-item:hover { border-color: var(--accent); background: var(--surface2); }

.rig-item-active {
  border-color: var(--accent);
  background: rgba(224,90,0,0.08);
}

.rig-item-loading {
  opacity: 0.5;
  pointer-events: none;
}

.rig-empty {
  cursor: default;
  color: var(--text-muted);
  font-size: 0.88rem;
  justify-content: center;
  padding: 2rem;
  border-style: dashed;
}
.rig-empty:hover { border-color: var(--border); background: var(--surface); }

.rig-index {
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  flex-shrink: 0;
}
.rig-item-active .rig-index {
  background: var(--accent);
  border-color: var(--accent);
  color: #000;
}

.rig-name {
  flex: 1;
  font-size: 0.95rem;
  font-weight: 500;
}

.rig-bpm {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.rig-active-badge {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent2);
  padding: 0.15rem 0.5rem;
  border: 1px solid var(--accent);
  border-radius: 20px;
}

@media (max-width: 640px) {
  .live-sticky {
    margin-left: -1rem;
    margin-right: -1rem;
    padding-left: 1rem;
    padding-right: 1rem;
  }
  /* Pedal connection status is already visible via the header's own
     pedal-status icon — drop this duplicate box on narrow screens. */
  .status-box { display: none; }
}


/* ── RIG tab: live editor for the active rig (live-rig.js) ───────────────── */
.lr-beta { font-size: 0.8rem; line-height: 1.45; color: var(--text-muted); background: rgba(232,168,56,0.07); border: 1px solid rgba(232,168,56,0.45); border-radius: 10px; padding: 0.6rem 0.85rem; margin: 0 0 1rem; }
.lr-beta a { color: var(--accent2); }
.lr-beta-tag { display: inline-block; margin-right: 0.35rem; padding: 0 0.45rem; border-radius: 20px; background: #e8a838; color: #1a1205; font-size: 0.66rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }
.lr-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}
.lr-rig-name { font-size: 1.15rem; font-weight: 700; }
.lr-rig-state { font-size: 0.78rem; color: var(--text-muted); margin-top: 0.15rem; }
.lr-rig-state.lr-dirty { color: var(--accent2); }
.lr-tools { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.lr-select {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font: inherit;
  font-size: 0.85rem;
  padding: 0.4rem 0.6rem;
  cursor: pointer;
}
.lr-select:focus-visible { outline: 2px solid var(--accent2); outline-offset: 0; }
.lr-btn {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.4rem 0.75rem;
  cursor: pointer;
}
.lr-btn:hover:not(:disabled) { border-color: var(--accent); }
.lr-btn:disabled { opacity: 0.45; cursor: default; }
.lr-btn:focus-visible { outline: 2px solid var(--accent2); outline-offset: 2px; }
.lr-btn-primary { background: var(--accent); border-color: var(--accent); color: #000; }
.lr-message { font-size: 0.82rem; color: var(--text-muted); min-height: 1.2rem; margin-bottom: 0.75rem; }
.lr-message-ok { color: #4caf50; }
.lr-message-error { color: #e05555; }

.lr-chain.lr-busy { opacity: 0.6; pointer-events: none; }
.lr-chain { display: block; }
.lr-chain-row { display: flex; align-items: center; width: max-content; }
.lr-chain-row + .lr-chain-row { margin-top: 0.75rem; }
.lr-row-spacer { width: 90px; flex-shrink: 0; }
.lr-double { cursor: grab; }
.lr-double .chain-block:hover { transform: none; }
.lr-x2 {
  position: absolute;
  top: 3px;
  right: 3px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.55rem;
  font-weight: 700;
  line-height: 1;
  padding: 0.15rem 0.25rem;
  cursor: pointer;
}
.lr-x2:hover:not(:disabled) { color: var(--text); border-color: var(--text-muted); }
.lr-x2.on { background: var(--accent); border-color: var(--accent); color: #000; }
.lr-x2:focus-visible { outline: 2px solid var(--accent2); outline-offset: 1px; }
.lr-empty .block-card { border-style: dashed; opacity: 0.55; }
.lr-empty .block-icon { font-weight: 700; color: var(--text-muted); }
.lr-empty:hover .block-card { opacity: 1; border-color: var(--accent); }
.lr-off .block-card { opacity: 0.45; }
.lr-off-tag {
  position: absolute;
  top: 4px;
  left: 6px;
  font-size: 0.5rem;
  font-weight: 700;
  color: var(--text-muted);
}

.lr-detail-cat { font-size: 0.72rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; }
.lr-onoff { margin-left: auto; }
.lr-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.25rem; }
.lr-preset { min-width: 10rem; }
.lr-no-params { grid-column: 1 / -1; font-size: 0.85rem; color: var(--text-muted); }

.lr-picker {
  background: var(--surface);
  border: 1.5px solid var(--accent);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
}
.lr-picker-title { font-weight: 700; margin-bottom: 0.75rem; }
.lr-picker-row { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.75rem; }
.lr-picker-row .lr-select { flex: 1; min-width: 10rem; }

/* ── "Connect your pedal" popup (live.js showLiveIntro) ──────────────────── */
.live-intro { max-width: 500px; }
.live-intro h3 { margin: 0 2rem 0.5rem 0; }
.live-intro h4 { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-muted); margin: 1.25rem 0 0.5rem; }
.live-intro-lead { font-size: 1rem; font-weight: 600; line-height: 1.45; margin: 0 0 0.5rem; }
.live-intro-status-row { display: flex; align-items: center; gap: 0.75rem; margin-top: 1.25rem; }
.live-intro-status { color: #e8a838; font-size: 0.85rem; margin: 0; flex: 1; min-width: 0; }
.live-intro-retry { flex-shrink: 0; padding: 0.35rem 0.75rem; font-size: 0.8rem; }
.live-intro-list { margin: 0.75rem 0 0; padding-left: 1.2rem; font-size: 0.88rem; line-height: 1.5; }
.live-intro-list li + li { margin-top: 0.35rem; }
.live-intro-note { font-size: 0.8rem; color: var(--text-muted); margin: 1rem 0 0; line-height: 1.45; }
.live-intro-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.5rem; }
.live-intro-actions a.btn { text-decoration: none; }

/* Routing picker with pictures + routing-aware signal chain (live-rig.js) */
.lr-routing { position: relative; }
.lr-routing-btn { display: inline-flex; align-items: center; gap: 0.45rem; padding: 0.3rem 0.6rem; }
.lr-routing-svg { width: 40px; height: 17px; flex-shrink: 0; display: block; }
.lr-routing-pop {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 50;
  display: grid; grid-template-columns: repeat(2, minmax(150px, 1fr)); gap: 0.4rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 0.6rem;
  box-shadow: 0 12px 32px rgba(0,0,0,0.5); width: max-content; max-width: calc(100vw - 2rem);
}
.lr-routing-pop[hidden] { display: none; }
.lr-routing-opt {
  display: flex; align-items: center; gap: 0.5rem; text-align: left;
  background: var(--surface2); border: 1px solid var(--border); border-radius: 8px;
  color: var(--text); font: inherit; font-size: 0.78rem; padding: 0.4rem 0.55rem; cursor: pointer;
}
.lr-routing-opt .lr-routing-svg { width: 56px; height: 24px; }
.lr-routing-opt:hover { border-color: var(--text-muted); }
.lr-routing-opt.active { border-color: var(--accent2); background: #3a2416; }
.lr-routing-opt:focus-visible { outline: 2px solid var(--accent2); outline-offset: 2px; }
.lr-chain { position: relative; }
.lr-chain .chain-arrow { width: 14px; padding: 0; text-align: center; }
.lr-chain-label { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-muted); margin: 0.75rem 0 0.35rem; }
.lr-chain-label:first-child { margin-top: 0; }
.lr-chain-row { position: relative; }
.lr-branch { min-height: 1px; }
.lr-branch-tag { position: absolute; top: 50%; transform: translate(-130%, -50%); font-size: 0.65rem; font-weight: 700; color: var(--text-muted); border: 1px solid var(--border); border-radius: 4px; padding: 0 0.3rem; }
.lr-branch:first-child .lr-branch-tag { color: #e8a838; border-color: #e8a838; }
.lr-branch:last-child .lr-branch-tag { color: #5aa0d8; border-color: #5aa0d8; }
.lr-branch-gap { flex-shrink: 0; border-top: 1px dashed var(--border); align-self: center; }
.lr-node .block-card { width: 52px; padding: 0.5rem 0.2rem; opacity: 0.75; border-top: 3px solid #444; }
.lr-node .block-name { font-size: 0.6rem; letter-spacing: 0.08em; }
@media (max-width: 640px) { .lr-routing-pop { grid-template-columns: 1fr; right: auto; left: 0; } }
