/* =========================================================
UI / CONTROLS

* botones
* selects
* barra superior
* HUD Arcade (legacy, INTENCIONAL)
  ========================================================= */

/* =========================================================
TOP BAR
========================================================= */


/* =========================================================
RESULTS PANEL (ARCADE)
========================================================= */
.results-panel .buttons {
  margin-top: 16px;
  display: flex;
  justify-content: space-between;
}

.results-panel button {
  background: #333;
  /* legacy */
  color: #fff;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
}

.results-panel button:hover {
  background: #555;
}

/* =========================================================
BUTTONS
========================================================= */
.btn-primary {
  background: linear-gradient(color-mix(in srgb, var(--accent-main) 80%, black),
      var(--accent-main));
  color: white;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 999px;
  border: none;
  cursor: pointer;


  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.25),
    0 3px 8px rgba(0, 0, 0, 0.6);

  transition: transform 0.08s ease, box-shadow 0.08s ease;
}

.btn-primary:hover {
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(1px);
  box-shadow:
    inset 0 -1px 0 rgba(0, 0, 0, 0.4),
    0 1px 3px rgba(0, 0, 0, 0.6);
}

.btn-toggle {
  background: linear-gradient(#222, #111);
  /* legacy visual */
  color: #ddd;
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-soft);
  cursor: pointer;


  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 2px 6px rgba(0, 0, 0, 0.6);
}

.btn-toggle.active {
  background: linear-gradient(var(--ok), #22cc66);
  color: #0b2b14;
  font-weight: 600;
}

.btn-toggle:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* =========================================================
TOGGLES / MIDI STATUS
========================================================= */
.toggle-group {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #bbb;
  /* legacy */
}

.toggle-group input {
  accent-color: var(--accent-main);
  transform: scale(0.9);
}

.midi-status {
  text-align: center;
  font-size: 14px;
  color: #aaa;
  margin-bottom: 8px;
  transition: color 0.3s ease;
}

.midi-status.connected {
  color: var(--timing-perfect);
}

#midi-status {
  margin-left: auto;
  font-size: 12px;
  color: #9fb8ff;
  /* legacy */
  opacity: 0.85;
  user-select: none;
}

.status-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  padding: 6px 12px;
  box-sizing: border-box;
}

.midi-status-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.midi-status-stack #midi-status {
  margin: 0;
  text-align: center;
}

.midi-status-stack .btn-toggle {
  max-width: min(92vw, 520px);
  white-space: normal;
  text-align: center;
}

/* =========================================================
ARCADE HUD (LEGACY – NO REFACTOR)
========================================================= */
#arcade-hud {
  transition: transform 0.15s ease;
}

#arcade-hud.hud-hit {
  transform: scale(1.08);
  background: rgba(0, 160, 80, 0.85);
  /* legacy */
}

#arcade-hud.hud-miss {
  animation: hud-shake 0.18s linear;
  background: rgba(160, 0, 0, 0.85);
  /* legacy */
}

#arcade-hud.hud-pulse {
  transform: scale(1.05);
}

#arcade-hud.hud-break {
  animation: combo-break 0.25s ease-out;
  background: rgba(200, 60, 60, 0.9);
  /* legacy */
}

@keyframes hud-shake {
  0% {
    transform: translateX(0);
  }

  25% {
    transform: translateX(-3px);
  }

  50% {
    transform: translateX(3px);
  }

  75% {
    transform: translateX(-2px);
  }

  100% {
    transform: translateX(0);
  }
}

@keyframes combo-break {
  0% {
    transform: scale(1.25) rotate(0deg);
  }

  30% {
    transform: scale(0.95) rotate(-2deg);
  }

  60% {
    transform: scale(1.05) rotate(2deg);
  }

  100% {
    transform: scale(1);
  }
}

/* =========================================================
COUNTDOWN
========================================================= */
.countdown {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;


  font-size: 96px;
  font-weight: bold;
  color: rgba(255, 255, 255, 0.9);

  background: radial-gradient(circle,
      rgba(0, 0, 0, 0.6) 0%,
      rgba(0, 0, 0, 0.9) 70%);

  z-index: var(--z-ui);
  pointer-events: none;
  transition: opacity 0.3s ease;

}

.countdown.hidden {
  opacity: 0;
  visibility: hidden;
}

.countdown.show {
  opacity: 1;
  visibility: visible;
}

/* =========================================================
FLOATING TEXT (ARCADE FEEDBACK)
========================================================= */
.floating-text {
  position: fixed;
  font-family: monospace;
  font-size: 14px;
  pointer-events: none;
  animation: floatUp 0.35s ease-out forwards;
  z-index: var(--z-feedback);
}

.floating-perfect {
  color: var(--arcade-hit);
}

.floating-good {
  color: var(--arcade-good);
}

.floating-ok {
  color: var(--arcade-ok);
}

.floating-miss {
  color: var(--arcade-miss);
}

@keyframes floatUp {
  from {
    opacity: 1;
    transform: translateY(0);
  }

  to {
    opacity: 0;
    transform: translateY(-18px);
  }
}

/* =========================================================
NOTE LABEL TOGGLE (GLOBAL)
========================================================= */
body:not(.show-note-labels) .key-label {
  visibility: hidden;
  pointer-events: none;
}

body.show-note-labels .key-label {
  visibility: visible;
  pointer-events: none;
}

/* =========================================================
RESULTS OVERLAY (ARCADE)
========================================================= */
#results-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-ui);
}

.results-panel {
  background: #111;
  /* legacy */
  color: #fff;
  padding: 24px 32px;
  border-radius: 10px;
  width: 280px;
  font-family: monospace;
  text-align: center;
}

.results-panel h2 {
  margin-top: 0;
}

.results-panel .accuracy {
  font-size: 18px;
  margin-bottom: 12px;
}

.results-panel .stats,
.results-panel .timing {
  margin: 10px 0;
  font-size: 14px;
}

/* =========================
   UI STRUCTURE — TOP BAR
   (Theme-agnostic)
   ========================= */

/* =========================
   MENU — ACCIONES PRINCIPALES
   ========================= */

.menu-control button {
  background: #222;
  border-color: #444;
  font-weight: 600;
}

.menu-control button:hover {
  background: #2a2a2a;
}

/* =========================
   MENU — MODO ACTIVO (PREP)
   ========================= */

.menu-control button.is-active {
  background: #2d3cff;
  border-color: #3f4cff;
  color: #fff;
}

/* =========================
   MENU — CONFIGURACIÓN
   ========================= */

.menu-group select {
  background: #161616;
  border-color: #2a2a2a;
  color: #ddd;
}

#toggle-note-labels {
  background: #2942ff;
  border-color: #3a4bff;
  color: #fff;
}

#toggle-note-labels:hover {
  background: #3a52ff;
}

/* =========================
   MENU PRINCIPAL — v1 CERRADO
   ========================= */

#top-bar {
  display: flex;
  flex-direction: row;
  align-items: center;
  flex-wrap: nowrap;
  gap: 18px;

  padding: 10px 14px;

  overflow-x: auto;
  overflow-y: visible;

  background: linear-gradient(to bottom, #111, #0b0b0b);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

/* ===== GRUPOS ===== */

.menu-group {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
}

/* Playback es horizontal */
.menu-control {
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

/* ===== PLAYBACK DESTACADO ===== */

.menu-control {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 8px;
}

.menu-control button {
  display: flex;
  flex-direction: row;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  min-width: 32px;
  padding: 0 10px;
}

.menu-group:last-child {
  border-right: none;
}

.menu-center .menu-group {
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  width: 180px;
  /* ancho fijo */
  min-width: 180px;
}

.menu-center .menu-group:last-child {
  border-right: none;
}

/* ===== TITULO DEL GRUPO ===== */

.group-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #888;
  margin-bottom: 4px;
  user-select: none;
  height: 14px;
  line-height: 14px;

}

/* ===== CONTROLES ===== */

.menu-group label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: #bbb;
}

