:root {
  --bg-dark: #0a0c10;
  --surface: #10131d;
  --panel-bg: #141721;
  --panel-bg-low: #181b25;
  --panel-bg-dark: #0f1117;
  --panel-bg-lowest: #0b0e18;
  --panel-border: #232838;
  --panel-border-soft: #1c1f2a;

  --accent-green: #10b981;
  --accent-green-light: #4edea3;
  --accent-amber: #f59e0b;
  --accent-amber-light: #ffb95f;
  --accent-blue: #3b82f6;
  --accent-blue-light: #adc6ff;
  --accent-red: #ef4444;
  --accent-purple: #a855f7;

  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --text-dim: #6b7280;

  --font-body: "Chivo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", "Courier New", monospace;

  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-xl: 12px;

  --topbar-h: 48px;
}

/* Reset */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: var(--font-body);
  user-select: none;
}

html,
body {
  min-height: 100%;
}

body {
  background: var(--bg-dark);
  color: var(--text-main);
  padding: 6px;
  padding-top: calc(var(--topbar-h) + 6px);
  padding-bottom: 6px;
  min-height: 100dvh;
  overflow-x: hidden;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

/* Ícones SVG */
.icon {
  display: inline-block;
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.icon-sm { width: 16px; height: 16px; }
.icon-lg { width: 24px; height: 24px; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Topbar */
.top-bar-compact {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 8px;
  height: var(--topbar-h);
  padding: 0 10px;
  background: rgba(20, 23, 33, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--panel-border);
}

.top-bar-compact .scene-name {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-blue-light);
  letter-spacing: 0.6px;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.top-bar-compact .time-info {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  white-space: nowrap;
}

/* Bolinha de gravação */
.record-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-red);
  box-shadow: 0 0 10px var(--accent-red);
  animation: pulseRecord 1s infinite alternate;
  flex-shrink: 0;
}

@keyframes pulseRecord {
  from { opacity: 0.4; }
  to { opacity: 1; }
}

.sidebar-btn.recording {
  border-color: var(--accent-red);
  color: var(--accent-red);
  background: rgba(239, 68, 68, 0.08);
}

.sidebar-btn.recording .icon {
  color: var(--accent-red);
}

/* Botões de ícone */
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  border: none;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-main);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.btn-icon:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--accent-green-light);
}

.btn-icon-sm {
  min-width: 28px;
  height: 28px;
}

/* Sidebar */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 900;
  display: none;
}

.sidebar-overlay.visible {
  display: block;
}

.sidebar {
  position: fixed;
  top: 0;
  left: -320px;
  width: 300px;
  max-width: 85vw;
  height: 100vh;
  background: var(--panel-bg);
  border-right: 1px solid var(--panel-border);
  z-index: 1000;
  padding: 14px;
  overflow-y: auto;
  transition: left 0.22s ease;
  box-shadow: 8px 0 30px rgba(0, 0, 0, 0.35);
}

.sidebar.open {
  left: 0;
}

.sidebar-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--panel-border);
}

.sidebar-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-logo {
  font-size: 20px;
  color: var(--accent-green-light);
}

.sidebar-title span {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 800;
  color: var(--accent-blue-light);
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.sidebar-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-md);
  background: var(--panel-bg-dark);
  color: var(--text-main);
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.sidebar-close:hover {
  border-color: var(--accent-blue);
}

.sidebar-group {
  margin-bottom: 18px;
}

.sidebar-group-title {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 800;
  margin-bottom: 7px;
  text-transform: uppercase;
  letter-spacing: 0.7px;
}

.sidebar-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  margin-bottom: 6px;
  background: var(--panel-bg-dark);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-md);
  color: var(--text-main);
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.sidebar-btn:hover {
  background: #1a1e2b;
  border-color: var(--accent-blue);
}

.sidebar-btn.loaded {
  border-color: var(--accent-green);
  color: var(--accent-green);
}


.sidebar-btn.is-danger {
  color: var(--accent-red);
  border-color: rgba(239, 68, 68, 0.4);
}

.sidebar-btn.is-danger:hover {
  background: rgba(239, 68, 68, 0.08);
  border-color: var(--accent-red);
}

