body {
  margin: 0;
  padding: 0;
  overflow: hidden;
  font-family: 'Arial', sans-serif;
  font-size: 14px;
  background: linear-gradient(135deg, #1a2a6c, #b21f1f, #fdbb2d);
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
}
* {
  user-select: none;
}
.container {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 30px;
  box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 20px;
}
#midi-input {
  position: fixed;
  top: 15px;
  right: 50px;
}
.controls,
.key-signature {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 20px;
}
select, button, input {
  margin: 5px;
  padding: 10px 15px;
  background-color: rgba(255, 255, 255, 0.2);
  color: #fff;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}
button#clear-notes {
  position: absolute;
  top: 10px;
  left: 10px;
  background-color: rgba(0, 0, 0, 0.2);
  color: #000;
}
div#scroll-notes-container {
  position: absolute;
  bottom: 10px;
  left: 10px;
  height: 24px;
  line-height: 24px;
  width: 120px;
  background-color: transparent;
  color: #000;
}

input[type=range] {
  padding: 0;    
}

select:hover, button:hover {
  background-color: rgba(255, 255, 255, 0.3);
}
#mute-track {
  width: 40px;
  background-image: url('../images/mute.png');
  opacity: .5;
}
button#mute-track:active {
  opacity: .3;
}
button#mute-track.active {
  opacity: 1.0;
}
#clear-track {
  width: 40px;
  background-image: url('../images/trash.png');
  opacity: .5;
}
button#clear-track:active {
  opacity: .3;
}
button:active {
  opacity: .8;
}
#track-select {
  width: 100px;
}
#instrument-select {
  width: 200px;
}
#key-select {
  width: 80px;
}
#transpose-value {
  margin-top: 10px;
  padding: 5px;
  font-style: italic;
}
.transpose-label {
  display: flex;
  height: 30px;
  line-height: 30px;
}
.transpose-controls {
  display: flex;
  align-items: center;
  border: solid 1px #555;
  border-radius: 10px;
  padding: 0 5px;
  margin-left: 5px;
}
.transpose-controls button {
  width: 30px;
  height: 30px;
  padding: 0;
  margin-top: 10px;
  font-size: 18px;
  line-height: 1;
}
#transpose-value {
  margin: 0 10px;
  width: 40px;
  text-align: center;
  background-color: rgba(255, 255, 255, 0.1);
}
.controls label {
  display: flex;
  height: 30px;
  line-height: 30px;
  padding: 10px 0 0 0;
  margin: 0 10px;
}
.controls select,
.key-signature select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url('data:image/svg+xml;utf8,<svg fill="%23ffffff" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/><path d="M0 0h24v24H0z" fill="none"/></svg>');
  background-repeat: no-repeat;
  background-position-x: 95%;
  background-position-y: 50%;
}
.controls select option,
.key-signature select option {
  background-color: #2a2a2a;
  color: #fff;
}
#keyboard {
  display: flex;
  justify-content: center;
  background: linear-gradient(to bottom, #4a4a4a, #2a2a2a);
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}
.key {
  position: relative;
  width: 36px;
  height: 130px;
  background-color: #f0f0f0;
  border: 1px solid #000;
  margin: 0 2px;
  cursor: pointer;
  border-radius: 0 0 5px 5px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  transition: background-color 0.1s ease;
  user-select: none;
}
.key.black {
  width: 26px;
  height: 88px;
  background-color: #000;
  margin-left: -14px;
  margin-right: -14px;
  z-index: 1;
}
.key p {
  width: 100%;
  text-align: center;
  font-weight: 700;
}
.key.white p {
  margin-top: 110px;
  color: #000;
}
.key.black p {
  margin-top: 50px;
  color: #fff;
}
.key:active, .key.active {
  background-color: #ccc;
  height: 127px;
  border-bottom: solid 3px LightSkyBlue;
}
.key.black:active, .key.black.active {
  background-color: #333;
  height: 85px;
  border-bottom: solid 3px LightSkyBlue;
}
.sharp .key.black.scale p .flat,
.flat .key.black.scale p .sharp {
  color: #333;
}
.key.scale p,
.key.black.scale p {
  color: blue;
}
.key.scale {
  width: 34px;
  height: 128px;
  background-color: limegreen;
  border-left: solid 2px #fff;
  border-right: solid 2px #fff;
  border-bottom: solid 2px #fff;
}
.key.black.scale {
  width: 24px;
  height: 86px;
  background-color: limegreen;
  border-left: solid 2px #000;
  border-right: solid 2px #000;
  border-bottom: solid 2px #000;
}
.key.scale:active, .key.scale.active {
  background-color: MediumSeaGreen;
  border-bottom: solid 3px #9f9;
}
.key.scale.black:active, .key.scale.black.active {
  background-color: MediumSeaGreen;
  border-bottom: solid 3px #cfc;
}
#harmonica {
  position: relative;
  display: flex;
  justify-content: center;
  background: linear-gradient(to bottom, #4a4a4a, #2a2a2a);
  padding: 10px 20px;
  margin-top: 20px;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}