.menu-group select,
.menu-group button {
  height: 28px;
  padding: 0 8px;

  background: #1a1a1a;
  color: #eee;

  border: 1px solid #333;
  border-radius: var(--ui-radius-sm, 6px);

  font-size: 12px;
}

.menu-group select,
.menu-group button {
  width: 100%;
  height: 32px;
  line-height: 32px;

}



/* ===== VISUAL MENOS DOMINANTE ===== */

.menu-visual {
  opacity: 0.9;
}

.menu-tempo,
.menu-visual {
  min-width: 140px;
}

.menu-music {
  max-width: 420px;
}

/* ===== RANGO SUGERIDO ===== */

.keyboard-range-hint {
  font-size: 11px;
  color: #aaa;
  background: rgba(255, 255, 255, 0.05);
  padding: 4px 6px;
  border-radius: 4px;
}

#autoApplyRangeWrapper {
  font-size: 11px;
  color: #bbb;
}

.menu-center .menu-group {
  min-width: 180px;
}

/* =========================
   CONFIG PANEL — FINAL
   ========================= */

.menu-keyboard {
  align-items: flex-start;
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
}

.toggle-switch {
  width: 42px;
  height: 22px;
  border-radius: 11px;
  background: #333;
  position: relative;
  cursor: pointer;
  border: none;
}

.toggle-switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  background: #bbb;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.toggle-switch[aria-pressed="true"] {
  background: #3b82f6;
}

.toggle-switch[aria-pressed="true"]::after {
  left: 23px;
  background: #fff;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  font-size: 13px;
  opacity: 0.9;
}

/* =========================
   PLAYBACK BUTTONS
   ========================= */

.menu-control button {
  min-width: 48px;
  height: 40px;
  padding: 0 16px;
  font-size: 16px;
  font-weight: 600;
}


.menu-control button#btnPlayer,
.menu-control button#btnStop {
  min-width: 48px;
  height: 38px;
  font-size: 16px;
}

.btn-config {
  margin-right: 16px;
  width: 36px;
  height: 36px;
  font-size: 16px;
}

#configPanel {
  position: fixed;

  top: 64px;
  right: 16px;

  width: 100px;
  max-width: calc(100vw - 16px);

  padding: 16px;

  background: rgba(15, 15, 15, 0.95);
  border-radius: 14px 0 0 14px;

  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.7);

  z-index: 2000;

  /* 🔑 CLAVE ABSOLUTA */
  transform: translateX(-100%);
  transform-origin: top right;
}

#btnConfig {
  width: 40px;
  height: 40px;
  font-size: 18px;
  flex-shrink: 0;
}


.visual-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
}

.menu-config {
  background: linear-gradient(180deg, #0f0f0f, #050505);
  border: 1px solid rgba(255, 255, 255, 0.034);
  border-radius: 12px;
  padding: 18px 20px;
  min-width: 220px;

  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);

  /* 🔽 estado inicial oculto */
  opacity: 0;
  transform: translateY(-6px) scale(0.97);
  pointer-events: none;

  transition:
    opacity 160ms ease-out,
    transform 160ms ease-out;
}

.menu-config.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}


/* =========================
   TOP BAR — JERARQUÍA VISUAL
   (Iteración 2 — tamaño uniforme)
   ========================= */

.top-bar .col {
  padding: 12px 14px;
  border-radius: 12px;

  background: rgba(255, 255, 255, 0.02);

  /* 🔑 CLAVE: tamaño uniforme */
  min-height: 92px;

  /* Alineación interna */
  display: flex;
  flex-direction: column;
  justify-content: flex-start;

  transition:
    background 120ms ease,
    transform 120ms ease;
}

/* Playback — bloque principal */
.top-bar .col.playback {
  background: rgba(255, 255, 255, 0.06);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 4px 12px rgba(0, 0, 0, 0.5);
}

/* Canción — contexto principal */
.top-bar .col.song {
  background: rgba(255, 255, 255, 0.035);
}

/* Controles secundarios */
.top-bar .col.hand,
.top-bar .col.tempo,
.top-bar .col.keyboard {
  background: rgba(255, 255, 255, 0.015);
}

.top-bar .col h3 {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.65;

  margin: 0 0 8px 0;

  /* 🔑 Reserva de espacio consistente */
  height: 14px;
  line-height: 14px;
}


/* =========================
   PLAYBACK — CLUSTER DE CONTROL
   ========================= */

.top-bar .col.playback .row {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Playback — botones base */

.top-bar .col.playback button {
  height: 44px;
  min-width: 44px;
  padding: 0 16px;

  font-size: 18px;
  font-weight: 600;

  border-radius: 10px;

  background: linear-gradient(#222, #111);
  border: 1px solid #333;
  color: #eee;

  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 3px 10px rgba(0, 0, 0, 0.6);

  transition:
    transform 80ms ease,
    box-shadow 80ms ease,
    background 120ms ease;
}

/* PLAY — acción principal */

.top-bar .col.playback #btnPlayer {
  min-width: 56px;
  font-size: 20px;

  background: linear-gradient(#3b82f6, #2563eb);
  border-color: #3f4cff;
  color: #fff;

  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.25),
    0 6px 16px rgba(0, 0, 0, 0.7);
}

/* STOP — acción crítica pero secundaria */

.top-bar .col.playback #btnStop {
  background: linear-gradient(#2a2a2a, #151515);
  border-color: #444;
}

/* Practice / Arcade — modos */

.top-bar .col.playback #btnPractice,
.top-bar .col.playback #btnPracticeLegacy,
.top-bar .col.playback #btnArcade,
.top-bar .col.playback #btnChord {
  font-size: 14px;
  font-weight: 500;
  padding: 0 14px;
  opacity: 0.9;
}

.top-bar .col.playback #btnArcade {
  gap: 6px;
}

/* Feedback físico */

.top-bar .col.playback button:active {
  transform: translateY(1px);
  box-shadow:
    inset 0 -1px 0 rgba(0, 0, 0, 0.4),
    0 2px 6px rgba(0, 0, 0, 0.6);
}


/* =========================
   CANCIÓN — VALOR PRINCIPAL
   ========================= */

.top-bar .col.song select {
  font-size: 14px;
  font-weight: 600;

  padding: 0 12px;
  height: 36px;
  border-radius: 10px;
  color: #f5f5f5;
  /* 🔑 más claro */
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.6);

  background: linear-gradient(#202020, #141414);
  border-color: #4a4a4a;

  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 2px 8px rgba(0, 0, 0, 0.5);
}

/* Canción activa */

.top-bar .col.song:focus-within {
  background: rgba(255, 255, 255, 0.05);
}

/* Hint de rango sugerido — secundario */

.top-bar .col.song .keyboard-range-hint {
  margin-top: 6px;

  border-top: 1px solid rgba(255, 255, 255, 0.06);

  font-size: 11px;
  line-height: 1.3;

  color: #9a9a9a;
  opacity: 0.8;

  background: rgba(255, 255, 255, 0.04);
}

/* Valor dentro del hint */

.top-bar .col.song .keyboard-range-hint span {
  color: #cfcfcf;
  opacity: 0.75;
  font-weight: 500;
}

/* Canción enfocada */

.top-bar .col.song select:focus {
  outline: none;
  border-color: #5a7cff;
  box-shadow:
    0 0 0 1px rgba(90, 124, 255, 0.6),
    0 2px 10px rgba(0, 0, 0, 0.6);
}

/* =========================
   MANO — FILTRO ACTIVO
   ========================= */

