* {
  user-select: none;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

#M {
  position: absolute;
  background: #000;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}

#M {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  margin: auto;

  width: 100vw;
  height: 66.66vw;
  background: #000;
}

@media (min-aspect-ratio: 3/2) {
  #M {
    width: 150vh;
    height: 100vh;
  }
}

#HUD {
  visibility: hidden;
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  margin: 10px;
}

#T,
#L {
  font-family: monospace;
  padding: 15px;
  line-height: 70px;
  font-size: 60px;
  text-shadow: 1px 1px 3px #000;
}

#L {
  float: right;
  color: #afc;
  transition: opacity 1.2s linear;
  opacity: 0;
}

#L.a {
  opacity: 1;
}

#T {
  float: left;
  border-radius: 10px;
  width: 70px;
  text-align: center;
  transition: color 150ms linear, background-color 300ms linear;
  background: rgba(20, 0, 40, 0.3);
  border: 1px solid rgba(20, 0, 40, 0.3);
}

#T.x {
  background: red;
}

#c {
  padding: 0;
  display: block;
  visibility: hidden;
}

pre {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  right: 0;
  color: #8fa;
  position: absolute;
  white-space: pre-wrap;
  font-size: 19px;
  padding: 1em;
}

#B {
  display: inline-block;
  background: #8fa;
  animation: B 1s linear infinite;
}

@keyframes B {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 1;
  }
  51% {
    opacity: 0;
  }
  100% {
    opacity: 0;
  }
}

#end {
  display: none;
}

.won #end {
  display: block;
}

.won #hud {
  display: none;
}

#intro {
  overflow: hidden;
  max-height: 0px;
  transition: max-height 1.2s linear;
}

#intro.a {
  max-height: 100%;
}

.started #intro {
  display: none;
}

.started #C,
.started #HUD {
  visibility: visible;
}

small {
  font-family: monospace;
  font-size: 13px;
  position: absolute;
  right: 0;
  bottom: 15px;
  color: #040;
}

.started small {
  display: none;
}

#joystick {
  position: absolute;
  bottom: 20px;
  left: 20px;
  width: 110px;
  height: 110px;
  touch-action: none;
  -webkit-user-select: none;
  z-index: 10;
}
#joystick .base {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(150,150,150,0.12);
  border: 2px solid rgba(150,150,150,0.18);
  border-radius: 50%;
  box-sizing: border-box;
}
#joystick .knob {
  position: absolute;
  width: 44px;
  height: 44px;
  left: calc(50% - 22px);
  top: calc(50% - 22px);
  background: rgba(175,255,192,0.9);
  border-radius: 50%;
  transition: transform 0s;
}
@media (min-aspect-ratio: 3/2) {
  #joystick {
    left: 30px;
    bottom: 30px;
  }
}
#rotateOverlay {
  position: absolute;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.9);
  color: #8fa;
  font-family: monospace;
  display: none;
  align-items: center;
  justify-content: center;
  text-align: center;
  z-index: 50;
  padding: 1em;
  font-size: 20px;
}
body.portrait #joystick {
  pointer-events: none;
  opacity: 0.35;
}
body.portrait #c {
  filter: blur(2px);
}
