/* ============================================================================
   CLAVIORA — Concert Grand Nocturne Design System
   Obsidian Stage · Champagne Gold · Luminous Cyan (RH) · Warm Rose (LH)
   ============================================================================ */

:root {
  --bg-deep: #07090f;
  --bg-surface: #0e1320;
  --bg-card: rgba(17, 23, 38, 0.84);
  --bg-card-hover: rgba(24, 33, 54, 0.92);
  --border: rgba(148, 163, 184, 0.16);
  --border-gold: rgba(244, 194, 107, 0.36);

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

  --gold: #f4c26b;
  --gold-soft: rgba(244, 194, 107, 0.16);
  --cyan: #38e8ff;
  --cyan-soft: rgba(56, 232, 255, 0.16);
  --rose: #ff6b9d;
  --rose-soft: rgba(255, 107, 157, 0.18);
  --emerald: #34d399;
  --violet: #a78bfa;
  --danger: #f87171;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-lg: 0 18px 48px rgba(0, 0, 0, 0.55);
}

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

html, body {
  height: 100%;
  width: 100%;
  overflow: hidden;
  background: var(--bg-deep);
  color: var(--text-main);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 13.5px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  user-select: none;
}

.mono {
  font-family: 'JetBrains Mono', monospace;
}

.gold { color: var(--gold) !important; }
.emerald { color: var(--emerald) !important; }
.hidden { display: none !important; }

/* Custom subtle scrollbars */
::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, 0.22); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: rgba(244, 194, 107, 0.45); }

/* ============================================================================
   APP SHELL LAYOUT (Full-Viewport Flexbox)
   ============================================================================ */
.app-shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100%;
  max-width: 100vw;
  overflow: hidden;
  background:
    radial-gradient(ellipse 70% 45% at 50% 0%, rgba(56, 232, 255, 0.06), transparent 65%),
    radial-gradient(ellipse 60% 35% at 80% 10%, rgba(244, 194, 107, 0.05), transparent 60%),
    var(--bg-deep);
}

/* Zen Focus Mode hides top bar cleanly */
.app-shell.focus-mode .top-bar {
  display: none;
}
.app-shell.focus-mode .piano-deck-controls .deck-center {
  opacity: 0.45;
}

/* ============================================================================
   TOP STUDIO HEADER
   ============================================================================ */
.top-bar {
  height: 52px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 12px;
  background: rgba(9, 12, 20, 0.92);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(16px);
  z-index: 30;
  max-width: 100%;
  overflow: hidden;
}

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

.brand-logo {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, #f4c26b 0%, #c98a2c 100%);
  display: grid;
  place-items: center;
  box-shadow: 0 0 18px rgba(244, 194, 107, 0.28);
}

.logo-keys {
  display: flex;
  gap: 2px;
  align-items: flex-start;
  height: 18px;
}

.logo-keys i {
  display: block;
  width: 5px;
  height: 18px;
  background: #0b0f19;
  border-radius: 1px 1px 2px 2px;
}
.logo-keys i:nth-child(2) {
  height: 12px;
  background: #fffbeb;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-name {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--gold);
}

.brand-sub {
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.035);
  padding: 4px;
  border-radius: 11px;
  border: 1px solid var(--border);
}

.nav-tab {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-dim);
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
}

.nav-tab:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.06);
}

.nav-tab.active {
  color: #090c14;
  background: linear-gradient(135deg, #f8d489, #e5aa48);
  box-shadow: 0 2px 14px rgba(244, 194, 107, 0.35);
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.live-chord-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 99px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--border);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-dim);
  min-width: 78px;
  justify-content: center;
  transition: all 0.15s ease;
}

.live-chord-pill.active-sound {
  border-color: var(--cyan);
  color: var(--cyan);
  box-shadow: 0 0 14px rgba(56, 232, 255, 0.22);
}

.chord-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
}
.live-chord-pill.active-sound .chord-dot {
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan);
}

.top-select, .deck-select {
  background: rgba(17, 24, 39, 0.9);
  color: var(--text-main);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 5px 7px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  max-width: 158px;
}
.top-select:hover, .deck-select:hover {
  border-color: var(--border-gold);
}

.tool-pill {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 8px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(17, 24, 39, 0.8);
  color: var(--text-dim);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.16s ease;
  white-space: nowrap;
}
.tool-pill:hover {
  color: var(--text-main);
  border-color: var(--border-gold);
}
.tool-pill.is-active {
  border-color: var(--emerald);
  color: var(--emerald);
  background: rgba(52, 211, 153, 0.12);
}
.focus-pill {
  border-color: rgba(167, 139, 250, 0.35);
  color: #ddd6fe;
}
.focus-pill:hover {
  background: rgba(167, 139, 250, 0.16);
}

/* Bilingual VI | EN Switcher Pill */
.lang-switch {
  display: inline-flex;
  align-items: center;
  padding: 2px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid var(--border-gold);
  gap: 2px;
  flex-shrink: 0;
}
.lang-opt {
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 4px 6px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  line-height: 1;
}
.lang-opt:hover { color: var(--text-main); }
.lang-opt.active {
  background: linear-gradient(135deg, #f4c26b, #d99326);
  color: #090b12;
  box-shadow: 0 1px 8px rgba(244, 194, 107, 0.35);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-muted);
}
.status-dot.connected {
  background: var(--emerald);
  box-shadow: 0 0 8px var(--emerald);
}