.top-bar .col.hand select {
  font-size: 14px;
  font-weight: 600;

  height: 36px;
  padding: 0 12px;

  color: #f0f0f0;
  border-radius: 10px;
  background: linear-gradient(#1d1d1d, #121212);
  border-color: #3a3a3a;

  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 2px 8px rgba(0, 0, 0, 0.45);
}


/* Mano — bloque ligeramente reforzado */

.top-bar .col.hand {
  background: rgba(255, 255, 255, 0.025);
}

/* Mano enfocada */

.top-bar .col.hand select:focus {
  outline: none;
  border-color: #6b8cff;
  box-shadow:
    0 0 0 1px rgba(107, 140, 255, 0.6),
    0 2px 10px rgba(0, 0, 0, 0.6);
}

/* =========================
   TIEMPO — VELOCIDAD (PRINCIPAL)
   ========================= */

.top-bar .col.tempo select {
  font-size: 14px;
  font-weight: 600;

  height: 36px;
  padding: 0 12px;

  width: auto;
  min-width: 70px;

  border-radius: 10px;
  /* consistente con Canción / Mano */

  color: #f0f0f0;

  background: linear-gradient(#1d1d1d, #121212);
  border-color: #3a3a3a;

  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 2px 8px rgba(0, 0, 0, 0.45);
}

/* Tiempo — label secundario */

.top-bar .col.tempo>label {
  font-size: 11px;
  opacity: 0.7;
  margin-bottom: 0;
}

/* =========================
   TIEMPO — METRÓNOMO
   ========================= */

.top-bar .col.tempo .toggle-row {
  grid-column: 1 / -1;
  margin-top: 8px;
  padding-top: 8px;

  border-top: 1px solid rgba(255, 255, 255, 0.06);
  border-top-color: rgba(255, 255, 255, 0.04);

  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* =========================
   TIEMPO — VELOCIDAD EN FILA
   ========================= */

/* Velocidad: label + select en una fila */

.top-bar .col.tempo>label:not(.toggle-row) {
  grid-column: 1;
  align-self: center;

  font-size: 12px;
  color: #cfcfcf;
}

.top-bar .col.tempo>select {
  grid-column: 2;
  justify-self: end;
}

/* Texto Metrónomo */

.top-bar .col.tempo .toggle-row span {
  font-size: 12px;
  color: #cfcfcf;
}

/* Tiempo — bloque secundario */

.top-bar .col.tempo {
  background: rgba(255, 255, 255, 0.02);
}

/* =========================
   TIEMPO — GRID INTERNO CORRECTO
   ========================= */

.top-bar .col.tempo {
  display: grid;
  grid-template-columns: 1fr auto;
  column-gap: 12px;
  row-gap: 0;
}

.top-bar .col.tempo>h3 {
  grid-column: 1 / -1;
}


/* =========================
   TECLADO — GRID INTERNO
   ========================= */

.top-bar .col.keyboard {
  display: grid;
  grid-template-columns: 1fr auto;
  column-gap: 12px;
  row-gap: 0;
  background: rgba(255, 255, 255, 0.02);
}

.top-bar .col.keyboard>h3 {
  grid-column: 1 / -1;
}

/* Rango — label / select en fila */


.top-bar .col.keyboard>label:not(.checkbox-row)>span,
.top-bar .col.keyboard>label:not(.checkbox-row) {
  grid-column: 1;
  font-size: 12px;
  color: #cfcfcf;
}

.top-bar .col.keyboard>label:not(.checkbox-row) select {
  grid-column: 2;
  justify-self: end;

  height: 36px;
  padding: 0 12px;
  border-radius: 10px;

  background: linear-gradient(#1d1d1d, #121212);
  border-color: #3a3a3a;
  color: #f0f0f0;

  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 2px 8px rgba(0, 0, 0, 0.45);
}

/* Checkbox — fila completa */

.top-bar .col.keyboard .checkbox-row {
  grid-column: 1 / -1;

  display: flex;
  align-items: center;
  gap: 8px;

  margin-top: 8px;
  padding-top: 8px;

  border-top: 1px solid rgba(255, 255, 255, 0.06);

  font-size: 12px;
  color: #cfcfcf;
}

.top-bar .col.keyboard .checkbox-row input {
  transform: scale(0.9);
}

/* Rango — mismo patrón que Velocidad */

.top-bar .col.keyboard>label:not(.checkbox-row) {
  grid-column: 1;
  align-self: center;

  font-size: 12px;
  color: #cfcfcf;
}

.top-bar .col.keyboard>select,
.top-bar .col.keyboard select#selectKeyboardRange {
  grid-column: 2;
  justify-self: end;
  align-self: center;
}


/* =========================
   TOP BAR — DIVISOR SUTIL
   ========================= */

.top-bar .section-divider {
  margin-top: 4px;
  padding-top: 4px;

  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* =========================
   CONFIG BUTTON
   ========================= */

#btnConfig {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;

  color: #eee;

  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 3px 10px rgba(0, 0, 0, 0.6);

  transition:
    background 120ms ease,
    box-shadow 120ms ease,
    transform 80ms ease;
}

#btnConfig:hover {
  background: rgba(255, 255, 255, 0.08);
}

#btnConfig:active {
  transform: translateY(1px);
}

#btnConfig.is-open {
  background: linear-gradient(#3b82f6, #2563eb);
  border-color: #3f4cff;
  color: #fff;

  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.25),
    0 6px 16px rgba(0, 0, 0, 0.7);
}

/* =========================
   VISUAL PANEL
   ========================= */

#configPanel {
  background: linear-gradient(#111, #0b0b0b);
  border: 1px solid rgba(255, 255, 255, 0.08);

  border-radius: 12px;

  box-shadow:
    0 12px 32px rgba(0, 0, 0, 0.7),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

#configPanel h3 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.7;

  margin-bottom: 10px;
}

#toggle-note-labels {
  height: 32px;
  border-radius: 10px;

  background: linear-gradient(#1d1d1d, #121212);
  border: 1px solid #3a3a3a;

  color: #f0f0f0;

  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 2px 8px rgba(0, 0, 0, 0.45);
}

#configPanel select {
  height: 32px;
  padding: 0 10px;
  border-radius: 10px;

  background: linear-gradient(#1d1d1d, #121212);
  border: 1px solid #3a3a3a;

  color: #f0f0f0;
}

#configPanel>*+* {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* =========================
   VISUAL — DIVISOR INTERNO
   ========================= */

#configPanel button+label {
  margin-top: 6px;
  padding-top: 6px;

  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

#configPanel label {
  font-size: 12px;
  color: #cfcfcf;
}


#synthCanvas {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
}

.synth-note.timing-perfect {
  background: #4cff8f;
}

.synth-note.timing-early {
  background: #ffd24c;
}

.synth-note.timing-late {
  background: #ff6b6b;
}

/* =========================
   LOADING STATE (SYNTH)
========================= */

#synth.loading {
  position: relative;
  pointer-events: none;
  opacity: 0.6;
}

#synth.loading::after {
  content: "Cargando canción…";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.85);
  color: #fff;
  padding: 12px 18px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 1000;
}


/* ===============================
   🎼 SONG ACTIONS (Import + Library)
   =============================== */

.col.song {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.song-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  width: 100%;
}

.song-actions #importScoreBtn {
  flex: 1;
  /* ⬅️ se estira */
  width: 100%;
}

/* =========================================
   🎨 Match buttons style with <select>
   ========================================= */

