:root {
  --bg-main: #090b12;
  --bg-card: #121624;
  --bg-card-elevated: #181e31;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(0, 242, 254, 0.35);

  --text-main: #f3f6fc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --cyan: #00f2fe;
  --cyan-soft: rgba(0, 242, 254, 0.14);
  --magenta: #ff4d94;
  --magenta-soft: rgba(255, 77, 148, 0.14);
  --emerald: #10b981;
  --emerald-soft: rgba(16, 185, 129, 0.16);
  --amber: #f59e0b;
  --amber-soft: rgba(245, 158, 11, 0.15);

  --radius-lg: 14px;
  --radius-md: 10px;
  --radius-sm: 7px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: radial-gradient(circle at 15% 0%, #151b32 0%, var(--bg-main) 55%);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ================= MODAL DE ONBOARDING ================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 7, 13, 0.85);
  backdrop-filter: blur(12px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 18px;
}

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

.modal-card {
  background: linear-gradient(165deg, #161b2e 0%, #0e121f 100%);
  border: 1px solid rgba(0, 242, 254, 0.25);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65), 0 0 40px rgba(0, 242, 254, 0.1);
  border-radius: 18px;
  max-width: 780px;
  width: 100%;
  padding: 26px 30px;
  max-height: 94vh;
  overflow-y: auto;
}

.modal-header {
  text-align: center;
  margin-bottom: 20px;
}

.brand-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--cyan);
  background: var(--cyan-soft);
  border: 1px solid rgba(0, 242, 254, 0.3);
  padding: 4px 12px;
  border-radius: 99px;
  margin-bottom: 8px;
}

.modal-header h1 {
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: 6px;
}

.gradient-text {
  background: linear-gradient(90deg, var(--cyan), var(--magenta));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.modal-header p {
  color: var(--text-muted);
  font-size: 0.92rem;
}

.onboarding-steps {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.onboarding-step {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 16px;
}

.onboarding-step.highlight-step {
  border-color: rgba(245, 158, 11, 0.35);
  background: rgba(245, 158, 11, 0.05);
}

.step-title {
  font-weight: 700;
  font-size: 0.92rem;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.step-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--cyan);
  color: #061018;
  font-size: 0.78rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.option-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.option-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: var(--text-main);
  text-align: left;
  cursor: pointer;
  transition: all 0.18s ease;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.option-btn:hover {
  border-color: rgba(0, 242, 254, 0.4);
  transform: translateY(-1px);
}

.option-btn.selected {
  background: var(--cyan-soft);
  border-color: var(--cyan);
  box-shadow: 0 0 15px rgba(0, 242, 254, 0.18);
}

.opt-icon {
  font-size: 1.2rem;
}

.opt-name {
  font-size: 0.84rem;
  font-weight: 700;
}

.opt-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.3;
}

.step-hint {
  font-size: 0.83rem;
  color: var(--text-muted);
  margin-bottom: 10px;
  line-height: 1.4;
}

.step-hint kbd {
  background: #262f47;
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--cyan);
  font-family: 'JetBrains Mono', monospace;
}

.mini-finder-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.c4-trigger-btn {
  position: relative;
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
  color: #111827;
  border: none;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-weight: 800;
  font-size: 0.86rem;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.c4-trigger-btn:hover {
  transform: scale(1.02);
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.45);
}

.c4-status {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  color: var(--amber);
}

.c4-status.found {
  color: var(--emerald);
  font-weight: 700;
}

.modal-footer {
  margin-top: 18px;
  display: flex;
  justify-content: center;
}

.primary-cta-btn {
  width: 100%;
  padding: 13px 20px;
  border-radius: var(--radius-md);
  border: none;
  background: linear-gradient(90deg, var(--cyan), #3b82f6, var(--magenta));
  color: #ffffff;
  font-weight: 800;
  font-size: 0.96rem;
  cursor: pointer;
  box-shadow: 0 8px 25px rgba(0, 242, 254, 0.28);
  transition: transform 0.15s ease, filter 0.15s ease;
}

.primary-cta-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

/* ================= BARRA SUPERIOR (HUD) ================= */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 20px;
  background: rgba(14, 18, 31, 0.92);
  border-bottom: 1px solid var(--border-subtle);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 90;
  flex-wrap: wrap;
}