.profile-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4px 10px 4px 7px;
  border-radius: 10px;
  border: 1px solid var(--border-gold);
  background: linear-gradient(135deg, rgba(244, 194, 107, 0.14), rgba(15, 23, 42, 0.9));
  color: var(--text-main);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.profile-chip:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(244, 194, 107, 0.22);
}
.rank-badge { font-size: 18px; }
.profile-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.15;
}
.profile-meta strong { font-size: 11.5px; color: var(--gold); }
.profile-meta small { font-size: 10px; color: var(--text-dim); }

/* ============================================================================
   ZEN FOCUS FLOATING BAR
   ============================================================================ */
.focus-bar {
  height: 44px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  background: linear-gradient(90deg, rgba(17, 24, 39, 0.96), rgba(30, 27, 75, 0.92));
  border-bottom: 1px solid rgba(167, 139, 250, 0.35);
}
.focus-bar-left { display: flex; align-items: center; gap: 12px; }
.focus-tag {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--violet);
  padding: 3px 9px;
  border-radius: 99px;
  background: rgba(167, 139, 250, 0.14);
}
.focus-song-name { font-weight: 700; color: var(--gold); }
.focus-timer-group { display: flex; align-items: center; gap: 7px; }
.focus-timer-display {
  font-family: 'JetBrains Mono', monospace;
  font-size: 16px;
  font-weight: 700;
  color: var(--cyan);
  margin-right: 4px;
}

/* ============================================================================
   MAIN WORKSPACE & VIEWS
   ============================================================================ */
.workspace-main {
  flex: 1;
  min-height: 0;
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.view-pane {
  display: none;
  flex: 1;
  min-height: 0;
  flex-direction: column;
}
.view-pane.active {
  display: flex;
}
.scrollable-pane {
  overflow-y: auto;
  padding: 16px 22px 24px;
}

/* ============================================================================
   VIEW 1: PRACTICE STAGE (Toolbar + HUD + Grand Staff + Waterfall)
   ============================================================================ */
.practice-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 14px;
  background: rgba(13, 18, 31, 0.9);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.pt-left, .pt-center, .pt-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.song-picker-btn {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 11px;
  border-radius: 10px;
  border: 1px solid var(--border-gold);
  background: rgba(244, 194, 107, 0.08);
  color: var(--text-main);
  cursor: pointer;
  max-width: 270px;
  transition: background 0.15s ease;
}
.song-picker-btn:hover { background: rgba(244, 194, 107, 0.16); }
.tier-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; background: var(--emerald); }
.song-picker-info { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; }
.song-picker-info strong {
  font-size: 12.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 205px;
}
.song-picker-info small { font-size: 10.5px; color: var(--text-dim); }
.song-picker-btn .chev { color: var(--gold); font-size: 12px; }

.transport-group { display: flex; align-items: center; gap: 4px; }

.btn-play {
  padding: 6px 14px;
  border-radius: 9px;
  border: none;
  background: linear-gradient(135deg, #34d399, #059669);
  color: #04130d;
  font-weight: 800;
  font-size: 12.5px;
  cursor: pointer;
  box-shadow: 0 2px 14px rgba(52, 211, 153, 0.32);
  transition: transform 0.12s ease, filter 0.15s ease;
}
.btn-play:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn-play.is-playing {
  background: linear-gradient(135deg, #f4c26b, #d97706);
  color: #160c02;
  box-shadow: 0 2px 14px rgba(244, 194, 107, 0.35);
}

.btn-icon {
  width: 31px;
  height: 31px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  font-size: 14px;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.btn-icon:hover { background: rgba(255, 255, 255, 0.1); border-color: var(--border-gold); }

.seg-compact {
  display: flex;
  background: rgba(0, 0, 0, 0.34);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 2px;
}
.sc-btn {
  padding: 4px 9px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--text-dim);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.sc-btn:hover { color: var(--text-main); }
.sc-btn.active {
  background: rgba(56, 232, 255, 0.18);
  color: var(--cyan);
}

.speed-control {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 4px 9px;
}
.mini-tag { font-size: 11px; color: var(--text-dim); }
.speed-control input[type="range"] { width: 72px; accent-color: var(--gold); cursor: pointer; }
.speed-control strong { font-size: 11.5px; color: var(--gold); min-width: 36px; text-align: right; font-family: 'JetBrains Mono', monospace; }

.tool-chip {
  padding: 5px 9px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.035);
  color: var(--text-dim);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.tool-chip:hover { color: var(--text-main); border-color: var(--border-gold); }
.tool-chip.active {
  background: rgba(244, 194, 107, 0.16);
  color: var(--gold);
  border-color: var(--border-gold);
}

/* Sub-drawers (Loop A-B & Song Theory Card) */
.sub-drawer {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  padding: 7px 16px;
  background: rgba(15, 21, 36, 0.96);
  border-bottom: 1px solid var(--border-gold);
  font-size: 12px;
}
.loop-inputs { display: flex; align-items: center; gap: 6px; color: var(--text-dim); }
.loop-inputs input {
  width: 52px;
  padding: 3px 6px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #080b14;
  color: var(--gold);
  font-weight: 700;
  text-align: center;
}

.theory-drawer {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr 1.6fr;
  gap: 16px;
  padding: 9px 16px;
}
.td-col { display: flex; flex-direction: column; gap: 2px; }
.td-col code { color: var(--cyan); font-family: 'JetBrains Mono', monospace; font-size: 12px; }
.td-tip span:last-child { color: #e2e8f0; }

.toggle-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  color: var(--text-main);
  font-weight: 600;
  font-size: 12px;
}
.toggle-chip input { accent-color: var(--gold); cursor: pointer; }
.gold-chip { color: var(--gold); }
.xs-chip { font-size: 11px; color: var(--text-dim); }

/* Live HUD Strip */
.hud-strip {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 5px 16px;
  background: rgba(8, 11, 19, 0.85);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.hud-item { display: flex; align-items: baseline; gap: 6px; }
.hud-lbl { font-size: 10px; font-weight: 700; letter-spacing: 0.08em; color: var(--text-muted); }
.hud-val { font-size: 15px; font-weight: 800; color: var(--text-main); }

.mult-badge {
  font-size: 11px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-dim);
}
.mult-badge.is-flow {
  background: linear-gradient(135deg, #f4c26b, #fb7185);
  color: #090b12;
  box-shadow: 0 0 12px rgba(244, 194, 107, 0.5);
}

.hud-progress-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
}
.hud-progress-track {
  flex: 1;
  height: 6px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
}
.hud-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--rose), var(--gold), var(--cyan));
  border-radius: 99px;
  transition: width 0.12s linear;
}

