/* ============================================================
   Guitar — minimal light theme
   ============================================================ */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg:       #f5e6c8;
  --text:     #000000;
  --text-dim: #555555;
  --accent:   #e74c3c;
  --font-ui:  'Segoe UI', system-ui, sans-serif;
  --font-mono:'Courier New', monospace;
}

html, body {
  height: 100%;
}

body {
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  padding: 24px 16px 80px;
}

/* ---- Header ---- */

header {
  width: 100%;
  max-width: 900px;
  margin-bottom: 24px;
  display: flex;
  align-items: baseline;
  gap: 16px;
}

header h1 {
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text);
}

header p.subtitle {
  color: var(--text-dim);
  font-size: 0.9rem;
}

/* ---- Control panel ---- */

.controls {
  width: 100%;
  max-width: 900px;
  padding: 20px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 20px 32px;
  align-items: flex-end;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--text);
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 140px;
}

.control-group label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-dim);
  font-weight: 600;
}

select {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--text);
  border-radius: 0;
  padding: 7px 10px;
  font-size: 0.9rem;
  font-family: var(--font-ui);
  cursor: pointer;
  outline: none;
  appearance: auto;
}

input[type="range"] {
  display: block;
  width: 100%;
  padding: 4px 0;
  accent-color: var(--accent);
  cursor: pointer;
  border: none;
  background: transparent;
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 4px;
}

.toggle-row input[type="checkbox"] {
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.toggle-row label {
  font-size: 0.85rem;
  color: var(--text-dim);
  cursor: pointer;
  user-select: none;
}

/* ---- Display title ---- */

.display-title-wrap {
  width: 100%;
  max-width: 900px;
  margin-bottom: 12px;
}

#display-title {
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.3px;
}

/* ---- Fretboard ---- */

.fretboard-card {
  width: 100%;
  max-width: 900px;
  padding: 24px 0 16px;
  overflow-x: auto;
  margin-bottom: 20px;
  min-height: 220px;
  flex-shrink: 0;
}

#fretboard {
  display: block;
  width: 100%;
  min-height: 180px;
}

#fretboard svg {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
}

/* ---- Legend ---- */

.legend-card {
  width: 100%;
  max-width: 900px;
  padding: 14px 0;
  border-top: 1px solid var(--text);
  border-bottom: 1px solid var(--text);
  margin-bottom: 24px;
}

.legend-heading {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-dim);
  font-weight: 600;
  margin-bottom: 10px;
}

#legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.88rem;
}

.legend-swatch {
  display: inline-block;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid var(--text);
  flex-shrink: 0;
}

.legend-label {
  color: var(--text);
}

/* ---- Position navigator ---- */

.position-nav-card {
  width: 100%;
  max-width: 900px;
  padding: 14px 0;
  margin-bottom: 12px;
}

.pos-nav-header {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.pos-nav-title {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-dim);
  font-weight: 600;
  white-space: nowrap;
}

.pos-nav-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pos-btn {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--text);
  border-radius: 0;
  width: 30px;
  height: 30px;
  font-size: 0.75rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: background 0.1s, color 0.1s;
}

.pos-btn:hover:not(:disabled) {
  background: var(--text);
  color: var(--bg);
}

.pos-btn:disabled {
  opacity: 0.3;
  cursor: default;
}

.pos-label {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  min-width: 120px;
  text-align: center;
}

.pos-count {
  font-size: 0.8rem;
  color: var(--text-dim);
  white-space: nowrap;
}

/* ---- Voicing gallery ---- */

.voicing-gallery {
  width: 100%;
  max-width: 900px;
  display: flex;
  flex-wrap: nowrap;
  gap: 12px;
  margin-bottom: 24px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 6px;
  min-height: 290px;
  flex-shrink: 0;
}

.voicing-card {
  flex: 0 0 calc(33.333% - 8px);
  min-width: 0;
  min-height: 250px;
  padding: 10px 10px 6px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  scroll-snap-align: start;
}

.voicing-card.active {
  border: 1px solid var(--text);
}

.voicing-diagram {
  min-height: 200px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.voicing-diagram svg {
  display: block;
  width: 100%;
  height: auto;
}

.voicing-card-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-dim);
  font-weight: 600;
  font-family: var(--font-mono);
}

/* ---- Responsive ---- */

@media (max-width: 640px) {
  header h1 { font-size: 1.4rem; }
  .controls { padding: 16px 0; gap: 16px; }
}

.app-footer {
  width: 100%;
  max-width: 900px;
  margin-top: 40px;
  border-top: 1px solid var(--text);
  padding: 10px 0 32px;
  font-size: 0.9rem;
  color: var(--text-dim);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.footer-links {
  display: flex;
  gap: 20px;
}

.footer-download {
  color: var(--text);
  text-decoration: underline;
  white-space: nowrap;
}
