/* ============================================================
   Virtual Guitar — page-specific styles
   Dark theme, uses design tokens from /css/styles.css
   ============================================================ */

.vguitar-page {
  --bg: #0C1A14;
  --bg-card: #12251B;
  --bg-card-border: #1F4B34;
  --text: #E8F5EE;
  --text-dim: #7CA88E;
  --accent: #10B981;
  --accent-hover: #059669;
  --red: #EF4444;
  --fret-wire: #C0A070;
  --nut-color: #F5E6C8;
  --string-bass: #B8A080;
  --string-treble: #D0C0A0;
}

/* ── Layout ── */
.vguitar-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 48px 24px 80px;
  background: var(--bg);
  min-height: 100vh;
}

body:has(.vguitar-page) { background: #0C1A14; }
body:has(.vguitar-page) .nav { background: rgba(12, 26, 20, 0.92); border-bottom-color: #1F4B34; }
body:has(.vguitar-page) .nav__menu a { color: #7CA88E; }
body:has(.vguitar-page) .nav__menu a:hover,
body:has(.vguitar-page) .nav__menu a.active { color: #10B981; }
body:has(.vguitar-page) .footer { background: #0A1610; color: #7CA88E; }
body:has(.vguitar-page) .footer h4 { color: #E8F5EE; }
body:has(.vguitar-page) .footer a { color: #7CA88E; }
body:has(.vguitar-page) .footer a:hover { color: #10B981; }
body:has(.vguitar-page) .footer__bottom { border-top-color: #1F4B34; color: #5A8A6E; }
body:has(.vguitar-page) .footer__brand p,
body:has(.vguitar-page) .footer .loc { color: #5A8A6E; }

.vguitar-page h1 {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  color: var(--text);
  margin-bottom: 8px;
  text-align: center;
}
.vguitar-page .page-subtitle {
  color: var(--text-dim);
  font-size: 1rem;
  margin-bottom: 32px;
  text-align: center;
}
.vguitar-page .page-subtitle strong { color: var(--text); font-weight: 500; }

/* ── Card ── */
.vg-card {
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-lg);
  padding: 24px;
}

/* ── Controls ── */
.vg-controls {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 20px;
}
.vg-ctrl {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8125rem;
  color: var(--text-dim);
  font-weight: 500;
}
.vg-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 90px;
  height: 4px;
  border-radius: 2px;
  background: var(--bg-card-border);
  outline: none;
  cursor: pointer;
}
.vg-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--accent); border: none; cursor: pointer;
}
.vg-slider::-moz-range-thumb {
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--accent); border: none; cursor: pointer;
}
.vg-toggle {
  padding: 6px 14px;
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  cursor: pointer;
  transition: all 0.15s;
}
.vg-toggle:hover { border-color: var(--accent); color: var(--text); }
.vg-toggle.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ── Fretboard Wrapper ── */
.vg-fretboard-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 4px;
}

/* ── Fret Numbers ── */
.vg-fret-numbers {
  display: grid;
  grid-template-columns: 48px repeat(15, 1fr);
  margin-bottom: 2px;
}
.vg-fret-num {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  color: var(--text-dim);
  opacity: 0.4;
  text-align: center;
}

/* ── Fretboard Grid ── */
.vg-fretboard-grid {
  display: grid;
  grid-template-columns: 48px repeat(15, 1fr);
  grid-template-rows: repeat(6, 1fr);
  background: linear-gradient(180deg, #3B1F0E 0%, #2A1508 50%, #1E0F04 100%);
  border-radius: var(--radius);
  min-height: 216px;
  position: relative;
  user-select: none;
  touch-action: none;
}

/* ── Open String Cells ── */
.vg-open {
  display: flex;
  align-items: center;
  justify-content: center;
  border-right: 5px solid var(--nut-color);
  cursor: pointer;
  position: relative;
  min-height: 36px;
}
.vg-open-label {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--text-dim);
  position: relative;
  z-index: 2;
  transition: color 0.15s;
}
.vg-open:hover .vg-open-label { color: var(--accent); }
.vg-open.muted .vg-open-label { display: none; }
.vg-open.muted::after {
  content: '✕';
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.875rem;
  color: var(--red);
  position: relative;
  z-index: 2;
}
.vg-open.chord-open .vg-open-label {
  color: var(--accent);
  text-shadow: 0 0 6px rgba(16, 185, 129, 0.5);
}

/* ── Fret Cells ── */
.vg-cell {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  border-right: 2px solid var(--fret-wire);
  cursor: pointer;
  min-height: 36px;
  transition: background 0.1s;
}
.vg-cell:hover { background: rgba(16, 185, 129, 0.08); }
.vg-cell.active {
  background: rgba(16, 185, 129, 0.2);
  box-shadow: inset 0 0 12px rgba(16, 185, 129, 0.3);
}

/* ── String Lines (pseudo-element) ── */
.vg-cell::before,
.vg-open::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: var(--string-thickness, 1.5px);
  background: var(--string-color, var(--string-treble));
  transform: translateY(-50%);
  pointer-events: none;
}

/* ── String Vibration ── */
@keyframes vg-vibrate {
  0%, 100% { transform: translateY(-50%); }
  25% { transform: translateY(calc(-50% - 2px)); }
  75% { transform: translateY(calc(-50% + 2px)); }
}
.vg-cell.plucked::before,
.vg-open.plucked::before {
  animation: vg-vibrate 0.05s linear 6;
}

/* ── Note Names ── */
.vg-note-name {
  font-family: var(--font-mono);
  font-size: 0.5625rem;
  color: var(--text-dim);
  opacity: 0;
  pointer-events: none;
  position: relative;
  z-index: 2;
  transition: opacity 0.2s;
  background: rgba(30, 15, 4, 0.7);
  padding: 0 2px;
  border-radius: 2px;
}
.vg-fretboard-grid.show-notes .vg-note-name { opacity: 1; }

/* ── Chord Overlay Dots ── */
.vg-chord-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 700;
  display: none;
  align-items: center;
  justify-content: center;
  position: absolute;
  z-index: 3;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.3);
}
.vg-chord-dot.visible { display: flex; }

/* ── Fret Markers ── */
.vg-markers {
  display: grid;
  grid-template-columns: 48px repeat(15, 1fr);
  height: 24px;
  pointer-events: none;
}
.vg-marker {
  display: flex;
  align-items: center;
  justify-content: center;
}
.vg-marker--double { gap: 6px; }
.vg-marker-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-dim);
  opacity: 0.35;
}