.flow-tag {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 2px 8px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-dim);
}
.flow-tag.flow-warm { background: rgba(244, 194, 107, 0.18); color: var(--gold); }
.flow-tag.flow-max {
  background: linear-gradient(135deg, #f4c26b, #38e8ff);
  color: #060911;
  animation: pulseGlow 1.4s infinite;
}

/* Grand Staff Stage */
.staff-stage {
  height: 126px;
  flex-shrink: 0;
  background: linear-gradient(180deg, #0b0f1b 0%, #090c16 100%);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px 12px;
  overflow: hidden;
}
.practice-grand-staff {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
}
.grand-staff-svg {
  width: 100%;
  height: 100%;
  max-height: 136px;
  display: block;
}

/* Waterfall Canvas Stage */
.waterfall-stage {
  flex: 1;
  min-height: 150px;
  position: relative;
  overflow: hidden;
  background: #070a12;
}
#waterfall-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.stage-welcome-hint {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  padding: 7px 16px;
  border-radius: 99px;
  background: rgba(11, 16, 29, 0.88);
  border: 1px solid var(--border-gold);
  color: var(--text-main);
  font-size: 12px;
  backdrop-filter: blur(8px);
  pointer-events: none;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5);
  white-space: nowrap;
}
.stage-welcome-hint code {
  color: var(--gold);
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
}

/* ============================================================================
   PERSISTENT GRAND PIANO DECK (3D Realistic Ivory & Ebony Keyboard)
   ============================================================================ */
.piano-deck {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #101522 0%, #090c14 100%);
  border-top: 1px solid rgba(244, 194, 107, 0.25);
  box-shadow: 0 -10px 32px rgba(0, 0, 0, 0.65);
  z-index: 25;
}

.piano-deck-controls {
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  gap: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.deck-left, .deck-center, .deck-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pedal-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-dim);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
}
.pedal-btn.is-active {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(244, 194, 107, 0.16);
}
.pedal-led {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-muted);
}
.pedal-btn.is-active .pedal-led {
  background: var(--gold);
  box-shadow: 0 0 8px var(--gold);
}

.octave-ctrl {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--text-dim);
  font-family: 'JetBrains Mono', monospace;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--text-dim);
}
.legend-item i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot-lh { background: var(--rose); }
.dot-rh { background: var(--cyan); }
.dot-gold { background: var(--gold); }

.vol-wrap {
  display: flex;
  align-items: center;
  gap: 5px;
}
.vol-wrap input[type="range"] { width: 64px; accent-color: var(--cyan); cursor: pointer; }

.piano-keyboard-root {
  height: 152px;
  width: 100%;
  position: relative;
  background: #06080e;
  touch-action: none;
}