.hole {
  width: 40px;
  height: 40px;
  background-color: #f0f0f0;
  border: 1px solid #000;
  margin: 0 3px;
  padding: 0;
  cursor: pointer;
  border-radius: 20px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  transition: background-color 0.1s ease;
  font-size: 40px;
  color: #000;
  text-align: center;
}
.hole.blow:active, .hole.blow.active {
  background-color: #f66;
}
.hole.draw:active, .hole.draw.active {
  background-color: #66f;
}
.hole.blow.draw:active, .hole.blow.draw.active {
  background: linear-gradient(135deg, #f66 50%, #66f 50%); 
}
#slide {
  position: absolute;
  right: -87px;
  top: 0;
  display: inline-block;
  width: 90px;
  height: 60px;
  background-image: url('../images/slide-button.png');
  font-size: 60px;
  font-weight: 700;
  color: #f00;
  text-align: right;
  z-index: -1;
}
#slide.in.out {
  right: -87px;
  background-image: url('../images/slide-button-error.png');
}
#slide.in {
  right: -57px;
}
#loading,
#splash {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 24px;
  background: rgba(0, 0, 0, 0.9);
  padding: 20px;
  border-radius: 10px;
  z-index: 20;
}
#splash {
  color: red;
  background: rgba(255, 255, 255, 0.7);
  animation: fadeOut 10s;
}
@keyframes fadeOut {
  0% { opacity: 1; }
  100% { opacity: 0; }
}
#chord-pads {
  display: inline-block;
  max-width: 850px;
  margin-top: 20px;
}
.chord-pad {
  width: 60px;
  height: 60px;
  margin: 5px;
  font-size: 16px;
  font-weight: bold;
  background-color: rgba(255, 255, 255, 0.2);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.1s ease;
}
.chord-pad:hover {
  background-color: rgba(255, 255, 255, 0.3);
}
.chord-pad:active {
  transform: scale(0.95);
}

#score {
  display: flex;
  width: 100%;
  width: 1200px;
  margin-bottom: 20px;
  background: AntiqueWhite;
}

#treble-clef {
  position: relative;
  display: block;
  width: calc(100% - 20px);
  height: 300px;
  padding: 0;
  margin: 0;
  color: #000;
  background-image: url('../images/treble-clef.png');
  background-position: 0 36px;
  background-repeat: no-repeat;
  // outline: solid 1px red;
}

#score.treble-only #treble-clef {
  height: 250px;
}

#bass-clef {
  display: none;
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 300px;
  padding: 0;
  margin: 0;
  color: #000;
  background-image: url('../images/bass-clef.png');
  background-position: 0 36px;
  background-repeat: no-repeat;
  // outline: solid 1px red;
}

#score.treble-only #bass-clef {
  display: none;
}

#signature,
#notes {
  display: inline-block;
  height: 310px;
  line-height: 550px;
  margin: 0;
  padding: 0 0 5px 0;
}

#score.treble-only #signature,
#score.treble-only #notes {
  height: 260px;
}

#signature {
  margin-left: 100px;
  width: 50px;
  // outline: solid 1px orange;
  z-index: 5;
}

#notes {
  position: absolute;
  left: 150px;
  width:  1020px;
  overflow-y: clip;
  overflow-x: auto;
  // direction: rtl;
  white-space: nowrap;
  //outline: solid 1px blue;
}

