.fretboard { display: block; width: 100%; height: auto; overflow: visible; user-select: none; }

.fb-wood { fill: var(--fb-wood); }
.fb-inlay { fill: var(--fb-inlay); opacity: 0.45; }
.fb-nut { fill: var(--fb-nut); }
.fb-fret { stroke: var(--fb-fret); stroke-width: 2.4; }
.fb-string { stroke: var(--fb-string); stroke-linecap: round; }

.fb-num {
  fill: var(--fb-num); font-family: var(--font-mono); font-size: 11px; text-anchor: middle;
  dominant-baseline: middle; opacity: 0; transition: opacity 120ms;
}
.fb-num.is-marked { fill: var(--ink-2); }
.show-fret-numbers .fb-num { opacity: 1; }

.fb-marker circle { stroke-width: 2; }
.fb-marker text {
  font-family: var(--font-mono); font-weight: 500; text-anchor: middle; dominant-baseline: central;
  pointer-events: none;
}
.fb-marker--root circle { fill: var(--accent); stroke: var(--accent); }
.fb-marker--root text { fill: var(--accent-ink); }
.fb-marker--target circle { fill: var(--fb-target); stroke: var(--fb-target); }
.fb-marker--target text { fill: var(--fb-target-ink); }
.fb-marker--target.is-good circle { fill: var(--good); stroke: var(--good); }
.fb-marker--target.is-bad circle { fill: var(--bad); stroke: var(--bad); }
.fb-marker--target.is-good text, .fb-marker--target.is-bad text { fill: #fff; }
.fb-marker--ghost circle { fill: none; stroke: var(--fb-ghost); stroke-dasharray: 3 2.5; }
.fb-marker--ghost text { fill: var(--fb-ghost); }
/* A note that is there but switched off (scales page). */
.fb-marker--dim circle { fill: var(--fb-wood); stroke: var(--fb-fret); stroke-opacity: 0.55; stroke-dasharray: 2.5 2.5; }
.fb-marker--dim text { fill: var(--fb-fret); opacity: 0.6; }
/* Open-string notes sit on the page, not the wood: give pale markers an edge there. */
.fb-marker--target[data-fret="0"]:not(.is-good):not(.is-bad) circle { stroke: var(--ink-3); stroke-width: 1.5; }
.fb-marker--dim[data-fret="0"] circle { fill: var(--paper); stroke: var(--ink-3); }
.fb-marker--dim[data-fret="0"] text { fill: var(--ink-3); }

.fb-marker--target circle, .fb-marker--root circle {
  animation: fb-pop 140ms ease-out;
  transform-box: fill-box; transform-origin: center;
}
@keyframes fb-pop { from { transform: scale(0.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .fb-marker circle { animation: none; }
}

/* Horizontal scroll on narrow screens: keep frets legible rather than squashing. */
.fretboard-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.fretboard-scroll > .fretboard { min-width: 760px; }