.piano-keys-stage {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

/* Iconic crimson velvet felt strip along keybed top */
.piano-felt-strip {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: linear-gradient(180deg, #991b1b, #450a0a);
  z-index: 15;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.7);
  pointer-events: none;
}

.piano-key {
  position: absolute;
  top: 4px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  transition: transform 0.05s ease, box-shadow 0.08s ease, background 0.08s ease;
}

/* White Ivory Keys */
.white-key {
  height: calc(100% - 6px);
  z-index: 2;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 75%, #e2e8f0 100%);
  border-left: 1px solid #cbd5e1;
  border-right: 1px solid #94a3b8;
  border-bottom: 1px solid #94a3b8;
  border-radius: 0 0 6px 6px;
  box-shadow: inset 0 -6px 0 rgba(148, 163, 184, 0.45), 0 2px 3px rgba(0, 0, 0, 0.35);
  padding-bottom: 6px;
}

.white-key.middle-c {
  background: linear-gradient(180deg, #fffbeb 0%, #fef3c7 85%, #fde68a 100%);
}

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

.white-key.is-pressed {
  transform: translateY(2px);
  background: linear-gradient(180deg, #bae6fd 0%, #38e8ff 100%);
  box-shadow: inset 0 -2px 0 rgba(2, 132, 199, 0.5), 0 0 18px rgba(56, 232, 255, 0.55);
}
.white-key.is-pressed[data-press-hand="L"] {
  background: linear-gradient(180deg, #fecdd3 0%, #fb7185 100%);
  box-shadow: inset 0 -2px 0 rgba(190, 18, 60, 0.5), 0 0 18px rgba(255, 107, 157, 0.55);
}

/* Black Ebony Keys */
.black-key {
  height: 61%;
  z-index: 8;
  background: linear-gradient(180deg, #272e3f 0%, #111622 65%, #07090f 100%);
  border: 1px solid #020409;
  border-radius: 0 0 5px 5px;
  box-shadow:
    inset 0 2px 2px rgba(255, 255, 255, 0.14),
    inset 0 -5px 0 rgba(0, 0, 0, 0.8),
    0 5px 10px rgba(0, 0, 0, 0.65);
  padding-bottom: 5px;
}

.black-key.is-pressed {
  transform: translateY(2px);
  background: linear-gradient(180deg, #0891b2 0%, #0e7490 100%);
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.5), 0 0 16px rgba(56, 232, 255, 0.7);
}
.black-key.is-pressed[data-press-hand="L"] {
  background: linear-gradient(180deg, #e11d48 0%, #9f1239 100%);
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.5), 0 0 16px rgba(255, 107, 157, 0.7);
}

/* Top LED strip inside each key */
.key-led {
  position: absolute;
  top: 3px;
  left: 16%;
  right: 16%;
  height: 4px;
  border-radius: 99px;
  opacity: 0;
  transition: opacity 0.1s ease;
}

/* Guide Highlights (Wait Mode / Next Note) */
.piano-key.guide-rh .key-led { opacity: 1; background: var(--cyan); box-shadow: 0 0 10px var(--cyan); }
.piano-key.guide-lh .key-led { opacity: 1; background: var(--rose); box-shadow: 0 0 10px var(--rose); }
.white-key.guide-rh.guide-expected {
  background: linear-gradient(180deg, #e0f2fe 0%, #7dd3fc 100%);
  box-shadow: inset 0 0 14px rgba(56, 232, 255, 0.75);
}
.white-key.guide-lh.guide-expected {
  background: linear-gradient(180deg, #ffe4e6 0%, #fda4af 100%);
  box-shadow: inset 0 0 14px rgba(255, 107, 157, 0.75);
}
.black-key.guide-rh.guide-expected {
  background: linear-gradient(180deg, #0284c7 0%, #0369a1 100%);
  box-shadow: 0 0 16px rgba(56, 232, 255, 0.85);
}
.black-key.guide-lh.guide-expected {
  background: linear-gradient(180deg, #e11d48 0%, #be123c 100%);
  box-shadow: 0 0 16px rgba(255, 107, 157, 0.85);
}

/* Chord Inspector Highlights */
.white-key.chord-hl { background: linear-gradient(180deg, #cffafe 0%, #67e8f9 100%); }
.white-key.chord-root { background: linear-gradient(180deg, #fef3c7 0%, #f4c26b 100%); }
.black-key.chord-hl { background: linear-gradient(180deg, #06b6d4 0%, #0e7490 100%); }
.black-key.chord-root { background: linear-gradient(180deg, #f59e0b 0%, #b45309 100%); }

/* Scale Dots (Theory & Jammer Scale Guide) */
.key-scale-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-bottom: 4px;
  opacity: 0;
  transform: scale(0.6);
  transition: all 0.15s ease;
}
.piano-key.in-scale .key-scale-dot {
  opacity: 1;
  transform: scale(1);
  background: var(--emerald);
  box-shadow: 0 0 8px var(--emerald);
}
.piano-key.scale-root .key-scale-dot {
  opacity: 1;
  transform: scale(1.25);
  background: var(--gold);
  box-shadow: 0 0 10px var(--gold);
}

/* Hit Feedback Flashes */
.piano-key.hit-perfect { box-shadow: inset 0 0 22px #34d399, 0 0 20px #34d399 !important; }
.piano-key.hit-good    { box-shadow: inset 0 0 18px #38e8ff, 0 0 16px #38e8ff !important; }
.piano-key.hit-miss    { box-shadow: inset 0 0 20px #f87171, 0 0 16px #f87171 !important; }

/* Finger & Root Badge inside key */
.key-badge {
  font-size: 10px;
  font-weight: 800;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin-bottom: auto;
  margin-top: 12px;
  opacity: 0;
}
.piano-key.guide-rh .key-badge:not(:empty) { opacity: 1; background: #0369a1; color: #fff; }
.piano-key.guide-lh .key-badge:not(:empty) { opacity: 1; background: #be123c; color: #fff; }
.piano-key.chord-root .key-badge:not(:empty) { opacity: 1; background: #78350f; color: #fef3c7; }
.black-key .key-badge { margin-top: 9px; width: 15px; height: 15px; font-size: 9px; }

/* Key Labels (QWERTY + Note Name) */
.key-labels {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  line-height: 1.05;
  pointer-events: none;
}
.white-key .key-qwerty {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9.5px;
  font-weight: 700;
  color: #64748b;
  background: rgba(15, 23, 42, 0.08);
  padding: 0 3px;
  border-radius: 3px;
}
.white-key .key-qwerty:empty { display: none; }
.white-key .key-note {
  font-size: 10px;
  font-weight: 700;
  color: #334155;
}
.black-key .key-qwerty {
  font-family: 'JetBrains Mono', monospace;
  font-size: 8.5px;
  font-weight: 700;
  color: #f4c26b;
}
.black-key .key-note {
  font-size: 8px;
  font-weight: 600;
  color: rgba(226, 232, 240, 0.72);
}

/* ============================================================================
   SHARED CARDS & BUTTONS (Curriculum, Theory, Studio)
   ============================================================================ */
.glass-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  backdrop-filter: blur(12px);
}

.card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.card-title-row h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
}

.mini-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-dim);
  letter-spacing: 0.03em;
  margin-bottom: 6px;
}

.btn-primary, .btn-primary-sm {
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #f4c26b, #d99326);
  color: #0b0e17;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.12s ease, filter 0.15s ease;
}
.btn-primary { padding: 9px 18px; font-size: 13px; }
.btn-primary-sm { padding: 6px 12px; font-size: 12px; }
.btn-primary:hover, .btn-primary-sm:hover { filter: brightness(1.08); transform: translateY(-1px); }

.btn-ghost, .btn-ghost-sm, .btn-ghost-xs {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  font-weight: 600;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.15s ease;
}
.btn-ghost { padding: 9px 16px; font-size: 13px; }
.btn-ghost-sm { padding: 5px 10px; font-size: 11.5px; }
.btn-ghost-xs { padding: 3px 7px; font-size: 11px; }
.btn-ghost:hover, .btn-ghost-sm:hover, .btn-ghost-xs:hover {
  border-color: var(--border-gold);
  background: rgba(244, 194, 107, 0.12);
}
.btn-ghost-xs.danger:hover { border-color: var(--danger); color: var(--danger); }

.pill-gold {
  padding: 3px 10px;
  border-radius: 99px;
  background: var(--gold-soft);
  border: 1px solid var(--border-gold);
  color: var(--gold);
  font-size: 11.5px;
  font-weight: 700;
}

/* ============================================================================
   VIEW 2: CURRICULUM 5-TIER BROWSER
   ============================================================================ */
.curriculum-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 18px;
}
.curriculum-header h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 26px;
  color: var(--gold);
  line-height: 1.15;
}
.curriculum-header p { color: var(--text-dim); margin-top: 3px; }

.tier-filter-bar { display: flex; gap: 6px; flex-wrap: wrap; }
.tier-pill {
  padding: 6px 12px;
  border-radius: 99px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-dim);
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
}
.tier-pill.active {
  background: var(--gold-soft);
  border-color: var(--gold);
  color: var(--gold);
}

.tier-section { margin-bottom: 22px; }
.tier-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.tier-badge {
  padding: 3px 11px;
  border-radius: 99px;
  background: color-mix(in srgb, var(--tier-col) 18%, transparent);
  border: 1px solid color-mix(in srgb, var(--tier-col) 55%, transparent);
  color: var(--tier-col);
  font-weight: 800;
  font-size: 12px;
}
.tier-sub { color: var(--text-dim); font-size: 12.5px; }

.songs-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(265px, 1fr));
  gap: 12px;
}

.song-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 13px 15px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}
.song-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-gold);
  background: var(--bg-card-hover);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.4);
}
.song-card.is-current {
  border-color: var(--cyan);
  box-shadow: 0 0 0 1px rgba(56, 232, 255, 0.3);
}
.sc-top { display: flex; justify-content: space-between; align-items: center; font-size: 11px; }
.sc-key { color: var(--cyan); font-weight: 700; font-family: 'JetBrains Mono', monospace; }
.sc-stars { color: var(--text-muted); letter-spacing: 1px; font-size: 13px; }
.sc-stars.earned { color: var(--gold); text-shadow: 0 0 8px rgba(244, 194, 107, 0.5); }
.sc-title { font-size: 14.5px; font-weight: 700; color: var(--text-main); }
.sc-composer { font-size: 11.5px; color: var(--text-dim); }
.sc-theory-chip {
  font-size: 11.5px;
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.04);
  padding: 5px 8px;
  border-radius: 7px;
  border-left: 2px solid var(--gold);
  margin-top: 2px;
}
.sc-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: 6px;
  font-size: 11.5px;
}
.sc-meta { color: var(--text-muted); }
.sc-cta { color: var(--gold); font-weight: 700; }

/* ============================================================================
   VIEW 3: THEORY STUDIO & GAMIFIED DOJO
   ============================================================================ */
.theory-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
}
.segmented-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--border);
  border-radius: 11px;
}
.seg-btn {
  padding: 7px 14px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-dim);
  font-weight: 700;
  font-size: 12.5px;
  cursor: pointer;
}
.seg-btn.active {
  background: linear-gradient(135deg, rgba(56, 232, 255, 0.22), rgba(244, 194, 107, 0.22));
  color: var(--text-main);
  box-shadow: inset 0 0 0 1px var(--border-gold);
}
.theory-quick-tip { font-size: 12px; color: var(--text-dim); }

.theory-explorer-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.95fr) minmax(380px, 1.15fr);
  gap: 16px;
}

.cof-svg-wrap {
  display: flex;
  justify-content: center;
  margin: 4px 0 10px;
}
.cof-svg { width: 256px; height: 256px; }
.cof-wedge path {
  fill: rgba(30, 41, 59, 0.72);
  stroke: rgba(148, 163, 184, 0.25);
  stroke-width: 1;
  cursor: pointer;
  transition: all 0.15s ease;
}
.cof-wedge.minor-wedge path { fill: rgba(15, 23, 42, 0.88); }
.cof-wedge:hover path { fill: rgba(56, 232, 255, 0.28); }
.cof-wedge.is-selected path {
  fill: rgba(244, 194, 107, 0.34);
  stroke: var(--gold);
  stroke-width: 1.6;
}
.cof-major-txt { fill: #f8fafc; font-size: 12px; font-weight: 800; pointer-events: none; }
.cof-minor-txt { fill: #94a3b8; font-size: 9.5px; font-weight: 700; pointer-events: none; }
.cof-wedge.is-selected .cof-major-txt,
.cof-wedge.is-selected .cof-minor-txt { fill: var(--gold); }

.diatonic-pills { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.chord-chip {
  flex: 1;
  min-width: 44px;
  padding: 6px 4px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
}
.chord-chip:hover { border-color: var(--cyan); background: var(--cyan-soft); }
.chord-chip .roman { font-size: 9.5px; color: var(--gold); font-weight: 700; }
.chord-chip strong { font-size: 12.5px; }

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

.mini-seg { display: inline-flex; gap: 4px; background: rgba(0,0,0,0.3); padding: 3px; border-radius: 9px; }
.mini-seg-btn {
  padding: 5px 11px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--text-dim);
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
}
.mini-seg-btn.active { background: var(--cyan-soft); color: var(--cyan); }

.root-picker {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 4px;
  margin-bottom: 10px;
}
.root-btn {
  padding: 6px 2px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.035);
  color: var(--text-dim);
  font-weight: 700;
  font-size: 11.5px;
  cursor: pointer;
}
.root-btn.active {
  background: var(--gold);
  color: #090b12;
  border-color: var(--gold);
}

.selector-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
.choice-pill {
  padding: 5px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.choice-pill.active {
  border-color: var(--cyan);
  background: var(--cyan-soft);
  color: var(--cyan);
}

.inversion-row {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.inv-btn {
  padding: 4px 10px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-dim);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
}
.inv-btn.active { border-color: var(--gold); color: var(--gold); background: var(--gold-soft); }

.theory-info-box {
  background: rgba(7, 10, 18, 0.7);
  border: 1px solid var(--border);
  border-left: 3px solid var(--gold);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 10px;
}
.info-headline { font-weight: 800; color: var(--gold); font-size: 14px; }
.info-formula { font-size: 12px; color: var(--text-dim); margin: 3px 0; }
.info-formula code { color: var(--cyan); font-family: 'JetBrains Mono', monospace; }
.info-mood { font-size: 12px; color: #cbd5e1; }

.mini-staff-box {
  height: 115px;
  background: rgba(7, 10, 18, 0.72);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px 8px;
}

/* Dojo Layout */
.dojo-layout {
  display: grid;
  grid-template-columns: 230px 1fr;
  gap: 16px;
}
.dojo-sidebar { display: flex; flex-direction: column; gap: 7px; }
.dojo-nav-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-main);
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
}
.dojo-nav-btn:hover { border-color: var(--border-gold); }
.dojo-nav-btn.active {
  border-color: var(--cyan);
  background: rgba(56, 232, 255, 0.12);
}
.dojo-ico { font-size: 20px; }
.dojo-nav-btn strong { display: block; font-size: 13px; }
.dojo-nav-btn small { color: var(--text-dim); font-size: 11px; }

.dojo-diff-box {
  margin-top: 8px;
  padding: 10px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid var(--border);
}
.diff-pills { display: flex; gap: 4px; }
.diff-btn {
  flex: 1;
  padding: 5px 4px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.diff-btn.active { background: var(--gold-soft); border-color: var(--gold); color: var(--gold); }

.dojo-arena { display: flex; flex-direction: column; gap: 14px; min-height: 310px; }
.dojo-top-hud { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dojo-hud-pill {
  padding: 5px 12px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  font-size: 12.5px;
}
.dojo-hud-pill strong { color: var(--gold); }
.dojo-top-hud button:first-of-type { margin-left: auto; }

.dojo-prompt-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
}
.dojo-question-title { font-size: 15px; font-weight: 700; color: var(--text-main); }
.dojo-staff-box { width: 100%; max-width: 440px; height: 150px; background: rgba(7,10,18,0.8); border-radius: 12px; border: 1px solid var(--border); padding: 4px; }
.dojo-hint-line { font-size: 12.5px; color: var(--text-dim); }
.dojo-ear-wave {
  padding: 10px 22px;
  border-radius: 12px;
  background: rgba(56, 232, 255, 0.08);
  border: 1px solid rgba(56, 232, 255, 0.25);
  font-size: 15px;
}

.big-chord-badge {
  font-family: 'Cormorant Garamond', serif;
  font-size: 46px;
  font-weight: 700;
  color: var(--gold);
  line-height: 1.05;
  text-shadow: 0 0 26px rgba(244, 194, 107, 0.35);
}

.collected-pills, .scale-run-steps {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}
.cb-slot, .sr-step {
  min-width: 40px;
  height: 40px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1.5px dashed rgba(148, 163, 184, 0.38);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 14px;
  color: var(--text-muted);
}
.cb-slot.filled, .sr-step.done {
  border-style: solid;
  border-color: var(--emerald);
  background: rgba(52, 211, 153, 0.16);
  color: var(--emerald);
}
.sr-step.current {
  border-style: solid;
  border-color: var(--gold);
  color: var(--gold);
  box-shadow: 0 0 14px rgba(244, 194, 107, 0.35);
}

.dojo-choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 8px;
  width: 100%;
  max-width: 640px;
}
.dojo-choice-btn {
  padding: 9px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  transition: all 0.15s ease;
}
.dojo-choice-btn:hover { border-color: var(--gold); background: var(--gold-soft); }
.dojo-choice-btn strong { color: var(--cyan); font-size: 14px; }
.dojo-choice-btn span { font-size: 11px; color: var(--text-dim); }

.dojo-feedback {
  min-height: 24px;
  text-align: center;
  font-weight: 700;
  font-size: 13px;
}
.dojo-feedback.is-correct { color: var(--emerald); }
.dojo-feedback.is-wrong { color: var(--danger); }

/* ============================================================================
   VIEW 4: FREE PLAY & SMART JAM STUDIO
   ============================================================================ */
.studio-grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 16px;
}
.studio-sub { font-size: 12.5px; color: var(--text-dim); margin-bottom: 12px; }
.studio-sub strong { color: var(--emerald); }

.vibe-pills {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}
.vibe-btn {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.035);
  color: var(--text-main);
  cursor: pointer;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.vibe-btn small { color: var(--text-muted); font-size: 11px; }
.vibe-btn.active {
  border-color: var(--gold);
  background: var(--gold-soft);
}
.vibe-btn.active strong { color: var(--gold); }

.jam-chord-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}
.jam-chord-box {
  padding: 12px 8px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(7, 10, 18, 0.72);
  text-align: center;
  transition: all 0.16s ease;
}
.jam-chord-box .jam-bar-num { display: block; font-size: 10px; color: var(--text-muted); margin-bottom: 2px; }
.jam-chord-box strong { font-size: 17px; color: var(--text-main); }
.jam-chord-box.is-active {
  border-color: var(--cyan);
  background: rgba(56, 232, 255, 0.16);
  transform: translateY(-2px);
  box-shadow: 0 4px 18px rgba(56, 232, 255, 0.25);
}
.jam-chord-box.is-active strong { color: var(--cyan); }