.note {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 290px;
  line-height: 550px;
  font-weight: 900;
  font-size: 20px;
  text-align: center;
  margin: 9px 0 0 10px;
  padding: 0;
  color: #1e99f0;
  background-size: 44px 110px;
  background-repeat: no-repeat;
  // outline: solid 1px green;
}

.note span.interval {
  position: absolute;
  display: block;
  width: 44px;
  left: -27px;
  padding-top: 5px;
  font-weight: 500;
  font-size: 14px;
  text-align: center;
  color: green;
}

#score.treble-only .note {
  height: 240px;
  line-height: 450px;
}

.bar {
  display: inline-block;
  width: 6px;
  height: 290px;
  line-height: 550px;
  margin: 0 0 0 10px;
  padding: 0;
  background-image: url('../images/bar.png');
  background-position: 0 36px;
  background-repeat: no-repeat;
  // outline: solid 1px green;
}

.quarter.note.inverted {
  background-image: url('../images/quarter-note-inverted.png');
}

.quarter.note {
  background-image: url('../images/quarter-note.png');
}

.quarter.note.inverted.error {
  background-image: url('../images/quarter-note-inverted-error.png');
}

.quarter.note.error {
  background-image: url('../images/quarter-note-error.png');
}

.eighth.note.inverted {
  background-image: url('../images/eighth-note-inverted.png');
}

.eighth.note.error {
  background-image: url('../images/eighth-note-error.png');
}

.eighth.note.inverted.error {
  background-image: url('../images/eighth-note-inverted-error.png');
}

.eighth.note {
  background-image: url('../images/eighth-note.png');
}

.note .flat,
.note .sharp,
.note .natural,
.note .double-sharp,
.note .double-flat {
  content: "";
  position: absolute;
  top: -15px;
  left: -5px;
  width: 44px;
  height: 290px;
  overflow: clip;
  background-size: 55px 138px;
  background-repeat: no-repeat;
  // outline: green solid 1px;
}

.note .flat {
  background-image: url('../images/flat.png');
}
.note .sharp {
  background-image: url('../images/sharp.png');
}
.note .natural {
  background-image: url('../images/natural.png');
}
.note .double-flat {
  background-image: url('../images/double-flat.png');
}
.note .double-sharp {
  background-image: url('../images/double-sharp.png');
}

.note.error .flat {
  background-image: url('../images/flat-error.png');
}
.note.error .sharp {
  background-image: url('../images/sharp-error.png');
}
.note.error .natural {
  background-image: url('../images/natural-error.png');
}
.note.error .double-flat {
  background-image: url('../images/double-flat-error.png');
}
.note.error .double-sharp {
  background-image: url('../images/double-sharp-error.png');
}

.D8.note,
.D8.note div {
  background-position: 0 -100px;
}

.C8.note,
.C8.note div {
  background-position: 0 -93px;
}

.B7.note,
.B7.note div {
  background-position: 0 -86px;
}

.D8.note::before,
.C8.note::before,
.B7.note::before {
  position: absolute;
  top: 5px;
  left: 12px;
  width: 23px;
  height: 60px;
  overflow: clip;
  content: url('../images/bar-lines.png');
}

.A7.note,
.A7.note div {
  background-position: 0 -79px;
}

.G7.note,
.G7.note div {
  background-position: 0 -72px;
}

.A7.note::before,
.G7.note::before {
  position: absolute;
  top: 5px;
  left: 12px;
  width: 23px;
  height: 60px;
  overflow: clip;
  content: url('../images/bar-lines.png');
}

.F7.note,
.F7.note div {
  background-position: 0 -65px;
}

.E7.note,
.E7.note div {
  background-position: 0 -58px;
}

.F7.note::before,
.E7.note::before {
  position: absolute;
  top: 5px;
  left: 12px;
  width: 23px;
  height: 60px;
  overflow: clip;
  content: url('../images/bar-lines.png');
}

.D7.note,
.D7.note div {
  background-position: 0 -51px;
}

.C7.note,
.C7.note div {
  background-position: 0 -44px;
}

.B6.note,
.B6.note div {
  background-position: 0 -37px;
}

.D7.note::before,
.C7.note::before,
.B6.note::before {
  position: absolute;
  top: 5px;
  left: 12px;
  width: 23px;
  height: 60px;
  overflow: clip;
  content: url('../images/bar-lines.png');
}

.A6.note,
.A6.note div {
  background-position: 0 -30px;
}