.song-actions button {
  background: var(--ui-bg, #111);
  border: 1px solid var(--ui-border, #333);
  border-radius: 10px;
  color: inherit;

  padding: 0 12px;
  height: 40px;

  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.song-actions button:hover {
  background: var(--ui-bg-hover, #1a1a1a);
}

.song-actions button:focus-visible {
  outline: none;
  border-color: var(--ui-accent, #4da3ff);
  box-shadow:
    0 0 0 2px rgba(77, 163, 255, 0.35);
}

/* Botón icono 📂 */
.song-actions .icon-btn {
  padding: 0;
  flex: 0 0 40px;
  width: 40px;
  min-width: 40px;
  justify-content: center;
  font-size: 18px;
}

/* =========================================
   TOP BAR – Equal height columns
   ========================================= */

.top-bar .top-grid {
  align-items: stretch;
}

.top-bar .col {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  /* 🔑 CLAVE */
}

/* Header spacing – same start line for controls */

.top-bar .col>h3,
.top-bar .col>label {
  margin-bottom: 14px;
  /* 🔑 ajusta si quieres */
}

/* =========================================
   TOP BAR – FIX GRID OFFSET (Tempo & Keyboard)
   ========================================= */

/* Alinear primer control de columnas grid
   con el select de Canción */

.top-bar .col.tempo> :not(h3),
.top-bar .col.keyboard> :not(h3) {
  align-self: start;
}

/* Fuerza que el primer label/select
   empiece justo debajo del header */

.top-bar .col.tempo>label:first-of-type,
.top-bar .col.keyboard>label:first-of-type {
  margin-top: 0;
}

/* =========================================
   📂 Local Score Library Panel
   ========================================= */

#localScoreAdmin {
  position: absolute;


  width: 320px;
  max-height: 360px;

  padding: 12px;

  background: rgba(20, 20, 20, 0.92);
  backdrop-filter: blur(12px);

  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;

  box-shadow:
    0 12px 32px rgba(0, 0, 0, 0.6);

  z-index: 1000;
}

#localScoreAdmin h4 {
  margin: 0 0 8px 0;
  font-size: 13px;
  opacity: 0.8;
}

#localScoreAdmin ul {
  list-style: none;
  padding: 0;
  margin: 0;

  display: flex;
  flex-direction: column;
  gap: 6px;

  max-height: 300px;
  overflow-y: auto;
}

#localScoreAdmin li {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* =========================================
   UI – Small action buttons (📂 🗑 ⚙)
   ========================================= */

.ui-action-btn {
  width: 32px;
  height: 32px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  background: rgba(30, 30, 30, 0.9);
  color: #e0e0e0;

  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;

  cursor: pointer;

  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.ui-action-btn:hover {
  background: rgba(45, 45, 45, 0.95);
}

.ui-action-btn:active {
  transform: translateY(1px);
}

.ui-action-btn:focus-visible {
  outline: none;
  border-color: var(--ui-accent, #4da3ff);
}

/* =========================================
   Library panel – smooth open / close
   ========================================= */

#localScoreAdmin {
  opacity: 0;
  transform: translateY(-6px);
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

#localScoreAdmin[data-open="true"] {
  opacity: 1;
  transform: translateY(0);
}

/* =========================================
   Sheet music panel (POC)
   ========================================= */

#sheetPanel {
  position: fixed;
  inset: 0;
  background: #111;
  z-index: 2000;

  display: flex;
  flex-direction: column;
}

#sheetHeader {
  height: 40px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;

  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

#sheetContainer {
  flex: 1;
  overflow: auto;
  padding: 16px;
}

/* Ensure native hidden attribute works */
[hidden] {
  display: none !important;
}

/* =========================
   SPLIT VIEW — PARTITURA
   ========================= */

#sheetView {
  height: 220px;
  background: #0b0b0b;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
}

#sheetHeader {
  height: 32px;
  padding: 6px 12px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #aaa;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

#sheetSplitContainer {
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;

}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 11000;
}

.modal-content {
  background: #111;
  padding: 20px;
  border-radius: 10px;
  width: 320px;
}

.modal-content {
  background: #181818;
  color: #eee;
  box-shadow: 0 0 30px rgba(0, 0, 0, .6);
}

.hidden {
  display: none;
}

#changelogContainer {
  max-height: 300px;
  overflow-y: auto;
}

.tag {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 6px;
  display: inline-block;
  margin-top: 10px;
}

.tag.added {
  background: #2e7d32;
  color: white;
}

.tag.improved {
  background: #1565c0;
  color: white;
}

.tag.fixed {
  background: #ef6c00;
  color: white;
}

.change-block ul {
  margin-top: 4px;
  margin-left: 18px;
}

/* =========================================
   VSCode Style Action Menu
========================================= */
.toolbar-right {
  position: absolute;
  top: 12px;
  right: 16px;

  display: flex;
  flex-direction: column;
  align-items: center;

  z-index: 3000;
}

/* ROTACIÓN DEL GEAR */

.main-btn {
  transition: transform 200ms ease;
}

.toolbar-right:hover .main-btn {
  transform: rotate(90deg);
}

/* SUBMENU */

.submenu {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;

  margin-top: 8px;
}

/* STAGGER ANIMATION */