/* Container principal */
.container {
  /* display: grid; */
  /* grid-template-columns: 1fr; */
  display: flex;
  justify-content: center;
  gap: 6px;
  padding-bottom: 6px;
  align-items: start;
}

/* Painéis laterais */
.panel-lateral {
  display: flex;
  flex-direction: column;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  min-height: 200px;
}

.panel-lateral-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid var(--panel-border);
  background: var(--panel-bg-low);
}

.panel-lateral-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.7px;
}

.panel-lateral-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 6px;
}

.panel-empty {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-dim);
  text-align: center;
  padding: 30px 6px;
}

/* Stage central */
.stage {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  width: 100%;
  max-width: 1200px;
}

/* Letra */
.lyrics-container {
  background: #000;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  padding: 6px;
  width: 100%;
  aspect-ratio: 16/11;
  overflow-y: auto;
  flex-shrink: 0;
}

.lyrics-content {
  font-size: 1rem; color: #fff;
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  min-height: 100%;
}

.lyrics-empty {color: var(--text-muted);font-family: var(--font-body);font-size: 14px;}

.lyrics-content pre {
  font-family: "Courier New", monospace;
  white-space: pre-wrap;
  overflow: hidden;
  word-wrap: break-word;
  word-break: normal;
  text-align: left;
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
  tab-size: 0;
}

.lyrics-content h1,
.lyrics-content h2,
.lyrics-content h3,
.lyrics-content h4,
.lyrics-content h5,
.lyrics-content h6,
.lyrics-content p {width: 100%;text-align: center; margin: 6px 0; padding: 0; display: block;}

.lyrics-content h1{font-size: 1.5rem;}
.lyrics-content h2{font-size: .8rem;}
.lyrics-content h3{font-size: .8rem;}
.lyrics-content p {font-size: .6rem; line-height: 1.5;}
.lyrics-content p b{color: var(--accent-amber-light);}

.lyrics-content wbr,
.lyrics-content pre wbr {display: none;visibility: hidden;position: absolute;}

.lyrics-content pre br {
  content: "";
  display: block;
}

.lyrics-content .chord {
  color: var(--accent-amber-light);
  font-weight: 800;
  font-size: 14px;
}

/* Progresso da letra */
.lyrics-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
}

.lyrics-progress-text {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--accent-green-light);
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.lyrics-progress-track {
  flex: 1;
  height: 4px;
  background: var(--panel-border);
  border-radius: 2px;
  overflow: hidden;
}

.lyrics-progress-fill {
  width: 0%;
  height: 100%;
  background: var(--accent-green);
  box-shadow: 0 0 8px rgba(78, 222, 163, 0.5);
  border-radius: 2px;
  transition: width 0.2s ease;
}

/* Controles da letra */
.lyrics-controls {
  display: flex;
  align-items: stretch;
  gap: 4px;
  padding: 6px 8px;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  flex-wrap: nowrap;
}

.bpm-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 6px;
  min-height: 36px;
  background: var(--panel-bg-dark);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color 0.15s ease;
  flex-shrink: 0;
}

.bpm-pill:hover {
  border-color: var(--accent-amber);
}

.bpm-value {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 800;
  color: var(--accent-amber-light);
}

.bpm-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-amber);
  box-shadow: 0 0 6px var(--accent-amber);
  display: none;
}

.bpm-label {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.6px;
  display: none;
}

.btn-tiny {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  min-width: 36px;
  padding: 0 8px;
  background: var(--panel-bg-dark);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-md);
  color: var(--text-main);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  transition: background-color 0.15s ease, border-color 0.15s ease;
  flex-shrink: 0;
}

.btn-tiny:hover {
  background: #1a1f2e;
  border-color: var(--accent-blue);
}

.btn-toggle {
  min-width: 74px;
}

.btn-toggle.auto-active {
  background: var(--accent-green);
  border-color: var(--accent-green);
  color: #000;
}

.btn-play {
  flex: 1;
  min-height: 36px;
  padding: 0 14px;
  background: var(--accent-green);
  color: #000;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(78, 222, 163, 0.35);
  transition: transform 0.05s ease, background-color 0.15s ease;
}

