:root {
  --bg: #1c1612;
  --tolex: #e9dcc0;      /* blonde tolex */
  --tolex-dark: #cdbb94;
  --ink: #2a1d14;
  --grille: #6b2a22;     /* oxblood */
  --accent: #d9482b;
  --teal: #2fb3a5;
  --lcd: #0f2420;
  --lcd-ink: #7ff5d9;
  --chrome-1: #fafafa;
  --chrome-2: #9a9a9a;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: 'Space Mono', ui-monospace, monospace;
  background-image: radial-gradient(circle at 50% -20%, #3a2a20 0, var(--bg) 60%);
  min-height: 100vh;
}
.marquee { text-align: center; padding: 22px 16px 10px; }
.logo { font-family: 'Righteous', system-ui, sans-serif; font-size: clamp(34px, 8vw, 64px); color: var(--tolex); letter-spacing: 2px; text-shadow: 3px 3px 0 var(--grille), 6px 6px 0 #00000055; }
.logo span { color: var(--teal); font-style: italic; }
.tag { color: var(--tolex-dark); font-size: 13px; letter-spacing: 3px; text-transform: uppercase; }
main { max-width: 1120px; margin: 0 auto; padding: 12px 16px 24px; display: grid; gap: 14px; }

.panel {
  background: var(--tolex);
  background-image: repeating-linear-gradient(45deg, #0000 0 3px, #00000008 3px 4px);
  border-radius: 12px; padding: 14px; box-shadow: inset 0 0 0 3px var(--tolex-dark), 0 6px 18px #0008;
}
.panel h2 { margin: 0 0 10px; font-family: 'Righteous', sans-serif; font-size: 16px; letter-spacing: 2px; text-transform: uppercase; color: var(--grille); }

.transport { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center; }
.btn {
  font: 700 13px 'Space Mono', monospace; text-transform: uppercase; letter-spacing: 1px;
  border: 0; border-radius: 8px; padding: 10px 14px; cursor: pointer; color: var(--tolex);
  background: linear-gradient(#3b2b22, #22180f); box-shadow: 0 3px 0 #000, inset 0 1px 0 #ffffff22;
}
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #000; }
.btn:focus-visible, .knob:focus-visible, select:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; }
.btn.big { background: linear-gradient(#e2573a, #a8321c); font-size: 16px; padding: 12px 22px; min-width: 130px; }
.btn.big.on { background: linear-gradient(#2fb3a5, #1b776d); }
.btn.warn { margin-left: 0; background: linear-gradient(#6b2a22, #41150f); }

.display { display: grid; grid-template-columns: minmax(260px, 1fr) 2fr; gap: 14px; }
.lcd { background: var(--lcd); color: var(--lcd-ink); border-radius: 8px; padding: 12px; box-shadow: inset 0 0 18px #000; font-size: 13px; min-width: 0; }
.lcd-row { display: flex; justify-content: space-between; gap: 10px; padding: 2px 0; border-bottom: 1px dashed #7ff5d922; }
.lcd-row span:last-child { text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lcd-row.title { font-size: 16px; font-weight: 700; border: 0; }
.lcd .k { opacity: 0.6; white-space: nowrap; }
.chord { font-family: 'Righteous', sans-serif; font-size: 44px; text-align: center; margin-top: 8px; text-shadow: 0 0 12px #7ff5d988; }
.viz { display: grid; gap: 8px; min-width: 0; }
.grid { display: grid; grid-template-columns: 52px repeat(16, 1fr); gap: 2px; background: var(--lcd); border-radius: 8px; padding: 8px; font-size: 10px; color: var(--lcd-ink); }
.grid .lane { opacity: 0.6; align-self: center; }
.grid .cell { height: 13px; border-radius: 2px; background: #ffffff10; }
.grid .cell.beat { background: #ffffff1e; }
.grid .cell.on { background: var(--lcd-ink); }
.grid .cell.now { box-shadow: 0 0 0 1px #fff; }
.grid .cell.on.now { background: #fff; }
canvas { width: 100%; height: 90px; background: var(--lcd); border-radius: 8px; }

.notation, .necks, .neck { min-width: 0; } /* let the necks scroll inside the panel on phones */
.necks { display: grid; gap: 10px; }
.neck-head { display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--grille); margin-bottom: 3px; }
.swatch { width: 12px; height: 12px; border-radius: 50%; box-shadow: 0 0 0 2px #0002; }
.neck-scroll { overflow: hidden; border-radius: 6px; background: #1d120c; padding: 2px 0; }
.neck-scroll canvas { display: block; }
.band .selects { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.band label { display: grid; gap: 4px; font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--grille); font-weight: 700; }
select { font: 13px 'Space Mono', monospace; padding: 8px; border-radius: 6px; border: 2px solid var(--tolex-dark); background: #fffaf0; color: var(--ink); width: 100%; }
.toggles { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 12px; font-size: 13px; }
.toggles label { display: flex; align-items: center; gap: 8px; text-transform: none; letter-spacing: 0; color: var(--ink); font-weight: 400; }
.toggles input { width: 18px; height: 18px; accent-color: var(--accent); }

.knobs { display: flex; flex-wrap: wrap; gap: 6px 4px; justify-content: space-around; }
.knob-wrap { display: grid; align-content: start; justify-items: center; gap: 2px; width: 74px; padding: 4px 0; border-radius: 10px; user-select: none; -webkit-user-select: none; touch-action: pan-y; cursor: ns-resize; }
.knob-wrap:hover { background: #0000000d; }
.knob-wrap.dragging { background: #00000014; }
.knob-wrap.dragging .knob-val { color: var(--teal); font-weight: 700; transform: scale(1.25); }
.knob-val { transition: transform .1s; cursor: text; }
.knob-input { width: 52px; font: inherit; font-size: 12px; text-align: center; border: 1px solid var(--grille); border-radius: 4px; padding: 1px 2px; }
.mute { cursor: pointer; }
.knob {
  width: 54px; height: 54px; border-radius: 50%; cursor: ns-resize; touch-action: none; position: relative;
  background: radial-gradient(circle at 35% 30%, var(--chrome-1), var(--chrome-2) 70%);
  box-shadow: 0 3px 6px #0007, inset 0 -2px 3px #0004;
}
.knob::before { /* scale ticks */
  content: ''; position: absolute; inset: -6px; border-radius: 50%;
  background: conic-gradient(from 225deg, var(--grille) 0 1deg, #0000 1deg 27deg) ; opacity: .5;
  -webkit-mask: radial-gradient(circle, #0000 30px, #000 31px); mask: radial-gradient(circle, #0000 30px, #000 31px);
}
.knob-cap { position: absolute; inset: 7px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #3a3a3a, #111); }
.knob-ind { position: absolute; left: 50%; top: 3px; width: 3px; height: 13px; margin-left: -1.5px; background: var(--tolex); border-radius: 2px; }
.knob-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; text-align: center; }
.knob-val { font-size: 11px; color: var(--grille); min-height: 14px; }
.mute { font: 700 10px 'Space Mono', monospace; border: 0; border-radius: 4px; padding: 2px 8px; cursor: pointer; background: var(--tolex-dark); color: var(--ink); }
.mute.on { background: var(--accent); color: #fff; }

footer { text-align: center; color: var(--tolex-dark); font-size: 11px; padding: 0 16px 28px; opacity: .8; }

@media (max-width: 720px) {
  .display { grid-template-columns: 1fr; }
  .btn.warn { margin-left: 0; }
  .grid { grid-template-columns: 40px repeat(16, 1fr); }
}

/* ---------- notation panel ---------- */
.notation-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.notation-head h2 { margin: 0; }
.seg { display: inline-flex; border: 2px solid var(--ink); border-radius: 8px; overflow: hidden; }
.seg button { font: 700 11px 'Space Mono', monospace; text-transform: uppercase; letter-spacing: 1px; padding: 5px 10px; border: 0; background: transparent; color: var(--ink); cursor: pointer; }
.seg button + button { border-left: 2px solid var(--ink); }
.seg button.on { background: var(--ink); color: var(--tolex); }
.necks[hidden], .tabs[hidden] { display: none; }
.notation.collapsed { padding-bottom: 10px; }
.necks, .tabs { margin-top: 10px; }

.tabs { background: var(--lcd); color: #d7efe8; border-radius: 8px; padding: 8px 6px 4px; min-width: 0; overflow: hidden; }
.system { margin-bottom: 10px; transition: opacity .3s; }
.sys-head { position: relative; height: 14px; margin-left: 38px; font-size: 10px; color: var(--lcd-ink); }
.sys-bar { position: absolute; top: 0; padding-left: 4px; white-space: nowrap; text-transform: uppercase; letter-spacing: .5px; }
.staff { display: grid; grid-template-columns: 38px 1fr; margin-top: 4px; }
.staff-label { display: grid; grid-auto-rows: var(--row); padding-top: var(--top); font-size: 10px; color: #8fb9ad; position: relative; }
.staff-name { position: absolute; left: 0; top: calc(var(--top) - 13px); font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--c, #8fb9ad); }
.staff-lead { --c: #2fb3a5; } .staff-rhythm { --c: #e8a33d; } .staff-bass { --c: #e0603f; }
.staff-str { text-align: right; padding-right: 8px; line-height: var(--row); }
.staff, .staff-body { --row: 13px; --top: 14px; }
.staff-bass, .staff-bass .staff-body { --row: 14px; }
.staff-lead, .staff-lead .staff-body { --top: 2px; }
.staff-bass, .staff-bass .staff-body { --top: 2px; }
.staff-body { position: relative; height: calc(var(--row) * var(--strings) + var(--top) + 2px); }
.str-line { position: absolute; left: 0; right: 0; height: 1px; background: #5d8a7f; }
.bar-line { position: absolute; top: calc(var(--top) + var(--row) * 0.5); bottom: calc(var(--row) * 0.5 + 2px); width: 1px; background: #8fb9ad; }
.chord-row { position: absolute; left: 0; right: 0; top: 0; height: 13px; }
.chord-name { position: absolute; top: 0; font-size: 10px; font-weight: 700; color: #e8a33d; white-space: nowrap; }
.tn { position: absolute; transform: translate(-50%, 0); height: var(--row); line-height: var(--row); padding: 0 2px; font-size: 11px; font-weight: 700; background: var(--lcd); color: #f2efe4; border-radius: 3px; transition: background .08s, color .08s; z-index: 1; }
.tn.two { font-size: 10px; letter-spacing: -0.5px; padding: 0 1px; }
.tn.pm { color: #b9cfc8; font-weight: 400; }
.tn.past { color: #8fb9ad; }
.tn.on { background: var(--c); color: #10201c; box-shadow: 0 0 8px var(--c); z-index: 2; }
.trem { position: absolute; height: 4px; background: repeating-linear-gradient(90deg, #f2efe4 0 2px, transparent 2px 4px); opacity: .8; }
.trem.on { background: repeating-linear-gradient(90deg, var(--c) 0 2px, transparent 2px 4px); opacity: 1; }
.vib { position: absolute; font-size: 10px; line-height: 1; color: #b9cfc8; overflow: hidden; white-space: nowrap; letter-spacing: -1px; }
.vib.on { color: var(--c); }
.gliss { position: absolute; background: linear-gradient(to bottom right, transparent calc(50% - 1px), #f2efe4 50%, transparent calc(50% + 1px)); }
.gliss.on { background: linear-gradient(to bottom right, transparent calc(50% - 1.5px), var(--c) 50%, transparent calc(50% + 1.5px)); }

/* ---------- phones / iOS shell ---------- */
body { padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); -webkit-tap-highlight-color: transparent; }
button, select, .knob-wrap, .seg button { touch-action: manipulation; } /* no double-tap-zoom delay */
.native footer { display: none; }  /* "in your browser" credits don't apply inside the app */

/* ---------- instrument racks: one colour per instrument (same as fretboard/tab) ---------- */
.racks { display: grid; gap: 16px; }
.rack { --sec: #8a7f6c; --tint: #8a7f6c1f; border: 2px solid var(--sec); border-radius: 16px; padding: 10px 10px 12px;
  background: linear-gradient(180deg, var(--tint), transparent 70%); }
.rack-lead { --sec: #2fb3a5; --tint: #2fb3a533; }
.rack-rhythm { --sec: #e8a33d; --tint: #e8a33d33; }
.rack-bass { --sec: #e0603f; --tint: #e0603f33; }
.rack-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin: 0 4px 10px; }
.rack-title { margin: 0; font-family: 'Righteous', sans-serif; font-size: 17px; letter-spacing: 2px; text-transform: uppercase;
  background: var(--sec); color: #15110d; padding: 3px 12px; border-radius: 999px; }
.rack-panels { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.rack-panels + .rack-panels { margin-top: 12px; }
.rack .panel { border-top: 5px solid var(--sec); }
.rack .panel h3 { margin: 0 0 8px; font-family: 'Righteous', sans-serif; font-size: 14px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--grille); }
/* mixer knobs wear their instrument's colour */
.knob-wrap[data-c] .knob { box-shadow: 0 0 0 3px var(--kc), 0 3px 6px #0007; }
.knob-wrap[data-c] .knob-label { color: var(--kc); filter: brightness(0.75); }
.knob-wrap[data-c="lead"] { --kc: #2fb3a5; }
.knob-wrap[data-c="rhythm"] { --kc: #e8a33d; }
.knob-wrap[data-c="bass"] { --kc: #e0603f; }
.knob-wrap[data-c="drums"] { --kc: #8a7f6c; }

/* stompboxes vs amps: a small badge, and pedals get a wash of the instrument colour */
.panel-stomp, .panel-amp, .panel-play { position: relative; }
.panel-stomp h3::before, .panel-amp h3::before { display: inline-block; margin-right: 8px; padding: 1px 6px; border-radius: 4px;
  font: 700 9px 'Space Mono', monospace; letter-spacing: 1px; vertical-align: 2px; }
.panel-stomp h3::before { content: 'STOMP'; background: var(--sec); color: #15110d; }
.panel-amp h3::before { content: 'AMP'; background: var(--grille); color: var(--tolex); }
.rack .panel-stomp { background-color: var(--tolex); background-image: linear-gradient(180deg, var(--tint), transparent 80%), repeating-linear-gradient(45deg, #0000 0 3px, #00000008 3px 4px); }

/* stompbox footswitch: chrome button with an LED in the instrument colour; off = bypassed + dimmed */
.panel-stomp h3 { display: flex; align-items: center; gap: 0; }
.footswitch { margin-left: auto; width: 34px; height: 34px; border-radius: 50%; border: 0; cursor: pointer; position: relative;
  background: radial-gradient(circle at 35% 30%, var(--chrome-1), var(--chrome-2) 70%); box-shadow: 0 2px 4px #0006, inset 0 -2px 3px #0004; }
.footswitch:active { transform: translateY(1px); box-shadow: 0 1px 2px #0006, inset 0 -1px 2px #0004; }
.footswitch .led { position: absolute; top: -6px; right: -4px; width: 11px; height: 11px; border-radius: 50%; background: #4a3a30; box-shadow: inset 0 1px 2px #0008; }
.footswitch.on .led { background: var(--sec); box-shadow: 0 0 8px var(--sec), 0 0 2px #fff8 inset; }
.footswitch:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; }
.panel.bypassed .knobs { opacity: 0.4; filter: grayscale(0.6); }
.panel.bypassed { background-image: none; }

/* Simple / Full view */
.mode-switch { margin-left: 0; }
body.simple .adv { display: none !important; }

/* FAQ & thanks */
.about h2 { margin-bottom: 8px; }
.about details { border-top: 1px dashed #6b2a2244; padding: 8px 2px; }
.about details:first-of-type { border-top: 0; }
.about summary { cursor: pointer; font-weight: 700; color: var(--ink); list-style: none; display: flex; gap: 8px; align-items: baseline; }
.about summary::-webkit-details-marker { display: none; }
.about summary::before { content: '+'; display: inline-block; width: 1em; color: var(--grille); font-weight: 700; }
.about details[open] summary::before { content: '−'; }
.about p { margin: 6px 0 2px 1.6em; font-size: 13px; line-height: 1.55; max-width: 75ch; }
.about kbd { font: 700 11px 'Space Mono', monospace; background: var(--tolex-dark); color: var(--ink); border-radius: 4px; padding: 0 5px; }
.thanks p { margin-left: 0; font-size: 15px; }
#credits p { margin-left: 0; }

/* links between the app and the FAQ page */
.top-links { margin-top: 8px; }
.top-links a, footer a { color: var(--teal); font-weight: 700; letter-spacing: 1px; text-decoration: none; border-bottom: 1px dashed currentColor; }
.top-links a:hover, footer a:hover { color: var(--lcd-ink); }
.faq-intro { margin: 0 0 6px; font-size: 12px; color: var(--grille); }

.about a { color: var(--grille); }

/* FAQ page: a centred reading column, text uses its full width */
main.page-narrow { max-width: 780px; }
.page-narrow .about p { max-width: none; }
.about .faq-intro { margin: 0 0 6px; }