.submenu .icon-btn {
  opacity: 0;
  transform: translateY(-10px) scale(0.95);
  pointer-events: none;

  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

/* primer botón */
.toolbar-right:hover .submenu .icon-btn:nth-child(1) {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
  transition-delay: 60ms;
}

/* segundo botón */
.toolbar-right:hover .submenu .icon-btn:nth-child(2) {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
  transition-delay: 120ms;
}

/* Buttons */

.icon-btn {
  width: 40px;
  height: 40px;

  display: flex;
  align-items: center;
  justify-content: center;

  font-size: 18px;

  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;

  color: #eee;
  cursor: pointer;

  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 4px 12px rgba(0, 0, 0, 0.6);

  transition:
    background 120ms ease,
    transform 80ms ease;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

.icon-btn:active {
  transform: translateY(1px);
}

/* Tooltip */

.icon-btn[data-tip] {
  position: relative;
}

.icon-btn[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  right: 120%;
  top: 50%;
  transform: translateY(-50%);

  background: #222;
  color: #eee;
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 6px;
  white-space: nowrap;

  opacity: 0;
  pointer-events: none;

  transition: opacity 120ms ease;
}

.icon-btn[data-tip]:hover::after {
  opacity: 1;
}

.about-card {
  width: 360px;
}

.about-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.about-version {
  font-size: 14px;
  opacity: 0.6;
}

.about-desc {
  margin-top: 12px;
  margin-bottom: 18px;
  opacity: 0.85;
}

.about-section {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.label {
  opacity: 0.6;
}

.modal-content {
  animation: scaleIn 140ms ease;
}

@keyframes scaleIn {
  from {
    transform: scale(.95);
    opacity: 0;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}

#aboutX {
  color: #4da3ff;
  text-decoration: none;
}

#aboutX:hover {
  text-decoration: underline;
}

.about-header h2 {
  letter-spacing: 0.5px;
}

.about-header {
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

/* =========================
   MODAL SYSTEM – SMOOTH
========================= */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .55);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;

  opacity: 0;
  animation: overlayFadeIn .18s ease forwards;
}

@keyframes overlayFadeIn {
  to {
    opacity: 1;
  }
}

.modal-card {
  background: #1a1a1a;
  color: #eee;
  min-width: 320px;
  max-width: 560px;
  padding: 22px;
  border-radius: 14px;
  max-height: 80vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow:
    0 20px 60px rgba(0, 0, 0, .8),
    0 0 0 1px rgba(255, 255, 255, .04);

  transform: translateY(10px) scale(.96);
  opacity: 0;

  animation: modalSmoothIn .18s cubic-bezier(.2, .8, .2, 1) forwards;
}

@keyframes modalSmoothIn {
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.modal-card .library-scroll {
  overflow-y: auto;
  padding-right: 4px;
}

.settings-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid rgba(255, 255, 255, .06);
}

/* ===== Modal closing animation ===== */

.modal-overlay.closing {
  animation: overlayFadeOut .18s ease forwards;
}

@keyframes overlayFadeOut {
  to {
    opacity: 0;
  }
}

.modal-card.closing {
  animation: modalSmoothOut .18s cubic-bezier(.4, .2, .2, 1) forwards;
}

@keyframes modalSmoothOut {
  to {
    transform: translateY(10px) scale(.95);
    opacity: 0;
  }
}

/* ===== Toggle Switch PRO ===== */

.switch {
  position: relative;
  width: 46px;
  height: 24px;
}

.switch input {
  display: none;
}

.slider {
  position: absolute;
  inset: 0;
  background: #333;
  border-radius: 20px;
  cursor: pointer;
  transition:
    background .25s ease,
    box-shadow .25s ease;
}

.slider::before {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition:
    transform .25s cubic-bezier(.2, .8, .4, 1.3);
}

/* ON state */

.switch input:checked+.slider {
  background: #4da3ff;
  box-shadow: 0 0 8px rgba(77, 163, 255, .6);
}

.switch input:checked+.slider::before {
  transform: translateX(22px);
}

.settings-row select {
  background: #222;
  color: #eee;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 6px 10px;
  transition:
    border .2s ease,
    box-shadow .2s ease;
}

.settings-row select:focus {
  outline: none;
  border: 1px solid #4da3ff;
  box-shadow: 0 0 6px rgba(77, 163, 255, .6);
}

.settings-row .settings-action-btn {
  background: #222;
  color: #eee;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12px;
  line-height: 1.2;
  cursor: pointer;
  transition:
    border .2s ease,
    box-shadow .2s ease,
    background .2s ease,
    color .2s ease;
}

.settings-row .settings-action-btn:hover {
  background: #262626;
}

.settings-row .settings-action-btn:focus {
  outline: none;
  border: 1px solid #4da3ff;
  box-shadow: 0 0 6px rgba(77, 163, 255, .6);
}

.settings-row .settings-action-btn.active {
  border-color: rgba(77, 163, 255, 0.85);
  box-shadow: 0 0 8px rgba(77, 163, 255, .35);
  color: #dceeff;
}

.library-list {
  list-style: none;
  padding: 0;
  margin: 6px 0;
}

.library-item {
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background .15s ease, transform .1s ease;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.library-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.library-item.active {
  background: rgba(255, 255, 255, 0.12);
  font-weight: 600;
}

.library-check {
  opacity: 0.7;
  font-size: 12px;
}

.library-item.selecting {
  transform: scale(0.97);
  background: rgba(255, 255, 255, 0.18);
}

.library-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.library-delete {
  background: transparent;
  border: none;
  color: #ff6b6b;
  cursor: pointer;
  font-size: 13px;
  opacity: 0.7;
  transition: opacity .15s ease;
}

.library-delete:hover {
  opacity: 1;
}

button.danger {
  background: #b00020;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
}

button.danger:hover {
  background: #d32f2f;
}

.library-rename {
  background: transparent;
  border: none;
  color: #4da3ff;
  cursor: pointer;
  font-size: 13px;
  opacity: 0.7;
  transition: opacity .15s ease;
}

.library-rename:hover {
  opacity: 1;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 16px;
}

.modal-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #ddd;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  transition: all .15s ease;
}

.modal-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

.modal-btn.primary {
  background: #4da3ff;
  border-color: #4da3ff;
  color: white;
}

.session-summary-modal {
  max-height: min(86vh, 760px);
}

.session-summary-body {
  overflow-y: auto;
  padding-right: 4px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.session-summary-body h3 {
  margin: 0;
  font-size: 1.15rem;
}

.summary-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.summary-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.73rem;
  line-height: 1;
  border: 1px solid transparent;
}

.summary-chip--ok {
  background: rgba(57, 197, 116, 0.14);
  border-color: rgba(57, 197, 116, 0.45);
  color: #9ff0c1;
}

.summary-chip--warn {
  background: rgba(255, 198, 83, 0.14);
  border-color: rgba(255, 198, 83, 0.5);
  color: #ffe09a;
}

.summary-chip--alert {
  background: rgba(255, 107, 107, 0.14);
  border-color: rgba(255, 107, 107, 0.45);
  color: #ffb7b7;
}

.summary-chip--info {
  background: rgba(77, 163, 255, 0.14);
  border-color: rgba(77, 163, 255, 0.45);
  color: #b7dcff;
}

.session-summary-body h4 {
  margin: 0 0 8px 0;
  font-size: 0.9rem;
  font-weight: 700;
  opacity: 0.9;
}

.summary-block {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 12px;
}

.summary-block ul {
  margin: 0;
  padding-left: 18px;
}

.summary-block ul+h4 {
  margin-top: 12px;
}

.summary-block--quick {
  background: linear-gradient(180deg,
      rgba(72, 137, 255, 0.14) 0%,
      rgba(72, 137, 255, 0.04) 100%);
}

.summary-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.summary-kpi {
  border-radius: 10px;
  padding: 8px;
  background: rgba(0, 0, 0, 0.24);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.summary-kpi__label {
  display: block;
  font-size: 0.72rem;
  opacity: 0.72;
}

.summary-kpi__value {
  display: block;
  margin-top: 2px;
  font-size: 1rem;
  line-height: 1.2;
}

.summary-weak-notes {
  margin: 0;
  font-size: 0.9rem;
  opacity: 0.95;
}

@media (max-width: 760px) {
  .summary-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.session-summary-modal .modal-actions {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: color-mix(in srgb, #1a1a1a 90%, transparent);
}

/* Delete más sutil */
.delete-btn:hover {
  color: #ff5f5f;
}

.modal-danger-name {
  color: #ff6b6b;
  font-weight: 600;
}

.library-search {
  margin-bottom: 16px;
}

.library-search input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.05);
  color: white;
  font-size: 14px;
  outline: none;
  transition: all 0.2s ease;
}

.library-search input:focus {
  border-color: rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.08);
}

.library-sort {
  background: #1c1c1c;
  color: #ddd;
  border: 1px solid #333;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.library-sort:hover {
  border-color: #555;
}

.library-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.library-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-select {
  background: #1c1c1f;
  color: white;
  border: 1px solid #333;
  border-radius: 8px;
  padding: 6px 10px;
}

.modal-btn.primary {
  background: #2b6ef3;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 6px 12px;
  cursor: pointer;
}

.modal-btn.primary:hover {
  background: #3c7bff;
}

.modal-btn.import {
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.sheet-modal {
  width: 95vw;
  height: 90vh;
  display: flex;
  flex-direction: column;
}

.sheet-modal-header {
  padding: 12px 16px;
  font-size: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, .1);
}

.sheet-modal-body {
  flex: 1;
  overflow: auto;
  padding: 10px;

  width: 100%;
  height: 100%;
}

.modal-fullscreen {
  width: 95vw !important;
  height: 92vh !important;
  max-width: none !important;
  max-height: none !important;
  display: flex;
  flex-direction: column;
}

.modal-fullscreen .sheet-modal-body {
  flex: 1;
  overflow: auto;
}

.sheet-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: white;
  font-size: 18px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: 0.2s;
}

.sheet-close-btn:hover {
  background: rgba(255, 255, 255, 0.25);
}

.melody-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.melody-row select {
  flex: 1;
}

.melody-row .custom-select {
  position: relative;
  flex: 1;
  min-width: 0;
}

.top-bar .col .custom-select {
  position: relative;
  display: block;
  min-width: 0;
}

.top-bar .col.hand .custom-select {
  width: 100%;
}

.top-bar .col.tempo>.custom-select {
  grid-column: 2;
  justify-self: end;
  min-width: 74px;
  align-self: start;
  margin-top: -8px;
}