.btn-play:active {
  transform: scale(0.98);
}

.btn-play.btn-red {
  background: var(--accent-red);
  color: #fff;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.35);
}

/* Painéis */
.panel-block {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  padding: 10px;
  width: 100%;
}

.section-header-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
  color: var(--accent-blue-light);
  text-transform: uppercase;
  margin-bottom: 10px;
  letter-spacing: 0.8px;
}

.section-header-title.amber {
  color: var(--accent-amber-light);
}

.next-variation-label {
  color: var(--accent-amber);
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 10px;
  text-transform: uppercase;
  white-space: nowrap;
}

.vs-pending-info {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-muted);
}

/* Arranger */
.arranger-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.btn-section {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--panel-bg-dark);
  border: 2px solid var(--panel-border);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-family: var(--font-mono);
  font-weight: 800;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-section-main {min-height: 70px;font-size: 18px;letter-spacing: 1px}
.btn-section-sub {min-height: 50px;font-size: 10px;letter-spacing: 0.5px;}

.btn-section:hover {border-color: var(--accent-blue)}
.btn-section.is-empty {opacity: 0.25}
.btn-section.armed {border-color: var(--accent-amber);background: #2e1a05;}
.btn-section.active {border-color: var(--accent-green);background: #063726;color: #fff;box-shadow: 0 0 10px rgba(78, 222, 163, 0.35)}

.btn-section.queued {border-color: var(--accent-amber);animation: pulse 0.6s infinite alternate;}

.btn-section.next-intro {box-shadow: inset 0 -3px 0 var(--accent-amber);}
.btn-section.default-break::after {
  content: "★";
  position: absolute;
  top: 4px;
  right: 6px;
  font-size: 12px;
  color: var(--accent-amber);
}

.btn-section.default-ending::after {
  content: "★";
  position: absolute;
  top: 4px;
  right: 6px;
  font-size: 12px;
  color: var(--accent-purple);
}

.btn-section.marked-up::before,
.btn-section.marked-down::before {
  position: absolute;
  top: 4px;
  left: 6px;
  font-size: 12px;
  line-height: 1;
}

.btn-section.marked-up::before {
  content: "▲";
  color: var(--accent-green);
}

.btn-section.marked-down::before {
  content: "▼";
  color: var(--accent-blue-light);
}

@keyframes pulse {from {opacity: 0.5}to {opacity: 1}}

/* Pads */
.vs-section {display: block}

.pads-grid {display: grid;grid-template-columns: repeat(6, 1fr);gap: 6px;}

.pad-btn {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  min-height: 40px; padding: 6px;
  background: var(--panel-bg-dark); color: var(--text-main);
  border: 1px solid var(--panel-border); border-radius: var(--radius-md);
  font-family: var(--font-mono); font-size: 11px; font-weight: 700;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.15s ease;
}

.pad-btn .pad-name {white-space: nowrap; overflow: hidden; text-overflow: ellipsis}
.pad-btn.is-empty {opacity: 0.25}
.pad-btn.pending, .pad-btn.armed {
  border-color: var(--accent-blue-light); background: var(--accent-blue); color: #fff; 
  animation: pulse 0.6s infinite alternate;
}
.pad-btn.active {border-color: var(--accent-green); background: var(--accent-green); color: #000}
.pad-btn.loop-active {border: 2px dashed var(--accent-green);}
.pad-btn.active.loop-active {border-style: solid;border-color: #fff}

.pad-sync-label {
  position: absolute;
  bottom: 3px;
  right: 5px;
  font-family: var(--font-mono);
  font-size: 8px;
  color: var(--text-muted);
}

.pad-loop-indicator {
  position: absolute;
  top: 3px;
  left: 5px;
  font-size: 10px;
  color: var(--accent-green);
  font-weight: 800;
}

.pad-btn.active .pad-sync-label,
.pad-btn.active .pad-loop-indicator {color: #000}


/* Modais */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.68);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 1100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 12px;
}

.modal-overlay.visible {display: flex;}

.modal-card {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  padding: 14px;
  width: min(600px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-mixer {width: min(900px, 100%)}
.modal-tempo {width: min(360px, 100%)}
.modal-settings {width: min(480px, 100%)}

.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: 10px; border-bottom: 1px solid var(--panel-border)
}

.modal-title-group {display: flex; align-items: center; gap: 8px}

.modal-title {
  color: var(--accent-blue-light);
  font-family: var(--font-mono);
  font-size: .8rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.8px;
}

.modal-dot {display: inline-block; width: 8px; height: 8px; border-radius: 2px;}
.modal-dot.blue { background: var(--accent-blue); box-shadow: 0 0 6px rgba(59, 130, 246, 0.6)}

.modal-close {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px;
  background: var(--panel-bg-dark); color: var(--text-main);
  border: 1px solid var(--panel-border); border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.modal-close:hover {border-color: var(--accent-blue); color: #fff;}

.modal-body {display: flex;flex-direction: column;gap: 12px}
.modal-footer {
  font-family: var(--font-mono); font-size: 10px; text-align: center;
  color: var(--text-muted); padding-top: 10px; border-top: 1px solid var(--panel-border);
}

.modal-footer-buttons {display: flex;flex-direction: column;gap: 8px}

/* Formulários */
.form-group {display: flex; flex-direction: column;gap: 4px;}
.form-row {display: flex;gap: 10px;flex-wrap: wrap;}
.form-row .form-group {flex: 1;min-width: 120px}

.form-group-checkbox{flex-direction: row; justify-content: flex-end;}
.form-group-checkbox label{display: flex; flex-direction: column; justify-content: flex-end;}

.form-group label {
  font-family: var(--font-mono); text-transform: uppercase;
  font-size: 10px; font-weight: 700; letter-spacing: 0.6px;
  color: var(--text-muted);
}

.form-group input[type="text"], .form-group input[type="number"], .form-group select {
  background: var(--panel-bg-dark); color: var(--text-main);
  border: 1px solid var(--panel-border);border-radius: var(--radius-sm);
  padding: 9px 10px;
  font-family: var(--font-mono); font-size: 12px; font-weight: 600;
  outline: none; transition: border-color 0.15s ease;
}

.form-group input[type="text"]:focus,
.form-group input[type="number"]:focus,
.form-group select:focus {border-color: var(--accent-blue);}

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-main);
  text-transform: none;
  letter-spacing: 0;
}

.checkbox-label input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  width: 56px;
  height: 32px;
  margin: 0;
  border-radius: 999px;
  background: var(--panel-bg-dark);
  border: 1px solid var(--panel-border);
  cursor: pointer;
  flex-shrink: 0;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.checkbox-label input[type="checkbox"]::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--text-dim);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
  transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.2s ease;
}

.checkbox-label input[type="checkbox"]:hover {
  border-color: var(--accent-green);
}

.checkbox-label input[type="checkbox"]:checked {
  background: var(--accent-green);
  border-color: var(--accent-green);
}

.checkbox-label input[type="checkbox"]:checked::before {
  background: #fff;
  transform: translateX(24px);
}

.checkbox-label input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: 2px;
}

.file-input-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--panel-bg-dark);
  color: var(--text-muted);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  min-height: 40px;
  word-break: break-all;
  transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}