.jam-controls-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.scale-guide-pill { font-size: 12px; color: var(--text-dim); }
.scale-guide-pill strong { color: var(--emerald); }

.btn-rec {
  padding: 6px 13px;
  border-radius: 99px;
  border: 1px solid rgba(248, 113, 113, 0.45);
  background: rgba(248, 113, 113, 0.12);
  color: #fca5a5;
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
}
.btn-rec.recording {
  background: #ef4444;
  color: #fff;
  animation: pulseGlow 1.1s infinite;
}

.live-chord-readout {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(7, 10, 18, 0.72);
  border: 1px solid var(--border);
  margin-bottom: 10px;
}
.live-chord-symbol {
  font-family: 'JetBrains Mono', monospace;
  font-size: 24px;
  font-weight: 800;
  color: var(--gold);
  min-width: 72px;
}
.live-chord-detail { font-size: 12.5px; color: var(--text-dim); }

.spectrum-canvas {
  width: 100%;
  height: 48px;
  border-radius: 8px;
  background: rgba(7, 10, 18, 0.75);
  border: 1px solid var(--border);
  margin-bottom: 10px;
  display: block;
}

.takes-list { margin-top: 10px; }
.empty-takes { font-size: 12px; color: var(--text-muted); font-style: italic; }
.take-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 9px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  margin-top: 5px;
  font-size: 12px;
}
.take-row small { color: var(--text-muted); }
.take-actions { display: flex; gap: 5px; }

