:root {
  --display-width: calc((100vh / 9 * 12) - 2vh);
  --display-height: calc(100vh - 2vh);

  --display-left: calc((100vw - var(--display-width)) / 2);
  --display-top: 1vh;
}

html {
  box-sizing: border-box;
}
*, *:before, *:after {
  box-sizing: inherit;
  user-select: none;
}

body {
  position: absolute;
  left    : 0px;
  right   : 0px;
  top     : 0px;
  bottom  : 0px;
  margin  : 0px;
  overflow: hidden;
  background-color: rgb(137,129,148);
}

canvas {
  position: absolute;
  width   : var(--display-width);
  height  : var(--display-height);
  z-index : 1;
  left    : var(--display-left);
  top     : var(--display-top);
  border  : solid 1px rgb(24,24,24);
}

header {
  position: absolute;
  font-weight: 900;
  z-index: 2;
  left: 1vh;
  top: var(--display-top);
  bottom: 1vh;
  width: calc(var(--display-left) - 32px);
}

header > span {
  top: 50%;
  right: 50%;
  position: absolute;
  transform: scale(-1) translate(-50%, 50%) rotate(90deg);
  font-size: calc(var(--display-left) - 32px);
  text-shadow: -2px 1px 2px rgba(80,80,80,0.75), 2px -1px 2px rgba(0,0,0,0.75);
  color: rgba(24,24,24,1);
  background: transparent;
}

nav {
  position: absolute;
  z-index: 2;
  color:red;
  right: 1vh;
  top: 1vh;
  bottom: 1vh;
  width: calc(var(--display-left) - 32px);
  background-color: transparent;
  display: flex;
  flex-direction: column;
}

/* overrides for developer view */
@media screen and (max-width: 133.34vh) {
  :root {
    --display-width: calc((100vw) - 2vh);
    --display-height: calc((100vw / 14 * 9) - 2vh);
    --display-left: 1vh;
    --display-top: calc((100vh - var(--display-height)) / 2);
  }

  /* canvas {
  } */

  header {
    top: calc(var(--display-top) - 10vh);
    right: 1vh;
    left: 1vh;
    height: 10vh;
    bottom: unset;
    width: unset;
    line-height: 10vh;
  }

  header > span {
    transform: scale(1) translate(50%, -50%);
    font-size: 10vh;
    text-shadow: 2px 1px 2px rgba(80,80,80,0.75), -2px -1px 2px rgba(0,0,0,0.75);
  }

  nav {
    top: calc(var(--display-top) + var(--display-height) + 1vh);
    right: 1vh;
    left: 1vh;
    height: 10vh;
    width: unset;
    bottom: unset;
    flex-direction: row;
  }
}

span.nobios {
  animation-name: color;
  animation-duration: 2s;
  animation-iteration-count: infinite;
}

@keyframes color {
  0% {
    color: rgb(96,24,24);
  }
  33% {
    color: rgb(24,24,24);
  }
  67% {
    color: rgb(24,24,24);
  }
  100% {
    color: rgb(96,24,24);
  }
}

nav > div {
  width: 10vh;
  height: 10vh;
  margin-bottom: 1vh;
  margin-right: 1vw;
  flex: none;
  border: 0.5vh solid #555;
  border-radius: 1vh;
  cursor: pointer;
  background-size: 8vh;
  background-repeat: no-repeat;
  background-position: center;
}

nav > div:last-child {
  margin-bottom: unset !important;
  margin-right: unset !important;
}

nav > span {
  flex: 1;
}

#globe {
  background-image: url('images/globe.svg');
}

#gamepad {
  background-image: url('images/keyboard.svg');
}

#gamepad.keyboard {
  background-image: url('images/keyboard.svg');
}

#gamepad.gamepad {
  background-image: url('images/gamepad.svg');
}

#gamepad.connected {
  border: 0.5vh solid #246;
}

input[type="file"] {
  display: none;
}
.custom-file-upload {
  display: inline-block;
  width: 100%;
  height: 100%;
  background-image: url('images/upload.svg');
  cursor: pointer;
}

#quality {
  text-align: center;
  line-height: 9vh;
  font-size: 5vh;
  font-weight: bold;
  color: rgb(80, 80, 80);
}

#quality.restart {
  border: 0.5vh solid #a42;
}