/*
 * The necks, chord charts and role colours, the same colours as Mac Strum's (static/app.css): root green, 3rd blue,
 * 5th red, 6th and 7th amber (dark text on it), 9th, 11th and 13th brown, altered notes purple.
 */

:root {
  --r-root: #2fa84f;
  --r-third: #0a5fd8;
  --r-fifth: #e0191e;
  --r-seventh: #e9a21f;
  --r-seventh-text: #a87000;
  --r-ext: #7a4a22;
  --r-alt: #8e4ec6;
  --fret: #b9ae9b;
  --string: #8c8475;
  --inlay: #e2d8c6;
}

:root[data-theme="dark"] {
  --r-root: #4ccb6e;
  --r-third: #4c95ff;
  --r-fifth: #ff4b4f;
  --r-seventh: #f2b843;
  --r-seventh-text: #f2b843;
  --r-ext: #b07a4a;
  --r-alt: #b485f0;
  --fret: #6e665a;
  --string: #a59c8b;
  --inlay: #3e3a33;
}

.r-root { fill: var(--r-root); stroke: var(--r-root); }
.r-third { fill: var(--r-third); stroke: var(--r-third); }
.r-fifth { fill: var(--r-fifth); stroke: var(--r-fifth); }
.r-seventh { fill: var(--r-seventh); stroke: var(--r-seventh); }
.r-ext { fill: var(--r-ext); stroke: var(--r-ext); }
.r-alt { fill: var(--r-alt); stroke: var(--r-alt); }
.r-root-text { color: var(--r-root); fill: var(--r-root); }
.r-third-text { color: var(--r-third); fill: var(--r-third); }
.r-fifth-text { color: var(--r-fifth); fill: var(--r-fifth); }
.r-seventh-text { color: var(--r-seventh-text); fill: var(--r-seventh-text); }
.r-ext-text { color: var(--r-ext); fill: var(--r-ext); }
.r-alt-text { color: var(--r-alt); fill: var(--r-alt); }

/* the necks */
.neck-area {
  margin: 8px auto;
  max-width: 340px;
}