.G6.note,
.G6.note div {
  background-position: 0 -23px;
}

.A6.note::before,
.G6.note::before {
  position: absolute;
  top: 19px;
  left: 12px;
  width: 23px;
  height: 46px;
  overflow: clip;
  content: url('../images/bar-lines.png');
}

.F6.note,
.F6.note div {
  background-position: 0 -16px;
}

.E6.note,
.E6.note div {
  background-position: 0 -9px;
}

.F6.note::before,
.E6.note::before {
  position: absolute;
  top: 33px;
  left: 12px;
  width: 23px;
  height: 32px;
  overflow: clip;
  content: url('../images/bar-lines.png');
}

.D6.note,
.D6.note div {
  background-position: 0 -2px;
}

.C6.note,
.C6.note div {
  background-position: 0 5px;
}

.D6.note::before,
.C6.note::before {
  position: absolute;
  top: 47px;
  left: 12px;
  width: 23px;
  height: 16px;
  overflow: clip;
  content: url('../images/bar-lines.png');
}

.B5.note,
.B5.note div {
  background-position: 0 12px;
}

.A5.note,
.A5.note div {
  background-position: 0 19px;
}

.B5.note::before,
.A5.note::before {
  position: absolute;
  top: 61px;
  left: 12px;
  width: 23px;
  height: 8px;
  overflow: clip;
  content: url('../images/bar-lines.png');
}

.G5.note,
.G5.note div {
  background-position: 0 26;
}

.F5.note,
.F5.note div {
  background-position: 0 33px;
}

.E5.note,
.E5.note div {
  background-position: 0 40px;
}

.D5.note,
.D5.note div {
  background-position: 0 47px;
}

.C5.note,
.C5.note div {
  background-position: 0 54px;
}

.B4.note,
.B4.note div {
  background-position: 0 61px;
}

.A4.note,
.A4.note div {
  background-position: 0 68px;
}

.G4.note,
.G4.note div {
  background-position: 0 75px;
}

.F4.note,
.F4.note div {
  background-position: 0 82px;
}

.E4.note,
.E4.note div {
  background-position: 0 89px;
}

.D4.note,
.D4.note div {
  background-position: 0 96px;
}

.C4.note,
.C4.note div {
  background-position: 0 103px;
}

#score.treble-only .B3.note::before,
.C4.note::before {
  content: "";
  position: absolute;
  top: 146px;
  right: 8px;
  width: 24px;
  height: 2px;
  background-color: #000;
  color: #000;
  // z-index: 5;
}

.B3.note,
.B3.note div {
  background-position: 0 110px;
}

.A3.note,
.A3.note div {
  background-position: 0 117px;
}

.G3.note,
.G3.note div {
  background-position: 0 124px;
}

#score.treble-only .A3.note::before,
#score.treble-only .G3.note::before {
  position: absolute;
  top: 146px;
  left: 12px;
  width: 23px;
  height: 20px;
  overflow: clip;
  content: url('../images/bar-lines.png');
}

.F3.note,
.F3.note div {
  background-position: 0 131px;
}

.E3.note,
.E3.note div {
  background-position: 0 138px;
}

#score.treble-only .F3.note::before,
#score.treble-only .E3.note::before {
  position: absolute;
  top: 146px;
  left: 12px;
  width: 23px;
  height: 34px;
  overflow: clip;
  content: url('../images/bar-lines.png');
}

.D3.note,
.D3.note div {
  background-position: 0 145px;
}

.C3.note,
.C3.note div {
  background-position: 0 152px;
}

#score.treble-only .D3.note::before,
#score.treble-only .C3.note::before {
  position: absolute;
  top: 146px;
  left: 12px;
  width: 23px;
  height: 48px;
  overflow: clip;
  content: url('../images/bar-lines.png');
}

.B2.note,
.B2.note div {
  background-position: 0 159px;
}

.A2.note,
.A2.note div {
  background-position: 0 166px;
}

.G2.note,
.G2.note div {
  background-position: 0 173px;
}

.F2.note,
.F2.note div {
  background-position: 0 180px;
}

.E2.note,
.E2.note div {
  background-position: 0 187px;
}

.D2.note,
.D2.note div {
  background-position: 0 194px;
}