.file-input-label:hover {
  border-color: var(--accent-blue);
  color: var(--text-main);
}

.file-input-label.loaded {
  border-color: var(--accent-green);
  color: var(--accent-green);
  background: rgba(16, 185, 129, 0.08);
}

/* Botões de ação */
.btn-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 14px;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.05s ease, filter 0.15s ease, background-color 0.15s ease;
}

.btn-action:active {
  transform: scale(0.98);
}

.btn-action.btn-green {
  background: var(--accent-green);
  color: #0b0e18;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.25);
}

.btn-action.btn-green:hover {
  filter: brightness(1.08);
}

.btn-action.btn-blue {
  background: var(--accent-blue);
  color: #fff;
}

.btn-action.btn-blue:hover {
  filter: brightness(1.08);
}

.btn-action.btn-red {
  background: var(--panel-bg-dark);
  color: var(--accent-red);
  border: 1px solid rgba(239, 68, 68, 0.5);
}

.btn-action.btn-red:hover {
  background: rgba(239, 68, 68, 0.08);
  border-color: var(--accent-red);
}

.btn-action-modal {
  padding: 12px 14px;
}

.export-midi {
  margin-top: 4px;
  min-height: 32px;
  font-size: 10px;
}

/* Mixer */
.mixer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.mixer-channel {
  background: var(--panel-bg-dark);
  padding: 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--panel-border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.channel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.channel-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-main);
}