/* ============================================================================
   MODALS (Profile, Song Complete, Quick Song Picker) & TOASTS
   ============================================================================ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 6, 12, 0.76);
  backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  z-index: 90;
  padding: 18px;
}

.modal-card {
  width: 100%;
  max-width: 640px;
  max-height: 86vh;
  overflow-y: auto;
  background: linear-gradient(180deg, #131a2b, #0c101b);
  border: 1px solid var(--border-gold);
  border-radius: 18px;
  padding: 20px 22px;
  box-shadow: var(--shadow-lg);
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.modal-head h3 { font-size: 17px; color: var(--gold); }
.modal-close {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
}
.modal-close:hover { color: #fff; border-color: var(--gold); }

/* Profile Modal */
.prof-top-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(244, 194, 107, 0.08);
  border: 1px solid var(--border-gold);
  margin-bottom: 14px;
}
.prof-rank-icon { font-size: 36px; }
.prof-rank-info { flex: 1; }
.prof-lvl { font-size: 16px; font-weight: 800; color: var(--gold); margin-bottom: 6px; }
.prof-xp-bar { height: 7px; border-radius: 99px; background: rgba(255,255,255,0.1); overflow: hidden; margin-bottom: 4px; }
.prof-xp-bar div { height: 100%; background: linear-gradient(90deg, var(--gold), var(--cyan)); }
.prof-xp-sub { font-size: 11.5px; color: var(--text-dim); }