.top-bar .col.keyboard>label:not(.checkbox-row) {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.top-bar .col.keyboard>label:not(.checkbox-row) .custom-select {
  min-width: 108px;
  margin-top: -8px;
}

.top-bar .col.tempo>label:not(.toggle-row),
.top-bar .col.keyboard>label:not(.checkbox-row) {
  margin-bottom: 0;
}

.top-bar .col.tempo>label:not(.toggle-row)>span,
.top-bar .col.tempo>label:not(.toggle-row),
.top-bar .col.keyboard>label:not(.checkbox-row)>span,
.top-bar .col.keyboard>label:not(.checkbox-row) {
  padding-top: 2px;
}

.top-bar .col.song .melody-row,
.top-bar .col.hand .custom-select,
.top-bar .col.tempo>.custom-select,
.top-bar .col.keyboard>label:not(.checkbox-row) .custom-select {
  margin-top: 0;
}

/* Final alignment pass: keep first-row selects aligned across columns */
.top-bar .col.hand>.custom-select,
.top-bar .col.song .melody-row>.custom-select,
.top-bar .col.tempo>.custom-select,
.top-bar .col.keyboard>label:not(.checkbox-row) .custom-select {
  align-self: start;
  margin-top: 0 !important;
}

.top-bar .col.hand>.custom-select {
  margin-top: 2px !important;
}

.top-bar .col.tempo>.custom-select,
.top-bar .col.keyboard>label:not(.checkbox-row) .custom-select {
  margin-top: -2px !important;
}

.top-bar .col.tempo>label:not(.toggle-row) {
  margin: 0;
  padding: 0;
  line-height: 36px;
}

.top-bar .col.keyboard>label:not(.checkbox-row) {
  margin: 0;
  padding: 0;
}

.top-bar .col.keyboard>label:not(.checkbox-row)>span {
  line-height: 36px;
  padding: 0;
}

.custom-select .is-customized {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
  clip-path: inset(50%);
  overflow: hidden;
}

.custom-select {
  position: relative;
  min-width: 0;
  width: 100%;
}

.custom-select-trigger {
  width: 100%;
  box-sizing: border-box;
  height: 36px;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--ui-border) 90%, transparent);
  background:
    linear-gradient(180deg,
      color-mix(in srgb, var(--ui-bg) 92%, transparent),
      color-mix(in srgb, var(--ui-bg-hover) 96%, transparent));
  color: var(--text-main);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 2px 8px rgba(0, 0, 0, 0.4);
  padding: 0 44px 0 12px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  text-align: left;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  position: relative;
}

.custom-select.is-disabled .custom-select-trigger {
  opacity: 0.7;
  cursor: not-allowed;
}

.custom-select-trigger::after {
  content: "";
  position: absolute;
  right: 12px;
  top: 50%;
  width: 8px;
  height: 8px;
  margin-top: -6px;
  border-right: 2px solid #aeb7c7;
  border-bottom: 2px solid #aeb7c7;
  transform: rotate(45deg);
}

.custom-select.is-open .custom-select-trigger::after {
  transform: rotate(-135deg);
  margin-top: -1px;
}

.custom-select-trigger:focus-visible {
  outline: none;
  border-color: color-mix(in srgb, var(--accent-main) 72%, #b8ccff);
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--accent-main) 50%, transparent),
    0 3px 10px rgba(0, 0, 0, 0.5);
}

.custom-select-label {
  display: block;
  flex: 1;
  min-width: 0;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.custom-select-panel {
  position: fixed;
  max-height: min(360px, 45vh);
  overflow: auto;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--ui-border) 82%, #c7d4f0);
  background: #111722;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.55);
  padding: 6px;
  z-index: 3300;
}

.custom-select-option {
  width: 100%;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #e9efff;
  text-align: left;
  font-size: 13px;
  line-height: 1.25;
  padding: 8px 10px;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.custom-select-option:hover {
  background: color-mix(in srgb, var(--accent-main) 20%, transparent);
}

.custom-select-option.is-selected {
  background: color-mix(in srgb, var(--accent-main) 30%, transparent);
  color: #ffffff;
}

.brand-bar {
  height: 64px;
  display: flex;
  align-items: center;
  padding: 0 10px;
  background: linear-gradient(to bottom, #0f0f10, #0b0b0c);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}


.brand-footer {
  padding: 60px 0 40px 0;
  text-align: center;
  opacity: 0.35;
  transition: opacity 0.3s ease;
}

.brand-footer:hover {
  opacity: 0.8;
}

.brand-footer-logo {
  height: 48px;
  /* antes 22px */
  margin-bottom: 14px;
}

.brand-footer-meta {
  font-size: 12px;
  letter-spacing: 1px;
  color: var(--text-muted, #777);
  /* Uses theme fallback */
}



.settings-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 12px;
}

.settings-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

/* =========================
   CHORD MODE UI
   ========================= */

#chord-container {
  /* Inherits from .training-hud-overlay */
  background: rgba(255, 255, 255, 0.02);
}

#chord-label {
  /* Inherits from .training-label */
  font-size: 48px;
  /* Special larger size for chords */
}

#chord-notes {
  font-size: 20px;
  opacity: 0.7;
  margin-top: 6px;
}

#chord-sequence-hint {
  margin-top: 8px;
  margin-bottom: 8px;
  font-size: 14px;
  letter-spacing: 1.5px;
  opacity: 0.85;
  text-align: center;
}

/* Flash feedback */
#chord-container.flash-success {
  background: rgba(76, 255, 143, 0.08);
  transition: background 200ms ease;
}

#chord-container.flash-success #chord-label {
  color: #4cff8f;
}

#chord-container.flash-error {
  background: rgba(255, 76, 76, 0.08);
  transition: background 200ms ease;
}

#chord-container.flash-error #chord-label {
  color: #ff4c4c;
}

.top-bar .col.playback .secondary-row {
  margin-top: 8px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.top-bar .col.playback .secondary-row button {
  font-size: 14px;
  height: 38px;
}

.modes-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.play-row {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-top: 14px;
}

.play-row button {
  width: 48px;
  height: 48px;
  font-size: 20px;
}

.top-bar .col.playback button.is-active {
  background: linear-gradient(#3b82f6, #2563eb);
  border-color: #3f4cff;
  color: #fff;

  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.25),
    0 6px 16px rgba(0, 0, 0, 0.7),
    0 0 12px rgba(76, 123, 255, 0.6);
}

.training-feedback {
  font-size: 14px;
  font-weight: 600;
  height: 20px;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s ease;
}

.training-feedback.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.training-subtitle {
  margin-top: 4px;
  font-size: 14px;
  opacity: 0.8;
  letter-spacing: 0.4px;
}

#interval-levels,
#chord-levels,
#staff-ear-levels {
  text-align: center;
  margin-top: 12px;
}

.staff-levels {
  text-align: center;
  margin-top: 12px;
}

#interval-levels .chord-level-btn,
#chord-levels .chord-level-btn,
#staff-ear-levels .staff-level-btn,
#staff-ear-levels .chord-level-btn {
  background: #1a1a1a;
  border: 1px solid #333;
  color: #ddd;
  padding: 6px 12px;
  margin: 0 4px;
  cursor: pointer;
  border-radius: 6px;
  font-size: 13px;
  transition: all 120ms ease;
}

#interval-levels .chord-level-btn:hover,
#chord-levels .chord-level-btn:hover,
#staff-ear-levels .staff-level-btn:hover,
#staff-ear-levels .chord-level-btn:hover {
  background: #222;
}

#interval-levels .chord-level-btn.is-active,
#chord-levels .chord-level-btn.is-active,
#staff-ear-levels .staff-level-btn.is-active,
#staff-ear-levels .chord-level-btn.is-active {
  background: #3b82f6;
  border-color: #4c7bff;
  color: white;
}

.training-label {
  font-size: 48px;
  text-align: center;
  margin: 20px 0;
  font-weight: bold;
}

.is-hidden {
  display: none !important;
}

.training-container {
  text-align: center;
  padding: 40px 0;
}

#note-stats {
  margin-top: 10px;
  opacity: 0.7;
}

#note-container {
  display: block;
}

#staff-ear-container {
  display: block;
}

.training-hud-overlay {
  position: relative;
  width: 100%;
  min-height: 280px;
  height: auto;
  /* Consistently match Synthesia stage height */
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 8px 0;
  /* Reduced to avoid cut-off */
  pointer-events: none;
  z-index: 20;
  /* Increased to stay above notations */
  box-sizing: border-box;
  overflow: visible;
}

#independence-container.training-hud-overlay {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
}

