@import url(https://fonts.googleapis.com/css?family=Raleway:300);
@import url(https://fonts.googleapis.com/css?family=Roboto+Condensed);
@import url(https://fonts.googleapis.com/css?family=Orbitron:900);
@import url(https://fonts.googleapis.com/css?family=VT323);

/* GENERAL */

* {
  user-select: none;
  -webkit-user-select: none;
}

body {
  background: #444 url(../images/bg.png); /* http://subtlepatterns.com/dark-sharp-edges/ */
  font-family: 'Raleway', sans-serif;
  font-weight: 300;
  letter-spacing: 1.5px;
  margin-top: 26px;
}

body.grabbing * {
  cursor: -webkit-grabbing !important;
}

.scaleContainer {
  margin: 8px auto;
}

.grid {
  width: 1300px;
  margin: 0 auto;
  visibility: hidden;
  border: 10px solid black;
  border-radius: 10px;
}

.panel {
  float: left;
  position: relative;
  width: 108px;
  height: 125px;
  min-height: 125px;
  padding: 10px;
  border: 1px solid #333;
  background-color: #f8f8f8;
  text-align: center;
}

.panel.enhancement {
  background-color: #e8e8e8;
}

.panelName {
  position: absolute;
  top: 2px;
  left: 0px;
  width: 100%;
  text-align: center;
  text-shadow: 1px 1px 1px #CCC;
  cursor: default;
}

.subPanel {
  margin: 20px;
  border: 1px solid #999;
  padding: 10px;
  position: relative;
}

.width2 {
  width: 238px;
}

.width3 {
  width: 368px;
}

.width4 {
  width: 498px;
}

.width6 {
  width: 758px;
}

.height2 {
  height: 272px;
}

.height4 {
  height: 566px;
}

/* PATCHBOARD */

#patches {
  margin: 0px auto;
  border-collapse: collapse;
  font-size: 0.9em;
}

#patches input {
  appearance: radio;
  -webkit-appearance: radio;
  -moz-appearance: radio;
  -ms-appearance: radio;
  position: relative;
  left: 2px;
}

#patches td:nth-child(1), #patches th {
  font-size: 0.9em;
}

#patches tr:nth-child(1) th {
  padding: 2px;
}

#patches tr:nth-child(2) {
  height: 105px;
}

#patches th {
  font-weight: normal;
  letter-spacing: 4px;
  line-height: 1em;
  max-width: 20px;
  border: 1px solid black;
  position: relative;
  vertical-align: top;
}

#patches th.vertical {
  padding-top: 2px;
  padding-bottom: 10px;
}

#patches th.horizontal {
  vertical-align: middle;
  border-bottom: 0;
}

#patches tr:nth-child(3) th {
  border-top: 0;
  padding-top: 5px;
  padding-left: 7px;
  padding-right: 3px;
}

#patches td {
  background: black;
  border-color: black;
}

#patches td:nth-child(1) {
  max-width: 120px;
  border: 1px solid black;
  background: inherit;
}

#patches td:nth-child(2) {
  background: inherit;
  padding: 0;
}

#patches td:nth-child(2) .tri {
  height: 22px;
  width: 18px;
  font-size: 26px;
  position: relative;
  top: -3px;
  left: -2px;
}

#patches td:last-child {
  border-left: 2px solid black;
  padding-left: 5px;
  background: inherit;
}

#patches th .tri {
  display: block;
  font-size: 28px;
  position: absolute;
  left: -3px;
  bottom: -11px;
  height: 24px;
}

#patches th:nth-child(1), #patches th:nth-child(2) {
  border: 0;
}

#patches tr:last-child td {
  border-top: 2px solid black;
  background: inherit;
  text-align: center;
}

#patches tr:last-child td:first-child, #patches tr:last-child td:nth-child(2), #patches tr:last-child td:last-child {
  border: 0;
}

/* KNOBS */

.dial {
  float: left;
  height: 125px;
  width: 115px;
  position: relative;
}

.width2 .dial {
  width: 118px;
}

.width3 .dial {
  width: 122px;
}

.width4 .dial {
  width: 124px;
}

.width6 .dial {
  width: 126px;
}

.knob-container {
  position: absolute;
  top: 20px;
  left: 0px;
  right: 0px;
  bottom: 0px;
  margin: auto;
}

.knob-label {
  position: absolute;
  top: 0px;
  left: 0px;
  right: 0px;
  bottom: 0px;
  margin: auto;
  cursor: default;
}

.freq {
  position: absolute;
  left: 48px;
  top: 72px;
  z-index: 999;
  width: 50px;
  font-family: 'Roboto Condensed', sans-serif;
  pointer-events: none;
}

/* MISC UI COMPONENENTS */

