:root {
  color-scheme: dark;
  --cream: #efe2bd;
  --legend: #e0c7b0;
  --ink: #380f1a;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: #d8a2ad;
  color: #56142a;
  font-family: Arial, Helvetica, sans-serif;
  min-height: 100vh;
}
button,
input {
  font: inherit;
}
button {
  cursor: pointer;
}
button:where(:not(#power)):focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid #fff2cb;
  outline-offset: 4px;
}
main {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 30px 3vw;
}
.topline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  letter-spacing: 2px;
  margin-bottom: 24px;
}
.edition {
  color: #794253;
  font-size: 9px;
}
.topline button,
.below button {
  background: none;
  color: #571326;
  border: 0;
  border-bottom: 1px solid #685058;
  padding: 10px 0;
  font-size: 11px;
  letter-spacing: 0.5px;
}
.stage {
  width: 100%;
  overflow: auto;
  padding: 15px 0 38px;
  scrollbar-color: #74374c #231d24;
}
.instrument-wrap {
  position: relative;
  margin: auto;
}
.instrument {
  position: absolute;
  width: 1100px;
  height: 600px;
  transform-origin: top left;
  user-select: none;
  color: var(--legend);
  font-size: 9px;
  filter: drop-shadow(0 25px 15px #0e080e80);
}
.body-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}
.panel {
  position: absolute;
  border: 0;
  background: none;
}
.panel h2 {
  font-size: 10px;
  text-align: center;
  font-weight: 500;
  margin: 3px 0 0;
  line-height: 12px;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.physical {
  display: block;
  width: 25px;
  height: 17px;
  border-radius: 5px;
  border: 1px solid #382a23;
  background: linear-gradient(#f7eed5, #e1d0af);
  box-shadow:
    0 2px 1px #20080f,
    inset 0 1px 1px #fff9df70;
  padding: 0;
  touch-action: none;
}
.physical:active,
.physical[aria-pressed="true"] {
  box-shadow: inset 0 1px 3px #0006;
  transform: translateY(1px);
}
.physical.red {
  background: linear-gradient(#d34045, #9b122b);
}
.physical.blue {
  background: linear-gradient(#438ca6, #145574);
}
.physical.grey {
  background: linear-gradient(#f1e6c8, #dfcfae);
}
.physical.yellow {
  background: linear-gradient(#f1d887, #cba855);
}
.led {
  display: inline-block;
  flex-shrink: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4a2831;
  border: 1px solid #2f1020;
  box-shadow: inset 0 1px 1px #130409;
  vertical-align: middle;
}
.led.on {
  background: #ed7d65;
  box-shadow: 0 0 4px #fc7855;
  border-color: #963d35;
}
.power-control {
  position: absolute;
  left: 107px;
  top: 125px;
  display: grid;
  justify-items: center;
  gap: 4px;
}
.power-control span {
  font-size: 8px;
}
.master-control {
  position: absolute;
  left: 77px;
  top: 177px;
  width: 62px;
}
.keyboard-control {
  position: absolute;
  left: 253px;
  top: 49px;
  display: flex;
  gap: 6px;
  align-items: center;
}
.keyboard-control span {
  font-size: 10px;
  text-decoration: underline;
}
.keyboard-control .physical {
  width: 25px;
  height: 16px;
}
.voice-panel {
  left: 164px;
  top: 91px;
  width: 179px;
  height: 66px;
}
.pattern-panel {
  left: 164px;
  top: 166px;
  width: 179px;
  height: 68px;
}
.selector-bank {
  display: flex;
  gap: 4px;
  position: absolute;
  left: 6px;
  right: 6px;
  top: 16px;
  align-items: center;
}
.selector {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 24px;
  gap: 4px;
  position: relative;
}
.selector .physical {
  width: 24px;
  height: 16px;
}
.selector span {
  font-size: 6.3px;
  white-space: nowrap;
}
.selector .led {
  width: 5px;
  height: 5px;
  position: absolute;
  top: 1px;
}
.selector .upper {
  margin-top: 8px;
}
.selector .lower {
  margin-top: -1px;
}
.selector.bank {
  width: 24px;
  gap: 8px;
}
.selector.bank .led {
  position: static;
}
.string-controls {
  left: 369px;
  top: 88px;
  width: 156px;
  height: 65px;
}
.rhythm-controls {
  left: 352px;
  top: 161px;
  width: 107px;
  height: 70px;
}
.chord-controls {
  left: 465px;
  top: 161px;
  width: 60px;
  height: 70px;
}
.knob-row {
  display: flex;
  justify-content: space-evenly;
  margin-top: 6px;
}
.knob-control {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 8px;
  white-space: nowrap;
}
.knob {
  display: block;
  position: relative;
  width: 33px;
  height: 33px;
  border-radius: 50%;
  background: repeating-conic-gradient(#b4a28a 0 4deg, #e3d8be 4deg 8deg);
  border: 1px solid #322423;
  box-shadow:
    0 2px 3px #18020a,
    0 0 0 2px #ceb79936;
  touch-action: none;
  cursor: ns-resize;
}
.knob:after {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: linear-gradient(125deg, #fff7df, #e2d3b6);
  box-shadow:
    inset 0 1px 2px #fff8eb,
    0 1px 2px #4c322e;
}
.knob:before {
  content: "";
  position: absolute;
  z-index: 2;
  left: 15px;
  top: 5px;
  width: 2px;
  height: 11px;
  background: #6c4340;
  transform: rotate(var(--turn));
  transform-origin: 1px 11px;
}
.knob input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 1px;
  height: 1px;
}
.chord-controls .knob-control {
  margin-top: 6px;
}
.chord-panel {
  position: absolute;
  left: 64px;
  top: 240px;
  width: 461px;
  height: 134px;
}
#chordGrid {
  position: relative;
  width: 100%;
  height: 100%;
}
.root-label {
  position: absolute;
  top: 3px;
  font-size: 8px;
  text-align: center;
  width: 23px;
}
.row-label {
  position: absolute;
  left: 4px;
  font-size: 8px;
}
.chord-button {
  position: absolute;
  width: 23px;
  height: 29px;
  border-radius: 6px;
  border: 1px solid #2b171b;
  background: linear-gradient(110deg, #f7eccf, #e7d7b6);
  box-shadow:
    0 2px 1px #230612,
    inset 0 1px 1px #fffaeb80;
  touch-action: none;
}
.chord-button.grey {
  background: linear-gradient(110deg, #f1e6c8, #dfcfae);
}
.chord-button.active,
.chord-button[aria-pressed="true"] {
  box-shadow: inset 0 2px 3px #311923aa;
  background: #dba88d;
  transform: translateY(2px);
}
.brand {
  position: absolute;
  left: 126px;
  top: 420px;
  width: 278px;
  height: 85px;
}
.brand img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 1px 0 #2d071655);
}
.realtime {
  left: 428px;
  top: 381px;
  width: 101px;
  height: 144px;
}
.realtime h2 {
  font-size: 8px;
}
.mode-legend {
  position: absolute;
  left: 54px;
  top: 15px;
  display: grid;
  gap: 3px;
  font-size: 7px;
}
.mode-legend span,
.sync-legend span {
  display: flex;
  align-items: center;
  gap: 3px;
}
#autoBass {
  position: absolute;
  left: 53px;
  top: 32px;
}
.chord-legend {
  position: absolute;
  left: 37px;
  top: 51px;
  font-size: 7px;
}
.hold-legend {
  position: absolute;
  left: 55px;
  top: 55px;
  font-size: 7px;
}
#chordHold {
  position: absolute;
  left: 53px;
  top: 66px;
}
.rhythm-legend {
  position: absolute;
  left: 13px;
  top: 65px;
  font-size: 7px;
}
.sync-legend {
  position: absolute;
  left: 12px;
  top: 75px;
  display: grid;
  gap: 2px;
  font-size: 7px;
}
#rhythmStart {
  position: absolute;
  left: 10px;
  top: 98px;
}
.strum-frame {
  position: absolute;
  left: 539px;
  top: 108px;
  width: 107px;
  height: 308px;
}
#strumplate {
  position: absolute;
  left: 7px;
  top: 8px;
  width: 96px;
  height: 288px;
  background: repeating-linear-gradient(
    to bottom,
    #e2cf8c 0 2px,
    #51492f 2px 3px,
    #bba963 3px 5px
  );
  clip-path: polygon(0 0, 100% 6%, 100% 96%, 0 100%);
  box-shadow: inset 0 0 5px #f4e6be66;
  touch-action: none;
  cursor: crosshair;
}
#strumplate:focus-visible {
  outline-offset: -4px;
}
.strum-flash {
  position: absolute;
  left: 0;
  right: 0;
  height: 7.7%;
  pointer-events: none;
  background: #fff3c78c;
  box-shadow: 0 0 12px #f6d7a480;
}
.strum-dots {
  position: absolute;
  left: 1px;
  top: 7px;
  line-height: 78px;
  font-size: 10px;
  pointer-events: none;
}
.speaker {
  position: absolute;
  left: 700px;
  top: 120px;
  width: 348px;
  height: 288px;
}
.below {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  font-size: 11px;
  color: #571326;
  margin: 0 12px;
}
.below p {
  margin: 0;
}
.below button {
  flex-shrink: 0;
}
#helpPanel {
  position: fixed;
  z-index: 20;
  right: 0;
  top: 0;
  bottom: 0;
  width: min(460px, 100vw);
  overflow: auto;
  background: #251c23f5;
  backdrop-filter: blur(15px);
  padding: 26px 28px;
  box-shadow: -15px 0 60px #10080d88;
  border-left: 1px solid #704753;
  color: #d8c7c9;
  font-size: 13px;
  line-height: 1.7;
}
#helpPanel[hidden] {
  display: none;
}
.drawer-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.drawer-heading h1 {
  font-size: 21px;
  font-weight: 500;
}
.drawer-heading button {
  font-size: 28px;
  padding: 0 10px;
}
#helpPanel h2 {
  font-size: 13px;
  letter-spacing: 1px;
  color: #e4c89d;
  margin-top: 26px;
}
#helpPanel button {
  background: #50303f;
  color: #eddddc;
  border: 1px solid #845465;
  border-radius: 4px;
  padding: 8px 12px;
}
.connection-buttons {
  display: flex;
  gap: 10px;
}
.project-note {
  border-top: 1px solid #533540;
  padding-top: 18px;
  color: #9c878c;
  font-size: 11px;
}
#sampleStatus {
  color: #e3cda6;
}
.learning {
  outline: 1px dashed #d9ba91;
}
@media (min-width: 1600px) {
  main {
    padding-left: 6vw;
    padding-right: 6vw;
  }
}
@media (max-width: 700px) {
  main {
    padding: 18px 12px;
    justify-content: flex-start;
  }
  .topline {
    letter-spacing: 1px;
    margin-bottom: 30px;
  }
  .edition {
    display: none;
  }
  .below {
    align-items: flex-start;
  }
  .stage {
    margin-bottom: 10px;
  }
  .topline button {
    font-size: 10px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
  }
}

