body {
  background: #e9e5dd;
  font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue",
    Helvetica, Arial, "Lucida Grande", sans-serif;
  font-weight: 300;
  margin: 0px;
  padding: 0px;
  touch-action: none;
  -webkit-touch-callout: none; /* iOS Safari */
  -webkit-user-select: none; /* Safari */
  -khtml-user-select: none; /* Konqueror HTML */
  -moz-user-select: none; /* Firefox */
  -ms-user-select: none; /* Internet Explorer/Edge */
  user-select: none; /* Non-prefixed version, currently
                                  supported by Chrome and Opera */
}

#game {
  width: 100%;
  touch-action: none;
}

#game canvas {
  margin-top: 20px;
  width: 100%;
  max-width: 480px;
  image-rendering: -moz-crisp-edges;
  image-rendering: -webkit-crisp-edges;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  border: 30px solid #736490;
  border-left: 60px solid #736490;
  border-right: 60px solid #736490;
  border-radius: 10px;
  border-bottom-right-radius: 40px;
}

#controller {
  display: none;
  touch-action: none;
}

#instructions {
  max-width: 480px;
  margin: 0px auto;
  padding: 20px;
  margin-top: 20px;
  margin-bottom: 20px;
  border-radius: 10px;
  text-align: left;
}

#instructions h2 {
  margin-top: 40px;
  text-decoration: underline;
}

#instructions strong {
  display: block;
  font-size: 80%;
  margin-bottom: 5px;
}

#instructions p {
  margin-bottom: 20px;
}

#instructions a {
  color: #000;
  font-weight: bold;
}

@media only screen and (max-width: 640px) {
  #game canvas {
    margin-top: 0px;
    width: 100%;
    max-width: 480px;
    border: 0px;
    border-radius: 0px;
    border-bottom: 10px solid #736490;
  }
}

@media only screen and (max-device-width: 812px) and (orientation: portrait) {
  body {
    background: #e9e5dd;
    margin: 0;
  }

  #instructions {
    display: none;
  }

  #game {
    width: 100%;
    position: fixed;
    touch-action: none;
  }

  #game canvas {
    margin: 0;
    display: block;
    width: 100%;
    border: 0;
    border-bottom: 10px solid #736490;
    border-radius: 0px;
  }

  #controller {
    display: block;
    position: fixed;
    bottom: 0px;
    height: 210px;
    width: 100%;
    background: #e9e5dd;
  }

  #controller_dpad {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 192px;
    height: 192px;
  }

  #controller_dpad:before {
    content: "";
    display: block;
    width: 64px;
    height: 64px;
    background: #222;
    position: absolute;
    left: 64px;
    top: 64px;
  }

  #controller_left {
    position: absolute;
    left: 0px;
    top: 64px;
    width: 64px;
    height: 64px;
    background: #222;
    background: radial-gradient(
      ellipse at center,
      #333 0%,
      #222 100%
    ); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */
    border-top-left-radius: 4px;
    border-bottom-left-radius: 4px;
  }

  #controller_right {
    position: absolute;
    left: 128px;
    top: 64px;
    width: 64px;
    height: 64px;
    background: #222;
    background: radial-gradient(
      ellipse at center,
      #333 0%,
      #222 100%
    ); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */
    border-top-right-radius: 4px;
    border-bottom-right-radius: 4px;
  }

  #controller_up {
    position: absolute;
    left: 64px;
    top: 0px;
    width: 64px;
    height: 64px;
    background: #222;
    background: radial-gradient(
      ellipse at center,
      #333 0%,
      #222 100%
    ); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;
  }

  #controller_down {
    position: absolute;
    left: 64px;
    top: 128px;
    width: 64px;
    height: 64px;
    background: #222;
    background: radial-gradient(
      ellipse at center,
      #333 0%,
      #222 100%
    ); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */
    border-bottom-left-radius: 4px;
    border-bottom-right-radius: 4px;
  }

  #controller_a {
    position: absolute;
    top: 20px;
    right: 10px;
    width: 80px;
    height: 80px;
  }

  #controller_a:after {
    content: "A";
    display: block;
    font-weight: bold;
    font-size: 32px;
    color: #440f1f;
    line-height: 80px;
    width: 80px;
    height: 80px;
    border-radius: 80px;
    background: #870a4c;
    background: radial-gradient(
      ellipse at center,
      #ab1465 0%,
      #8b1e57 100%
    ); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */
    box-shadow: 0px 4px 5px rgba(0, 0, 0, 0.2);
  }

  #controller_start {
    position: absolute;
    bottom: 20px;
    right: 10px;
    width: 80px;
    height: 40px;
  }

  #controller_start:after {
    content: "START";
    font-weight: bold;
    font-size: 14px;
    color: #111;
    display: block;
    line-height: 40px;
    width: 80px;
    height: 40px;
    border-radius: 40px;
    background: #222;
    background: radial-gradient(
      ellipse at center,
      #333 0%,
      #222 100%
    ); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */
    box-shadow: 0px 4px 5px rgba(0, 0, 0, 0.2);
  }

  .btn_pressed:after {
    opacity: 0.5;
  }
}

@media only screen and (max-device-width: 812px) and (orientation: landscape) {
  html,
  body {
    height: 100%;
  }
  body {
    background: #333;
    display: flex;
    justify-content: center;
    align-items: center;
  }

  #game:after {
    content: "PLEASE ROTATE ↻";
    font-size: 24px;
    font-weight: bold;
    color: #fff;
  }

  #game canvas {
    display: none;
  }
}