.channel-dot {
  width: 4px;
  height: 14px;
  border-radius: 2px;
}

.channel-dot.amber {
  background: var(--accent-amber);
}

.channel-dot.green {
  background: var(--accent-green);
}

.channel-dot.blue {
  background: var(--accent-blue-light);
}

.channel-value {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-main);
  background: var(--panel-bg-low);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
}

.mixer-channel input[type="range"] {
  width: 100%;
  height: 4px;
  background: var(--panel-border);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

.mixer-channel input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent-amber);
  cursor: pointer;
}

.mixer-channel:nth-child(2) input[type="range"]::-webkit-slider-thumb {
  background: var(--accent-green);
}

.mixer-channel:nth-child(3) input[type="range"]::-webkit-slider-thumb {
  background: var(--accent-blue-light);
}

.mixer-row {
  display: flex;
  gap: 6px;
  align-items: center;
}

.mixer-row select {
  flex: 1;
  background: var(--panel-bg-dark);
  color: var(--text-main);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
  padding: 6px 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  outline: none;
}

.mixer-toggle {
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
  background: var(--panel-bg-low);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.mixer-toggle.on {
  background: var(--accent-green);
  color: #000;
  border-color: var(--accent-green);
}

.mixer-toggle.muted {
  background: var(--accent-red);
  color: #fff;
  border-color: var(--accent-red);
}

/* Modal tempo */
.tempo-display-box {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
  padding: 16px;
  background: var(--panel-bg-lowest);
  border-radius: var(--radius-lg);
  box-shadow: inset 0 0 30px rgba(245, 158, 11, 0.1);
}

.tempo-display-input {
  width: 130px;
  background: transparent;
  border: none;
  outline: none;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 52px;
  font-weight: 800;
  color: var(--accent-amber-light);
  line-height: 1;
  text-shadow: 0 0 20px rgba(255, 185, 95, 0.4);
}

.tempo-display-unit {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-amber);
  letter-spacing: 1.5px;
}

.tempo-steps {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
}

.tempo-step {
  min-height: 42px;
  background: var(--panel-bg-low);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.1s ease;
}

.tempo-step:hover {
  border-color: var(--accent-amber);
}

.tempo-step:active {
  background: var(--accent-amber);
  color: #000;
}

.btn-tap-tempo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 0 16px;
  background: var(--accent-blue);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.35);
  transition: transform 0.05s ease;
}

.btn-tap-tempo:active {
  transform: scale(0.98);
}

.tap-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #fff;
}

/* Modal configurações */
.settings-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.settings-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.settings-section-title {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.badge-pill {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  background: var(--panel-bg-dark);
  color: var(--text-muted);
  border: 1px solid var(--panel-border);
  text-transform: uppercase;
}

.badge-pill.is-green {
  background: rgba(16, 185, 129, 0.1);
  color: var(--accent-green);
  border-color: rgba(16, 185, 129, 0.3);
}

.badge-pill.is-amber {
  background: rgba(245, 158, 11, 0.1);
  color: var(--accent-amber);
  border-color: rgba(245, 158, 11, 0.3);
}

.badge-pill.is-red {
  background: rgba(239, 68, 68, 0.1);
  color: var(--accent-red);
  border-color: rgba(239, 68, 68, 0.3);
}

.settings-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: var(--panel-bg-dark);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-md);
}

.settings-card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-md);
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  color: var(--text-muted);
  flex-shrink: 0;
}

.settings-card-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.settings-card-title {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.settings-card-desc {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-dim);
}

.settings-warning {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: var(--accent-amber);
  line-height: 1.4;
}

/* Loading */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 12, 16, 0.92);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 16px;
}