#loader {
  display: block;
  margin: 0 auto;
  position: relative;
  top: 50%;
  -webkit-transform: translateY(-50%);
  -ms-transform: translateY(-50%);
  transform: translateY(-50%);
  text-align: center;
}

#loader img {
  z-index: -9999;
}

#loader #sadBrowserText {
  color: rgb(238, 238, 238);
  width: 400px;
  margin: -35px auto;
}

#sadBrowserText a {
  text-decoration: underline;
  cursor: pointer;
}

#sadBrowserText a:hover {
  text-decoration: none;
}

.logo {
  position: absolute;
  bottom: 0;
  left: 0;
  border-top: 5px solid black;
  width: 100%;
  padding-top: 8px;
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  font-size: 26px;
  letter-spacing: 8px;
  text-align: left;
  padding-left: 100px;
}

#gfx {
  margin: 0 auto;
  border: 1px solid #999;
  border-radius: 15px;
  background: white;
}

#joystick {
  position: relative;
  top: 0;
  left: 50px;
  width: 140px;
  height: 140px;
  background-color: #333;
  background-image: repeating-linear-gradient(0deg,transparent,transparent 34px,#CCC 34px,#CCC 35px),repeating-linear-gradient(-90deg,transparent,transparent 34px,#CCC 34px,#CCC 35px);
  background-size: 35px 35px;
  cursor: -webkit-grab;
  cursor: -moz-grab;
}

.trackpad-base {
  position: relative;
  background-color: #444;
  border-radius: 5px;
  box-shadow: inset 0 0 10px #222;
  overflow: hidden;
}

.trackpad-marker {
  position: absolute;
  border-radius: 50%;
}

.trackpad-marker:after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-image: radial-gradient(circle closest-side at center,
    rgba(68, 68, 68, 0) 0,
    rgba(68, 68, 68, 0) 50%, 
    #333 100%
  );
}

#bankDisplayContainer {
  float: left;
  background-color: #333; 
  padding: 10px; 
  margin-top: 15px;
  border-radius: 10px;
}

#bankSelectButtons {
  position: absolute;
  width: 30px;
  top: 23px;
  right: 12px;
}

#bankSelectButtons button {
  height: 42px;
  margin: 2px;
  margin-left: 5px;
  padding: 3px 4px;
  font-size: 1.2em;
  color: #e95d0f;
}

#bankSelectButtons button:first {
  margin-top: 0px;
}

#bankOperationButtons button {
  font-size: 9px;
  margin-top: 3px;
  margin-right: 2px;
}

#inputSources {
  margin-top: 12px;
  font-size: 0.75em;
}

.inputSource {
  float: left;
  width: 110px;
  height: 117px;
  margin-right: 7px;
  border: 1px solid #333;
  border-radius: 10px;
}

.inputSource .inputSourceHeading {
  font-size: 1.5em;
  font-weight: bold;
  margin: 5px 0;
}

.inputSource div {
  clear: both;
  height: 21px;
}

.inputSource input {
  width: 45px;
}

.inputSource input[type=file] {
  float: left;
  width: 82px;
  padding-left: 5px;
}

.inputSource .indicators span {
  display: none;
  width: 16px;
  height: 16px;
}

.inputSource .indicators span img {
  padding-top: 3px;
}

.inputSource .successIndicator {
  background-color: #0C0;
}

.inputSource .failureIndicator {
  background-color: #F00;
}

#envLight {
  position: absolute;
  left: 120px;
  top: 6px;
  width: 30px;
  background-color: #eee;
  height: 30px;
  border-radius: 15px;
  box-shadow: inset 0 0 10px #222;
}

#envLight.on {
  background-color: rgba(255, 0, 0, 0.58);
  box-shadow: inset 0 0 10px #222, inset 0 0 5px #fff;
}

#manualTrigger {
  position: absolute;
  bottom: 4px;
  right: 4px;
  width: 45px;
  height: 72px;
  font-size: 10px;
  text-align: center;
}

#manualTrigger button {
  float: none;
  width: 28px;
  height: 28px;
  margin: 0 auto 8px;
  border: 3px solid black;
  border-top-width: 4px;
  border-radius: 0;
}

/* DIALOGS */

/* taken from http://www.webdesignerdepot.com/2012/10/creating-a-modal-window-with-html5-and-css3/ */
.modalDialog {
  display: none;
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: rgba(0,0,0,0.8);
  z-index: 99999;
  -webkit-transition: opacity 400ms ease-in;
  -moz-transition: opacity 400ms ease-in;
  transition: opacity 400ms ease-in;
}

.modalDialog.noOverlay {
  background: none;
  height: 0;
}

