/* Adam's Guitar – Thrash Guitar */
:root {
  --bg: #0b0b0d;
  --bg-2: #141418;
  --panel: #1b1b20;
  --line: #2c2c33;
  --text: #e9e6e1;
  --muted: #9a968f;
  --red: #d7261e;
  --red-hot: #ff4a2e;
  --steel: #c9ccd2;
  --display: Impact, "Haettenschweiler", "Arial Narrow Bold", "Franklin Gothic Bold", sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  /* materials shared by the amp and the riff machine */
  --tolex:
    repeating-linear-gradient(45deg, rgba(255,255,255,.025) 0 2px, transparent 2px 4px),
    repeating-linear-gradient(-45deg, rgba(0,0,0,.25) 0 2px, transparent 2px 4px),
    #111114;
  --brushed:
    repeating-linear-gradient(90deg, rgba(255,255,255,.05) 0 1px, transparent 1px 3px),
    linear-gradient(180deg, #4a4c52, #2a2b30 60%, #35363b);
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  background:
    radial-gradient(1100px 500px at 50% -120px, rgba(215, 38, 30, .22), transparent 70%),
    linear-gradient(var(--bg), var(--bg));
  color: var(--text);
  font: 16px/1.55 var(--body);
  min-height: 100vh;
}

a { color: inherit; }

/* ---------- Header ---------- */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  max-width: 1180px;
  margin: 0 auto;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.logo-mark { color: var(--red); display: grid; }

.logo-text {
  font-family: var(--display);
  font-size: 28px;
  letter-spacing: .04em;
  text-transform: uppercase;
  line-height: 1;
}

.logo-text b { color: var(--red); font-weight: inherit; }

.tagline {
  color: var(--muted);
  font-size: 14px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px 40px;
}

/* ---------- Hero ---------- */
.hero { text-align: center; padding: 30px 0 18px; }

.hero h1 {
  font-family: var(--display);
  font-weight: normal;
  font-size: clamp(44px, 8vw, 84px);
  line-height: .95;
  margin: 0 0 10px;
  letter-spacing: .03em;
  text-transform: uppercase;
  background: linear-gradient(180deg, #fff 0%, #d9d9de 45%, #8d8f96 55%, #e4e5ea 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 3px 0 #000) drop-shadow(0 0 22px rgba(215, 38, 30, .45));
}

.hero p { margin: 0 auto; max-width: 560px; color: var(--muted); }

/* ---------- Amp head ---------- */
.amp {
  margin: 18px auto 0;
  max-width: 1040px;
  padding: 14px;
  border-radius: 14px;
  background: var(--tolex);
  border: 1px solid #000;
  box-shadow: 0 18px 40px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.06);
}

.amp-face {
  display: grid;
  grid-template-columns: 190px 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border-radius: 8px;
  background: var(--brushed);
  border: 1px solid #000;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18), inset 0 -2px 6px rgba(0,0,0,.5);
}

.amp-brand { display: flex; flex-direction: column; line-height: 1; min-width: 0; }

.amp-name {
  font-family: var(--display);
  font-size: 26px;
  white-space: nowrap;
  letter-spacing: .06em;
  color: #f2f2f2;
  text-shadow: 0 2px 0 #000;
}

.amp-name .amp-dot { color: var(--red); margin: 0 3px; }

.amp-sub {
  margin-top: 6px;
  font-size: 11px;
  letter-spacing: .25em;
  text-transform: uppercase;
  color: #b9bbc1;
}

.knobs {
  display: flex;
  justify-content: center;
  gap: 14px 6px;
  flex-wrap: wrap;
}

.knob {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 62px;
  cursor: ns-resize;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  outline: none;
}

.knob-cap {
  --rot: 0deg;
  position: relative;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, #4b4b52, #121215 62%),
    #111;
  border: 2px solid #050506;
  box-shadow:
    0 4px 8px rgba(0,0,0,.7),
    0 0 0 4px rgba(0,0,0,.25),
    inset 0 1px 1px rgba(255,255,255,.2);
  transform: rotate(var(--rot));
}

.knob-cap i {
  position: absolute;
  left: 50%;
  top: 4px;
  width: 4px;
  height: 17px;
  margin-left: -2px;
  border-radius: 2px;
  background: #f4f4f4;
}

.knob:focus-visible .knob-cap { box-shadow: 0 0 0 3px var(--red-hot), 0 4px 8px rgba(0,0,0,.7); }

.knob-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #f0f0f0;
  text-shadow: 0 1px 0 #000;
}

.knob-val {
  font: 600 11px/1 ui-monospace, Consolas, monospace;
  color: #ffb3a8;
  background: rgba(0,0,0,.45);
  padding: 2px 6px;
  border-radius: 4px;
  min-width: 34px;
  text-align: center;
}

.switches { display: flex; flex-direction: column; gap: 8px; }

.switch {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 6px;
  border: 1px solid #000;
  background: linear-gradient(#26272c, #17171a);
  color: #ddd;
  font: 700 11px/1 var(--body);
  letter-spacing: .14em;
  text-transform: uppercase;
  cursor: pointer;
}

.switch .led {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #3a1210;
  box-shadow: inset 0 1px 1px rgba(0,0,0,.6);
}

.switch.held .led,
.switch.on .led {
  background: var(--red-hot);
  box-shadow: 0 0 8px var(--red-hot), 0 0 2px #fff inset;
}

.presets {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.presets-label {
  font-size: 11px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-right: 4px;
}

.presets button,
.btn {
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  font: 600 13px/1 var(--body);
  cursor: pointer;
}

.presets button:hover,
.btn:hover { border-color: #55555f; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.presets button.active {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}

/* ---------- Status ---------- */
.status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 26px 0 10px;
  min-height: 48px;
}

.readout { display: flex; align-items: baseline; gap: 12px; }

.readout span {
  font-family: var(--display);
  font-size: 40px;
  line-height: 1;
  color: #fff;
  min-width: 70px;
}

.readout small { color: var(--muted); font-size: 14px; }

.loader { display: flex; align-items: center; gap: 10px; transition: opacity .4s; }
.loader.done { opacity: 0; pointer-events: none; }

.loader-bar {
  width: 160px;
  height: 6px;
  border-radius: 3px;
  background: var(--line);
  overflow: hidden;
}

.loader-bar span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--red);
  transition: width .15s;
}

.loader small { color: var(--muted); font-size: 12px; }

/* ---------- Neck ---------- */
.neck-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 10px;
  box-shadow: 0 16px 34px rgba(0,0,0,.6);
}

.neck {
  --open-col: 64px;
  position: relative;
  display: grid;
  grid-template-rows: repeat(6, 44px);
  min-width: 860px;
  padding: 10px 0;
  /* rosewood */
  background:
    repeating-linear-gradient(90deg, rgba(0,0,0,.12) 0 2px, transparent 2px 7px),
    linear-gradient(180deg, #2e1a12, #3b2116 30%, #2b170f 70%, #22120b);
  touch-action: pan-x;
  user-select: none;
  -webkit-user-select: none;
}

/* open-string column (headstock side) */
.neck::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--open-col);
  background: linear-gradient(90deg, #121214, #1d1d21);
  border-right: 7px solid #e8dfc8; /* nut */
  pointer-events: none;
}

