/* Bass Practice Tool - ADHD-friendly: large targets, minimal clutter,
   high contrast, immediate feedback */
:root {
  --bg: #14161a;
  --surface: #1e2128;
  --surface-2: #282c35;
  --text: #eef0f4;
  --muted: #9aa3b2;
  --accent: #4f9cff;
  --accent-2: #38d178;
  --danger: #ff5c5c;
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", system-ui, sans-serif;
  font-size: 18px;
  line-height: 1.5;
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px;
}

h1 { font-size: 1.6rem; margin: 0 0 20px; }
h2 { font-size: 1.2rem; color: var(--muted); font-weight: 600; }

button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 56px;
  padding: 12px 24px;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  background: var(--surface-2);
  border: 2px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.12s, border-color 0.12s, transform 0.05s;
}
button:hover, .btn:hover { background: #333945; }
button:active, .btn:active { transform: scale(0.98); }
button.primary, .btn.primary { background: var(--accent); color: #0b1220; }
button.primary:hover, .btn.primary:hover { background: #6cb0ff; }
button.active, .btn.active {
  border-color: var(--accent-2);
  background: #1f3a2c;
  color: var(--accent-2);
}
button:disabled { opacity: 0.45; cursor: default; }

/* ---------- Song List ---------- */
.song-list { display: flex; flex-direction: column; gap: 14px; margin-top: 24px; }
.song-row { display: flex; gap: 10px; align-items: stretch; }
.song-row .song-open { flex: 1; justify-content: space-between; }
.song-delete {
  min-width: 56px;
  padding: 0 14px;
  font-size: 1.2rem;
  background: var(--surface);
}
.song-delete:hover { background: #4a2028; color: var(--danger); }
.song-copy {
  min-width: 56px;
  padding: 0 14px;
  font-size: 1.2rem;
  background: var(--surface);
}
.song-copy:hover { background: #1f3a2c; color: var(--accent-2); }
.song-status { font-size: 0.85rem; color: var(--muted); font-weight: 400; }

/* ---------- Wizard ---------- */
.wizard-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 32px;
  margin-top: 24px;
  text-align: center;
}
.wizard-step { font-size: 1.1rem; margin-bottom: 20px; }
.progress-track {
  height: 22px;
  background: var(--surface-2);
  border-radius: 11px;
  overflow: hidden;
  margin: 20px 0;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.4s ease;
}
.error-text { color: var(--danger); }
input[type="file"] { display: none; }

/* ---------- Header bar (practice/editor) ---------- */
.header-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 20px;
  background: var(--surface);
}
.header-bar .title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-right: auto;
}
.header-bar button, .header-bar .btn { min-height: 46px; padding: 8px 18px; }

/* ---------- Transport bar ---------- */
.transport-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 20px;
  background: var(--surface-2);
}
.transport-group {
  display: flex;
  align-items: center;
  gap: 8px;
}
.transport-label { color: var(--muted); font-size: 0.9rem; margin-right: 4px; }
.transport-bar button { min-height: 46px; padding: 8px 16px; }

/* ---------- Sing-along view ---------- */
.singalong {
  padding: 24px 28px 80px;
  max-width: 1100px;
  margin: 0 auto;
}
.sheet-section { margin-bottom: 28px; }
.sheet-section-header {
  color: var(--muted);
  font-weight: 700;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 14px;
  border-bottom: 1px solid var(--surface-2);
  padding-bottom: 6px;
}
.sheet-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  row-gap: 26px;
  column-gap: 6px;
  padding-top: 18px; /* room for the cursor marker above notes */
}
.note-chip {
  position: relative;
  min-width: 52px;
  padding: 6px 10px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 1.15rem;
  font-weight: 700;
  background: var(--surface);
  border: 2px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  user-select: none;
  transition: background 0.1s, border-color 0.1s;
}
.chip-note { font-size: 1.05rem; font-weight: 700; line-height: 1.2; }
.chip-fing {
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--accent-2);
  min-height: 1.2em;
}
.note-chip.current .chip-fing { color: inherit; }
.note-chip.selected {
  border-color: var(--accent);
  background: #21334d;
}
.note-chip:hover { background: var(--surface-2); }
.note-chip.unassigned .chip-note { color: var(--muted); font-weight: 500; }
.note-chip.current {
  background: var(--accent);
  color: #0b1220;
}
.note-chip.current::before {
  content: "▼";
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--accent-2);
  font-size: 0.85rem;
}
.measure-bar {
  color: #4a5160;
  font-size: 1.4rem;
  font-weight: 300;
  padding: 0 4px;
  user-select: none;
}