.brand-area {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--cyan), var(--magenta));
  color: #090b12;
  font-weight: 900;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 16px rgba(0, 242, 254, 0.35);
}

.brand-name {
  font-weight: 800;
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  gap: 7px;
}

.version-pill {
  font-size: 0.65rem;
  padding: 2px 7px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--cyan);
  font-weight: 700;
}

.brand-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* CRONÓMETRO 30M */
.routine-hud {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  padding: 5px 10px;
  border-radius: 12px;
}

.routine-blocks {
  display: flex;
  align-items: center;
  gap: 6px;
}

.routine-pill {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.16s ease;
}

.routine-pill:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
}

.routine-pill.active {
  background: var(--cyan-soft);
  border-color: rgba(0, 242, 254, 0.45);
  color: var(--text-main);
}

.b-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-dim);
}

.routine-pill.active .b-dot {
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan);
}

.b-time {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  opacity: 0.75;
}

.timer-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-left: 8px;
  border-left: 1px solid var(--border-subtle);
}

.timer-display {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1rem;
  font-weight: 700;
  color: var(--cyan);
  min-width: 52px;
  text-align: center;
}

.icon-btn {
  background: var(--bg-card-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  width: 28px;
  height: 28px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 0.78rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.icon-btn:hover {
  border-color: var(--cyan);
  color: var(--cyan);
}

/* STATS HUD */
.status-hud {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stat-chip {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  padding: 6px 11px;
  border-radius: 99px;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-main);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.input-chip {
  cursor: pointer;
  border-color: rgba(0, 242, 254, 0.3);
}

.input-chip:hover {
  background: var(--cyan-soft);
}

/* ================= SUBNAV ================= */
.subnav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 20px;
  background: rgba(18, 22, 36, 0.75);
  border-bottom: 1px solid var(--border-subtle);
  flex-wrap: wrap;
  gap: 10px;
}

.subnav-tabs {
  display: flex;
  gap: 8px;
}

.subtab {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  padding: 6px 13px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.subtab:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.04);
}

.subtab.active {
  background: var(--bg-card-elevated);
  border-color: rgba(0, 242, 254, 0.35);
  color: var(--cyan);
}

.subnav-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.kb-size-control {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.04);
  padding: 3px 8px;
  border-radius: 8px;
  border: 1px solid rgba(0, 242, 254, 0.25);
  font-size: 0.74rem;
  color: var(--text-main);
}

.kb-size-control label {
  font-weight: 700;
  color: var(--cyan);
}

.compact-select {
  padding: 4px 8px;
  font-size: 0.74rem;
  height: auto;
}

.notation-badge {
  font-size: 0.75rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.03);
  padding: 4px 10px;
  border-radius: 6px;
}

.notation-badge strong {
  color: var(--amber);
  font-family: 'JetBrains Mono', monospace;
}

/* ================= WORKSPACE & VIEWS ================= */
.workspace {
  padding: 14px 20px 26px;
  max-width: 1560px;
  margin: 0 auto;
}

.view-section {
  display: none;
}

.view-section.active {
  display: block;
}

.studio-grid {
  display: grid;
  grid-template-columns: 1fr 330px;
  gap: 14px;
  align-items: start;
}

.stage-column {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

/* ================= PANEL DE MÓDULO ACTIVO ================= */
.module-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
}

.block-content {
  display: none;
}

.block-content.active {
  display: block;
}

.module-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.module-tag {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 2px 8px;
  border-radius: 4px;
  margin-bottom: 4px;
}

.module-tag.cyan {
  background: var(--cyan-soft);
  color: var(--cyan);
}