.modalDialog.noOverlay .panel:first-of-type {
  position: fixed;
  top: 0;
  left: 50%;
  /* Must supply `margin-left: -(width);` to properly center-align. */
}

.modalDialog .panel:first-of-type > .panelName {
  top: 4px;
  cursor: move;
}

.modalDialog button.closeButton {
  position: absolute;
  top: 5px;
  right: 5px;
}

#memoryDialog .panel {
  width: 400px;
  height: auto;
  position: relative;
  float: none;
  margin: 10% auto;
  border-width: 3px;
  border-color: #000;
  pointer-events: auto;
}

#memoryDialog textarea {
  margin-top: 15px;
  width: 100%;
  height: 180px;
  font-family: 'VT323';
}

#memoryDialog button {
  float: none;
  margin-top: 5px;
}

button#bankImportExport {
  color: yellow;
}

button#memoryDialogClose {
  background: red;
}

#toolbar {
  position: absolute;
  right: 0;
  bottom: 0;
  margin: 3px;
}

#toolbar button {
  float: right;
  height: 30px;
  width: 30px;
  padding: 3px;
  font-size: 1.1em;
  margin-right: 5px;
}

#toolbar button#pianoButton {
  padding: 0;
}

#toolbar button img {
  width: 100%;
  height: 100%;
}

#toolbar button:hover {
  border: 2px solid orange;
}

#pianoDialog .panel:first-of-type {
  width: 850px;
  height: 200px;
  margin-left: -425px;
  margin-top: 10%;
  background-color: black;
  float: none;
}

#pianoDialog .panel:first-of-type > .panelName {
  color: white;
}

#pianoDialog #piano {
  position: absolute;
  top: 50px;
  right: 10px;
}

#pianoDialog .piano-ivory .piano-key-code {
  padding-top: 110px;
  padding-left: 2px;
  color: #999;
}

#pianoDialog .piano-ebony .piano-key-code {
  padding-top: 50px;
  padding-left: 1px;
  color: #888;
  font-size: 0.9em;
}

#pianoDialog #A4Freq, #pianoDialog #A5Freq {
  position: absolute;
  color: white;
  top: -16px;
  font-size: 0.6em;
  width: 50px;
}

#pianoDialog #A4Freq {
  left: 291px;
}

#pianoDialog #A5Freq {
  left: 467px;
}

#pianoDialog #pianoControls {
  top: 40px;
  width: 280px;
  height: auto;
  padding: 0;
}

#pianoDialog #pianoControls .subPanel {
  margin: 0;
  height: 80px;
}

#pianoDialog #pianoControls .subPanel .panelName {
  font-size: 0.7em;
  width: auto;
  border: 1px solid black;
  padding: 2px;
  margin-left: 5px;
}

#pianoDialog #pianoControls .subPanel#pianoControlsInputs {
  height: 50px;
  padding: 3px;
}

#pianoDialog #pianoControls .subPanel#pianoControlsInputs > div {
  position: relative;
  height: 50%;
}

#pianoDialog #pianoControls .dial {
  width: 85px;
  height: 95px;
}

#pianoDialog #pianoControls .knob-label {
  top: 13px !important;
  font-size: 0.8em;
}

#pianoDialog #pianoControls .inputSelector {
  float: right;
  width: 200px;
  margin-top: 3px;
  font-size: 0.8em;
}

#helpDialog .panel {
  width: 800px;
  height: 600px;
  top: -50px;
  position: relative;
  float: none;
  margin: 10% auto;
  border-width: 3px;
  border-color: #000;
  pointer-events: auto;
  padding: 0;
}

#helpDialog .panelName {
  margin-top: 10px;
}

#helpDialog #helpArea {
  margin-top: 40px;
}

#helpDialog #sidebar {
  float: left;
  width: 250px;
  height: 560px;
  background: #666;
}

#helpDialog #sidebar ul {
  margin: 0;
  padding: 0;
}

#helpDialog #sidebar li {
  list-style: none;
  text-align: left;
  padding: 8px;
  padding-left: 1em;
  border-bottom: 1px solid #CCC;
  cursor: pointer;
  color: #CCC;
}

#helpDialog #sidebar li.active {
  background: #30C7C7;
  color: #333;
}

#helpDialog #content {
  background: #EEE;
  text-align: left;
  float: left;
  width: 530px;
  height: 540px;
  padding: 10px;
  overflow-y: scroll;
}

#helpDialog #content .page {
  display: none;
}

#helpDialog #content p, #helpDialog #content h3 {
  margin: 0;
  margin-bottom: 1em;
}

#helpDialog #content img {
  max-width: 468px;
  margin: 5px auto 1em;
  display: block;
}

#helpDialog #content #usage img {
  max-width: 300px;
}

#helpDialog #content iframe {
  display: block;
  width: 100%;
  height: 100%;
}

