/* ── Virtual Oud — Option A: Horizontal Neck ── */

/* Outer wrapper */
.oud-neck-container {
  position: relative;
  width: 100%;
  margin: 0 auto;
}

/* Nut label row above the neck */
.oud-neck-header {
  display: flex;
  align-items: center;
  margin-bottom: 4px;
  padding-left: 48px; /* align with neck start (after note labels) */
  padding-right: 8px;
}
.oud-neck-header-nut {
  font-size: 10px;
  color: #9ca3af;
  letter-spacing: 0.04em;
}
.oud-neck-header-bridge {
  font-size: 10px;
  color: #9ca3af;
  margin-left: auto;
  letter-spacing: 0.04em;
}

/* The full neck — rows of strings stacked vertically */
.oud-neck {
  background: linear-gradient(180deg, #3a1e0c 0%, #4e2912 40%, #5d3218 60%, #3a1e0c 100%);
  border: 3px solid #1a0a04;
  border-radius: 6px;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  padding: 10px 0;
  touch-action: none;
  overflow: hidden;
}

/* Horizontal wood grain lines */
.oud-neck::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    90deg,
    transparent,
    transparent 2px,
    rgba(0,0,0,0.07) 2px,
    rgba(0,0,0,0.07) 3px
  );
  pointer-events: none;
  z-index: 1;
}

/* Nut — vertical bar on the left */
.oud-nut {
  position: absolute;
  left: 48px; /* width of note-label column */
  top: 0;
  bottom: 0;
  width: 5px;
  background: linear-gradient(to bottom, #d4a96a, #c8933f, #d4a96a);
  border-right: 1px solid #8a5e20;
  z-index: 10;
  pointer-events: none;
}

/* Fret reference lines (vertical, evenly spaced) */
.oud-fret-lines {
  position: absolute;
  left: 48px;
  right: 0;
  top: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 2;
}
.oud-fret-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(255,255,255,0.08);
}
.oud-fret-line.major {
  background: rgba(255,255,255,0.18);
}

/* Each string row — full width, acts as the interaction hitbox */
.oud-string-hitbox {
  position: relative;
  width: 100%;
  height: 36px;
  z-index: 10;
  cursor: crosshair;
  display: flex;
  align-items: center;
}

/* Note label on the left of each string */
.oud-string-label {
  width: 48px;
  flex-shrink: 0;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: #c8a96e;
  font-family: monospace;
  z-index: 12;
  pointer-events: none;
  letter-spacing: 0.03em;
}

/* String track area — the actual neck to the right of the label */
.oud-string-track {
  position: relative;
  flex: 1;
  height: 100%;
  display: flex;
  align-items: center;
  pointer-events: none;
}

/* The visual string line — horizontal */
.oud-string-line {
  position: absolute;
  left: 0;
  right: 0;
  pointer-events: none;
  border-radius: 1px;
  transition: background 0.1s;
}

/* Bass string — thicker */
.oud-string-hitbox[data-course="false"] .oud-string-line {
  height: 3px;
  background: linear-gradient(to right, #7a8fa6, #c8d8e8, #9aafc4, #c8d8e8, #7a8fa6);
  top: 50%;
  transform: translateY(-50%);
}

/* Paired course — two thin lines */
.oud-string-hitbox[data-course="true"] .oud-string-line.top-str {
  height: 1.5px;
  background: linear-gradient(to right, #8899aa, #dde8f0, #aabbc8, #dde8f0, #8899aa);
  top: calc(50% - 4px);
}
.oud-string-hitbox[data-course="true"] .oud-string-line.bot-str {
  height: 1.5px;
  background: linear-gradient(to right, #8899aa, #dde8f0, #aabbc8, #dde8f0, #8899aa);
  top: calc(50% + 2px);
}

/* Pluck animation — strings vibrate vertically now */
.oud-string-hitbox.plucked .oud-string-line {
  animation: oud-vibrate-h 0.35s ease-out;
  background: linear-gradient(to right, transparent, #ffffff 20%, #ffffff 80%, transparent) !important;
}

@keyframes oud-vibrate-h {
  0%   { transform: translateY(0); }
  20%  { transform: translateY(-3px); }
  40%  { transform: translateY(2px); }
  60%  { transform: translateY(-2px); }
  80%  { transform: translateY(1px); }
  100% { transform: translateY(0); }
}

/* Pitch cursor — a small vertical line that follows your finger/mouse along the string */
.oud-pitch-cursor {
  position: absolute;
  top: 4px;
  bottom: 4px;
  width: 2px;
  background: rgba(249, 115, 22, 0.85);
  border-radius: 1px;
  pointer-events: none;
  z-index: 20;
  display: none;
}
.oud-string-hitbox.active .oud-pitch-cursor {
  display: block;
}

/* Semitone markers — below the neck */
.oud-markers {
  display: flex;
  position: relative;
  margin-left: 48px; /* align with neck */
  height: 18px;
  margin-top: 4px;
  pointer-events: none;
}
.oud-marker {
  position: absolute;
  font-size: 9px;
  color: #9ca3af;
  transform: translateX(-50%);
  white-space: nowrap;
}
.oud-marker.major {
  font-weight: 700;
  color: #f97316;
}

/* Separator between strings */
.oud-string-hitbox + .oud-string-hitbox {
  border-top: 1px solid rgba(0,0,0,0.2);
}

@media (max-width: 600px) {
  .oud-string-hitbox { height: 28px; }
  .oud-string-label { font-size: 10px; width: 38px; }
  .oud-nut { left: 38px; }
  .oud-markers { margin-left: 38px; }
}