.module-tag.amber {
  background: var(--amber-soft);
  color: var(--amber);
}

.module-tag.magenta {
  background: var(--magenta-soft);
  color: var(--magenta);
}

.module-tag.emerald {
  background: var(--emerald-soft);
  color: var(--emerald);
}

.module-header h2 {
  font-size: 1.05rem;
  font-weight: 700;
}

.exercise-selector {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.chip-btn {
  background: var(--bg-card-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 6px 11px;
  border-radius: 7px;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.chip-btn:hover:not(:disabled) {
  color: var(--text-main);
  border-color: rgba(255, 255, 255, 0.22);
}

.chip-btn.active {
  background: var(--cyan-soft);
  border-color: var(--cyan);
  color: var(--cyan);
}

.chip-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* BLOQUE 1: CHECK POSTURAL Y ESCALA 5 DEDOS */
.posture-check-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border-subtle);
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.posture-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.77rem;
  color: var(--text-muted);
}

.posture-item input[type="checkbox"] {
  accent-color: var(--emerald);
  width: 15px;
  height: 15px;
  cursor: pointer;
}

.action-pill-btn {
  background: linear-gradient(90deg, var(--cyan), #38bdf8);
  color: #06121d;
  border: none;
  padding: 7px 14px;
  border-radius: 7px;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.14s ease, filter 0.14s ease;
}

.action-pill-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

.sequence-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.seq-label {
  font-size: 0.76rem;
  color: var(--text-muted);
  font-weight: 600;
}

.seq-steps {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  flex: 1;
}

.seq-note-pill {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.74rem;
  padding: 4px 9px;
  border-radius: 6px;
  background: var(--bg-card-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
}

.seq-note-pill.current {
  background: var(--cyan-soft);
  border-color: var(--cyan);
  color: var(--cyan);
  font-weight: 700;
  box-shadow: 0 0 10px rgba(0, 242, 254, 0.25);
}

.seq-note-pill.done {
  background: var(--emerald-soft);
  border-color: var(--emerald);
  color: var(--emerald);
}

.evenness-meter {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.meter-track {
  width: 90px;
  height: 7px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 99px;
  overflow: hidden;
}

.meter-track.large {
  width: 220px;
  height: 10px;
}

.meter-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--emerald), var(--cyan));
  border-radius: 99px;
  transition: width 0.25s ease;
}

/* BLOQUE 2: TRÍADAS E INVERSIONES */
.chords-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.chord-buttons {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

.chord-btn {
  background: var(--bg-card-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 7px 12px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 78px;
  transition: all 0.15s ease;
}

.chord-btn strong {
  font-size: 0.95rem;
  font-family: 'JetBrains Mono', monospace;
  color: var(--amber);
}

.chord-btn span {
  font-size: 0.68rem;
  color: var(--text-muted);
}

.chord-btn.active {
  background: var(--amber-soft);
  border-color: var(--amber);
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.2);
}

.inversion-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 0.76rem;
  color: var(--text-muted);
}

.inv-pills {
  display: flex;
  gap: 5px;
}

.inv-btn {
  background: var(--bg-card-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 0.74rem;
  cursor: pointer;
}

.inv-btn.active {
  background: var(--emerald-soft);
  border-color: var(--emerald);
  color: var(--emerald);
  font-weight: 700;
}

.chord-detail-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: rgba(255, 255, 255, 0.025);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  flex-wrap: wrap;
}

.pivot-badge {
  font-size: 0.75rem;
  color: var(--emerald);
  background: var(--emerald-soft);
  padding: 3px 9px;
  border-radius: 99px;
  font-weight: 600;
}

/* BLOQUE 3: ESTUDIO DE CANCIÓN & LOOPING */
.song-selector-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
}

.modern-select, .mini-select {
  background: var(--bg-card-elevated);
  color: var(--text-main);
  border: 1px solid rgba(255, 255, 255, 0.14);
  padding: 6px 10px;
  border-radius: 7px;
  font-size: 0.78rem;
  font-weight: 600;
}