.loading-overlay.visible {
  display: flex;
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--panel-border);
  border-top: 4px solid var(--accent-blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loading-text {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

/* Responsivo */
@media (min-width: 576px) {
   .lyrics-container {aspect-ratio: 16 / 8;}
}

@media (min-width: 768px) {
  .lyrics-content {font-size: 22px;}
  .lyrics-content .chord {font-size: 20px;}
}

@media (min-width: 1024px) {
  body {padding-bottom: 6px;}

  .container {
    /* grid-template-columns: 200px 1fr 220px; */
    gap: 6px;
    align-items: start;
  }

  .panel-lateral {
    max-height: calc(100dvh - var(--topbar-h) - 18px);
    position: sticky;
    top: calc(var(--topbar-h) + 6px);
  }

  .arranger-grid{grid-template-columns: repeat(6, 1fr);}

  .btn-section-main {min-height: 90px;font-size: 24px;}

  .pad-btn {min-height: 70px;}
  .bpm-dot, .bpm-label{display: inherit;}
}

@media (min-width: 1200px) {
  .lyrics-content {font-size: 26px;}
  .lyrics-content .chord {font-size: 22px;}

  .btn-section-main {
    min-height: 100px;
    font-size: 28px;
  }
}


/* Equalizador por grupo */
.eq-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
  align-items: center;
}

.eq-group-select {
  background: var(--panel-bg-dark);
  color: var(--text-main);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.eq-btn {
  padding: 6px 12px;
  min-height: 32px;
  background: var(--panel-bg-dark);
  color: var(--text-main);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  cursor: pointer;
}

.eq-btn.active {
  background: var(--accent-green);
  color: #000;
  border-color: var(--accent-green);
}

.eq-btn-danger {
  color: var(--accent-red);
  border-color: rgba(239, 68, 68, 0.4);
}

.eq-graph-wrap {
  background: var(--panel-bg-dark);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-md);
}

.eq-graph {
  display: block;
  width: 100%;
  height: 200px;
  cursor: pointer;
}

.eq-editor {
  background: var(--panel-bg-dark);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-md);
  padding: 10px;
  min-height: 100px;
}

.eq-editor-empty {
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 11px;
  text-align: center;
  padding: 28px 0;
  letter-spacing: 0.4px;
}

.eq-band-block {
  display: none;
  flex-direction: column;
  gap: 0.55rem;
}

.eq-band-block.visible {
  display: flex;
}

.eq-band-title {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
  color: var(--accent-blue-light);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 0.15rem;
}

.eq-slider-row {
  display: grid;
  grid-template-columns: 42px 1fr 62px;
  padding: 10px 0;
  align-items: center;
}

.eq-slider-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

.eq-slider-value {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--text-main);
  text-align: right;
}

.eq-slider-row input[type="range"] {
  width: 100%;
  height: 4px;
  accent-color: var(--accent-blue);
}


/* 
 * Painel de ritmos
 */
 
.panel-rhythms {
  display: flex; position: fixed;
 
  top: 0; left: -320px;
  width: 300px; height: 100vh; max-width: 75vw; max-height: 100vh;
  z-index: 1000;
  
  border-radius: 0; border-left: 1px solid var(--panel-border);
  box-shadow: -8px 0 30px rgba(0, 0, 0, 0.35);
  transition: left 0.22s ease;
  overflow-y: auto;
}

body.rhythms-open .panel-rhythms {left: 0;}

@media (min-width: 1024px) {
  .panel-rhythms {
    display: flex; position: relative; left: 0;
    height: calc(100dvh - var(--topbar-h) - 22px);
    border-radius: var(--radius-lg);
    z-index:0;
  }

  #btnOpenRhythms{display: none;}
}

.rhythm-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  background: var(--panel-bg-dark);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
  text-align: left;
}

.rhythm-item:hover {
  border-color: var(--accent-blue);
  background: #1a1e2b;
}

.rhythm-item.active {
  border-color: var(--accent-green);
  background: rgba(16, 185, 129, 0.08);
  color: var(--accent-green);
}

.rhythm-item-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rhythm-item-bpm {
  font-size: 10px;
  color: var(--text-muted);
  background: var(--panel-bg);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.rhythm-item.active .rhythm-item-bpm {
  color: var(--accent-green);
}