/* Base flash overlay for all training containers */
.training-hud-overlay::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: -1;
}

.training-hud-overlay.flash-success::after {
  opacity: 1;
  box-shadow: inset 0 0 40px rgba(77, 255, 140, 0.3);
  animation: pulse-glow-green 0.6s ease-out;
}

.training-hud-overlay.flash-error::after {
  opacity: 1;
  box-shadow: inset 0 0 40px rgba(255, 77, 77, 0.3);
  animation: pulse-glow-red 0.6s ease-out;
}

.hud-top,
.hud-center,
.hud-bottom {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  pointer-events: none;
}

.hud-top {
  margin-top: 5px;
}

.hud-bottom {
  margin-bottom: 8px;
  /* Reduced further */
  gap: 8px;
  /* More compact */
  flex-direction: column;
  /* Stack feedback ABOVE buttons */
}

.hud-bottom>* {
  pointer-events: auto;
  /* Re-enable for controls */
}

.hud-center {
  flex-grow: 1;
  flex-direction: column;
  justify-content: center;
}

#note-label,
#chord-label,
#note-sequence,
#chord-sequence {
  pointer-events: auto;
}

.training-stats {
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  padding: 6px 14px;
  border-radius: 20px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.training-label {
  font-size: 32px;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
  letter-spacing: -0.5px;
  opacity: 1;
  transition: opacity 2s ease-out;
}

.training-label.fade-out {
  opacity: 0;
}

#independence-container>* {
  pointer-events: auto;
}

#synthesia {
  position: relative;
  transition: box-shadow 300ms ease-out;
}

#synthesia::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 5;
  transition: box-shadow 300ms ease-out;
}

#synthesia.flash-success::after {
  box-shadow: inset 0 0 100px rgba(76, 255, 143, 0.15);
}

#synthesia.flash-error::after {
  box-shadow: inset 0 0 100px rgba(255, 76, 76, 0.15);
}

#synthesia.beat-pulse::after {
  animation: pulse-glow 300ms ease-out forwards;
}

@keyframes pulse-glow {
  0% {
    box-shadow: inset 0 0 40px rgba(255, 255, 255, 0.04);
  }

  100% {
    box-shadow: inset 0 0 10px rgba(255, 255, 255, 0);
  }
}

.independence-controls {
  margin-top: 20px;
  display: flex;
  justify-content: center;
  gap: 10px;
}

.independence-level-btn {
  background: rgba(26, 26, 26, 0.6);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #aaa;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  font-weight: 600;
  font-size: 13px;
}

.independence-level-btn:hover {
  background: rgba(40, 40, 40, 0.8);
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
  transform: translateY(-2px);
}

.independence-level-btn.is-active {
  background: #4da3ff;
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(77, 163, 255, 0.3);
}

#staff-ear-cue {
  min-height: 98px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
}

#staff-ear-cue svg {
  width: min(420px, 94vw);
  height: auto;
  background: transparent !important;
}

#staff-ear-cue canvas {
  background: transparent !important;
}

#staff-ear-cue[data-loading="true"] {
  color: rgba(220, 228, 244, 0.88);
  font-size: 14px;
}

#staff-ear-stats {
  margin-top: 10px;
  opacity: 0.7;
}

.staff-ear-controls {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 4px;
}

/* =========================
   NOTE MODE FLASH
   ========================= */

#note-container.flash-success {
  background: rgba(76, 255, 143, 0.08);
  transition: background 200ms ease;
}

#note-container.flash-success #note-label {
  color: #4cff8f;
}

#note-container.flash-error {
  background: rgba(255, 76, 76, 0.08);
  transition: background 200ms ease;
}

#note-container.flash-error #note-label {
  color: #ff4c4c;
}

.note-sequence {
  text-align: center;
  margin-top: 6px;
  margin-bottom: 14px;
  font-size: 30px;
  letter-spacing: 8px;
  font-family: system-ui, sans-serif;
}

.note-exercise-area {
  min-height: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.sequence-display {
  font-size: 24px;
  letter-spacing: 6px;
}

.sequence-note {
  display: inline-flex;
  align-items: center;
  margin: 0 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  opacity: 0.35;
  transition: opacity 0.15s ease, transform 0.15s ease, background 0.15s ease;
}

.sequence-note.active {
  opacity: 1;
  color: #4cff8f;
  font-weight: 600;
  background: rgba(76, 255, 143, 0.14);
}

.sequence-active {
  transform: scale(1.15);
  font-weight: 600;
}

.sequence-item.is-active,
.sequence-item--active,
.sequence-note.is-active,
.sequence-note--active {
  background: var(--uiv2-accent, #ff2a5a);
  color: #fff;
  box-shadow: 0 0 18px color-mix(in srgb, var(--uiv2-accent, #ff2a5a) 45%, transparent);
}

.sequence-progress-dots {
  margin-top: 4px;
  margin-bottom: 10px;
  font-size: 13px;
  letter-spacing: 3px;
  opacity: 0.85;
  text-align: center;
}

#staff-sequence-dots {
  margin-top: 6px;
  font-size: 16px;
  opacity: 0.8;
  letter-spacing: 4px;
  text-align: center;
}

.seq-note {
  opacity: 0.35;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.seq-note-active {
  opacity: 1;
  color: #4cff8f;
  font-weight: 600;
  transform: scale(1.15);
}

.seq-note-done {
  opacity: 0.7;
  color: #9cff9c;
}

.difficulty-indicator {
  margin-top: 6px;
  font-size: 16px;
  letter-spacing: 6px;
  opacity: 0.8;
  display: none;
}

.difficulty-dot {
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.55);
  cursor: pointer;
  font-size: inherit;
  letter-spacing: inherit;
  padding: 0 2px;
}

.difficulty-dot.is-active {
  color: rgba(255, 255, 255, 0.95);
}

.sequence-progress {
  display: none;
  margin-top: 6px;
  font-size: 12px;
  opacity: 0.75;
  text-align: center;
  letter-spacing: 0.5px;
}

.note-exercise-selector {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

#chord-exercise-selector {
  pointer-events: auto;
}

.note-exercise-btn,
.chord-level-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.note-exercise-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 4px 12px;
  border-radius: 8px;
  font-size: 12px;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.75);
  transition: all 120ms ease;
}

.note-exercise-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: white;
}

