:root {
  --bg: #100e0c;
  --bg-elevated: #17140f;
  --bg-panel: #1b1712;
  --bg-panel-alt: #221d16;
  --bg-input: #1e1a14;
  --border: rgba(232, 224, 208, 0.09);
  --border-strong: rgba(232, 224, 208, 0.18);
  --text: #efe9dd;
  --text-dim: rgba(239, 233, 221, 0.58);
  --text-faint: rgba(239, 233, 221, 0.38);
  --accent: #e8a33d;
  --accent-hi: #f4c979;
  --accent-dim: rgba(232, 163, 61, 0.14);
  --accent-ink: #241705;
  --green: #7fb87a;
  --green-dim: rgba(127, 184, 122, 0.16);
  --red: #e2705a;
  --red-dim: rgba(226, 112, 90, 0.16);
  --radius-lg: 16px;
  --radius-md: 11px;
  --radius-sm: 7px;
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.2), 0 8px 24px -12px rgba(0, 0, 0, 0.55);
  --font-display: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background:
    radial-gradient(1100px 500px at 15% -10%, rgba(232, 163, 61, 0.07), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.app {
  max-width: 1160px;
  margin: 0 auto;
  padding: 36px 24px 72px;
}

.app-header {
  padding-bottom: 26px;
  margin-bottom: 30px;
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.brand-mark {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(155deg, rgba(232, 163, 61, 0.22), rgba(232, 163, 61, 0.06));
  border: 1px solid rgba(232, 163, 61, 0.3);
  color: var(--accent-hi);
  margin-top: 2px;
}

.app-header h1 {
  margin: 0 0 5px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.55rem;
  letter-spacing: -0.015em;
  color: var(--text);
}

.tagline {
  margin: 0;
  color: var(--text-dim);
  font-size: 0.93rem;
  max-width: 620px;
  line-height: 1.5;
}

.layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 26px;
  align-items: start;
}

@media (max-width: 820px) {
  .layout { grid-template-columns: 1fr; }
}

.sidebar h2 {
  font-family: var(--font-display);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-weight: 700;
  color: var(--text-faint);
  margin: 0 0 12px;
  padding-left: 2px;
}

.turnaround-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.turnaround-list li {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 1px solid transparent;
  border-left: 2px solid transparent;
  font-size: 0.85rem;
  font-weight: 500;
  line-height: 1.3;
  color: var(--text-dim);
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.turnaround-list li:hover {
  background: var(--bg-panel-alt);
  color: var(--text);
}

.turnaround-list li.active {
  background: var(--accent-dim);
  border-left-color: var(--accent);
  color: var(--text);
  font-weight: 700;
}

.ta-name {
  padding-top: 2px;
}

.difficulty-badge {
  flex: none;
  margin-top: 1px;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  background: rgba(239, 233, 221, 0.08);
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease;
}

.difficulty-badge.level-beginner { color: var(--green); }
.difficulty-badge.level-intermediate { color: var(--accent-hi); }
.difficulty-badge.level-advanced { color: var(--red); }

.turnaround-list li.active .difficulty-badge.level-beginner { background: var(--green); color: #0d1a0c; }
.turnaround-list li.active .difficulty-badge.level-intermediate { background: var(--accent); color: var(--accent-ink); }
.turnaround-list li.active .difficulty-badge.level-advanced { background: var(--red); color: #200a05; }

.main {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}

.description-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  box-shadow: var(--shadow-card);
}

.ta-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.description-card h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -0.01em;
}

.description-card p {
  margin: 0;
  color: var(--text-dim);
  font-size: 0.91rem;
  line-height: 1.6;
}

.difficulty-pill {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 700;
}

.difficulty-pill.level-beginner { background: var(--green-dim); color: var(--green); }
.difficulty-pill.level-intermediate { background: var(--accent-dim); color: var(--accent-hi); }
.difficulty-pill.level-advanced { background: var(--red-dim); color: var(--red); }

.controls {
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 22px;
  box-shadow: var(--shadow-card);
}

.controls-row {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: end;
}

.controls-row-bottom {
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

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

.control-group.grow {
  flex: 1 1 200px;
  min-width: 180px;
}

.control-group label {
  font-family: var(--font-display);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--text-faint);
}

.control-group label span {
  color: var(--accent-hi);
  font-family: var(--font-mono);
}

.toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

select {
  appearance: none;
  -webkit-appearance: none;
  background: var(--bg-input) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23a89f8e' stroke-width='1.4' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 11px center;
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 8px 30px 8px 12px;
  font-size: 0.87rem;
  font-family: var(--font-body);
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

select:hover { border-color: rgba(232, 163, 61, 0.4); }
select:focus-visible, button:focus-visible, input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.segmented {
  display: flex;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-input);
}

.segmented button {
  background: transparent;
  color: var(--text-dim);
  border: none;
  padding: 8px 16px;
  font-size: 0.84rem;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.segmented button:hover:not(.active) { color: var(--text); }

.segmented button.active {
  background: var(--accent);
  color: var(--accent-ink);
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(to right, var(--accent) 0%, var(--accent) var(--fill, 40%), var(--bg-input) var(--fill, 40%), var(--bg-input) 100%);
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent-hi);
  border: 2px solid var(--accent-ink);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  cursor: pointer;
}

input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent-hi);
  border: 2px solid var(--accent-ink);
  cursor: pointer;
}

input[type="range"]::-moz-range-track {
  height: 4px;
  border-radius: 999px;
  background: var(--bg-input);
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--text-dim);
  cursor: pointer;
  user-select: none;
}

.checkbox-label input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.checkbox-box {
  flex: none;
  width: 17px;
  height: 17px;
  border-radius: 5px;
  border: 1.5px solid var(--border-strong);
  background: var(--bg-input);
  position: relative;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.checkbox-box::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 1.5px;
  width: 4px;
  height: 8px;
  border: solid var(--accent-ink);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  opacity: 0;
  transition: opacity 0.1s ease;
}

.checkbox-label input:checked + .checkbox-box {
  background: var(--accent);
  border-color: var(--accent);
}

.checkbox-label input:checked + .checkbox-box::after { opacity: 1; }
.checkbox-label:hover .checkbox-box { border-color: var(--accent); }
.checkbox-label:has(input:checked) { color: var(--text); }

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

button {
  font-family: var(--font-body);
}

.primary-btn, .icon-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: transform 0.08s ease, filter 0.15s ease, background 0.15s ease;
}

.primary-btn {
  background: linear-gradient(155deg, var(--accent-hi), var(--accent));
  color: var(--accent-ink);
  border: none;
  padding: 10px 20px;
  font-size: 0.88rem;
  font-weight: 700;
  box-shadow: 0 4px 14px -4px rgba(232, 163, 61, 0.45);
}

.primary-btn:hover { filter: brightness(1.06); }
.primary-btn:active { transform: translateY(1px); }

.icon-btn {
  background: var(--bg-input);
  color: var(--text-dim);
  border: 1px solid var(--border-strong);
  width: 37px;
  height: 37px;
  align-items: center;
  justify-content: center;
}

.icon-btn:hover { color: var(--text); border-color: rgba(232, 163, 61, 0.4); }
.icon-btn:active { transform: translateY(1px); }

.canvas-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px 12px;
  box-shadow: var(--shadow-card);
}

.canvas-card h4 {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-weight: 700;
  color: var(--text-faint);
}

#fretboard-canvas {
  width: 100%;
  height: 150px;
  display: block;
}

#notation-canvas {
  width: 100%;
  height: 195px;
  display: block;
}
