/* ============================================
   PianoChords - Thème sombre
   Fichier: css/style.css
   ============================================ */

:root {
  --bg: #0f0f1a;
  --bg2: #1a1a30;
  --surface: #1e1e38;
  --surface2: #252550;
  --surface3: #2a2a5a;
  --accent: #e94560;
  --accent-glow: rgba(233, 69, 96, 0.3);
  --accent2: #7b2ff7;
  --accent2-glow: rgba(123, 47, 247, 0.3);
  --green: #00e676;
  --green-glow: rgba(0, 230, 118, 0.3);
  --text: #e8e8f0;
  --text2: #8888aa;
  --text3: #5a5a7a;
  --border: #2a2a48;
  --border-focus: #e94560;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  --white-key: #f0f0f8;
  --white-key-hover: #dddde8;
  --white-key-active: #ff6b8a;
  --white-key-root: #ff3366;
  --black-key: #16162a;
  --black-key-hover: #2a2a48;
  --black-key-active: #e94560;
  --black-key-root: #cc2952;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}

/* ---- Header ---- */
.app-header {
  background: linear-gradient(135deg, #1a1040 0%, #251060 30%, #0f0f2a 100%);
  padding: 28px 24px;
  text-align: center;
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}
.app-header::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 50% 50%, rgba(123, 47, 247, 0.05) 0%, transparent 60%);
  pointer-events: none;
}
.app-header h1 {
  font-size: 2.2em;
  font-weight: 800;
  letter-spacing: 2px;
  background: linear-gradient(90deg, #fff, #c084fc, #ff6b8a);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  position: relative;
  z-index: 1;
}
.app-header .subtitle {
  color: var(--text2);
  margin-top: 6px;
  font-size: 0.95em;
  letter-spacing: 4px;
  text-transform: uppercase;
  position: relative;
  z-index: 1;
}

/* ---- Layout ---- */
.main-container {
  max-width: 1300px;
  margin: 0 auto;
  padding: 24px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
@media (max-width: 1000px) {
  .main-container {
    grid-template-columns: 1fr;
    padding: 16px;
    gap: 16px;
  }
}

/* ---- Top bar (tabs + chord info) ---- */
.top-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.top-bar .mode-tabs {
  flex-shrink: 0;
  margin-bottom: 0;
}
.top-bar .chord-display {
  flex: 1;
  min-width: 250px;
  padding: 14px 20px;
  margin-bottom: 0;
}

/* ---- Panels ---- */
.panel {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 24px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: border-color 0.3s;
}
.panel:hover {
  border-color: rgba(123, 47, 247, 0.2);
}

.panel-title {
  font-size: 0.85em;
  font-weight: 700;
  margin-bottom: 18px;
  color: var(--accent2);
  text-transform: uppercase;
  letter-spacing: 3px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.panel-title::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 16px;
  background: var(--accent2);
  border-radius: 2px;
}

/* ---- Mode Tabs (Accord / Gamme) ---- */
.mode-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 18px;
  padding: 4px;
  background: var(--bg);
  border-radius: var(--radius-sm);
}
.mode-tab {
  flex: 1;
  padding: 9px 16px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text2);
  font-size: 0.82em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  letter-spacing: 0.5px;
  white-space: nowrap;
}
.mode-tab:hover {
  color: var(--text);
}
.mode-tab.active {
  background: var(--accent2);
  color: #fff;
  box-shadow: 0 2px 8px rgba(123, 47, 247, 0.3);
}
.chord-display {
  background: linear-gradient(135deg, var(--surface2), var(--surface3));
  border-radius: var(--radius);
  padding: 20px 24px;
  text-align: center;
  margin-bottom: 20px;
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}
.chord-display::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 70% 30%, rgba(233, 69, 96, 0.05) 0%, transparent 60%);
  pointer-events: none;
}
.chord-name {
  font-size: 2.2em;
  font-weight: 800;
  color: #fff;
  letter-spacing: 1px;
}
.chord-notes {
  color: var(--text2);
  font-size: 1em;
  margin-top: 8px;
  letter-spacing: 0.5px;
}
.chord-intervals {
  color: var(--accent);
  font-size: 0.82em;
  margin-top: 6px;
  opacity: 0.7;
}

