.guitar-page-card {
  margin-bottom: 24px;
}

.guitar-toolbar-actions {
  align-items: center;
  margin-top: 16px;
}

.guitar-toolbar-actions:first-of-type {
  margin-top: 20px;
}

.tuning-readout {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
  letter-spacing: 0.08em;
}

/* ── Guitar illustration + fret grid ─────────────────────────── */
.guitar-wrap {
  position: relative;
  margin-top: 20px;
  overflow-x: auto;
  overflow-y: hidden;
  border-radius: 22px;
  background: radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.03), transparent 60%);
}

.guitar-illustration {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.fret-grid {
  position: absolute;
  display: grid;
  border-radius: 6px;
  background: linear-gradient(160deg, #4a2f14 0%, #241608 100%);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4);
}

/* The nut — a solid bar marking where "open" ends and real frets begin,
   so fret 1 doesn't look like a continuation of the open-string column. */
.fret-nut-divider {
  background: #f4e9d8;
  box-shadow: 0 0 6px rgba(244, 233, 216, 0.5);
  pointer-events: none;
}

.fret-cell {
  position: relative;
  border: none;
  border-right: 1px solid rgba(255, 224, 178, 0.3);
  background: transparent;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fret-cell:last-child {
  border-right: none;
}

/* Open-string column: no fret wire on its right (the nut divider already
   marks that boundary) and its background reads as part of the headstock
   side rather than "just another fret". */
.fret-cell-open {
  border-right: none;
  background: rgba(0, 0, 0, 0.12);
}

/* string line running through the middle of every cell in its row,
   thicker for lower (bass) strings, matching a real guitar's string gauges */
.fret-cell::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: var(--string-thickness, 1.5px);
  background: linear-gradient(180deg, rgba(255, 224, 178, 0.85), rgba(220, 190, 150, 0.6));
  transform: translateY(-50%);
  pointer-events: none;
}

.fret-marker-row {
  position: absolute;
  inset: 0;
  display: grid;
  pointer-events: none;
}

.fret-marker-dot {
  align-self: center;
  justify-self: center;
  width: 12%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(255, 224, 178, 0.28);
}

.fret-cell-label {
  position: relative;
  z-index: 1;
  font-size: var(--label-size, 11px);
  font-weight: 800;
  color: #f4e9d8;
  background: rgba(20, 12, 4, 0.72);
  border-radius: 50%;
  width: 1.9em;
  height: 1.9em;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

/* Open-string note badge: a ringed dot, not a plain filled one — the same
   filled-vs-open convention standard chord diagrams use (see this app's
   own guitar-ui.css .chord-symbol-open), adapted to this grid's circular
   note badges instead of a floating "○" above the nut. It still needs the
   same solid dark backing the fretted badges get, though — a fully
   transparent ring let the wood-grain neck (and the string line) show
   straight through, which made the letter hard to read. */
.fret-cell-label-open {
  background: rgba(15, 9, 3, 0.88);
  border: 2px solid #f4e9d8;
  color: #fff8ec;
  width: calc(1.9em - 4px);
  height: calc(1.9em - 4px);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.3);
}

/* Persistent selection for teaching a shape/pattern — deliberately a
   different color from the momentary yellow press-flash below (blue reads
   as "marked", yellow reads as "sounding right now"), and defined before
   .is-pressed so a quick click still flashes yellow on top of a highlight
   before settling back to blue. */
.fret-cell.is-highlighted {
  background: linear-gradient(180deg, #6facff 0%, #4a8ef0 100%) !important;
}

.fret-cell.is-pressed {
  background: linear-gradient(180deg, #ffe14d 0%, #f5c518 100%) !important;
}

.fret-cell.is-pressed .fret-cell-label {
  background: transparent;
  border-color: transparent;
  color: #2a1a00;
}

.fret-numbers {
  position: absolute;
  display: grid;
}

.fret-numbers span {
  text-align: center;
  font-size: 0.72rem;
  color: rgba(255, 224, 178, 0.55);
}

.fret-number-open {
  font-weight: 800;
  color: rgba(255, 224, 178, 0.85) !important;
}

.highlight-hint,
.keyboard-map-hint {
  margin: 18px 2px 0;
  color: var(--muted);
  line-height: 1.6;
}

@media (max-width: 760px) {
  .toolbar-actions {
    width: 100%;
  }

  .mode-toggle,
  .zoom-control {
    width: 100%;
    justify-content: center;
  }

  .guitar-toolbar-actions {
    flex-direction: column;
    align-items: stretch;
  }
}
