body {
  font-family: sans-serif;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 100;
}

#container {
  position: relative;
  width: 90vw;
  margin: auto;
}

.CodeMirror {
  box-sizing: border-box;
  border: 1px black solid;
  font-size: 20px;
  height: auto;
  min-height: 100%;
  width: 100%;
}

.code {
  font-family: Courier;
}

button {
  background: white;
  border: 1px black solid;
  box-sizing: border-box;
  box-shadow: 4px 4px rgb(200, 200, 200);
  font-size: 20px;
  height: 50px;
  /* margin: 0 10px 10px 0; */
}

button:hover {
  box-shadow: 4px 4px black;
}

button:focus {
  border-color: rgb(0, 0, 0);
  outline: none;
}

button:active:hover, button.down {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px black;
}

button.run {
  margin-right: 20px;
}

button.run:hover {
  box-shadow: 4px 4px rgb(43, 156, 212);
}

button.run:focus {
  border-color: rgb(43, 156, 212);
}

button.run:active:hover, button.run.down {
  box-shadow: 2px 2px rgb(43, 156, 212);
}

#presets {
  display: inline-block;
  height: 50px;
  flex-grow: 1;
}

#presets button {
  height: 30px;
}

/* oh boy */
#clock-wrapper-wrapper {
  margin-right: 20px;
  display: flex;
  justify-content: flex-end;
}

#clock-wrapper {
  position: relative;
}

#clock-icon {
  position: absolute;
  top: 5px;
  left: 4px;
  filter: grayscale(1) contrast(1.5) opacity(0.5);
}

#clock-display {
  height: 30px;
  box-sizing: border-box;
  border: 1px black solid;
  text-align: right;
  font-family: monospace;
  font-size: x-large;
  width: 4em;
  padding: 10px;
}

#clock button {
  height: 30px;
}

#volume-wrapper {
  display: flex;
  height: 30px;
}

#speaker-icon {
  line-height: 30px;
  width: 25px;
  filter: grayscale(1);
}

#volume-slider {
  flex-grow: 1;
}

.key-wrap {
  display: inline-block;
  width: 120px;
}

.key {
  background-color: rgb(243,243,243);
  border: solid 1px #ccc;
  box-sizing: border-box;
  border-bottom-color: #bbb;
  border-radius: 3px;
  box-shadow: inset 0 -1px 0 #bbb;
  color: rgb(33,33,33);
  font-family: monospace;
  font-size: 11px;
  margin-left: 2px;
  padding: 1px 4px;
}

#main {
  display: grid;
  grid-template-columns: 1fr 5fr 1fr 2fr;
  row-gap: 30px;
}

#menu {
  display: grid;
  grid-template-columns: 5.5fr 1.5fr 2fr;
}

/* Hack. */
.CodeMirror-sizer {
  margin-bottom: 0 !important;
}

.player-id {
  display: inline-block;
  border: 1px dashed black;
  text-align: center;
  font-size: 20px;
  line-height: 50px;
  position: relative;
}

.editor {
  display: inline-block;
  min-width: 0;
}

#controls {
  display: inline-block;
}

.scopes {
  display: grid;
  font-size: 12px;
  grid-template-columns: 1fr 1fr;
  height: 0;
}

.scopes .scope {
  box-sizing: border-box;
  border: 1px black solid;
  min-height: 50px;
  min-width: 0;
  position: relative;
}

.scopes .scope h3 {
  margin: 0 5px;
  font-weight: bold;
}

.CodeMirror:not(.CodeMirror-focused) .CodeMirror-cursors {
  visibility: visible !important;
}

.editor {
  outline: solid 0px;
  transition: all 0.5s;
  z-index: 1;
}

.selected {
  outline: solid 2px red;
  transition: none;
}

.ran {
  outline: solid 10px greenyellow;
  transition: all 0.1s;
}

.error {
  outline: solid 10px red;
  animation: shake 0.2s;
  transform: rotate(0deg);
  transition: all 0.1s;
}

/* Unfortunately, this somehow causes the CodeMirror editor to change height sometimes...

@keyframes shake {
10%, 50%, 90% {
  transform: rotate(-3deg);
}

0%, 100% {
  transform: rotate(0deg);
}

30%, 70% {
  transform: rotate(3deg);
}
*/

@keyframes shake {
  10%, 90% {
    transform: translate3d(-2px, 0, 0);
  }

  20%, 80% {
    transform: translate3d(4px, 0, 0);
  }

  30%, 50%, 70% {
    transform: translate3d(-8px, 0, 0);
  }

  40%, 60% {
    transform: translate3d(8px, 0, 0);
  }
}


canvas {
  border: solid 1px black;
}

.remove-process {
  position: absolute;
  cursor: pointer;
  position: absolute;
  top: 50%;
  left: 0%;
  padding: 12px 16px;
  transform: translate(0%, -50%);
  filter: grayscale(1) contrast(1.5) opacity(0.5);
}

#top {
  display: flex;
  justify-content: space-between;
  margin-bottom: 20px;
}

#title {
  font-family: 'Share Tech Mono', monospace;
  margin-bottom: 0;
  margin-top: 10px;
  font-size: 42px;
  letter-spacing: 0.2em;
}

#connect-box, #disconnect-box {
  margin-bottom: 20px;
}

#server-address {
  background: white;
  border: 1px black solid;
  box-sizing: border-box;
  font-size: 20px;
  padding-left: 10px;
  font-family: monospace;
  height: 50px;
  width: 14.5em;
}

#add-process-btn {
  margin-top: 20px;
}

[hidden] {
  display: none;
}

/* No arrows in number inputs. */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
input[type="number"] {
    -moz-appearance: textfield;
}