.prof-metrics-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}
.pm-box {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px;
  text-align: center;
}
.pm-box span { display: block; font-size: 10px; color: var(--text-muted); font-weight: 700; }
.pm-box strong { font-size: 16px; color: var(--text-main); }

.prof-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.prof-panel {
  background: rgba(7, 10, 18, 0.65);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
}
.prof-panel h4 { font-size: 13px; color: var(--cyan); margin-bottom: 10px; }
.radar-wrap { display: flex; justify-content: center; }
.radar-svg { width: 205px; height: 205px; }

.quests-list { display: flex; flex-direction: column; gap: 10px; }
.quest-item {
  padding: 8px 10px;
  border-radius: 9px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
}
.quest-item.done { border-color: rgba(52, 211, 153, 0.45); background: rgba(52, 211, 153, 0.08); }
.q-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; font-size: 12px; font-weight: 600; margin-bottom: 5px; }
.q-head strong { white-space: nowrap; flex-shrink: 0; }
.q-bar { height: 5px; border-radius: 99px; background: rgba(255,255,255,0.08); overflow: hidden; margin-bottom: 3px; }
.q-bar div { height: 100%; background: var(--emerald); }
.quest-item small { font-size: 10.5px; color: var(--text-dim); }

/* Song Complete Modal */
.complete-modal { max-width: 480px; text-align: center; }
.complete-stars {
  font-size: 46px;
  color: var(--gold);
  letter-spacing: 6px;
  text-shadow: 0 0 28px rgba(244, 194, 107, 0.6);
  margin-bottom: 6px;
}
.complete-modal h2 { font-family: 'Cormorant Garamond', serif; font-size: 30px; color: #fff; }
.cmp-sub { color: var(--text-dim); margin-bottom: 16px; }
.cmp-stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 12px; }
.cmp-stat {
  background: rgba(255,255,255,0.045);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 6px;
}
.cmp-stat span { display: block; font-size: 10px; color: var(--text-muted); font-weight: 700; }
.cmp-stat strong { font-size: 17px; font-family: 'JetBrains Mono', monospace; }
.cmp-timing-note { font-size: 12px; color: var(--cyan); margin-bottom: 18px; }
.cmp-actions { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }

/* Quick Song Picker Modal */
.songs-modal { max-width: 560px; }
.qsm-group { margin-bottom: 12px; }
.qsm-tier { font-size: 11.5px; font-weight: 800; letter-spacing: 0.04em; margin-bottom: 5px; }
.qsm-item {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 11px;
  margin-bottom: 4px;
  border-radius: 9px;
  border: 1px solid transparent;
  background: rgba(255,255,255,0.035);
  color: var(--text-main);
  cursor: pointer;
  text-align: left;
  font-size: 12.5px;
}
.qsm-item small { color: var(--text-dim); }
.qsm-item:hover { background: rgba(244, 194, 107, 0.12); border-color: var(--border-gold); }
.qsm-item.active { border-color: var(--cyan); background: rgba(56, 232, 255, 0.12); }
.qsm-stars { color: var(--gold); letter-spacing: 1px; }

/* Toasts */
.toast-stack {
  position: fixed;
  top: 64px;
  right: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 120;
  pointer-events: none;
}
.toast-item {
  padding: 9px 14px;
  border-radius: 10px;
  background: rgba(15, 22, 38, 0.95);
  border: 1px solid var(--border-gold);
  color: var(--text-main);
  font-size: 12.5px;
  font-weight: 600;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5);
  animation: slideInToast 0.25s ease;
}
.toast-gold { border-color: var(--gold); color: var(--gold); }
.toast-success { border-color: var(--emerald); color: var(--emerald); }
.toast-item.leaving { opacity: 0; transform: translateX(20px); transition: all 0.25s ease; }

@keyframes slideInToast {
  from { opacity: 0; transform: translateX(24px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes pulseGlow {
  0%, 100% { filter: brightness(1); }
  50%      { filter: brightness(1.22); }
}

/* ============================================================================
   RESPONSIVE TWEAKS
   ============================================================================ */
@media (max-width: 1420px) {
  .brand-sub, .live-chord-pill { display: none; }
  .top-select { max-width: 138px; }
}
@media (max-width: 1160px) {
  .deck-center { display: none; }
  .theory-explorer-grid, .studio-grid, .dojo-layout, .prof-two-col {
    grid-template-columns: 1fr;
  }
  .theory-drawer { grid-template-columns: 1fr; }
}
@media (max-width: 780px) {
  .top-bar { padding: 0 8px; gap: 6px; }
  .nav-tab span:last-child { display: none; }
  .piano-keyboard-root { height: 128px; }
  .staff-stage { height: 108px; }
}