.unassigned-hint { color: var(--muted); font-size: 1rem; }

/* ---------- Editor ---------- */
.editor-layout { padding: 20px; display: flex; flex-direction: column; gap: 20px; }
.note-navigator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
}
.note-info { text-align: center; min-width: 260px; }
.note-info .big { font-size: 2.4rem; font-weight: 800; }
.note-info .dim { color: var(--muted); }
.pending-input {
  font-size: 1.3rem;
  color: var(--accent-2);
  min-height: 1.6em;
  text-align: center;
}
.fretboard-wrap {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px;
  overflow-x: auto;
}
canvas#fretboard { display: block; margin: 0 auto; cursor: pointer; }
.editor-help {
  color: var(--muted);
  font-size: 0.95rem;
  text-align: center;
}
kbd {
  background: var(--surface-2);
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 0.9em;
  border: 1px solid #3a4150;
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent-2);
  color: #0b1220;
  font-weight: 700;
  padding: 12px 28px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}
.toast.show { opacity: 1; }

/* ---------- Inline fingering editor (practice page) ---------- */
.edit-panel {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 12px 20px;
  background: var(--surface);
  border-top: 2px solid var(--accent);
  box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.45);
}
.edit-panel[hidden] { display: none; }
.edit-panel .sel-count {
  font-weight: 700;
  color: var(--accent);
  min-width: 110px;
}
.edit-panel label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  color: var(--muted);
  font-weight: 600;
}
.edit-panel select {
  min-height: 44px;
  padding: 6px 10px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid #3a4150;
  border-radius: 10px;
}
.edit-panel .pitch-preview {
  font-weight: 700;
  color: var(--accent-2);
  min-width: 48px;
  text-align: center;
}
.edit-panel button { min-height: 44px; padding: 8px 16px; font-size: 0.95rem; }
.edit-panel .danger:hover { background: #4a2028; color: var(--danger); }
.singalong { padding-bottom: 140px; } /* keep last line above the panel */

/* ---------- Practice layout page ---------- */
.layout-title {
  background: transparent;
  border: 2px solid transparent;
  border-radius: 10px;
  color: var(--text);
  font-family: inherit;
  padding: 6px 10px;
  min-width: 220px;
  flex: 0 1 auto;
}
.layout-title:hover { border-color: #3a4150; }
.layout-title:focus { border-color: var(--accent); outline: none; background: var(--surface-2); }
.save-state {
  font-size: 0.85rem;
  color: var(--muted);
  margin-right: auto;
  min-width: 70px;
}
.track-pick {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  color: var(--muted);
  font-weight: 600;
}
.track-pick select {
  min-height: 44px;
  max-width: 260px;
  padding: 6px 10px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid #3a4150;
  border-radius: 10px;
}
.chip-gap {
  display: inline-block;
  width: 10px;
  align-self: stretch;
  min-height: 44px;
  border-radius: 4px;
  cursor: pointer;
}
.chip-gap:hover { background: #3a415088; }
.chip-gap.active {
  width: 4px;
  margin: 0 3px;
  background: var(--accent-2);
  animation: caret-blink 1.1s step-end infinite;
}
@keyframes caret-blink { 50% { opacity: 0.25; } }
.clickable-bar { cursor: pointer; border-radius: 6px; padding: 0 8px; }
.clickable-bar:hover { background: var(--surface-2); }
.clickable-bar.selected { background: #21334d; color: var(--accent); }