.practice-tools-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(255, 255, 255, 0.025);
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  flex-wrap: wrap;
}

.tool-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.tool-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
}

.loop-counter {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--amber);
  margin-left: 4px;
}

/* BLOQUE 4: JAM SESSION */
.jam-controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.jam-progression-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.jam-bar {
  background: var(--bg-card-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: all 0.18s ease;
}

.jam-bar span {
  font-size: 0.68rem;
  color: var(--text-muted);
}

.jam-bar strong {
  font-size: 0.9rem;
  color: var(--text-main);
}

.jam-bar small {
  font-size: 0.7rem;
  color: var(--cyan);
  font-family: 'JetBrains Mono', monospace;
}

.jam-bar.active {
  border-color: var(--emerald);
  background: var(--emerald-soft);
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.2);
}

/* ================= VISUALIZADOR DUAL (PENTAGRAMA + PIANO ROLL) ================= */
.dual-visualizer-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.visualizer-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 14px;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--border-subtle);
  flex-wrap: wrap;
  gap: 8px;
}

.vis-title {
  font-size: 0.78rem;
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--text-muted);
}

.Vis-title strong {
  color: var(--text-main);
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 8px var(--emerald);
}

.vis-toggles {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mini-toggle {
  background: var(--bg-card-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 0.72rem;
  padding: 4px 9px;
  border-radius: 6px;
  cursor: pointer;
}

.mini-toggle.active {
  border-color: rgba(0, 242, 254, 0.4);
  color: var(--cyan);
}

.accuracy-pill {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--amber);
}

.canvas-wrapper {
  width: 100%;
  background: #0b0e18;
  display: flex;
  justify-content: center;
}

#dual-canvas {
  width: 100%;
  height: 270px;
  display: block;
}

/* ================= TECLADO INTERACTIVO ================= */
.piano-dock-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 12px 14px 16px;
}

.piano-dock-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 0.74rem;
  color: var(--text-muted);
  flex-wrap: wrap;
  gap: 8px;
}