/* ── Chord Selector ── */
.vg-chords {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--bg-card-border);
}
.vg-chords__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.vg-chords__title {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--text);
  margin: 0;
}
.vg-chords__grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.vg-chord-btn {
  padding: 6px 12px;
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  cursor: pointer;
  transition: all 0.15s;
}
.vg-chord-btn:hover { border-color: var(--accent); color: var(--text); }
.vg-chord-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

.vg-btn--strum {
  padding: 10px 24px;
  border-radius: var(--radius);
  background: var(--accent);
  color: #fff;
  border: none;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
}
.vg-btn--strum:hover { background: var(--accent-hover); }
.vg-btn--strum:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── Info Sections ── */
.vg-info {
  margin-top: 32px;
  padding: 28px;
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-lg);
}
.vg-info + .vg-info { margin-top: 20px; }
.vg-info h2 {
  font-family: var(--font-display);
  font-size: 1.375rem;
  color: var(--text);
  margin-bottom: 16px;
}
.vg-info ol, .vg-info ul {
  margin: 0;
  padding-left: 20px;
  color: var(--text-dim);
  line-height: 1.8;
}
.vg-info ol strong { color: var(--text); font-weight: 500; }
.vg-info p {
  margin: 12px 0 0;
  font-size: 0.9rem;
  color: var(--text-dim);
  line-height: 1.7;
}
.vg-info p:first-of-type { margin-top: 0; }
.vg-info a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.vg-info a:hover { opacity: 0.8; }
.vg-info--links { background: transparent; border: none; padding: 0 4px; text-align: center; }
.vg-info--links p { opacity: 0.6; font-size: 0.85rem; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .vguitar-page { padding: 32px 12px 64px; }
  .vg-card { padding: 16px 12px; }
  .vg-fretboard-grid { min-height: 180px; }
  .vg-cell, .vg-open { min-height: 30px; }
  .vg-controls { flex-direction: column; gap: 10px; align-items: flex-start; }
}
@media (max-width: 480px) {
  .vg-fretboard-grid,
  .vg-markers,
  .vg-fret-numbers { grid-template-columns: 36px repeat(15, 1fr); }
  .vg-chord-dot { width: 20px; height: 20px; font-size: 0.5625rem; }
}