/* ---- Controls ---- */
.controls-row {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.select-group {
  flex: 1;
  min-width: 130px;
}
.select-group label {
  display: block;
  font-size: 0.72em;
  color: var(--text3);
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 600;
}
select, input[type="text"], input[type="range"] {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 0.9em;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%238888aa' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 14px;
  cursor: pointer;
}
select:focus, input:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(233, 69, 96, 0.15);
}

/* ---- Buttons ---- */
.btn {
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  border: none;
  font-size: 0.88em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  letter-spacing: 0.5px;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.btn:active {
  transform: scale(0.97);
}
.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 15px var(--accent-glow);
}
.btn-primary:hover {
  background: #ff5277;
  box-shadow: 0 6px 20px var(--accent-glow);
  transform: translateY(-1px);
}
.btn-secondary {
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  background: var(--surface3);
  border-color: var(--accent2);
}
.btn-play {
  background: var(--green);
  color: #000;
  box-shadow: 0 4px 15px var(--green-glow);
}
.btn-play:hover {
  background: #00ff84;
  box-shadow: 0 6px 20px var(--green-glow);
  transform: translateY(-1px);
}
.btn-stop {
  background: var(--accent);
  color: #fff;
}
.btn-small {
  padding: 7px 14px;
  font-size: 0.8em;
  border-radius: 6px;
}
.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2em;
}
.btn-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

/* ---- Piano ---- */
.piano-wrapper {
  background: linear-gradient(180deg, #0a0a18 0%, #13132a 100%);
  border-radius: var(--radius);
  padding: 16px 10px 12px;
  margin-top: 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border);
  touch-action: pan-x;
}
.piano {
  touch-action: none;
  position: relative;
}

/* ---- Piano split (accompagnement) ---- */
.piano-split-marker {
  position: absolute;
  top: 0; bottom: 0;
  width: 3px;
  background: var(--accent2);
  z-index: 10;
  box-shadow: 0 0 8px var(--accent2-glow);
  pointer-events: none;
}
.white-key.left-hand {
  background: #d8d0f0 !important;
  color: #6a5acd;
}
.white-key.left-hand.root-note {
  background: #c0b0f0 !important;
}
.white-key.left-hand.accomp-active {
  background: var(--accent2) !important;
  color: #fff;
  box-shadow: 0 0 14px var(--accent2-glow), inset 0 0 6px rgba(255,255,255,0.2);
}
.black-key.left-hand {
  background: #2a2050 !important;
  color: #7a6ad0;
}
.black-key.left-hand.accomp-active {
  background: #7b2ff7 !important;
  color: #fff;
}
.white-key.right-hand {
  background: var(--white-key);
}