.E2.note::before,
.D2.note::before {
  position: absolute;
  top: 229px;
  left: 12px;
  width: 23px;
  height: 8px;
  overflow: clip;
  content: url('../images/bar-lines.png');
}

.C2.note,
.C2.note div {
  background-position: 0 201px;
}

.C2.note::before {
  position: absolute;
  top: 229px;
  left: 12px;
  width: 23px;
  height: 16px;
  overflow: clip;
  content: url('../images/bar-lines.png');
}

#score.treble-only .B2.note,
#score.treble-only .A2.note,
#score.treble-only .G2.note,
#score.treble-only .F2.note,
#score.treble-only .E2.note,
#score.treble-only .D2.note,
#score.treble-only .C2.note {
  display: none;
}

nav {
  position: absolute;
  display: inline-block;
  top: 10px;
  left: 0;
}
#menuToggle {
  display: block;
  position: relative;
  top: 50px;
  left: 50px;
  z-index: 1;
  -webkit-user-select: none;
  user-select: none;
}
#menuToggle a {
  text-decoration: none;
  color: #333;
  transition: color 0.3s ease;
}
#menuToggle a:hover {
  color: tomato;
}
#menuToggle input#close {
  display: block;
  width: 40px;
  height: 40px;
  position: absolute;
  top: -7px;
  left: -5px;
  cursor: pointer;
  opacity: 0; /* hide this */
  z-index: 2; /* and place it over the hamburger */
  -webkit-touch-callout: none;
}
#menuToggle #hamburger {
  display: block;
  width: 40px;
  height: 40px;
  padding: 0;
  margin: 0;
  position: absolute;
  top: -7px;
  left: -5px;
}
#menuToggle #hamburger span {
  display: block;
  width: 33px;
  height: 4px;
  margin-bottom: 5px;
  position: relative;
  background: #fff;
  border-radius: 3px;
  z-index: 1;
  transform-origin: 4px 0px;
  transition: transform 0.5s cubic-bezier(0.77,0.2,0.05,1.0),
              background 0.5s cubic-bezier(0.77,0.2,0.05,1.0),
              opacity 0.55s ease;
}
#menuToggle #hamburger span:first-child {
  transform-origin: 0% 0%;
}
#menuToggle #hamburger span:nth-last-child(2) {
  transform-origin: 0% 100%;
}
#menuToggle input#close:checked ~ #hamburger span {
  opacity: 1;
  transform: rotate(45deg) translate(-2px, -19px);
  background: #333;
}
#menuToggle input#close:checked ~ #hamburger span:nth-last-child(3) {
  opacity: 0;
  transform: rotate(0deg) scale(0.2, 0.2);
}
#menuToggle input#close:checked ~ #hamburger span:nth-last-child(2) {
  transform: rotate(-45deg) translate(0, 19px);
}
#menu {
  position: absolute;
  display: inline-block;
  margin: -100px 0 0 -50px;
  padding: 50px;
  padding-top: 125px;
  background: #ddd;
  list-style-type: none;
  -webkit-font-smoothing: antialiased;
  transform-origin: 0% 0%;
  transform: translate(-100%, 0);
  transition: transform 0.5s cubic-bezier(0.77,0.2,0.05,1.0);
}
#menu li {
  padding: 10px 0;
  color: #555;
  font-size: 22px;
  text-wrap: nowrap;
}
#menuToggle input#close:checked ~ ul {
  transform: none;
}
#menu li p {
  padding: 10px;
  font-size: 18px;
  text-wrap: wrap;
  border: solid #000 1px;
}

.switch {
  position: absolute;
  right: 30px;
  display: inline-block;
  width: 40px;
  height: 24px;
  margin-top: 3px;
}

/* Hide default HTML checkbox */
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

/* The slider */
.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  -webkit-transition: .4s;
  transition: .4s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  -webkit-transition: .4s;
  transition: .4s;
}

input:checked + .slider {
  background-color: #2196F3;
}

input:focus + .slider {
  box-shadow: 0 0 1px #2196F3;
}

input:checked + .slider:before {
  -webkit-transform: translateX(16px);
  -ms-transform: translateX(16px);
  transform: translateX(16px);
}

/* Rounded sliders */
.slider.round {
  border-radius: 34px;
}

.slider.round:before {
  border-radius: 50%;
}
