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);
}

/* ── Reverb toggle ── */
.reverb-toggle-wrap {
  display: flex;
  align-items: center;
  gap: 1px;
  background: #f3f4f6;
  border-radius: 8px;
  padding: 3px;
}
.reverb-btn {
  padding: 5px 12px;
  border-radius: 6px;
  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;
}
.reverb-btn.active {
  background: #fff;
  color: #065f46;
  box-shadow: 0 1px 4px rgba(0,0,0,0.10);
}

/* ── Erhu Instrument Frame ── */
.erhu-container {
  display: flex;
  justify-content: center;
  padding: 20px 0;
  user-select: none;
  -webkit-touch-callout: none;
}

.erhu-instrument {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 120px;
}

/* ── Neck ── */
.erhu-neck {
  width: 60px;
  height: 400px; /* Playable area */
  background: linear-gradient(90deg, #4a2810 0%, #6b3f20 20%, #4a2810 80%, #311808 100%);
  border-radius: 4px 4px 0 0;
  position: relative;
  display: flex;
  justify-content: space-evenly;
  box-shadow: inset 0 0 10px rgba(0,0,0,0.8), 2px 0 5px rgba(0,0,0,0.3);
}

.erhu-neck::before {
  /* Faux tuning pegs at top */
  content: '';
  position: absolute;
  top: -20px;
  left: -20px;
  right: -20px;
  height: 20px;
  background: url('data:image/svg+xml;utf8,<svg width="100" height="20" xmlns="http://www.w3.org/2000/svg"><rect x="15" y="5" width="20" height="10" fill="%23d4af37"/><rect x="65" y="5" width="20" height="10" fill="%23d4af37"/></svg>') no-repeat center top;
  pointer-events: none;
}

/* ── Strings ── */
.erhu-string-wrap {
  position: relative;
  width: 30px;
  height: 100%;
  cursor: pointer;
  touch-action: none;
}

.erhu-string {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  background: linear-gradient(90deg, #ccc 0%, #fff 50%, #999 100%);
  box-shadow: 0 0 3px rgba(0,0,0,0.5);
  transition: all 0.1s;
}

.erhu-string-wrap.active .erhu-string {
  filter: brightness(1.5);
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.8), 0 0 12px rgba(16, 185, 129, 0.6);
  width: 3px;
}

.erhu-string-label {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.6);
  color: #fff;
  font-size: 10px;
  padding: 2px 4px;
  border-radius: 4px;
  pointer-events: none;
  white-space: nowrap;
}
.erhu-string-label.top-label { top: 4px; }
.erhu-string-label.bottom-label { bottom: 4px; }

/* ── Note Markers ── */
.erhu-markers {
  position: absolute;
  top: 0; bottom: 0; left: 0; right: 0;
  pointer-events: none;
}

.erhu-marker {
  position: absolute;
  left: 0; right: 0;
  height: 1px;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

/* Subtle note name on hover or always if we want */
.erhu-marker::before {
  content: attr(data-note);
  position: absolute;
  left: -24px;
  color: rgba(255,255,255,0.4);
  font-size: 8px;
  font-family: monospace;
}

/* Higher contrast for root notes */
.erhu-marker.root-note {
  height: 2px;
  background: rgba(16, 185, 129, 0.4);
}
.erhu-marker.root-note::before {
  color: rgba(16, 185, 129, 0.8);
  font-weight: bold;
}

/* ── Interaction Layer & Pitch Display ── */
.erhu-interaction-layer {
  position: absolute;
  top: 0; bottom: 0; left: 0; right: 0;
  pointer-events: none;
}

.erhu-touch-indicator {
  position: absolute;
  left: -15px; right: -15px;
  height: 4px;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 2px;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.8);
  transform: translateY(-50%);
  opacity: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.erhu-touch-indicator.visible {
  opacity: 1;
}

.erhu-pitch-label {
  position: absolute;
  left: 110%;
  background: #065f46;
  color: #fff;
  font-size: 12px;
  font-weight: bold;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
}

/* ── Resonator Body ── */
.erhu-resonator {
  width: 100px;
  height: 110px;
  background: linear-gradient(135deg, #3a1c06 0%, #1f0c02 100%);
  border-radius: 8px 8px 24px 24px / 8px 8px 30px 30px;
  position: relative;
  margin-top: -10px;
  z-index: 10;
  box-shadow: inset 0 -4px 10px rgba(0,0,0,0.8), 0 8px 16px rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Hexagonal faux depth */
.erhu-resonator::before {
  content: '';
  position: absolute;
  top: 5px; bottom: 5px; left: 5px; right: 5px;
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 4px 4px 20px 20px / 4px 4px 24px 24px;
}

.erhu-snakeskin {
  width: 70px;
  height: 80px;
  /* Simulated snakeskin pattern using repeating linear gradients and noise */
  background: 
    repeating-linear-gradient(45deg, 
      rgba(200, 180, 140, 0.1) 0px, 
      rgba(200, 180, 140, 0.1) 2px,
      transparent 2px, 
      transparent 4px
    ),
    repeating-linear-gradient(-45deg, 
      rgba(200, 180, 140, 0.1) 0px, 
      rgba(200, 180, 140, 0.1) 2px,
      transparent 2px, 
      transparent 4px
    ),
    #c2ab85;
  border-radius: 5px;
  box-shadow: inset 0 0 15px rgba(0,0,0,0.8);
  position: relative;
}

.erhu-bridge {
  position: absolute;
  top: 15px; /* Overlaps strings at bottom of neck before skin */
  left: 50%;
  transform: translateX(-50%);
  width: 14px;
  height: 6px;
  background: #e8dcc8; /* Bone bridge color */
  border-radius: 2px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

/* ── Tooltips / Interactions ── */
.erhu-string-wrap:hover .erhu-string {
  filter: brightness(1.2);
}