/* ---- Accompagnement ---- */
.accomp-section {
  margin: 12px 0 8px;
}
.accomp-bar {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.btn-accomp {
  background: transparent;
  border: 2px solid var(--accent2);
  color: var(--accent2);
  font-weight: 700;
  font-size: 0.82em;
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.btn-accomp:hover { background: rgba(123,47,247,0.15); }
.btn-accomp.active {
  background: var(--accent2);
  color: #fff;
  box-shadow: 0 0 16px var(--accent2-glow);
}
.piano-wrapper::-webkit-scrollbar {
  height: 6px;
}
.piano-wrapper::-webkit-scrollbar-track {
  background: transparent;
}
.piano-wrapper::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}
.piano {
  display: flex;
  position: relative;
  min-width: fit-content;
  user-select: none;
  -webkit-user-select: none;
  padding-bottom: 4px;
}
.white-key {
  width: 44px;
  height: 150px;
  background: var(--white-key);
  border: 1px solid #d0d0d8;
  border-radius: 0 0 7px 7px;
  cursor: pointer;
  position: relative;
  z-index: 1;
  transition: background 0.08s ease, box-shadow 0.08s ease;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 10px;
  font-size: 0.7em;
  font-weight: 500;
  color: #999;
  flex-shrink: 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.white-key:hover {
  background: var(--white-key-hover);
}
.white-key:active {
  background: #e0e0ee;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}
.white-key.active {
  background: var(--white-key-active) !important;
  color: #fff;
  font-weight: 700;
  box-shadow: 0 0 16px var(--accent-glow), inset 0 0 8px rgba(255, 255, 255, 0.15);
  border-color: #ff5277;
}
.white-key.root-note {
  background: var(--white-key-root) !important;
  color: #fff;
  font-weight: 800;
  box-shadow: 0 0 20px rgba(255, 51, 102, 0.5), inset 0 0 10px rgba(255, 255, 255, 0.2);
}
.black-key {
  width: 30px;
  height: 95px;
  background: var(--black-key);
  border: 1px solid #000;
  border-radius: 0 0 5px 5px;
  cursor: pointer;
  position: absolute;
  z-index: 2;
  transition: background 0.08s ease, box-shadow 0.08s ease;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 8px;
  font-size: 0.55em;
  font-weight: 500;
  color: #555;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
}
.black-key:hover {
  background: var(--black-key-hover);
}
.black-key:active {
  background: #1a1a38;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}
.black-key.active {
  background: var(--black-key-active) !important;
  color: #fff;
  font-weight: 700;
  box-shadow: 0 0 14px var(--accent-glow), inset 0 0 6px rgba(255, 255, 255, 0.1);
}
.black-key.root-note {
  background: var(--black-key-root) !important;
  color: #fff;
  font-weight: 800;
}

/* ---- Preset Grid ---- */
.presets-section {
  margin-top: 18px;
}
.presets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 7px;
  max-height: 200px;
  overflow-y: auto;
  padding-right: 4px;
}
.presets-grid::-webkit-scrollbar {
  width: 4px;
}
.presets-grid::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}
.preset-chip {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 8px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s ease;
}
.preset-chip:hover {
  border-color: var(--accent2);
  background: var(--surface2);
  transform: translateY(-1px);
}
.preset-chip.selected {
  border-color: var(--accent);
  background: var(--surface3);
  box-shadow: 0 0 12px var(--accent-glow);
}
.preset-chip .preset-name {
  font-weight: 700;
  font-size: 0.95em;
  color: var(--text);
}
.preset-chip .preset-detail {
  font-size: 0.7em;
  color: var(--text3);
  margin-top: 3px;
}

/* ---- Progression ---- */
.progression-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
  min-height: 44px;
  align-items: center;
}
.progression-chip {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 9px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  animation: fadeInChip 0.3s ease;
}
@keyframes fadeInChip {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}
.progression-chip:hover {
  border-color: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
}
.progression-chip.playing {
  border-color: var(--green);
  background: var(--bg);
  box-shadow: 0 0 16px var(--green-glow);
  animation: pulseChip 0.6s ease;
}
@keyframes pulseChip {
  0%, 100% { box-shadow: 0 0 8px var(--green-glow); }
  50% { box-shadow: 0 0 24px var(--green-glow); }
}
.progression-chip .chip-number {
  font-size: 0.75em;
  color: var(--text3);
  font-weight: 400;
}
.progression-chip .chip-remove {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: var(--text2);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.8em;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.progression-chip .chip-remove:hover {
  background: var(--accent);
  color: #fff;
}
.empty-state {
  color: var(--text3);
  font-style: italic;
  font-size: 0.9em;
  padding: 8px 0;
}

/* ---- BPM Control ---- */
.bpm-control {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0;
}
.bpm-control label {
  font-size: 0.75em;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
}
.bpm-control input[type="range"] {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 3px;
  background: var(--border);
  outline: none;
  padding: 0;
  cursor: pointer;
}
.bpm-control input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent2);
  border: 2px solid var(--bg);
  cursor: pointer;
}
.bpm-control .bpm-value {
  font-weight: 700;
  font-size: 0.9em;
  color: var(--accent2);
  min-width: 36px;
  text-align: center;
}