.la-background,
.pink-wash {
  position: fixed;
  inset: 0;
  pointer-events: none;
}
.la-background {
  z-index: -2;
  background: url("assets/la.webp") center 52% / cover no-repeat;
  filter: saturate(1.65) contrast(0.68) brightness(1.2) sepia(0.12);
  transform: scale(1.025);
}
.pink-wash {
  z-index: -1;
  background:
    linear-gradient(
      180deg,
      rgba(255, 210, 222, 0.58),
      rgba(244, 164, 184, 0.52)
    ),
    radial-gradient(
      circle at 50% 38%,
      rgba(255, 241, 235, 0.32),
      rgba(128, 0, 32, 0.14)
    );
  backdrop-filter: blur(0.6px);
}
body {
  isolation: isolate;
}
.panel-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
#power:focus,
#power:focus-visible {
  outline: none;
}
#power:focus-visible {
  box-shadow:
    0 2px 1px #20080f,
    inset 0 0 0 2px #d6b985;
}

.string-controls .knob-row {
  margin-top: 2px;
}
.string-controls .knob-control {
  gap: 3px;
}
.rhythm-controls .knob-row {
  margin-top: 4px;
}
.rhythm-controls .knob-control,
.chord-controls .knob-control {
  gap: 4px;
}

.sync-mode {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

main {
  padding-bottom: 112px;
}
.below {
  position: fixed;
  z-index: 8;
  left: 3vw;
  right: 3vw;
  bottom: 22px;
  margin: 0;
  pointer-events: none;
}
.display-plaque {
  max-width: min(390px, 32vw);
  padding: 12px 16px;
  border: 1px solid #7b3044;
  border-radius: 5px;
  color: var(--cream);
  background: #59152b;
  box-shadow:
    0 3px 1px #dfa4b75c,
    inset 0 1px 0 #f0bbcd12;
  line-height: 1.45;
  pointer-events: none;
}
.page-controls {
  display: flex;
  gap: 16px;
  align-items: center;
  pointer-events: auto;
  flex-shrink: 0;
}
.playing-display {
  min-width: 0;
}
#keyboardToggle {
  border: 1px solid #7b3044;
  border-radius: 5px;
  padding: 12px 27px;
  background: #59152b;
  color: var(--cream);
  font-size: 12px;
  letter-spacing: 1px;
  box-shadow:
    0 3px 1px #dfa4b76b,
    inset 0 1px 0 #f0bbcd14;
  transition:
    box-shadow 0.3s ease,
    background 0.3s ease;
}
#keyboardToggle[aria-pressed="true"] {
  background: radial-gradient(ellipse at center, #6b2036, #59152b);
  box-shadow:
    0 3px 1px #dfa4b76b,
    inset 0 0 13px #f4b6cd16;
}
#keyboardOverlay {
  --key-backlight-center: rgba(199, 110, 146, 0.28);
  --key-backlight-edge: rgba(139, 43, 81, 0.46);
  position: fixed;
  z-index: 9;
  bottom: 86px;
  right: 3vw;
  width: min(820px, 78vw);
  padding: 5px 4px 9px;
  background: rgba(255, 216, 230, 0.78);
  border-radius: 10px;
  box-shadow:
    0 4px 18px #571b3024,
    inset 0 0 0 1px #70203924;
  overflow-x: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #78283c70 transparent;
  transform: translateY(calc(100% + 105px));
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    transform 0.42s cubic-bezier(0.2, 0.75, 0.25, 1),
    opacity 0.3s ease,
    visibility 0s 0.42s;
}
.keyboard-open #keyboardOverlay {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition:
    transform 0.42s cubic-bezier(0.2, 0.75, 0.25, 1),
    opacity 0.3s ease,
    visibility 0s;
}
#computerKeyboard {
  display: grid;
  gap: 5px;
  min-width: 680px;
  background: transparent;
}
.computer-key-row {
  display: flex;
  gap: 5px;
  background: transparent;
}
.computer-key {
  flex: var(--key-width) 1 0;
  min-width: 0;
  height: 38px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 3px;
  border: 1.8px solid #702039;
  border-radius: 6px;
  background: transparent;
  color: #65192f;
  font-size: 10px;
  line-height: 1;
  box-shadow: 0 2px 2px #571b3012;
  user-select: none;
  touch-action: none;
}
.key-label {
  white-space: pre-line;
  text-align: center;
  line-height: 1.15;
}
.mapped-key .key-label {
  font-size: 15px;
  font-weight: 600;
}
.computer-key small {
  font-size: 10px;
  font-weight: 500;
}
.computer-key.key-active {
  background: radial-gradient(
    ellipse at center,
    var(--key-backlight-center),
    var(--key-backlight-edge)
  );
  box-shadow:
    inset 0 0 12px #d889aa18,
    0 2px 2px #571b3012;
}
.computer-key:focus-visible {
  outline: 2px solid #762a44;
  outline-offset: 1px;
}
@media (max-width: 700px) {
  #keyboardOverlay {
    width: calc(100vw - 20px);
    right: 10px;
    bottom: 90px;
  }
  #keyboardToggle {
    padding: 11px 15px;
    font-size: 11px;
  }
  .below {
    bottom: 22px;
    left: 12px;
    right: 12px;
    gap: 10px;
    align-items: center;
  }
  .display-plaque {
    max-width: 100%;
    padding: 8px 10px;
    font-size: 10px;
  }
  .page-controls {
    gap: 8px;
  }
  .page-controls button {
    font-size: 9px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .keyboard-open #keyboardOverlay,
  #keyboardOverlay,
  #keyboardToggle,
  main {
    transition: none;
  }
}

#keyboardToggle:focus,
#keyboardToggle:focus-visible {
  outline: none;
}
#keyboardToggle:focus-visible {
  box-shadow:
    0 3px 1px #dfa4b76b,
    inset 0 0 0 1px #e7c89955;
}