.inlay {
  grid-row: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 116px;
  pointer-events: none;
  z-index: 0;
}

.inlay i {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fbf7ee, #cfc6b3 70%);
  box-shadow: 0 0 0 1px rgba(0,0,0,.3);
}

.fretwire {
  grid-row: 1 / -1;
  justify-self: end;
  width: 4px;
  margin-right: -2px;
  background: linear-gradient(90deg, #8d9097, #f1f2f4 50%, #8d9097);
  pointer-events: none;
  z-index: 1;
}

.string {
  grid-column: 1 / -1;
  align-self: center;
  height: var(--gauge, 2px);
  background: linear-gradient(180deg, #f7f7f7, #9da0a6 60%, #6b6e74);
  box-shadow: 0 2px 2px rgba(0,0,0,.55);
  pointer-events: none;
  z-index: 2;
  transform-origin: center;
}

.string.wound {
  background:
    repeating-linear-gradient(90deg, rgba(0,0,0,.35) 0 1px, transparent 1px 3px),
    linear-gradient(180deg, #e9dcc0, #a9946e 60%, #6e5d40);
}

.string.vib { animation: vib .45s ease-out; }

@keyframes vib {
  0%   { transform: translateY(0) scaleY(1.6); }
  10%  { transform: translateY(-2px) scaleY(1.6); }
  20%  { transform: translateY(2px) scaleY(1.5); }
  35%  { transform: translateY(-1.5px) scaleY(1.3); }
  50%  { transform: translateY(1px) scaleY(1.2); }
  70%  { transform: translateY(-.5px); }
  100% { transform: translateY(0); }
}

.fret {
  position: relative;
  display: grid;
  place-items: center;
  padding: 0;
  margin: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  z-index: 3;
  -webkit-tap-highlight-color: transparent;
}

.fret:focus-visible { outline: 2px solid var(--red-hot); outline-offset: -3px; }

.fret .dot {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font: 700 11px/1 var(--body);
  color: #fff;
  opacity: 0;
  transform: scale(.6);
  transition: opacity .12s, transform .12s, background .12s;
  background: rgba(20, 20, 24, .85);
  border: 1px solid rgba(255,255,255,.2);
}

.fret:hover .dot { opacity: .85; transform: scale(.9); }

.show-notes .fret .dot { opacity: .9; transform: scale(.85); }

.fret.hit .dot {
  opacity: 1;
  transform: scale(1.05);
  background: var(--red);
  border-color: #ff8a73;
  box-shadow: 0 0 14px var(--red-hot), 0 0 30px rgba(255, 74, 46, .45);
  transition: none;
}

.fret-num {
  position: relative;
  z-index: 1;
  grid-row: 7;
  text-align: center;
  font: 600 11px/1 var(--body);
  color: var(--muted);
  padding-top: 6px;
}

/* ---------- Controls ---------- */
.controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 14px 0 0;
}

.toggle { display: flex; align-items: center; gap: 8px; color: var(--muted); cursor: pointer; font-size: 14px; }
.toggle input { accent-color: var(--red); width: 16px; height: 16px; }

/* ---------- How to ---------- */
.howto {
  margin-top: 46px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}

.howto h2 {
  font-family: var(--display);
  font-weight: normal;
  letter-spacing: .04em;
  text-transform: uppercase;
  font-size: 32px;
  margin: 0 0 16px;
}

.howto-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.howto-grid > div {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px 20px;
}

.howto h3 { margin: 0 0 8px; font-size: 16px; color: #fff; }
.howto ul { margin: 0; padding-left: 18px; color: #cfcbc4; font-size: 14.5px; }
.howto li { margin: 6px 0; }
.howto p { margin: 6px 0; color: #cfcbc4; font-size: 14.5px; }

.tab {
  margin: 6px 0 10px;
  padding: 10px 12px;
  background: #0a0a0c;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: #ffb3a8;
  font: 13px/1.4 ui-monospace, Consolas, monospace;
  overflow-x: auto;
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  padding: 18px;
}

/* ---------- Responsive ---------- */
@media (min-width: 861px) and (max-width: 1090px) {
  .knobs { display: grid; grid-template-columns: repeat(4, 62px); justify-content: center; }
}

@media (max-width: 860px) {
  .amp-face { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .amp-brand { align-items: center; }
  .switches { flex-direction: row; }
  .howto-grid { grid-template-columns: 1fr; }
  .tagline { display: none; }
}

.swipe-hint { display: none; }

@media (max-width: 900px) {
  .swipe-hint {
    display: block;
    margin: 0 0 8px;
    color: var(--muted);
    font-size: 13px;
    text-align: center;
  }
}

@media (max-width: 520px) {
  .knobs { gap: 10px; }
  .knob { width: 56px; }
  .knob-cap { width: 44px; height: 44px; }
  .status { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  .string.vib { animation: none; }
}

/* ---------- Style switcher ---------- */
/* Guitar and style picker: the same tolex case and brushed face as the amp and the riff machine */
.styles-wrap {
  max-width: 1040px;
  margin: 8px auto 0;
  padding: 14px;
  border-radius: 14px;
  background: var(--tolex);
  border: 1px solid #000;
  text-align: center;
  /* shadow pulled in so it does not fall on the amp below */
  box-shadow: 0 26px 34px -12px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.06);
}

.picker-face {
  padding: 16px 20px 14px;
  border-radius: 8px;
  background: var(--brushed);
  border: 1px solid #000;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18), inset 0 -2px 6px rgba(0,0,0,.5);
}

.picker-face .styles button { border-color: #000; box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 2px 4px rgba(0,0,0,.5); }
.picker-face .styles button.active { border-color: #ff6a52; box-shadow: 0 0 18px rgba(215, 38, 30, .45); }
.picker-face .style-desc { color: #eeeae4; text-shadow: 0 1px 1px rgba(0,0,0,.6); }
.picker-face .tuning-tag { background: rgba(0,0,0,.45); border-color: #000; color: #b9b5ae; text-shadow: none; }

@media (max-width: 520px) {
  .styles-wrap { padding: 8px; }
  .picker-face { padding: 12px 10px; }
}

/* ---------- Guitar switch ----------
   Three keys in a black bay, each with the amp's red lamp: the guitar is chosen here,
   its styles in the row underneath. */
.inst-switch {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  margin: 0 0 14px;
  border-radius: 11px;
  background: #050506;
  border: 1px solid #000;
  box-shadow: inset 0 2px 6px rgba(0,0,0,.9), 0 1px 0 rgba(255,255,255,.07);
}

.inst-switch button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px 9px 15px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-family: var(--display);
  font-size: 18px;
  letter-spacing: .08em;
  text-transform: uppercase;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: color .15s, background .15s;
}

.inst-switch .led {
  flex: none;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #3a1210;
  box-shadow: inset 0 1px 1px rgba(0,0,0,.6);
}

.inst-switch button.active {
  color: #fff;
  border-color: #000;
  background: linear-gradient(#3a3b41, #1f2024);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.16), 0 2px 5px rgba(0,0,0,.7);
}

.inst-switch button.active .led {
  background: var(--red-hot);
  box-shadow: 0 0 8px var(--red-hot), 0 0 2px #fff inset;
}

.inst-switch button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

@media (hover: hover) {
  .inst-switch button:not(.active):hover { color: var(--text); }
}

@media (max-width: 520px) {
  .inst-switch { display: flex; }
  .inst-switch button { flex: 1 1 0; justify-content: center; gap: 7px; padding: 9px 4px; font-size: 15px; letter-spacing: .05em; }
}

@media (max-width: 340px) {
  .inst-switch button { font-size: 13.5px; gap: 5px; }
  .inst-switch .led { width: 7px; height: 7px; }
}

.styles {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.styles button {
  padding: 10px 18px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: linear-gradient(#1f1f25, #151519);
  color: var(--text);
  font-family: var(--display);
  font-size: 18px;
  letter-spacing: .06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color .15s, background .15s, transform .1s;
}

.styles button:hover { border-color: #5a5a64; }
.styles button:active { transform: translateY(1px); }

.styles button.active {
  background: linear-gradient(#e2332a, #a8150f);
  border-color: #ff6a52;
  color: #fff;
  box-shadow: 0 0 18px rgba(215, 38, 30, .45);
}

.style-desc {
  margin: 12px auto 0;
  max-width: 720px;
  color: #cfcbc4;
  font-size: 14.5px;
}

.tuning-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12.5px;
  white-space: nowrap;
}

.tuning-tag b { color: #ffb3a8; font-weight: 600; }

kbd {
  font: 600 12px/1 ui-monospace, Consolas, monospace;
  padding: 2px 5px;
  border: 1px solid #44444c;
  border-bottom-width: 2px;
  border-radius: 4px;
  background: #1c1c21;
  color: #fff;
}

@media (max-width: 520px) {
  .styles button { padding: 8px 12px; font-size: 15px; }
}

/* ---------- Riff machine (riff + song generator) ----------
   Built from the amp's parts: tolex shell, brushed-metal face, black caps, red LEDs.
   Keys, pads and the display sit in black bays cut into the face; faders and switches sit on it. */
.riffgen {
  max-width: 1040px;
  margin: 12px auto 0;
  padding: 14px;
  border-radius: 14px;
  background: var(--tolex);
  border: 1px solid #000;
  /* the amp's shadow, pulled in so it does not fall on the amp sitting above */
  box-shadow: 0 26px 34px -12px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.06);
}

.rg-face {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  padding: 14px 20px 18px;
  border-radius: 8px;
  background: var(--brushed);
  border: 1px solid #000;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18), inset 0 -2px 6px rgba(0,0,0,.5);
}

/* name plate */
.rg-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 12px;
}

.rg-name {
  font-family: var(--display);
  font-size: 20px;
  line-height: 1;
  letter-spacing: .06em;
  text-transform: uppercase;
  white-space: nowrap;
  color: #f2f2f2;
  text-shadow: 0 2px 0 #000;
}

.rg-name .amp-dot { color: var(--red); margin: 0 3px; }

/* memory: Save and My songs, top right of the unit */
.rg-memory { display: flex; gap: 8px; }
.mem-btn { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; white-space: nowrap; }
.mem-btn svg { flex: none; color: #ff6a52; }
.mem-btn:disabled { opacity: .45; cursor: not-allowed; }

.cnt {
  margin-left: 2px;
  padding: 3px 6px;
  border-radius: 4px;
  background: #0d0707;
  box-shadow: inset 0 1px 3px rgba(0,0,0,.9);
  color: #ffb3a8;
  font: 700 11px/1 ui-monospace, Consolas, monospace;
  letter-spacing: 0;
}

/* a bay cut into the face */
.rg-transport,
.rg-lcd,
.seg,
.share-box,
.library,
.export-box,
.timeline {
  border: 1px solid #000;
  border-radius: 10px;
  background: #0b0b0d;
  box-shadow: inset 0 2px 6px rgba(0,0,0,.9), 0 1px 0 rgba(255,255,255,.16);
}

/* ----- transport keys + display ----- */
.rg-main {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
}

.rg-transport {
  display: flex;
  gap: 5px;
  padding: 5px;
}

.gen-btn,
.rg-key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  border: 1px solid #000;
  border-radius: 6px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform .08s, filter .15s, box-shadow .15s;
}

.gen-btn {
  gap: 10px;
  min-width: 0;
  min-height: 58px;
  padding: 8px 24px;
  background: linear-gradient(180deg, #ff6450 0%, #e2332a 36%, #a8150f 100%);
  color: #fff;
  font-family: var(--display);
  font-size: 22px;
  line-height: 1;
  letter-spacing: .06em;
  text-transform: uppercase;
  white-space: nowrap;
  text-shadow: 0 1px 0 rgba(0,0,0,.5);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.5), inset 0 -3px 0 rgba(0,0,0,.25), 0 0 18px rgba(255,74,46,.4);
}

.gen-btn svg { flex: none; filter: drop-shadow(0 1px 0 rgba(0,0,0,.4)); }
.gen-btn:active {
  transform: translateY(2px);
  box-shadow: inset 0 3px 8px rgba(0,0,0,.45), 0 0 10px rgba(255,74,46,.3);
}

.rg-key {
  flex-direction: column;
  gap: 8px;
  min-width: 66px;
  padding: 8px 10px;
  background: linear-gradient(180deg, #3b3c43, #1e1f23 58%, #27282d);
  color: #e9e9ec;
  font: 700 11px/1 var(--body);
  letter-spacing: .14em;
  text-transform: uppercase;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.2), inset 0 -3px 0 rgba(0,0,0,.35);
}

.rg-key:active { transform: translateY(1px); box-shadow: inset 0 2px 6px rgba(0,0,0,.65); }

.play-btn svg { flex: none; }
.rg-key .led { margin: 4.5px 0; }
.play-btn.on {
  background: linear-gradient(180deg, #50211d, #2b1210 58%, #361614);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18), inset 0 -3px 0 rgba(0,0,0,.35), 0 0 12px rgba(255,74,46,.35);
}
.play-btn.on svg { color: var(--red-hot); filter: drop-shadow(0 0 5px var(--red-hot)); }

.play-btn.pulse { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse {
  0%, 100% { box-shadow: inset 0 1px 0 rgba(255,255,255,.2), inset 0 -3px 0 rgba(0,0,0,.35), 0 0 0 0 rgba(255,74,46,0); }
  50% { box-shadow: inset 0 1px 0 rgba(255,255,255,.2), inset 0 -3px 0 rgba(0,0,0,.35), 0 0 0 5px rgba(255,74,46,.45); }
}

.gen-btn:focus-visible,
.rg-key:focus-visible,
.seg button:focus-visible,
.riff-actions .btn:focus-visible,
.opt select:focus-visible,
.tl-block:focus-visible,
.share-box input:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* display */
.rg-lcd {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
  padding: 10px 14px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,0) 44%),
    repeating-linear-gradient(0deg, rgba(0,0,0,.3) 0 1px, transparent 1px 3px),
    radial-gradient(130% 170% at 50% 0%, #2b0f0c 0%, #140908 55%, #0a0505 100%);
}

.riff-info {
  display: grid;
  gap: 7px;
  min-width: 0;
  margin: 0;
  color: #ffb3a8;
  font: 600 12.5px/1.35 ui-monospace, Consolas, monospace;
}

.lcd-title {
  padding-right: 62px; /* room for the beat lights */
  font-family: var(--display);
  font-weight: normal;
  font-size: 25px;
  line-height: 1.05;
  letter-spacing: .05em;
  text-transform: uppercase;
  overflow-wrap: anywhere;
  color: #ffe9e4;
  text-shadow: 0 0 12px rgba(255,74,46,.85), 0 0 2px rgba(255,150,130,.9);
}

.lcd-title small {
  margin-left: 8px;
  font: 600 12px/1 ui-monospace, Consolas, monospace;
  letter-spacing: 0;
  text-transform: none;
  color: #ffd27a;
  text-shadow: none;
}

.lcd-meta { display: flex; flex-wrap: wrap; gap: 2px 18px; }
.lcd-meta .f { white-space: nowrap; }
.lcd-meta .note { color: #ffd27a; }

.rg-beats {
  position: absolute;
  top: 13px;
  right: 14px;
  display: flex;
  gap: 6px;
  transform: translateZ(0); /* own layer: a beat repaints these four dots and nothing else */
}

.rg-beats i,
.sw .led,
.mem-btn .led {
  flex: none;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #3a1210;
  box-shadow: inset 0 1px 1px rgba(0,0,0,.6);
}

.rg-beats i.on,
.sw input:checked + .led,
.mem-btn.on .led {
  background: var(--red-hot);
  box-shadow: 0 0 8px var(--red-hot), 0 0 2px #fff inset;
}

/* ----- switches, selectors and small keys on the face ----- */
.sw,
.opt select,
.riff-actions .btn,
.mem-btn,
.lib-act,
.ex-status .btn {
  border: 1px solid #000;
  border-radius: 6px;
  background: linear-gradient(#26272c, #17171a);
  color: #ddd;
  font: 700 11px/1 var(--body);
  letter-spacing: .14em;
  text-transform: uppercase;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 1px 0 rgba(255,255,255,.1);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.sw {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  white-space: nowrap;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* the real checkbox stays in the page for the keyboard and screen readers */
.sw input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}

.sw:active,
.riff-actions .btn:active:not(:disabled) { transform: translateY(1px); }
.sw input:focus-visible + .led { outline: 2px solid #fff; outline-offset: 3px; }
@supports selector(:has(a)) {
  .sw:has(input:focus-visible) { outline: 2px solid #fff; outline-offset: 2px; }
  .sw input:focus-visible + .led { outline: none; }
}

/* the Loop key in the transport bay keeps the key look, with the light above the label */
.rg-key.sw {
  flex-direction: column;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 6px;
  background: linear-gradient(180deg, #3b3c43, #1e1f23 58%, #27282d);
  color: #e9e9ec;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.2), inset 0 -3px 0 rgba(0,0,0,.35);
}
.rg-key.sw:active { box-shadow: inset 0 2px 6px rgba(0,0,0,.65); }

/* ----- mixer: drums, bass, tempo ----- */
.rg-mix {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px 28px;
}

.rg-ch {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.rg-ch > :first-child { flex: 0 0 104px; }

.opt {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: 700 11px/1 var(--body);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #f0f0f0;
  text-shadow: 0 1px 0 #000;
}

.riffgen input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  --p: .5;
  flex: 1 1 auto;
  min-width: 0;
  height: 30px;
  margin: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
}

.riffgen input[type="range"]:focus { outline: none; }

.riffgen input[type="range"]::-webkit-slider-runnable-track {
  box-sizing: border-box;
  height: 8px;
  border: 1px solid #000;
  border-radius: 4px;
  background:
    linear-gradient(90deg, #a8150f, #ff4a2e) 0 0 / calc(9px + (100% - 18px) * var(--p)) 100% no-repeat,
    #08080a;
  box-shadow: inset 0 1px 3px rgba(0,0,0,.9), 0 1px 0 rgba(255,255,255,.18);
}

.riffgen input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  box-sizing: border-box;
  width: 18px;
  height: 28px;
  margin-top: -11px;
  border: 1px solid #000;
  border-radius: 3px;
  background:
    linear-gradient(90deg, transparent 7px, #f4f4f4 7px 9px, transparent 9px),
    linear-gradient(180deg, #5c5d64, #1c1c20 55%, #323338);
  box-shadow: 0 2px 4px rgba(0,0,0,.7), inset 0 1px 0 rgba(255,255,255,.3);
}

.riffgen input[type="range"]::-moz-range-track {
  box-sizing: border-box;
  height: 8px;
  border: 1px solid #000;
  border-radius: 4px;
  background: #08080a;
  box-shadow: inset 0 1px 3px rgba(0,0,0,.9), 0 1px 0 rgba(255,255,255,.18);
}

.riffgen input[type="range"]::-moz-range-progress {
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(90deg, #a8150f, #ff4a2e);
}

.riffgen input[type="range"]::-moz-range-thumb {
  box-sizing: border-box;
  width: 18px;
  height: 28px;
  border: 1px solid #000;
  border-radius: 3px;
  background:
    linear-gradient(90deg, transparent 7px, #f4f4f4 7px 9px, transparent 9px),
    linear-gradient(180deg, #5c5d64, #1c1c20 55%, #323338);
  box-shadow: 0 2px 4px rgba(0,0,0,.7), inset 0 1px 0 rgba(255,255,255,.3);
}

.riffgen input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 2px #fff, 0 2px 4px rgba(0,0,0,.7); }
.riffgen input[type="range"]:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 2px #fff, 0 2px 4px rgba(0,0,0,.7); }

/* tempo readout, same family as the amp's knob values */
.rg-bpm {
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  gap: 5px;
  padding: 7px 8px 6px;
  border: 1px solid #000;
  border-radius: 5px;
  background: #0d0707;
  box-shadow: inset 0 1px 4px rgba(0,0,0,.9), 0 1px 0 rgba(255,255,255,.16);
}

.rg-bpm b {
  font: 700 16px/1 ui-monospace, Consolas, monospace;
  color: #ffb3a8;
  text-shadow: 0 0 9px rgba(255,74,46,.75);
}

.rg-bpm small {
  font: 700 9px/1 var(--body);
  letter-spacing: .12em;
  color: #b9756b;
}

/* ----- riff / song options and export ----- */
.rg-opts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
}

.seg {
  display: inline-flex;
  gap: 3px;
  padding: 3px;
  border-radius: 8px;
}

.seg button {
  padding: 7px 14px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: #a9aab0;
  font: 700 11px/1 var(--body);
  letter-spacing: .14em;
  text-transform: uppercase;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.seg button.active {
  border-color: #ff6a52;
  background: linear-gradient(#e2332a, #a8150f);
  color: #fff;
  text-shadow: 0 1px 0 rgba(0,0,0,.45);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.3), 0 0 12px rgba(215,38,30,.55);
}

.opt select {
  -webkit-appearance: none;
  appearance: none;
  padding: 9px 30px 9px 11px;
  color: #fff;
  letter-spacing: .08em;
  text-shadow: none;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23ff6a52' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") right 10px center / 10px 7px no-repeat,
    linear-gradient(#26272c, #17171a);
}

.opt select option { background: #17171a; color: #fff; text-transform: none; letter-spacing: 0; }

.riff-actions { display: flex; gap: 8px; margin-left: auto; }
.riff-actions .btn { display: inline-flex; align-items: center; gap: 7px; padding: 8px 12px; white-space: nowrap; }
.riff-actions .btn svg { flex: none; color: #ff6a52; }

/* share link */
.share-box {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 7px 14px;
  padding: 8px 8px 8px 14px;
}

.share-box p {
  margin: 0;
  color: #9fe0a8;
  font: 600 12.5px/1.35 ui-monospace, Consolas, monospace;
}

.share-box input {
  width: 100%;
  padding: 7px 9px;
  border: 1px solid #26262b;
  border-radius: 5px;
  background: #050506;
  color: #d9d9dc;
  font: 12px/1.2 ui-monospace, Consolas, monospace;
}

/* ----- song strip ----- */
.timeline {
  display: flex;
  gap: 3px;
  padding: 5px;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: #3a3b42 transparent;
}

.tl-block {
  --pad-a: #45464e;
  --pad-b: #2c2d33;
  position: relative;
  flex: 1 0 0;
  min-width: 52px;
  padding: 11px 3px 10px;
  border: 1px solid #000;
  border-radius: 5px;
  background: linear-gradient(180deg, var(--pad-a), var(--pad-b));
  color: #f4f2ee;
  font: 700 10.5px/1 var(--body);
  letter-spacing: .07em;
  text-transform: uppercase;
  text-shadow: 0 1px 0 rgba(0,0,0,.6);
  white-space: nowrap;
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.2), inset 0 -2px 0 rgba(0,0,0,.3);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.tl-block.r-C { --pad-a: #c12a22; --pad-b: #7d1510; }
.tl-block.r-P { --pad-a: #86651a; --pad-b: #56400f; }
.tl-block.r-B { --pad-a: #35556f; --pad-b: #213547; }
.tl-block.r-S { --pad-a: #9c7915; --pad-b: #6a510b; }
.tl-block.r-T { --pad-a: #2f6c64; --pad-b: #1c433e; }
.tl-block.r-E { --pad-a: #26272c; --pad-b: #17171a; color: #c9cacf; }

/* the section that is playing: lit, with no filter so its progress bar stays cheap to draw */
.tl-block.now {
  border-color: #fff;
  background:
    linear-gradient(rgba(255,255,255,.16), rgba(255,255,255,.16)),
    linear-gradient(180deg, var(--pad-a), var(--pad-b));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.3), 0 0 12px rgba(255,255,255,.4);
}

/* progress through the section; a transform, so it costs the phone nothing while audio plays */
.tl-block.now::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,.22);
  transform-origin: 0 50%;
  transform: scaleX(0);
  animation: tlfill var(--dur, 2s) linear forwards;
}
@keyframes tlfill { to { transform: scaleX(1); } }

@media (hover: hover) {
  .gen-btn:hover { filter: brightness(1.1); }
  .rg-key:hover { filter: brightness(1.15); }
  .sw:hover,
  .riff-actions .btn:hover:not(:disabled),
  .opt select:hover,
  .tl-block:hover { filter: brightness(1.2); }
  .riff-actions .btn:hover { border-color: #000; }
  .seg button:hover { color: #fff; }
}


/* a key whose tray is open stays pressed in */
.riff-actions .btn.open,
.mem-btn.open {
  color: #fff;
  background: linear-gradient(#17171a, #222327);
  box-shadow: inset 0 2px 6px rgba(0,0,0,.75), 0 1px 0 rgba(255,255,255,.1);
}

/* ----- My songs ----- */
.library { padding: 6px; }

.lib-list {
  display: grid;
  gap: 4px;
  max-height: 312px;
  margin: 0;
  padding: 0;
  list-style: none;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #3a3b42 transparent;
}

.lib-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 6px;
  padding: 4px 6px 4px 4px;
  border: 1px solid #000;
  border-radius: 6px;
  background: linear-gradient(#1d1e22, #151518);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
}

.lib-item.now {
  border-color: #6b1a14;
  background: linear-gradient(#2c1513, #1b0d0c);
  box-shadow: inset 3px 0 0 var(--red-hot), inset 0 1px 0 rgba(255,255,255,.06);
}

.lib-open {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 6px 8px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.lib-open b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #f2f2f2;
  font: 700 14px/1.2 var(--body);
}

.lib-item.now .lib-open b { color: #ffe9e4; }

.lib-open span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #a9aab0;
  font: 600 11.5px/1.2 ui-monospace, Consolas, monospace;
}

.lib-date { font-style: normal; }
.lib-act { display: inline-flex; align-items: center; justify-content: center; min-width: 36px; padding: 8px 10px; }
.lib-act svg { color: #ff6a52; }
.lib-del.arm { color: #fff; background: linear-gradient(#e2332a, #a8150f); border-color: #ff6a52; }

.lib-name {
  min-width: 0;
  padding: 8px 9px;
  border: 1px solid #5a4a1e;
  border-radius: 5px;
  background: #050506;
  color: #fff;
  font: 700 14px/1.2 var(--body);
}

.lib-empty {
  padding: 14px 10px;
  color: #c9cacf;
  font: 600 12.5px/1.4 ui-monospace, Consolas, monospace;
}

.lib-empty b { color: #fff; }

.lib-note {
  margin: 7px 6px 2px;
  color: #8d8e95;
  font-size: 12px;
}

/* ----- Export tray ----- */
.export-box { display: grid; gap: 8px; padding: 6px; }

.ex-opts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
}

.ex-opt {
  display: grid;
  gap: 6px;
  padding: 11px 13px;
  border: 1px solid #000;
  border-radius: 6px;
  background: linear-gradient(180deg, #3b3c43, #1e1f23 58%, #27282d);
  color: #e9e9ec;
  text-align: left;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.2), inset 0 -3px 0 rgba(0,0,0,.35);
  -webkit-tap-highlight-color: transparent;
}

.ex-opt b { font: 700 12px/1 var(--body); letter-spacing: .14em; text-transform: uppercase; }
.ex-opt span { color: #b9bbc1; font-size: 12.5px; line-height: 1.35; }
.ex-opt:active:not(:disabled) { transform: translateY(1px); box-shadow: inset 0 2px 6px rgba(0,0,0,.65); }
.ex-opt:disabled { opacity: .45; cursor: not-allowed; }
.ex-opt:focus-visible,
.lib-open:focus-visible,
.lib-act:focus-visible,
.mem-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

.ex-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 2px 6px 4px;
}

.ex-bar {
  flex: 1 1 100%;
  height: 8px;
  overflow: hidden;
  border: 1px solid #000;
  border-radius: 4px;
  background: #08080a;
}

.ex-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #a8150f, #ff4a2e);
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform .25s linear;
}

.ex-status p {
  flex: 1 1 260px;
  margin: 0;
  color: #ffb3a8;
  font: 600 12.5px/1.4 ui-monospace, Consolas, monospace;
}

.ex-status .btn { display: inline-flex; align-items: center; padding: 9px 14px; text-decoration: none; }

@media (hover: hover) {
  .mem-btn:hover:not(:disabled),
  .lib-act:hover,
  .ex-opt:hover:not(:disabled) { filter: brightness(1.2); }
  .lib-open:hover b { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
}

/* ----- narrower screens ----- */
@media (max-width: 900px) {
  .rg-main { grid-template-columns: minmax(0, 1fr); }
  .rg-transport .gen-btn { flex: 1 1 auto; }
}

/* same point where the amp stacks: the mixer becomes three rows */
@media (max-width: 860px) {
  .rg-mix { grid-template-columns: minmax(0, 1fr); gap: 6px; }
}

@media (max-width: 700px) {
  .share-box { grid-template-columns: minmax(0, 1fr); padding: 10px; }
  .ex-opts { grid-template-columns: minmax(0, 1fr); }
  .ex-opt { grid-template-columns: 80px minmax(0, 1fr); align-items: center; }
}

/* phones: everything under the mixer lines up on two columns */
@media (max-width: 520px) {
  .riffgen { padding: 8px; border-radius: 12px; }
  .rg-face { gap: 10px; padding: 12px 12px 14px; }
  .rg-name { font-size: 18px; }
  .rg-memory { flex: 1 1 100%; }
  .mem-btn { flex: 1 1 0; justify-content: center; }
  .gen-btn { min-height: 50px; padding: 6px 10px; font-size: 17px; line-height: 1.05; gap: 8px; white-space: normal; text-align: center; }
  .rg-key { min-width: 54px; padding: 6px 8px; gap: 6px; }
  .rg-key.sw { padding: 6px 8px; gap: 6px; }
  .rg-lcd { padding: 9px 12px; }
  .riff-info { gap: 5px; font-size: 12px; }
  .lcd-title { font-size: 19px; letter-spacing: .03em; }
  .lcd-meta { gap: 2px 14px; }
  .lcd-meta .f-style,
  .lcd-meta .f-bpm { display: none; } /* the style is in the amp name, the tempo right below */
  .rg-ch { gap: 10px; }
  .rg-ch .sw { padding: 8px 12px; }
  .rg-opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 10px; }
  .seg { display: flex; }
  .seg button { flex: 1 1 0; padding: 7px 4px; }
  .opt { display: flex; }
  .opt select { flex: 1 1 auto; min-width: 0; }
  .rg-opts > .sw { padding: 8px 12px; }
  .riff-actions { grid-column: 1 / -1; gap: 10px; margin-left: 0; }
  .riff-actions .btn { flex: 1 1 0; justify-content: center; min-width: 0; padding: 9px 6px; }
  .lib-act { padding: 9px 9px; }
  .lib-date { display: none; } /* newest first anyway; room for the name */
  .tl-block { min-width: 58px; padding: 10px 3px 9px; }
}

@media (max-width: 340px) {
  .gen-btn { font-size: 15px; }
  .gen-btn svg { display: none; }
  .rg-key { min-width: 50px; }
  .rg-ch > :first-child { flex-basis: 92px; }
  .rg-opts > .sw,
  .riff-actions .btn { letter-spacing: .08em; }
  .opt select { padding: 9px 24px 9px 8px; letter-spacing: .04em; background-position: right 8px center, 0 0; }
}

@media (prefers-reduced-motion: reduce) {
  .play-btn.pulse { animation: none; box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 0 0 3px rgba(255,74,46,.45); }
}

/* ---------- Tab ---------- */
.tab-wrap { margin-top: 26px; }

.tab-title {
  font-family: var(--display);
  font-weight: normal;
  letter-spacing: .04em;
  text-transform: uppercase;
  font-size: 24px;
  margin: 0 0 10px;
}

.tabgrid {
  display: flex;
  overflow-x: auto;
  padding: 10px 8px;
  background: #0a0a0c;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: 13px/1 ui-monospace, Consolas, monospace;
}

.tcol {
  display: flex;
  flex-direction: column;
  min-width: 22px;
  flex: 1 0 22px;
  border-radius: 4px;
  transition: background .08s;
}

.tcol span {
  position: relative;
  height: 20px;
  display: grid;
  place-items: center;
  color: #ffb3a8;
}

/* the string line */
.tcol span:not(.tpm)::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  border-top: 1px solid #3a3a42;
  z-index: 0;
}

.tcol span b {
  position: relative;
  z-index: 1;
  padding: 0 2px;
  background: #0a0a0c;
  color: #fff;
  font-weight: 700;
}
.tcol.now span b { background: #3a1513; }

.tcol .tpm { color: var(--red-hot); font-size: 11px; height: 16px; }

.tcol.beat { border-left: 1px dashed #26262d; }

/* chord names over the tab (clean and acoustic styles); a name may run over the next steps */
.tcol span.tch {
  height: 18px;
  justify-items: start;
  padding-left: 3px;
  color: #ffd27a;
  font: 700 12px/1 var(--body);
  white-space: nowrap;
  z-index: 2;
}
.tcol span.tch::before { display: none; }
.tcol.bar { border-left: 2px solid var(--red); }

.tlabels { min-width: 22px; flex: 0 0 22px; }
.tlabels span { color: var(--muted); font-weight: 700; }
.tlabels span::before { display: none; }

.tcol.now { background: rgba(215, 38, 30, .28); }

.tab-hint { margin: 8px 0 0; color: var(--muted); font-size: 13px; }

/* ---------- Recorder ---------- */
.rec-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  font: 600 13px/1 var(--body);
  cursor: pointer;
}
.rec-btn:hover { border-color: #55555f; }
.rec-dot { width: 11px; height: 11px; border-radius: 50%; background: #d7261e; }
.rec-btn.on { border-color: var(--red); background: #2a1514; }
.rec-btn.on .rec-dot { animation: blink 1s steps(2, start) infinite; box-shadow: 0 0 8px var(--red-hot); }
@keyframes blink { to { visibility: hidden; } }
.rec-time { font: 600 12px/1 ui-monospace, Consolas, monospace; color: #ffb3a8; }

.rec-msg { margin: 8px 0 0; text-align: center; color: var(--muted); font-size: 13px; min-height: 1em; }

.takes { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.take {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-2);
}
.take-name { font-size: 13.5px; color: #fff; min-width: 180px; }
.take audio { height: 34px; flex: 1 1 240px; }
.take-dl { text-decoration: none; }

.toggles-left { display: flex; flex-wrap: wrap; gap: 8px 18px; }

/* ---------- Key labels ---------- */
.fret .dot .kk { display: none; }
.show-keys .fret[data-key] .dot { opacity: .9; transform: scale(.85); }
.show-keys .fret[data-key] .dot .nn { display: none; }
.show-keys .fret[data-key] .dot .kk { display: inline; color: #ffd27a; }
@media (pointer: coarse) { .desktop-only { display: none !important; } }

.right-btns { display: flex; gap: 8px; }
.right-btns .btn { display: inline-flex; align-items: center; gap: 6px; }

/* ---------- Full-screen stage ---------- */
.stage-bar, .rotate-hint { display: none; }

body.stage-mode { overflow: hidden; }
body.stage-mode .stage {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: max(6px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) max(6px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
  background: var(--bg);
}
body.stage-mode .stage-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  flex: 0 0 auto;
}
.sbtn, #stageStyle {
  flex: 0 0 auto;
  padding: 7px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  font: 600 13px/1 var(--body);
}
.sbtn.switch { display: inline-flex; gap: 6px; }
.sgen { background: linear-gradient(#e2332a, #a8150f); border-color: #ff6a52; color: #fff; }
.sexit { margin-left: auto; }
body.stage-mode .status { margin: 0; min-height: 0; flex: 0 0 auto; }
body.stage-mode .readout span { font-size: 22px; }
body.stage-mode .readout small { font-size: 12px; }
body.stage-mode .loader, body.stage-mode .swipe-hint { display: none; }
body.stage-mode .neck-wrap { flex: 1 1 auto; min-height: 0; overflow: hidden; border-radius: 8px; }
body.stage-mode .neck {
  --open-col: 48px;
  min-width: 0;
  height: 100%;
  padding: 4px 0;
  grid-template-rows: repeat(6, minmax(0, 1fr)) auto;
  touch-action: none;
}
body.stage-mode .inlay { gap: 0; justify-content: space-evenly; }
body.stage-mode .inlay i + i { margin-top: 0; }
body.stage-mode .fret .dot { width: 26px; height: 26px; }

@media (orientation: portrait) {
  body.stage-mode .rotate-hint {
    display: block;
    margin: 0;
    padding: 6px;
    text-align: center;
    color: #ffd27a;
    font-size: 13px;
  }
}

/* ---------- Multi-part tabs + editor ---------- */
.tab-hint.top { margin: 0 0 10px; }
.tabpart { margin-bottom: 14px; }
.tabhead { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.tabhead > b { font-size: 15px; }
.tabhead small { color: var(--muted); }
.tabpart.playing .tabhead > b { color: var(--red-hot); }
.locks { display: flex; gap: 6px; margin-left: auto; flex-wrap: wrap; }
.lockbtn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--panel); color: var(--muted);
  font: 600 12px/1 var(--body); cursor: pointer;
}
.lockbtn.on { color: #fff; border-color: #c9a227; background: #3a3112; }
.tcell { cursor: pointer; }
.tcell:hover { background: rgba(255,255,255,.06); }
.tcell.sel { outline: 2px solid #ffd27a; outline-offset: -2px; border-radius: 3px; background: rgba(255,210,122,.12); }
.tcol .tpm[role="button"] { cursor: pointer; }

.tab-editor {
  margin: 4px 0 10px;
  padding: 12px 14px;
  border: 1px solid #5a4a1e;
  border-radius: 10px;
  background: #18150c;
}
.ed-head { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: baseline; margin-bottom: 10px; }
.ed-head b { color: #ffd27a; font-size: 14px; }
.ed-keys { color: var(--muted); font-size: 12px; }
.ed-frets { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.fbtn {
  min-width: 38px; padding: 8px 0; border-radius: 6px;
  border: 1px solid var(--line); background: var(--panel); color: var(--text);
  font: 700 14px/1 ui-monospace, Consolas, monospace; cursor: pointer;
}
.fbtn.on { background: var(--red); border-color: var(--red); color: #fff; }
.ed-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.ed-actions .btn.on { border-color: var(--red); color: #fff; }

.styles .row-break { flex-basis: 100%; height: 0; }

[hidden] { display: none !important; }

/* bend / vibrato marks in the tab */
.tcol span b i {
  position: absolute;
  top: -6px;
  right: -7px;
  font: 700 9px/1 ui-monospace, Consolas, monospace;
  font-style: normal;
  color: #ffd27a;
  pointer-events: none;
}

/* ---------- Song arranger (under the song bar) ---------- */
.arr-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: -6px;
}
.arr-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; flex: 1 1 auto; min-width: 0; }
.arr-hint { color: #c9c6c0; font-size: 12.5px; text-shadow: 0 1px 1px rgba(0,0,0,.6); }
.arr-sel { display: inline-flex; align-items: baseline; gap: 7px; margin-right: 4px; color: #fff; text-shadow: 0 1px 1px rgba(0,0,0,.6); }
.arr-sel b { font: 700 12px/1 var(--body); letter-spacing: .1em; text-transform: uppercase; }
.arr-sel small { color: #c9c6c0; font-size: 12px; }
.arr-group { display: inline-flex; align-items: center; gap: 3px; }
.arr-num { min-width: 52px; text-align: center; color: #ffb3a8; font: 600 12px/1 ui-monospace, Consolas, monospace; }
.arr-bar .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 32px; padding: 7px 11px; white-space: nowrap;
  border: 1px solid #000; border-radius: 6px;
  background: linear-gradient(#26272c, #17171a); color: #ddd;
  font: 700 11px/1 var(--body); letter-spacing: .12em; text-transform: uppercase;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 1px 0 rgba(255,255,255,.1);
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.arr-bar .btn.arr-ico { min-width: 32px; padding: 7px 8px; letter-spacing: 0; font-size: 12px; }
.arr-bar .btn:disabled { opacity: .4; cursor: default; }
.arr-bar .btn:active:not(:disabled) { transform: translateY(1px); }
.arr-bar .btn.on { color: #fff; background: linear-gradient(#50211d, #2b1210); }
.arr-bar .btn.arr-del { color: #ffb3a8; }
.arr-bar .btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.arr-key { flex: none; margin-left: auto; }
.arr-key .led {
  width: 9px; height: 9px; border-radius: 50%; background: #3a1210;
  box-shadow: inset 0 1px 1px rgba(0,0,0,.6);
}
.arr-key.on { color: #fff; }
.arr-key.on .led { background: var(--red-hot); box-shadow: 0 0 8px var(--red-hot), 0 0 2px #fff inset; }
.arr-add select { min-height: 32px; }

/* the song bar while arranging */
.timeline.arranging .tl-block { cursor: grab; }
.timeline.arranging.dragging .tl-block { cursor: grabbing; }
.tl-block.sel { border-color: #ffd27a; box-shadow: inset 0 1px 0 rgba(255,255,255,.3), 0 0 0 2px #ffd27a; z-index: 1; }
.tl-block.alone { background-image: repeating-linear-gradient(135deg, rgba(0,0,0,.28) 0 4px, transparent 4px 9px), linear-gradient(180deg, var(--pad-a), var(--pad-b)); }
.tl-block.now.still::after { animation: none; transform: scaleX(0); }

@media (hover: hover) {
  .arr-bar .btn:hover:not(:disabled) { filter: brightness(1.2); }
}
@media (max-width: 700px) {
  .arr-bar { flex-direction: column-reverse; align-items: stretch; }
  .arr-key { margin-left: 0; align-self: flex-end; }
}

/* ---------- Tab toolbar: play, undo, clear ---------- */
.tab-top { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 16px; margin: 0 0 10px; }
.tab-top .tab-title { margin: 0; }
.tab-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.tbtn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--panel); color: var(--text);
  font: 600 13px/1 var(--body); cursor: pointer;
}
.tbtn:disabled { opacity: .45; cursor: default; }
.tbtn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.tbtn.tplay { padding: 8px 18px; border-color: #ff6a52; background: linear-gradient(#e2332a, #a8150f); color: #fff; font-weight: 700; }
.tbtn.tplay.on { background: linear-gradient(#50211d, #2b1210); }
.lockbtn.playhere { color: #fff; border-color: #6a2a24; background: #2a1514; }
@media (hover: hover) {
  .tbtn:hover:not(:disabled) { border-color: #55555f; }
  .tbtn.tplay:hover { filter: brightness(1.1); }
}

/* three buttons in the action row on phones: tighter lettering, and no icons on the narrowest */
@media (max-width: 520px) {
  .riff-actions { gap: 6px; }
  .riff-actions .btn { gap: 5px; padding: 9px 4px; letter-spacing: .05em; }
}
@media (max-width: 380px) {
  .riff-actions .btn svg { display: none; }
}

/* guitar switch inside its case on narrow phones */
@media (max-width: 520px) {
  .inst-switch button { min-width: 0; }
}
@media (max-width: 400px) {
  .inst-switch button { font-size: 13.5px; gap: 5px; padding: 9px 2px; letter-spacing: .03em; }
  .inst-switch .led { width: 7px; height: 7px; }
}
@media (max-width: 340px) {
  .inst-switch button { font-size: 12px; }
  .inst-switch .led { display: none; }
}
@media (max-width: 520px) {
  .inst-switch button { flex: 1 1 auto; }
}
@media (max-width: 440px) {
  .inst-switch button { font-size: 13.5px; gap: 5px; padding: 9px 3px; letter-spacing: .03em; }
  .inst-switch .led { width: 7px; height: 7px; }
}
@media (max-width: 380px) {
  .riff-actions { flex-wrap: wrap; }
  .riff-actions #riffBlank { flex-basis: 100%; }
  .riff-actions .btn svg { display: inline; }
}
@media (max-width: 340px) {
  .inst-switch button { font-size: 12px; }
  .inst-switch .led { display: none; }
}

/* ---------- Loading a MIDI file ---------- */
.midi-box { grid-template-columns: minmax(0, 1fr); }
.midi-box p { color: #ffd27a; }
.midi-pick { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.midi-pick .opt { flex: 1 1 260px; min-width: 0; }
.midi-pick select { width: 100%; }
.midi-pick .btn {
  display: inline-flex; align-items: center; min-height: 32px; padding: 7px 14px;
  border: 1px solid #000; border-radius: 6px; background: linear-gradient(#26272c, #17171a); color: #ddd;
  font: 700 11px/1 var(--body); letter-spacing: .12em; text-transform: uppercase; cursor: pointer;
}
.midi-pick #midiLoad { color: #fff; background: linear-gradient(#e2332a, #a8150f); }
.lib-midi {
  display: flex; align-items: center; gap: 8px; width: 100%; margin: 8px 0 0; padding: 9px 12px;
  border: 1px dashed #3a3b42; border-radius: 6px; background: transparent; color: #d9d6d0;
  font: 600 13px/1 var(--body); cursor: pointer; text-align: left;
}
.lib-midi svg { color: #ff6a52; }
.lib-midi:hover { border-color: #6a6b72; color: #fff; }
.lib-midi:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.midi-pick .sw small { color: #9a968f; font-weight: 500; letter-spacing: 0; text-transform: none; margin-left: 4px; }

/* ---------- Help ---------- */
.header-right { display: flex; align-items: center; gap: 16px; }
.help-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--panel); color: var(--text);
  font: 600 14px/1 var(--body); cursor: pointer;
}
.help-btn svg { color: var(--red-hot); }
.help-btn:focus-visible, .help-close:focus-visible, .help summary:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
@media (hover: hover) { .help-btn:hover { border-color: #55555f; } }
@media (max-width: 600px) { .tagline { display: none; } }

.help {
  width: min(760px, calc(100vw - 24px));
  max-height: calc(100vh - 40px);
  padding: 0;
  border: 1px solid #000;
  border-radius: 14px;
  background: #141418;
  color: var(--text);
  box-shadow: 0 30px 80px rgba(0,0,0,.7);
  overflow: hidden;
}
.help[open] { display: flex; flex-direction: column; }
.help::backdrop { background: rgba(0,0,0,.65); }
.help-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 20px; background: var(--brushed); border-bottom: 1px solid #000;
}
.help-head h2 { margin: 0; font-family: var(--display); font-weight: normal; font-size: 24px; letter-spacing: .04em; text-transform: uppercase; text-shadow: 0 1px 1px rgba(0,0,0,.6); }
.help-close {
  width: 34px; height: 34px; border-radius: 50%; border: 1px solid #000;
  background: linear-gradient(#26272c, #17171a); color: #ddd; font-size: 15px; cursor: pointer;
}
.help-body { overflow-y: auto; padding: 18px 22px 22px; font-size: 15px; line-height: 1.6; }
.help-body ul, .help-body ol { margin: 8px 0 4px; padding-left: 22px; }
.help-body li { margin: 5px 0; }
.help-body li ul { margin: 4px 0; }
.help-body p { margin: 10px 0 0; color: #cfcbc4; }
.help-body code { font: 13px ui-monospace, Consolas, monospace; color: #ffb3a8; }
.help-quick {
  padding: 14px 18px 16px; margin-bottom: 14px;
  border: 1px solid #5a2a24; border-radius: 10px; background: #1d1211;
}
.help-quick h3 { margin: 0; font-family: var(--display); font-weight: normal; font-size: 20px; letter-spacing: .05em; text-transform: uppercase; color: #ffb3a8; }
.help-quick ol li::marker { color: var(--red-hot); font-weight: 700; }
.help details { border-top: 1px solid var(--line); }
.help details:last-child { border-bottom: 1px solid var(--line); }
.help summary {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 4px; cursor: pointer; list-style: none;
  font-weight: 700; font-size: 16px;
}
.help summary::-webkit-details-marker { display: none; }
.help summary::after { content: "+"; color: var(--red-hot); font-size: 20px; font-weight: 400; line-height: 1; }
.help details[open] summary::after { content: "\2212"; }
.help details > ul { margin: 0 0 14px; }
@media (max-width: 520px) {
  .help { max-height: calc(100vh - 16px); width: calc(100vw - 12px); }
  .help-body { padding: 14px 14px 18px; font-size: 14.5px; }
}
.help-body:focus { outline: none; }

/* the tab before there is a song */
.tab-empty {
  padding: 22px 20px; border: 1px dashed #3a3b42; border-radius: 10px; background: #0d0d10; text-align: center;
}
.tab-empty p { margin: 0 0 14px; color: #cfcbc4; }
.tab-empty-btns { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.tab-wrap.empty > .tab-hint:not(.top) { display: none; }
.tab-wrap.empty .tab-tools { display: none; }
