body { font-family: Inter, sans-serif; }

.tool-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  padding: 1.5rem;
  box-shadow: 0 3px 12px rgba(0,0,0,.04);
}

.mode-btn {
  padding: 5px 12px;
  border-radius: 7px;
  font-size: 0.72rem;
  font-weight: 600;
  color: #6b7280;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
}
.mode-btn.active {
  background: #fff;
  color: #92400e;
  box-shadow: 0 1px 4px rgba(0,0,0,0.10);
}

.fret-nav-btn {
  width: 26px; height: 26px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #f9fafb;
  color: #6b7280;
  font-size: 0.7rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.12s, color 0.12s;
  flex-shrink: 0;
}
.fret-nav-btn:hover { background: #fff; color: #92400e; border-color: #fcd34d; }

.fret-display {
  font-size: 0.78rem;
  font-weight: 700;
  color: #1f2937;
  min-width: 48px;
  text-align: center;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 3px 8px;
}

/* ── Banjo body ── */
.banjo-body {
  display: flex;
  align-items: stretch;
  background: linear-gradient(160deg, #1a1005 0%, #0d0800 100%);
  border-radius: 0.75rem;
  overflow: hidden;
  box-shadow:
    inset 0 2px 8px rgba(255,200,80,0.08),
    inset 0 -4px 20px rgba(0,0,0,0.5),
    0 6px 20px rgba(0,0,0,0.2);
  position: relative;
  min-height: 160px;
  user-select: none;
  margin: 0 -0.5rem;
}

/* ── Neck ── */
.banjo-neck {
  flex: 1;
  position: relative;
  /* Maple neck — lighter than bass */
  background: linear-gradient(90deg, #c8a060 0%, #e0b870 40%, #c8a060 100%);
  min-height: 160px;
  overflow: hidden;
  cursor: crosshair;
}
.banjo-neck::after {
  content: '';
  position: absolute; inset: 0;
  background: repeating-linear-gradient(
    90deg,
    transparent 0px,
    transparent 22px,
    rgba(0,0,0,0.04) 22px,
    rgba(0,0,0,0.04) 23px
  );
  pointer-events: none;
}

/* ── Neck gutter (open labels) ── */
.banjo-neck-gutter {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 28px;
  background: rgba(0,0,0,0.35);
  border-right: 1px solid rgba(255,200,80,0.15);
  z-index: 4;
  pointer-events: none;
}

/* ── Fret lines ── */
.fret-lines {
  position: absolute;
  top: 0; bottom: 0;
  left: 28px; right: 0;
  pointer-events: none;
}
.fret-line {
  position: absolute;
  top: 0; bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, #888 0%, #aaa 50%, #888 100%);
  opacity: 0.8;
}
.fret-line.nut {
  width: 5px;
  background: linear-gradient(180deg, #f0e8d0 0%, #fff 50%, #f0e8d0 100%);
  opacity: 1;
}

/* ── Fret markers ── */
.fret-markers {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  left: 28px; right: 0;
  pointer-events: none;
  z-index: 1;
}
.fret-dot {
  position: absolute;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: rgba(100,60,10,0.35);
  transform: translate(-50%, -50%);
  top: 50%;
}

/* ── Strings ── */
.banjo-strings {
  position: absolute;
  top: 0; bottom: 0;
  left: 28px; right: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  padding: 8px 0;
}
.banjo-string-row {
  display: flex;
  align-items: center;
  position: relative;
  flex: 1;
  cursor: pointer;
}
.banjo-string-line {
  position: absolute;
  left: 0; right: 0;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  border-radius: 999px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.4), 0 -0.5px 1px rgba(255,255,255,0.2);
  transition: filter 0.05s;
}
.banjo-string-row:hover .banjo-string-line { filter: brightness(1.6); }
.banjo-string-row.plucked .banjo-string-line {
  filter: brightness(2.2);
  animation: banjoVibrate 0.35s ease-out;
}
@keyframes banjoVibrate {
  0%   { transform: translateY(-50%) scaleY(1); }
  8%   { transform: translateY(calc(-50% + 4px)) scaleY(1.8); }
  20%  { transform: translateY(calc(-50% - 3px)) scaleY(1.4); }
  35%  { transform: translateY(calc(-50% + 1.5px)) scaleY(1.15); }
  55%  { transform: translateY(-50%) scaleY(1); }
  100% { transform: translateY(-50%) scaleY(1); }
}

/* String thicknesses — banjo strings are thin and bright */
.bstr-0 .banjo-string-line { height: 1px; background: linear-gradient(180deg, #e8e8e8, #c0c0c0); } /* 5th drone G */
.bstr-1 .banjo-string-line { height: 1.5px; background: linear-gradient(180deg, #d8d8d8, #b8b8b8); } /* 1st D */
.bstr-2 .banjo-string-line { height: 2px; background: linear-gradient(180deg, #d0c080, #a89040); } /* 2nd B */
.bstr-3 .banjo-string-line { height: 2.5px; background: linear-gradient(180deg, #c8b070, #987830); } /* 3rd G */
.bstr-4 .banjo-string-line { height: 3px; background: linear-gradient(180deg, #c0a060, #906820); } /* 4th D */

/* 5th string (drone G) — draws full length like other strings */
.bstr-0.drone-string {
  opacity: 0.85;
}

/* ── Note labels ── */
.note-labels {
  position: absolute;
  top: 0; bottom: 0;
  left: 28px; right: 0;
  pointer-events: none;
  z-index: 3;
}
.note-label {
  position: absolute;
  font-size: 8px;
  font-weight: 700;
  color: rgba(40,20,0,0.65);
  transform: translate(-50%, -50%);
  pointer-events: none;
  line-height: 1;
  text-shadow: 0 0 4px rgba(255,220,100,0.5);
}

/* ── Open string labels in gutter ── */
.open-label {
  position: absolute;
  left: 0;
  width: 26px;
  text-align: center;
  font-size: 8.5px;
  font-weight: 700;
  color: rgba(255,200,80,0.9);
  pointer-events: none;
  z-index: 5;
  text-shadow: 0 1px 3px rgba(0,0,0,1);
}

/* ── Fret hit flash ── */
.fret-hit-flash {
  position: absolute;
  top: 0; bottom: 0;
  pointer-events: none;
  background: rgba(255,180,40,0.2);
  border-radius: 2px;
  animation: fretFlash 0.25s ease-out forwards;
  z-index: 4;
}
@keyframes fretFlash {
  from { opacity: 1; }
  to   { opacity: 0; }
}

/* ── Banjo head (circular resonator) ── */
.banjo-head-section {
  width: 90px;
  flex-shrink: 0;
  background: linear-gradient(160deg, #1a0f05 0%, #0d0800 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  position: relative;
}
.banjo-head {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #f5f0e8 0%, #d8cdb0 60%, #b8a888 100%);
  border: 4px solid #8b7040;
  position: relative;
  box-shadow:
    0 0 0 3px #6b5020,
    0 4px 12px rgba(0,0,0,0.6),
    inset 0 2px 6px rgba(0,0,0,0.1);
}
.banjo-head-ring {
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  border: 1px solid rgba(139,112,64,0.4);
}
.banjo-head-center {
  position: absolute;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #8b7040;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

tbody tr:nth-child(even) { background: #f9fafb; }

@media (max-width: 480px) {
  .banjo-head-section { width: 60px; }
  .banjo-head { width: 50px; height: 50px; }
  .banjo-body { margin: 0 -0.25rem; }
}
