/* ─── Fretboard Container ───────────────────────────── */
.fretboard-section {
  width: 100%;
}

/* ─── Fretboard Header Row ──────────────────────────── */
/* Chord name centred; Tone/Tuning/Capo moved to icon bar below fretboard */
.fb-header-row {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 14px 2px;
  min-height: 48px;
}

/* Each icon + its popover share a positioned wrapper */
.fb-icon-wrap {
  position: relative;
  flex-shrink: 0;
}

/* Icon button — fixed square so the circle outline never distorts */
.fb-icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px;
  border-radius: 50%;        /* always circular — prevents oval on first open */
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  opacity: 0.82;
  transition: opacity 0.15s, transform 0.12s;
}
.fb-icon-btn img { display: block; border-radius: 50%; }
.fb-icon-btn:hover { opacity: 1; transform: scale(1.08); }
.fb-icon-btn.open  { opacity: 1; outline: 2px solid var(--accent-gold); outline-offset: 3px; }

/* Floating popover panel — fixed so it escapes overflow:hidden ancestors */
.fb-popover {
  position: fixed;
  z-index: 9999;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  box-shadow: 0 10px 32px rgba(0,0,0,0.6);
  min-width: 300px;
}
#tuning-popover { max-width: 590px; }  /* stays within the 640px left panel */

/* Label text next to Tuning / Tone icons */
.fb-icon-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #7090c0;
  white-space: nowrap;
}

/* ─── Live Chord Name Label ─────────────────────────── */
/* Absolutely centred over the full header row width */
.fb-chord-label {
  text-align: center;
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--accent-blue);
  letter-spacing: 0.02em;
  padding: 4px 8px;
  line-height: 1;
}

/* Shape annotation "(Shape: E)" — smaller, muted, same style as icon bar labels */
.fb-chord-shape-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  text-transform: uppercase;
  vertical-align: middle;
  margin-left: 4px;
}

#fretboard-container {
  width: 100%;
  background: var(--bg-panel);
  overflow-x: auto;
  padding: 8px 0 4px;
}

#fretboard-svg {
  display: block;
  width: 100%;
  min-width: 600px;
  height: auto;
  cursor: crosshair;
}

/* ─── SVG Fretboard Elements ────────────────────────── */

/* Wood body background */
.fb-body {
  fill: var(--fb-wood);
}

/* Fret lines */
.fb-fret {
  stroke: var(--fb-fret);
  stroke-width: 1.5;
}

/* The nut (thicker first fret marker) */
.fb-nut {
  stroke: var(--fb-nut);
  stroke-width: 4;
}

/* String lines */
.fb-string-0 { stroke: var(--fb-string); stroke-width: 2.8; }  /* low E - thickest */
.fb-string-1 { stroke: var(--fb-string); stroke-width: 2.4; }
.fb-string-2 { stroke: var(--fb-string); stroke-width: 2.0; }
.fb-string-3 { stroke: var(--fb-string); stroke-width: 1.6; }
.fb-string-4 { stroke: var(--fb-string); stroke-width: 1.2; }
.fb-string-5 { stroke: var(--fb-string); stroke-width: 0.9; }   /* high e - thinnest */

/* Scale position dim overlay (covers neck outside active box) */
.fb-pos-dim {
  fill: rgba(0, 0, 0, 0.45);
  pointer-events: none;
}

/* Fret position inlay markers */
.fb-inlay {
  fill: var(--fb-inlay);
  pointer-events: none;
}

/* String root note labels (left of nut) */
.fb-string-label {
  fill: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  text-anchor: middle;
  dominant-baseline: middle;
  font-family: system-ui, sans-serif;
  pointer-events: none;
}

/* Fret number labels (below fretboard) */
.fb-fret-label {
  fill: var(--text-hint);
  font-size: 10px;
  text-anchor: middle;
  font-family: system-ui, sans-serif;
  pointer-events: none;
}

/* Invisible hit areas */
.fb-hit {
  fill: transparent;
  cursor: pointer;
}
.fb-hit:hover ~ .fb-hover-ring,
.fb-hit:hover + .fb-hover-ring {
  opacity: 1;
}

/* Hover preview ring (shown on hover via JS) */
.fb-hover-ring {
  fill: none;
  stroke: rgba(255,255,255,0.55);
  stroke-width: 2;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.1s;
}

/* ─── Note Dots ─────────────────────────────────────── */
.note-dot {
  pointer-events: none;
  transition: r 0.1s;
}
.note-dot-selected {
  fill: var(--dot-selected);
}
.note-dot-tonic {
  fill: var(--dot-tonic);
}
.note-dot-dominant {
  fill: var(--dot-dominant);
}
.note-dot-scale {
  fill: var(--dot-scale);
}
.note-dot-suggestion {
  fill: rgba(155, 89, 182, 0.5);
  stroke: #9b59b6;
  stroke-width: 1.5;
}

/* Note text labels inside dots */
.note-label {
  fill: var(--dot-text);
  font-size: 10px;
  font-weight: 700;
  text-anchor: middle;
  dominant-baseline: middle;
  font-family: system-ui, sans-serif;
  pointer-events: none;
}
.note-label-scale {
  fill: rgba(255,255,255,0.8);
  font-size: 9px;
}

/* Mute 'X' markers above strings */
.fb-mute {
  fill: var(--text-hint);
  font-size: 13px;
  font-weight: 700;
  text-anchor: middle;
  dominant-baseline: middle;
  font-family: system-ui, sans-serif;
  pointer-events: none;
}

/* Open string 'O' markers — hollow ring on the string, left of the nut */
.fb-open {
  fill: none;
  stroke: var(--text-secondary);
  stroke-width: 2;
  pointer-events: none;
}

/* Capo bar — purple vertical band rendered above strings at the capo fret */
.fb-capo-bar {
  fill: #9333ea;
  opacity: 0.88;
  pointer-events: none;
}