.note-exercise-btn.is-active,
.exercise-mode--active {
  background: color-mix(in srgb, var(--uiv2-accent, #ff2a5a) 12%, transparent);
  color: color-mix(in srgb, var(--uiv2-accent, #ff2a5a) 82%, #fff 18%);
  border: 1px solid color-mix(in srgb, var(--uiv2-accent, #ff2a5a) 35%, transparent);
  box-shadow: none;
}

.chord-level-btn.is-active,
.level-btn--active {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: color-mix(in srgb, var(--uiv2-accent, #ff2a5a) 82%, #fff 18%);
  border-bottom: 2px solid var(--uiv2-accent, #ff2a5a);
}

#staff-ear-container.flash-success {
  background: rgba(76, 255, 143, 0.08);
  transition: background 200ms ease;
}

#staff-ear-container.flash-error {
  background: rgba(255, 76, 76, 0.08);
  transition: background 200ms ease;
}

.training-feedback {
  margin-top: 10px;
  font-weight: 600;
  height: 24px;
  transition: opacity 200ms ease;
  opacity: 0;
}

.training-feedback.is-visible {
  opacity: 1;
}

.training-option {
  display: block;
  margin-top: 10px;
  font-size: 14px;
  opacity: 0.8;
}

.training-mode-toolbar {
  margin-top: 6px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
}

.training-settings-btn {
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.9);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 13px;
  cursor: pointer;
}

.training-settings-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

.training-icon-btn {
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 999px;
  font-size: 15px;
  line-height: 1;
}

.training-settings-panel {
  margin-top: 10px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  background: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(12px);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
  z-index: 100;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 240px;
  max-width: min(92vw, 460px);
}

.training-settings-anchor {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  margin-top: 8px;
  min-height: 44px;
}

#staff-settings-panel .staff-ear-controls {
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

#staff-settings-panel .training-option {
  margin-top: 0;
}

#chord-settings-panel .training-option {
  margin-top: 0;
}

#staff-settings-panel #staff-ear-note-name-style {
  -webkit-appearance: none;
  appearance: none;
  min-width: 118px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 0 30px 0 10px;
  background-color: rgba(17, 22, 30, 0.92);
  color: #e8eefc;
  font-size: 14px;
  line-height: 1;
  background-image:
    linear-gradient(45deg, transparent 50%, #b9c6e4 50%),
    linear-gradient(135deg, #b9c6e4 50%, transparent 50%);
  background-position:
    calc(100% - 14px) 52%,
    calc(100% - 9px) 52%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  transition: border-color 140ms ease, box-shadow 140ms ease, background-color 140ms ease;
}

#staff-settings-panel #staff-ear-note-name-style:hover {
  border-color: rgba(189, 206, 246, 0.55);
  background-color: rgba(21, 28, 38, 0.95);
}

#staff-settings-panel #staff-ear-note-name-style:focus-visible {
  outline: none;
  border-color: #4da3ff;
  box-shadow: 0 0 0 2px rgba(77, 163, 255, 0.28);
}

#staff-settings-panel #staff-ear-note-name-style option {
  background: #10151d;
  color: #e8eefc;
}

.training-replay-hint {
  margin-top: -4px;
  font-size: 12px;
  opacity: 0.72;
  letter-spacing: 0.2px;
  line-height: 1.2;
  min-height: 16px;
  transition: opacity 220ms ease, visibility 220ms ease;
}

.training-replay-hint.is-faded {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.training-replay-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

#staff-ear-container .training-replay-row {
  margin-top: -6px;
}

#staff-ear-feedback {
  margin-top: 6px;
}

.training-replay-help {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.85);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}

.training-replay-help:hover {
  background: rgba(255, 255, 255, 0.16);
}

.exercise-help-btn {
  opacity: 0.6;
}

.exercise-help-btn:hover {
  opacity: 1;
}

/* =========================================
   VISUAL PASS V2 (NO LAYOUT CHANGES)
   ========================================= */

.top-bar {
  padding: 12px 18px;
  border-bottom: 1px solid var(--border-soft);
  position: relative;
  z-index: 3200;
  overflow: visible;
  background: linear-gradient(to bottom,
      color-mix(in srgb, var(--bg-panel) 86%, #000),
      color-mix(in srgb, var(--bg-panel-2) 92%, #000));
}

.top-bar .col.song {
  position: relative;
  z-index: 3250;
}

.top-bar .col {
  min-height: 84px;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--border-soft) 85%, transparent);
  background: linear-gradient(180deg,
      color-mix(in srgb, var(--bg-panel) 90%, transparent),
      color-mix(in srgb, var(--bg-panel-2) 92%, transparent));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 4px 14px rgba(0, 0, 0, 0.26);
}

.top-bar .col.playback {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 6px 16px rgba(0, 0, 0, 0.3);
}

.top-bar .col h3 {
  font-size: 10px;
  letter-spacing: 0.1em;
  opacity: 0.78;
  color: var(--text-muted);
  margin: 0 0 10px 0;
}

.top-bar .col.playback button {
  height: 38px;
  min-width: 38px;
  border-radius: 9px;
  font-size: 15px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 2px 8px rgba(0, 0, 0, 0.36);
}

.top-bar .col.playback #btnPlayer {
  min-width: 52px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 4px 12px color-mix(in srgb, var(--accent-main) 25%, #000);
}

.top-bar .col.playback .secondary-row button {
  height: 34px;
  font-size: 13px;
}

.top-bar .col select,
.top-bar .col input[type="text"],
.song-actions button {
  height: 36px;
  border-radius: 9px;
  border: 1px solid color-mix(in srgb, var(--ui-border) 90%, transparent);
  background: linear-gradient(180deg,
      color-mix(in srgb, var(--ui-bg) 92%, transparent),
      color-mix(in srgb, var(--ui-bg-hover) 96%, transparent));
  color: var(--text-main);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 2px 7px rgba(0, 0, 0, 0.28);
}

.top-bar .col.song .keyboard-range-hint {
  color: color-mix(in srgb, var(--text-muted) 86%, #fff);
  opacity: 0.95;
}

.top-bar .col.song .keyboard-range-hint span {
  color: var(--text-main);
  opacity: 0.85;
}

.top-bar .col.keyboard #midiRangeLockHint {
  grid-column: 1 / -1;
  justify-self: start;
  margin-top: 2px;
  max-width: 280px;
  padding: 4px 8px;
  border-radius: 8px;
  border: 1px solid color-mix(in srgb, var(--ui-border) 90%, transparent);
  background: color-mix(in srgb, var(--ui-bg-hover) 92%, transparent);
  color: color-mix(in srgb, var(--text-muted) 74%, #dbe7ff);
  font-size: 11px;
  line-height: 1.25;
  white-space: normal;
}

.top-bar .col.keyboard #midiRangeLockHint[hidden] {
  display: none !important;
}

#synthesia {
  position: relative;
  background:
    linear-gradient(to bottom, rgba(94, 162, 255, 0.05), rgba(0, 0, 0, 0) 36%),
    linear-gradient(to bottom, rgba(7, 10, 16, 0.9), rgba(5, 8, 12, 0.98));
  border-top: 1px solid color-mix(in srgb, var(--border-soft) 75%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--border-soft) 75%, transparent);
}

#piano-wrapper {
  border-top: 1px solid color-mix(in srgb, var(--border-soft) 75%, transparent);
}

.status-bar,
#midi-status {
  color: color-mix(in srgb, var(--text-muted) 75%, #c9d8ff);
  opacity: 0.95;
}

.brand-footer {
  opacity: 1;
}

.brand-footer-meta {
  color: color-mix(in srgb, var(--text-muted) 42%, #ffffff);
}

.brand-footer #footerVersion,
.brand-footer .brand-footer-meta span {
  color: inherit;
}

.app-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(10px);
  background: rgba(12, 14, 18, 0.92);
  color: #d8e2f2;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  letter-spacing: 0.2px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
  z-index: 9999;
}

.app-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ---------------------------------
   Select polish (closed control)
   --------------------------------- */
.top-bar .col select,
.settings-row select,
#configPanel select {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 34px;
  background-image:
    linear-gradient(45deg, transparent 50%, #aeb7c7 50%),
    linear-gradient(135deg, #aeb7c7 50%, transparent 50%),
    linear-gradient(180deg,
      color-mix(in srgb, var(--ui-bg) 92%, transparent),
      color-mix(in srgb, var(--ui-bg-hover) 96%, transparent));
  background-position:
    calc(100% - 14px) 50%,
    calc(100% - 9px) 50%,
    0 0;
  background-size:
    6px 6px,
    6px 6px,
    100% 100%;
  background-repeat: no-repeat;
}

.top-bar .col select:hover,
.settings-row select:hover,
#configPanel select:hover {
  border-color: color-mix(in srgb, var(--ui-border) 78%, #c7d4f0);
}

.top-bar .col select option,
.settings-row select option,
#configPanel select option {
  background-color: #151a22;
  color: #ecf2ff;
}

/* ---------------------------------
   Final top-row alignment (Hand vs Tempo/Keyboard)
   --------------------------------- */
.top-bar .col.hand>.custom-select {
  margin-top: 0 !important;
}

.top-bar .col.tempo>label:not(.toggle-row),
.top-bar .col.keyboard>label:not(.checkbox-row) {
  margin-top: -2px !important;
}

.top-bar .col.tempo>.custom-select,
.top-bar .col.keyboard>label:not(.checkbox-row) .custom-select {
  margin-top: -2px !important;
}