/* ---- Saved Progressions ---- */
.saved-list {
  max-height: 280px;
  overflow-y: auto;
  padding-right: 4px;
}
.saved-list::-webkit-scrollbar {
  width: 4px;
}
.saved-list::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}
.saved-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
  gap: 10px;
}
.saved-item:hover {
  border-color: var(--border);
  background: var(--surface2);
}
.saved-item.loaded {
  border-color: var(--accent2);
  background: var(--surface2);
}
.saved-item-name {
  font-weight: 700;
  font-size: 0.95em;
}
.saved-item-chords {
  color: var(--text2);
  font-size: 0.78em;
  margin-top: 3px;
}

/* ---- Toast ---- */
.toast-container {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  background: var(--surface3);
  color: #fff;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9em;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s ease;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  pointer-events: auto;
}
.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* ---- Recording Bar ---- */
.recording-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg);
  border-radius: var(--radius);
  margin-bottom: 16px;
  border: 1px solid var(--border);
  transition: all 0.3s ease;
  flex-wrap: wrap;
}
.recording-bar.active {
  border-color: var(--accent);
  background: linear-gradient(135deg, rgba(233,69,96,0.12), rgba(123,47,247,0.06));
  box-shadow: 0 0 20px rgba(233,69,96,0.15);
}
.btn-rec {
  background: transparent;
  border: 2px solid var(--accent);
  color: var(--accent);
  font-weight: 700;
  font-size: 0.85em;
  padding: 8px 18px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 1px;
}
.btn-rec:hover { background: rgba(233,69,96,0.15); }
.btn-rec.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 0 16px var(--accent-glow);
}
.rec-dot {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--text3); flex-shrink: 0; transition: all 0.3s;
}
.recording-bar.active .rec-dot {
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent-glow);
  animation: recPulse 0.8s ease-in-out infinite;
}
@keyframes recPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(1.3); }
}
.rec-counter {
  font-weight: 700; font-size: 1em; color: var(--accent); min-width: 50px; text-align: right;
}
.rec-actions { display: flex; gap: 8px; align-items: center; }
.btn-stop-rec { background: var(--accent); color: #fff; box-shadow: 0 2px 10px var(--accent-glow); }
.btn-stop-rec:hover { background: #ff5277; }

/* ---- Sub Tabs (Accord / Gamme) ---- */
.sub-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  padding: 3px;
  background: var(--bg);
  border-radius: 6px;
}
.sub-tab {
  flex: 1;
  padding: 7px 12px;
  border: none;
  border-radius: 5px;
  background: transparent;
  color: var(--text2);
  font-size: 0.78em;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
}
.sub-tab:hover { color: var(--text); }
.sub-tab.active {
  background: rgba(123,47,247,0.25);
  color: #c084fc;
}

/* ---- Drum Pads ---- */
.drum-header {
  margin-bottom: 16px;
}
.drum-pads {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}
.drum-pad {
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: all 0.08s ease;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  position: relative;
  overflow: hidden;
}
.drum-pad:hover { border-color: var(--accent2); }
.drum-pad:active, .drum-pad.hit {
  transform: scale(0.94);
  border-color: var(--accent);
  box-shadow: 0 0 20px var(--accent-glow);
}
.drum-pad .pad-name {
  font-weight: 700;
  font-size: 0.85em;
  color: var(--text);
  z-index: 1;
}
.drum-pad .pad-key {
  font-size: 0.65em;
  color: var(--text3);
  z-index: 1;
}
.pad-kick { background: linear-gradient(135deg, #2a1040, #1a1030); }
.pad-snare { background: linear-gradient(135deg, #1a2040, #102030); }
.pad-hh_closed { background: linear-gradient(135deg, #1a3020, #102a18); }
.pad-hh_open { background: linear-gradient(135deg, #203020, #182a18); }
.pad-clap { background: linear-gradient(135deg, #302020, #2a1818); }
.pad-tom_high { background: linear-gradient(135deg, #2a2040, #1a1840); }
.pad-tom_mid { background: linear-gradient(135deg, #2a1840, #1a1038); }
.pad-tom_low { background: linear-gradient(135deg, #301a30, #201020); }
.pad-rim { background: linear-gradient(135deg, #2a2a20, #202010); }
.pad-crash { background: linear-gradient(135deg, #302a18, #2a2010); }

.drum-display {
  text-align: center;
  min-height: 30px;
  padding: 8px;
}

/* ---- Rhythm Grid ---- */
.rhythm-section {
  margin-bottom: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  background: var(--bg);
}
.rhythm-header {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.rhythm-grid {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.rhythm-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.rhythm-label {
  font-size: 0.65em;
  color: var(--text3);
  width: 55px;
  flex-shrink: 0;
  text-align: right;
  font-weight: 600;
  text-transform: uppercase;
}
.rhythm-steps {
  display: flex;
  gap: 2px;
  flex: 1;
}
.rhythm-step {
  flex: 1;
  aspect-ratio: 1;
  max-width: 22px;
  max-height: 22px;
  border-radius: 3px;
  background: var(--surface2);
  border: 1px solid transparent;
  transition: all 0.08s;
}
.rhythm-step.on {
  border-color: var(--accent);
  box-shadow: 0 0 6px var(--accent-glow);
}
.rhythm-step.beat-start {
  border-left: 2px solid var(--accent2);
}
.rhythm-step.kick { background: #4a2040; }
.rhythm-step.snare { background: #2a3a50; }
.rhythm-step.hh_closed { background: #2a4a2a; }
.rhythm-step.hh_open { background: #3a4a2a; }
.rhythm-step.clap { background: #3a2a2a; }
.rhythm-step.tom_high { background: #3a2a50; }
.rhythm-step.tom_mid { background: #3a2050; }
.rhythm-step.tom_low { background: #4a2a40; }
.rhythm-step.rim { background: #4a4a2a; }
.rhythm-step.crash { background: #5a4a20; }
.rhythm-row.active .rhythm-label { color: var(--accent); }
.rhythm-step.current {
  border-color: #fff !important;
  box-shadow: 0 0 10px rgba(255,255,255,0.5);
  transform: scale(1.2);
}

/* ---- Metronome ---- */
.metronome-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
  border: 1px solid var(--border);
  flex-wrap: wrap;
}
.beat-indicator {
  display: flex;
  gap: 6px;
  align-items: center;
}
.beat-dot {
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--border);
  transition: all 0.1s ease;
}
.beat-dot.active {
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
  transform: scale(1.2);
}
.beat-dot.first {
  background: var(--accent2);
  box-shadow: 0 0 12px var(--accent2-glow);
}
.wave-bars {
  display: none;
  gap: 2px;
  align-items: flex-end;
  height: 20px;
}
.wave-bars.visible {
  display: flex;
}
.wave-bar {
  width: 3px;
  background: var(--green);
  border-radius: 2px;
  animation: waveAnim 0.5s ease-in-out infinite alternate;
}
.wave-bar:nth-child(2) { animation-delay: 0.1s; }
.wave-bar:nth-child(3) { animation-delay: 0.2s; }
.wave-bar:nth-child(4) { animation-delay: 0.3s; }
@keyframes waveAnim {
  from { height: 6px; }
  to { height: 18px; }
}

/* ---- Input row ---- */
.input-row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  flex-wrap: wrap;
}
.input-row .input-field {
  flex: 1;
  min-width: 150px;
}
.input-row .input-field label {
  display: block;
  font-size: 0.72em;
  color: var(--text3);
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 600;
}