#helpDialog #content li {
  margin-bottom: 0.5em;
}

#helpDialog #content table {
  border-collapse: collapse;
}

#helpDialog #content .no-margin {
  margin: 0;
}

#settingsDialog .panel {
  width: 300px;
  height: 250px;
  position: relative;
  float: none;
  margin: 10% auto;
  border-width: 3px;
  border-color: #000;
  pointer-events: auto;
}

#settingsDialog .setting {
  margin-top: 10px;
}

#settingsDialog .dial {
  float: none;
  margin: 0 auto;
}

#settingsDialog .ui-slider {
  display: inline-block;
  width: 150px;
}

/* BUTTONS */

/* adapted from https://codepen.io/james2doyle/pen/AKblD */
button {
  padding-top: 2px;
  padding-bottom: 3px;
  cursor: pointer;
  float: left;
  text-shadow: 0 -1px 0 rgba(0,0,0,0.7), 0 0 0 hsla(208.12, 44.44%, 85.88%, 0);
  color: #fff;
  font-weight: bold;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.2), 0 6px 10px -1px rgba(0,0,0,0.6);

  background: -moz-linear-gradient(top, #37373d 0%, #222228 100%); /* FF3.6+ */
  background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#37373d), color-stop(100%,#222228)); /* Chrome,Safari4+ */
  background: -webkit-linear-gradient(top, #37373d 0%,#222228 100%); /* Chrome10+,Safari5.1+ */
  background: -o-linear-gradient(top, #37373d 0%,#222228 100%); /* Opera 11.10+ */
  background: -ms-linear-gradient(top, #37373d 0%,#222228 100%); /* IE10+ */
  background: linear-gradient(to bottom, #37373d 0%,#222228 100%); /* W3C */

  user-select: none;
  border-radius: 5px;
}
button:focus {
  outline: none;
}
button:hover {
  background: -moz-linear-gradient(top, #68686d 0%, #222228 100%); /* FF3.6+ */
  background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#68686d), color-stop(100%,#222228)); /* Chrome,Safari4+ */
  background: -webkit-linear-gradient(top, #68686d 0%,#222228 100%); /* Chrome10+,Safari5.1+ */
  background: -o-linear-gradient(top, #68686d 0%,#222228 100%); /* Opera 11.10+ */
  background: -ms-linear-gradient(top, #68686d 0%,#222228 100%); /* IE10+ */
  background: linear-gradient(to bottom, #68686d 0%,#222228 100%); /* W3C */
}
button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

button.red {
  background: -moz-linear-gradient(top, #f90303 0%,#bd0e0e 100%); /* FF3.6+ */
  background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f90303), color-stop(100%,#bd0e0e)); /* Chrome,Safari4+ */
  background: -webkit-linear-gradient(top, #f90303 0%,#bd0e0e 100%); /* Chrome10+,Safari5.1+ */
  background: -o-linear-gradient(top, #f90303 0%,#bd0e0e 100%); /* Opera 11.10+ */
  background: -ms-linear-gradient(top, #f90303 0%,#bd0e0e 100%); /* IE10+ */
  background: linear-gradient(to bottom, #f90303 0%,#bd0e0e 100%); /* W3C */
}

button.red:hover {
  background: -moz-linear-gradient(top, #ff4040 0%,#cc4040 100%); /* FF3.6+ */
  background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ff4040), color-stop(100%,#cc4040)); /* Chrome,Safari4+ */
  background: -webkit-linear-gradient(top, #ff4040 0%,#cc4040 100%); /* Chrome10+,Safari5.1+ */
  background: -o-linear-gradient(top, #ff4040 0%,#cc4040 100%); /* Opera 11.10+ */
  background: -ms-linear-gradient(top, #ff4040 0%,#cc4040 100%); /* IE10+ */
  background: linear-gradient(to bottom, #ff4040 0%,#cc4040 100%); /* W3C */
}

/* BROWSER-SPECIFIC */

/* Firefox */
@media screen and (-moz-images-in-menus:0) {
  #loader {
    top: 100px;
    transform: translateY(0);
  }

  .logo {
    position: static;
    font-size: 16px;
    padding-top: 5px;
  }

  button::-moz-focus-inner {
    padding: 0 !important;
    border: 0 none !important;
  }

  .radial.metal { background-color: hsla(0,0%,90%,1) !important; }
  .radial.metal.green { background-color: hsla(140,100%,60%,0.5) !important; }
  .radial.metal.blue { background-color: hsla(197, 71%,60%,0.5) !important; }
  .radial.metal.red { background-color: hsla(0, 100%,60%,0.5) !important; }
  .radial.metal.yellow { background-color: hsla(60, 100%,60%,0.5) !important; }
}