.neck {
  display: block;
  width: 100%;
  height: auto;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

.neck-fret { stroke: var(--fret); stroke-width: 1.4; }
.neck-nut { stroke: var(--text2); stroke-width: 5; stroke-linecap: round; }
.neck-string { stroke: var(--string); }
.neck-inlay { fill: var(--inlay); }
.neck-number { font-size: 11px; fill: var(--text3); }
.neck-hit { fill: transparent; }
.neck-hit:active { fill: var(--accent-soft); }
.neck-muted { font-size: 18px; fill: var(--text3); pointer-events: none; }
.neck-open { fill: var(--bg); stroke: var(--text2); stroke-width: 2.4; pointer-events: none; }
.neck-open.r-root { fill: var(--bg); stroke: var(--r-root); }
.neck-open.r-third { fill: var(--bg); stroke: var(--r-third); }
.neck-open.r-fifth { fill: var(--bg); stroke: var(--r-fifth); }
.neck-open.r-seventh { fill: var(--bg); stroke: var(--r-seventh); }
.neck-open.r-ext { fill: var(--bg); stroke: var(--r-ext); }
.neck-open.r-alt { fill: var(--bg); stroke: var(--r-alt); }
.neck-open-text { font-size: 10px; font-weight: 700; fill: var(--text2); pointer-events: none; }
.neck-label { font-size: 13px; font-weight: 600; fill: var(--text2); }
.neck-dot { stroke: none; pointer-events: none; }
.neck-dot.r-none { fill: var(--text3); }
.neck-dot-text { font-size: 11px; font-weight: 600; fill: #ffffff; pointer-events: none; }
.neck-dot-text.dark { fill: #3a2a00; }

/* the reference neck */
.ref-note { fill: var(--bg3); stroke: var(--line2); stroke-width: 1; }
.ref-note.outside { opacity: 0.35; }
.ref-note.lit { stroke: none; }
.ref-note.lit.r-root { fill: var(--r-root); }
.ref-note.lit.r-third { fill: var(--r-third); }
.ref-note.lit.r-fifth { fill: var(--r-fifth); }
.ref-note.lit.r-seventh { fill: var(--r-seventh); }
.ref-note.lit.r-ext { fill: var(--r-ext); }
.ref-note.lit.r-alt { fill: var(--r-alt); }
.ref-text { font-size: 9.5px; fill: var(--text3); }
.ref-text.lit { fill: #ffffff; font-weight: 700; font-size: 10.5px; }
.ref-text.lit.dark { fill: #3a2a00; }
.ref-text.outside { opacity: 0.5; }
.ref-ring { fill: none; stroke: var(--text); stroke-width: 1.6; stroke-dasharray: 3 2; }
.ref-degree { font-size: 10px; font-weight: 700; }

/* chord charts */
.chord-chart { display: block; }
.cc-name { font-size: 15px; font-weight: 650; fill: var(--text); }
.cc-nut { stroke: var(--text); stroke-width: 4; }
.cc-fret { stroke: var(--line2); stroke-width: 1.2; }
.cc-string { stroke: var(--text2); stroke-width: 1; }
.cc-base { font-size: 10.5px; fill: var(--text2); }
.cc-muted { font-size: 12px; fill: var(--text3); }
.cc-open { fill: none; stroke: var(--text2); stroke-width: 1.4; }
.cc-open.root { stroke: var(--r-root); stroke-width: 2; }
.cc-dot { fill: var(--text); stroke: none; }
.cc-dot.thumb { stroke: #2e9e6e; stroke-width: 2.2px; }
.cc-label { fill: var(--bg); font-weight: 700; }
.cc-barre { stroke: var(--text); stroke-linecap: butt; opacity: 0.85; }
.cc-sub { font-size: 10.5px; fill: var(--text3); font-family: var(--mono); }

.chart-strip {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 4px 0 8px;
  -webkit-overflow-scrolling: touch;
}

.chart-pick {
  flex: none;
  padding: 2px;
  border: 0.5px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
}

.chart-pick.current {
  border: 2px solid var(--accent);
}

.chart-missing {
  flex: none;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 8px;
  color: var(--text3);
}

/* the Analyzer */
.analyzer-name {
  min-height: 96px;
}

.name-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
}

.big-name {
  font-size: 34px;
  font-weight: 700;
  line-height: 1.15;
}

.big-name.empty {
  color: var(--text3);
}

.short-form {
  font-size: 18px;
  color: var(--text3);
}

.said,
.inversion {
  margin: 4px 0;
  color: var(--text2);
}

.chooser {
  margin: 6px 0;
}

.chord-input,
.degrees-input {
  width: 100%;
  min-height: 42px;
  padding: 8px 12px;
  border: 0.5px solid var(--line2);
  border-radius: 10px;
  background: var(--bg2);
  font-size: 16px;
}

.suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.frets-text {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text3);
}

.panel {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.panel-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel-group {
  width: 84px;
  flex: none;
  font-size: 12px;
  color: var(--text3);
}

.panel-roles {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.panel-box {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  min-width: 42px;
  padding: 3px 5px;
  border: 1.5px dashed var(--line2);
  border-radius: 7px;
  color: var(--text3);
  font-size: 13px;
}

.panel-box.filled { border-style: solid; }
.panel-box.filled.r-root { border-color: var(--r-root); color: var(--r-root); }
.panel-box.filled.r-third { border-color: var(--r-third); color: var(--r-third); }
.panel-box.filled.r-fifth { border-color: var(--r-fifth); color: var(--r-fifth); }
.panel-box.filled.r-seventh { border-color: var(--r-seventh); color: var(--r-seventh-text); }
.panel-box.filled.r-ext { border-color: var(--r-ext); color: var(--r-ext); }
.panel-box.filled.r-alt { border-color: var(--r-alt); color: var(--r-alt); }
.panel-box { fill: none; }
.panel-note { font-size: 12px; font-weight: 600; }
.panel-bass,
.panel-missing { font-size: 13px; color: var(--text2); }

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin: 10px 0;
  font-size: 12px;
  color: var(--text2);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.legend-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: currentColor;
}

.legend-dot.square { border-radius: 3px; }
.legend-dot.r-root { color: var(--r-root); }
.legend-dot.r-third { color: var(--r-third); }
.legend-dot.r-fifth { color: var(--r-fifth); }
.legend-dot.r-seventh { color: var(--r-seventh); }
.legend-dot.r-ext { color: var(--r-ext); }
.legend-dot.r-alt { color: var(--r-alt); }

.warnings {
  margin: 10px 0;
}

.warning {
  padding: 8px 12px;
  margin: 6px 0;
  border-radius: 10px;
  background: var(--warn-bg);
}

.warning p {
  margin: 2px 0 0;
  font-size: 14px;
}

.building {
  margin: 0;
  padding: 0;
  list-style: none;
}

.building li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 0.5px solid var(--line);
}

.building-label {
  width: 84px;
  font-size: 12px;
  color: var(--text3);
}

.building-notes {
  display: flex;
  gap: 6px;
  font-weight: 600;
}

.building-name {
  margin-left: auto;
}

/* Progressions */
.chord-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chord-button {
  min-height: 36px;
  padding: 5px 12px;
  border: 0.5px solid var(--line2);
  border-radius: 8px;
  background: var(--bg2);
  font-weight: 600;
}

.degree-chord {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
}

.degree-chord small {
  font-size: 11px;
  color: var(--text3);
}

.progression {
  border-bottom: 0.5px solid var(--line);
  padding: 4px 0;
}

.progression-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  width: 100%;
  padding: 8px 0;
  border: 0;
  background: none;
  text-align: left;
}

.progression-chords {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  font-weight: 600;
}

/* Reference */
.page-chooser {
  margin-bottom: 8px;
}

.reference-title {
  font-size: 18px;
  margin: 8px 0 4px;
}

.position-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0;
}

.position-label {
  flex: 1;
  font-size: 14px;
  color: var(--text2);
}

/* the Draftspace */
.draft-tabs,
.add-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.add-row .chord-input {
  flex: 1;
  width: auto;
}

.draft-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0;
}

.draft-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4px 2px 2px;
  border: 0.5px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
}

.draft-card.selected {
  border: 2px solid var(--accent);
}

.draft-numeral {
  min-height: 18px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text2);
}

.draft-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 6px 0;
}

.draft-foot {
  margin-top: 16px;
}