.legend-items {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.leg-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.dot-lh, .dot-rh, .dot-pivot, .dot-c4 {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
}

.dot-lh { background: var(--magenta); }
.dot-rh { background: var(--cyan); }
.dot-pivot { background: var(--emerald); }
.dot-c4 { background: var(--amber); }

.piano-keyboard {
  position: relative;
  display: flex;
  height: 195px;
  user-select: none;
  background: #07090f;
  padding: 6px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.white-key {
  position: relative;
  flex: 1;
  min-width: 0;
  height: 100%;
  background: linear-gradient(180deg, #f8fafc 0%, #e2e8f0 90%, #cbd5e1 100%);
  border: 1px solid #94a3b8;
  border-radius: 0 0 6px 6px;
  margin: 0;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  padding-bottom: 6px;
  color: #1e293b;
  transition: background 0.1s ease, box-shadow 0.12s ease;
  overflow: visible;
}

.white-key:hover {
  background: linear-gradient(180deg, #ffffff 0%, #f1f5f9 100%);
}

.white-key.middle-c {
  border-bottom: 5px solid var(--amber);
  background: linear-gradient(180deg, #fffbeb 0%, #fef3c7 90%, #fde68a 100%);
}

.white-key.target-rh {
  background: linear-gradient(180deg, #e0faff 0%, #67e8f9 100%);
  box-shadow: inset 0 -6px 0 var(--cyan), 0 0 14px rgba(0, 242, 254, 0.35);
}

.white-key.target-lh {
  background: linear-gradient(180deg, #ffe4ef 0%, #f472b6 100%);
  box-shadow: inset 0 -6px 0 var(--magenta), 0 0 14px rgba(255, 77, 148, 0.35);
}

.white-key.target-pivot {
  background: linear-gradient(180deg, #d1fae5 0%, #34d399 100%);
  box-shadow: inset 0 -6px 0 var(--emerald), 0 0 16px rgba(16, 185, 129, 0.45);
}

.white-key.active-press {
  background: linear-gradient(180deg, var(--cyan) 0%, #0284c7 100%) !important;
  color: #ffffff;
  box-shadow: inset 0 5px 10px rgba(0, 0, 0, 0.35), 0 0 22px var(--cyan);
}

.black-key {
  position: absolute;
  top: 0;
  left: 100%;
  width: 64%;
  height: 60%;
  transform: translateX(-50%);
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 85%, #020617 100%);
  border: 1px solid #334155;
  border-radius: 0 0 5px 5px;
  z-index: 5;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  padding-bottom: 5px;
  color: #cbd5e1;
  font-size: 0.56rem;
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.65);
  transition: transform 0.05s ease, background 0.1s ease;
  overflow: hidden;
}

.black-key.target-rh {
  background: linear-gradient(180deg, #06b6d4 0%, #0e7490 85%, #155e75 100%);
  border-color: var(--cyan);
  color: #ffffff;
  box-shadow: 0 0 16px rgba(0, 242, 254, 0.75);
}

.black-key.target-lh {
  background: linear-gradient(180deg, #ec4899 0%, #be185d 85%, #831843 100%);
  border-color: var(--magenta);
  color: #ffffff;
  box-shadow: 0 0 16px rgba(255, 77, 148, 0.75);
}

.black-key.active-press {
  transform: translateX(-50%) translateY(3px);
  background: linear-gradient(180deg, var(--amber) 0%, #d97706 100%) !important;
  color: #090b12;
  box-shadow: 0 0 18px var(--amber);
}

.key-finger-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  font-weight: 800;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #0f172a;
  color: var(--cyan);
  display: none;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}

.white-key.show-finger > .key-finger-badge,
.black-key.show-finger > .key-finger-badge {
  display: inline-flex;
}

.key-note-label {
  font-weight: 800;
  font-size: 0.74rem;
  line-height: 1.1;
}

.key-solfege-label {
  font-size: 0.66rem;
  opacity: 0.75;
  margin-bottom: 3px;
}

.key-shortcut {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.62rem;
  background: rgba(15, 23, 42, 0.12);
  padding: 1px 5px;
  border-radius: 4px;
  color: #475569;
}

.hide-labels .key-note-label,
.hide-labels .key-solfege-label {
  opacity: 0;
}

/* ================= SIDEBAR DERECHA ================= */
.sidebar-column {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.side-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 13px 14px;
}

.side-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 9px;
}

.pulse-badge {
  background: var(--cyan-soft);
  color: var(--cyan);
  padding: 2px 7px;
  border-radius: 99px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
}

.coach-text {
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--text-main);
  margin-bottom: 10px;
}

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

.beat-led {
  background: var(--bg-card-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 7px;
  padding: 5px;
  text-align: center;
  transition: all 0.1s ease;
}

.beat-led span {
  display: block;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 800;
  font-size: 0.85rem;
}

.beat-led small {
  font-size: 0.65rem;
  color: var(--text-muted);
}

.beat-led.active {
  background: var(--cyan-soft);
  border-color: var(--cyan);
  color: var(--cyan);
  box-shadow: 0 0 12px rgba(0, 242, 254, 0.25);
}

/* TEMPO & METRÓNOMO */
.cyan-text {
  color: var(--cyan);
  font-family: 'JetBrains Mono', monospace;
}

.modern-slider, .track-vol {
  width: 100%;
  accent-color: var(--cyan);
  cursor: pointer;
}

.tempo-presets {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin: 8px 0;
}

.preset-btn {
  background: var(--bg-card-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 5px;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
}

.preset-btn.active {
  border-color: var(--cyan);
  color: var(--cyan);
  background: var(--cyan-soft);
}

.metro-actions {
  display: flex;
  gap: 6px;
}

.secondary-btn {
  flex: 1;
  background: var(--bg-card-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 6px 10px;
  border-radius: 7px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
}

.secondary-btn.active {
  background: var(--emerald-soft);
  border-color: var(--emerald);
  color: var(--emerald);
}

/* MIXER */
.mixer-tracks {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.track-row {
  display: grid;
  grid-template-columns: 118px 1fr;
  align-items: center;
  gap: 8px;
}

.track-mute-btn {
  background: var(--bg-card-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 5px 8px;
  border-radius: 6px;
  font-size: 0.73rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.track-mute-btn.active {
  border-color: rgba(16, 185, 129, 0.45);
  color: var(--emerald);
  background: var(--emerald-soft);
}

/* LOGROS */
.badges-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.badge-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 7px 8px;
  display: flex;
  align-items: center;
  gap: 7px;
  opacity: 0.42;
  filter: grayscale(1);
  transition: all 0.25s ease;
}

.badge-item.unlocked {
  opacity: 1;
  filter: grayscale(0);
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.35);
}

.b-icon {
  font-size: 1.15rem;
}

.badge-item strong {
  display: block;
  font-size: 0.72rem;
}

.badge-item small {
  display: block;
  font-size: 0.63rem;
  color: var(--text-muted);
}

/* ================= VISTA 2: ROADMAP 30 DÍAS ================= */
.roadmap-header-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.roadmap-header-card p {
  color: var(--text-muted);
  font-size: 0.86rem;
  margin-top: 4px;
}

.rp-top {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  margin-bottom: 6px;
}

.weeks-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.week-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px;
}

.week-card h3 {
  font-size: 0.98rem;
  margin-bottom: 10px;
  color: var(--cyan);
}

.milestone-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.milestone-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg-card-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
}

.milestone-left {
  display: flex;
  gap: 9px;
  align-items: flex-start;
}

.milestone-left input {
  margin-top: 3px;
  accent-color: var(--emerald);
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.milestone-day {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  color: var(--amber);
  font-weight: 700;
}

.milestone-desc {
  font-size: 0.8rem;
  color: var(--text-main);
  margin-top: 2px;
  line-height: 1.35;
}

/* ================= VISTA 3: ERGONOMÍA Y TEORÍA ================= */
.ergo-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.ergo-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
}

.ergo-card.full-span {
  grid-column: 1 / -1;
}

.ergo-card h3 {
  font-size: 1.05rem;
  margin: 4px 0 10px;
}

.ergo-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 10px;
  line-height: 1.45;
}

.ergo-list {
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.83rem;
  color: var(--text-main);
  line-height: 1.45;
}

.theory-tables-wrap {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 16px;
  align-items: center;
  margin-top: 10px;
}

.clean-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.clean-table th, .clean-table td {
  border: 1px solid var(--border-subtle);
  padding: 8px 10px;
  text-align: center;
}

.clean-table th {
  background: var(--bg-card-elevated);
  color: var(--cyan);
  font-family: 'JetBrains Mono', monospace;
}

.rhythm-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.r-box {
  background: var(--bg-card-elevated);
  border: 1px solid var(--border-subtle);
  padding: 10px;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.r-box strong {
  color: var(--amber);
  font-size: 0.88rem;
}

.r-box span {
  font-size: 0.76rem;
  font-weight: 700;
}

.r-box small {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* ================= VISTA 4: MODO JUEGO CASCADA SYNTHESIA ================= */
.subtab.game-tab {
  border-color: rgba(140, 233, 58, 0.35);
  color: #a3e635;
}

.subtab.game-tab.active {
  background: rgba(140, 233, 58, 0.15);
  border-color: #8ce93a;
  color: #a3e635;
  box-shadow: 0 0 14px rgba(140, 233, 58, 0.25);
}

.synthesia-container {
  background: #14161c;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.65);
}

.synthesia-container:fullscreen {
  border-radius: 0;
  height: 100vh;
}

.syn-hud-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  background: #0f1219;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
  flex-wrap: wrap;
}

.syn-controls-left,
.syn-controls-center,
.syn-score-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.syn-hand-pills,
.syn-speed-pills {
  display: flex;
  gap: 4px;
}

.syn-play {
  background: linear-gradient(90deg, #8ce93a, #22c55e);
  color: #071209;
}

.syn-stat {
  background: #181c26;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 4px 10px;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 72px;
}

.syn-stat span {
  font-size: 0.6rem;
  color: var(--text-muted);
  font-weight: 700;
  letter-spacing: 0.06em;
}

.syn-stat strong {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9rem;
  color: #ffffff;
}

.syn-stat.combo strong {
  color: #a3e635;
}

.synthesia-stage {
  display: flex;
  flex-direction: column;
  width: 100%;
  background: #1e2026;
  flex: 1;
}

.syn-canvas-wrap {
  position: relative;
  width: 100%;
  background: #212329;
  flex: 1;
}

#synthesia-canvas {
  width: 100%;
  height: 410px;
  display: block;
}

.synthesia-container:fullscreen #synthesia-canvas {
  height: calc(100vh - 235px);
}

.syn-banner {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(10, 14, 23, 0.86);
  border: 1px solid rgba(140, 233, 58, 0.45);
  color: #e2e8f0;
  padding: 7px 16px;
  border-radius: 99px;
  font-size: 0.8rem;
  pointer-events: none;
  backdrop-filter: blur(6px);
  white-space: nowrap;
}

.syn-felt-strip {
  width: 100%;
  height: 5px;
  background: linear-gradient(90deg, #7f1d1d, #dc2626, #7f1d1d);
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.6);
  z-index: 4;
}

.synthesia-keyboard {
  position: relative;
  display: flex;
  width: 100%;
  height: 168px;
  background: #090a0f;
  user-select: none;
}

.syn-white-key {
  position: relative;
  flex: 1;
  min-width: 0;
  height: 100%;
  background: linear-gradient(180deg, #ffffff 0%, #f1f5f9 88%, #cbd5e1 100%);
  border-right: 1px solid #64748b;
  border-bottom: 4px solid #94a3b8;
  border-radius: 0 0 5px 5px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  padding-bottom: 8px;
  color: #334155;
  font-weight: 700;
  font-size: 0.72rem;
  cursor: pointer;
  transition: background 0.06s ease;
  overflow: visible;
}

.syn-white-key.middle-c {
  border-bottom: 5px solid #f59e0b;
  background: linear-gradient(180deg, #fffbeb 0%, #fef3c7 88%, #fde68a 100%);
}

.syn-white-key.syn-hit-lh {
  background: linear-gradient(180deg, #dbeafe 0%, #74a9f8 45%, #3b82f6 100%) !important;
  color: #0f172a;
  border-bottom-color: #1d4ed8;
  box-shadow: inset 0 12px 20px rgba(255, 255, 255, 0.85), 0 0 22px rgba(116, 169, 248, 0.85);
}

.syn-white-key.syn-hit-rh {
  background: linear-gradient(180deg, #ecfccb 0%, #8ce93a 45%, #4d7c0f 100%) !important;
  color: #0f172a;
  border-bottom-color: #365314;
  box-shadow: inset 0 12px 20px rgba(255, 255, 255, 0.85), 0 0 22px rgba(140, 233, 58, 0.85);
}

.syn-black-key {
  position: absolute;
  top: 0;
  left: 100%;
  width: 64%;
  height: 62%;
  transform: translateX(-50%);
  background: linear-gradient(180deg, #27272a 0%, #09090b 88%, #000000 100%);
  border: 1px solid #3f3f46;
  border-bottom: 4px solid #18181b;
  border-radius: 0 0 4px 4px;
  z-index: 5;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  padding-bottom: 6px;
  color: #a1a1aa;
  font-size: 0.54rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.65);
  overflow: hidden;
}

.syn-black-key.syn-hit-lh {
  background: linear-gradient(180deg, #93c5fd 0%, #3b82f6 80%, #1d4ed8 100%) !important;
  color: #ffffff;
  box-shadow: 0 0 18px #60a5fa;
}

.syn-black-key.syn-hit-rh {
  background: linear-gradient(180deg, #bef264 0%, #65a30d 80%, #3f6212 100%) !important;
  color: #090b12;
  box-shadow: 0 0 18px #8ce93a;
}

/* ================= PARTITURA DE LETRA & ACORDES SINCRONIZADA (BLOQUE 3 & SYNTHESIA) ================= */
.lyrics-lead-sheet {
  margin-top: 10px;
  background: rgba(9, 12, 22, 0.85);
  border: 1px solid rgba(0, 242, 254, 0.25);
  border-radius: 10px;
  padding: 10px 12px;
}

.lyrics-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.lyrics-badge {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: var(--amber);
  background: rgba(245, 158, 11, 0.14);
  padding: 3px 8px;
  border-radius: 6px;
}

.studio-verse-highlight {
  font-size: 0.84rem;
  font-weight: 700;
  color: #f8fafc;
}

.lyrics-measures-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.lyric-measure-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 7px 10px;
  transition: all 0.15s ease;
}

.lyric-measure-card.active-measure {
  border-color: rgba(0, 242, 254, 0.5);
  background: rgba(0, 242, 254, 0.06);
}

.lyric-measure-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-bottom: 5px;
}

.lyric-measure-verse {
  color: #cbd5e1;
  font-style: italic;
  font-weight: 600;
}

.lyric-steps-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.lyric-step-pill {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 3px 7px;
  cursor: pointer;
  min-width: 44px;
  transition: all 0.12s ease;
}

.lyric-step-pill:hover {
  border-color: var(--cyan);
}

.lyric-step-pill.active-step {
  background: linear-gradient(180deg, rgba(140, 233, 58, 0.28), rgba(16, 185, 129, 0.25));
  border-color: #8ce93a;
  box-shadow: 0 0 12px rgba(140, 233, 58, 0.4);
  transform: translateY(-1px);
}

.lsp-chord {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.62rem;
  font-weight: 800;
  color: #74a9f8;
  min-height: 12px;
}

.lsp-note {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--amber);
}

.lsp-word {
  font-size: 0.76rem;
  font-weight: 700;
  color: #ffffff;
}

/* BARRA DE KARAOKE EN SYNTHESIA */
.syn-karaoke-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 7px 14px;
  background: linear-gradient(90deg, #111522 0%, #171d2e 50%, #111522 100%);
  border-bottom: 1px solid rgba(140, 233, 58, 0.28);
}

.syn-karaoke-chord {
  background: rgba(116, 169, 248, 0.18);
  border: 1px solid #74a9f8;
  color: #93c5fd;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 800;
  font-size: 0.92rem;
  padding: 4px 11px;
  border-radius: 8px;
  min-width: 72px;
  text-align: center;
}

.syn-karaoke-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  min-width: 0;
}

.syn-karaoke-verse {
  font-size: 0.85rem;
  font-weight: 700;
  color: #f8fafc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.syn-karaoke-syllables {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.syn-syl-chip {
  font-size: 0.74rem;
  padding: 2px 7px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.05);
  color: #94a3b8;
  font-weight: 600;
}

.syn-syl-chip strong {
  color: #f59e0b;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.66rem;
  margin-right: 3px;
}

.syn-syl-chip.active-syl {
  background: rgba(140, 233, 58, 0.25);
  border: 1px solid #8ce93a;
  color: #ffffff;
  font-weight: 800;
  box-shadow: 0 0 10px rgba(140, 233, 58, 0.45);
}

@media (max-width: 1120px) {
  .studio-grid, .lyrics-measures-grid {
    grid-template-columns: 1fr;
  }
  .weeks-grid, .ergo-grid, .theory-tables-wrap {
    grid-template-columns: 1fr;
  }
  .option-grid {
    grid-template-columns: 1fr;
  }
}
