body {
  background-color: black;
  overflow: hidden; /* Prevent scrolling */
  height: 100vh;
  width: 100vw;
  touch-action: none;
}

/* Prevent scrolling on html as well */
html {
  overflow: hidden;
  height: 100vh;
  width: 100vw;
}
#touch-controls {
  position: fixed;
  bottom: 12px;
  left: 12px;
  z-index: 10;
  display: none;
  pointer-events: auto;
}

.dpad {
  display: grid;
  grid-template-columns: 56px 56px 56px;
  grid-template-rows: 56px 56px 56px;
  gap: 6px;
}

.dpad .touch-btn {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  border: 2px solid #fbd62a;
  background: rgba(0, 0, 0, 0.6);
  color: #fbd62a;
  font-size: 20px;
  font-family: 'Press Start 2P', cursive;
  touch-action: none;
}

.dpad .touch-btn:nth-child(1) {
  grid-column: 2;
  grid-row: 1;
}

.dpad .touch-btn:nth-child(2) {
  grid-column: 1;
  grid-row: 2;
}

.dpad .touch-btn:nth-child(3) {
  grid-column: 3;
  grid-row: 2;
}

.dpad .touch-btn:nth-child(4) {
  grid-column: 2;
  grid-row: 3;
}

@media (max-width: 700px) {
  .dpad {
    grid-template-columns: 46px 46px 46px;
    grid-template-rows: 46px 46px 46px;
  }
  .dpad .touch-btn {
    width: 46px;
    height: 46px;
    font-size: 16px;
  }
}

@font-face {
  font-family: clipneon;
  src: url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/707108/clip.ttf);
}

@font-face {
  font-family: "Press Start 2P";
  src: url("fonts/PressStart2P.ttf");
}

#controls {
  display: block;
}

.game-font {
  font-family: 'Press Start 2P', cursive;
  text-transform: uppercase;
}

li {
  color: #fbd62a;
  font-family: 'Press Start 2P', cursive;
  text-transform: uppercase;
}

h4 {
  color: white;
}

.name {
  position: absolute;
  top: 39vh;
  font-family: 'Press Start 2P', cursive;
  font-size: 12px;
}

.game-input {
    top: 43vh;

}

input {
  border: none;
}

canvas {
  position: relative;
  padding-left: 0;
  padding-right: 0;
  margin-right: auto !important;
  display: none;
  -webkit-animation-name: canvasUp;
  -webkit-animation-duration: 1s;
  animation-name: canvasUp;
  animation-duration: 1s animation-duration: 1s;
  z-index: 0;
}

#connection-status,
#lobby-status,
#session-status {
  font-family: 'Press Start 2P', cursive;
  text-transform: uppercase;
  color: #fbd62a;
  z-index: 5;
  pointer-events: none;
}

#connection-status {
  position: fixed;
  top: 12px;
  left: 12px;
  font-size: 10px;
  background: rgba(0, 0, 0, 0.6);
  padding: 6px 10px;
  border: 1px solid #fbd62a;
}

#lobby-status,
#session-status {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  background: rgba(0, 0, 0, 0.65);
  padding: 8px 14px;
  border: 1px solid #fbd62a;
  text-align: center;
  max-width: 90vw;
}

#session-status {
  top: 54px;
  font-size: 10px;
  color: #ffffff;
  border-color: #ffffff;
}

#lobby-status:empty,
#session-status:empty {
  display: none;
}

@-webkit-keyframes canvasUp {
  from {
    bottom: -100px;
    opacity: 0
  }

  to {
    bottom: 0px;
    opacity: 1
  }
}

#white {
  color: white
}

@keyframes canvasUp {
  from {
    bottom: -100px;
    opacity: 0
  }

  to {
    bottom: 0;
    opacity: 1
  }
}

#loader {
  position: absolute;
  z-index: 1;
  width: 100%;
  background-image: url("images/rollercoaster1.gif");
  height: 100%;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

ul {
  position: absolute;
  right: 30;
  top: 0;
  list-style-type: none;
}

.sign-four {
  -webkit-transform: matrix3d(0.77, 0, -0.64, -.001, 0.00, 1, 0.00, 0, 0.64, 0, 0.77, 0, 0, 0, 0, 1);
  color: #F0D6DE;
  font-family: clipneon;
  font-size: 2vw;
  line-height: 6vw;
  margin-right: 2vw;
  transform: matrix3d(0.77, 0, -0.64, -.001, 0.00, 1, 0.00, 0, 0.64, 0, 0.77, 0, 0, 0, 0, 1);
  text-shadow:
    .1vw 0vw .25vw #F0D6DE, .2vw 0vw .25vw #F0D6DE, .4vw 0vw .25vw #F0D6DE,
    .1vw 0vw .1vw #F181B2, .2vw 0vw 0vw #F181B2, .4vw 0vw 0vw #F181B2,
    .1vw 0vw .1vw #F181B2, .2vw 0vw .1vw #F181B2, .4vw 0vw 0vw #F181B2,
    .1vw 0vw 1vw #F181B2, .2vw 0vw 2vw #F181B2, .4vw 0vw 2vw #F181B2, .2vw 0vw 5vw #F181B2,
    .1vw 0vw .5vw #F20B70, .2vw 0vw .5vw #F20B70, .4vw 0vw 6vw #F20B70,
    .1vw 0vw 4vw #F20B70, .2vw 0vw 20vw #F20B70, .4vw 0vw 10vw #F20B70,
    .1vw 0vw 10vw #F20B70, .2vw 0vw 30vw #F20B70, .4vw 0vw 10vw #F20B70;
}

.eightbit-btn {
  background: #92CD41;
  display: inline-block;
  position: relative;
  text-align: center;
  font-size: 10px;
  font-family: 'Press Start 2P', cursive;
  text-decoration: none;
  color: white;
  box-shadow: inset -4px -4px 0px 0px #4AA52E;
  padding: 5px;
  top: 47vh;
}

.eightbit-btn:hover, .eightbit-btn:focus {
  background: #76c442;
  box-shadow: inset -6px -6px 0px 0px #4AA52E;
}

.eightbit-btn:active {
  box-shadow: inset 4px 4px 0px 0px #4AA52E;
}

.eightbit-btn:before, .eightbit-btn:after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  box-sizing: content-box;
}

.eightbit-btn:before {
  top: -6px;
  left: 0;
  border-top: 6px black solid;
  border-bottom: 6px black solid;
}

.eightbit-btn:after {
  left: -6px;
  top: 0;
  border-left: 6px black solid;
  border-right: 6px black solid;
}

.eightbit-btn--reset {
  background: #E76E55;
  box-shadow: inset -4px -4px 0px 0px #8C2022;
}

.eightbit-btn--reset:hover, .eightbit-btn--reset:focus {
  background: #CE372B;
  box-shadow: inset -6px -6px 0px 0px #8C2022;
}

#ui-flex-container {
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 10;
  pointer-events: none;
  background: none;
}

#ui-flex-container > *:not(.title) {
  margin: 16px 0;
  pointer-events: auto;
  font-family: 'Press Start 2P', cursive !important;
  text-align: center;
  /* Animation for slide-in and unblur */
  animation: ui-slide-unblur 1s cubic-bezier(0.23, 1, 0.32, 1) forwards;
  filter: blur(8px);
  opacity: 0;
}

#ui-flex-container > .show,
#ui-flex-container > *:not(.title).show {
  filter: blur(0);
  opacity: 1;
}

/* Keyframes for sliding from bottom and unblurring */
@keyframes ui-slide-unblur {
  0% {
    transform: translateY(80px);
    filter: blur(8px);
    opacity: 0;
  }
  60% {
    filter: blur(2px);
    opacity: 1;
  }
  100% {
    transform: translateY(0);
    filter: blur(0);
    opacity: 1;
  }
}

#ui-flex-container > .title,
.title {
    position: absolute !important;
    top: 26vh !important;
  left: 0;
  right: 0;
  margin: 0 auto;
  z-index: 20;
  display: block !important;
  pointer-events: none;
  font-family: 'Press Start 2P', cursive !important;
  text-align: center;
  font-size: 40px;
  font-weight: 700;
  text-transform: uppercase;
  color: #fbd62a;
  text-shadow: 0 -1px 15px rgba(0, 0, 0, 0.9), 0 1px 0 #7f6303, 0 3px 0 #846703, 0 5px 0 #896b03, 0 7px 0 #8e6f03, 0 9px 0 #937203, 0 6px 50px rgba(252, 223, 92, 0.8);
  line-height: 0.8;
  /* keep transform for 3D effect */
  -webkit-transform: perspective(2.5em) rotateX(15deg) scaleY(0.8);
  -moz-transform: perspective(2.5em) rotateX(15deg) scaleY(0.8);
  -ms-transform: perspective(2.5em) rotateX(15deg) scaleY(0.8);
  -o-transform: perspective(2.5em) rotateX(15deg) scaleY(0.8);
  transform: perspective(2.5em) rotateX(15deg) scaleY(0.8);
  /* Animation for slide-in and unblur */
  animation: title-slide-unblur 1s cubic-bezier(0.23, 1, 0.32, 1) forwards;
  filter: blur(8px);
  opacity: 0;
}

#ui-flex-container > .title.show,
.title.show {
  filter: blur(0);
  opacity: 1;
}

/* Keyframes for sliding from top and unblurring */
@keyframes title-slide-unblur {
  0% {
    transform: translateY(-80px) perspective(2.5em) rotateX(15deg) scaleY(0.8);
    filter: blur(8px);
    opacity: 0;
  }
  60% {
    filter: blur(2px);
    opacity: 1;
  }
  100% {
    transform: translateY(0) perspective(2.5em) rotateX(15deg) scaleY(0.8);
    filter: blur(0);
    opacity: 1;
  }
}

.title:hover {
  -webkit-transform: perspective(8em) rotateX(11deg) scale(1.2);
  -moz-transform: perspective(8em) rotateX(11deg) scale(1.2);
  -ms-transform: perspective(8em) rotateX(11deg) scale(1.2);
  -o-transform: perspective(8em) rotateX(11deg) scale(1.2);
  transform: perspective(8em) rotateX(11deg) scale(1.2);
  text-shadow: 0 -1px 15px black, 0 1px 0 #7f6303, 0 2px 0 #846703, 0 0px 0 #896b03, 0 1px 0 #8e6f03, 0 2px 0 #937203, 0 2px 30px rgba(252, 223, 92, 0.6);
}

.eightbit-btn--reset:active {
  box-shadow: inset 4px 4px 0px 0px #8C2022;
}

#ready-button {
  position: relative;
  z-index: 30;
}

.sidebar {
  width: 100%;
  height: 80px;
  top: 0px;
  left: 0px;
  background-color: transparent;
  transition: 0.5s;
  position: fixed;
  /* opacity: 0.9; */
  z-index: 1;
}

.visible {
  height: 100%;
  transition: 0.5s;
  animation: fadeIn 0.7s 1 linear;
  background-color: #000000c4;
}

@keyframes fadeIn {
  0% {
    opacity: 0;
  }

  100% {
    opacity: 0.8;
  }
}

.sidebar ul {
  list-style: none;
  text-align: center;
  margin: 0px;
  padding: 0px;
  display: none;
  float: right;
  margin-top: 5%;
  position: absolute;
  left: 0;
}

.sidebar ul li {
  margin-top: 5px;
}

.sidebar ul li a {
  text-decoration: none;
  color: #ccc;
  padding: 12px;
  width: 200px;
  display: block;
  opacity: 1;
}

.sidebar .display {
  display: block;
}

.sidebar ul li a:hover {
  padding-right: 20px;
  transition: 0.5s;
}

.sidebar-btn {
  display: none;
  top: 10%;
  width: 30px;
  left: calc(100% - 65px);
  cursor: pointer;
  transition: 0.3s;
  position: fixed;
  z-index: 2;
}

.open {
  transition: 0.5s;
  z-index: 2;
}

.sidebar-btn span {
  width: 20px;
  height: 3px;
  background-color: #78bbff;
  margin-top: 5px;
  display: block;
}

.topRotate {
  transform: rotate(45deg);
  transition: 0.7s linear;
  width: 15px;
}

.arrow {
  margin-left: -15px;
  transition: 0.7s linear;
}

.buttomRotate {
  transform: rotate(-45deg);
  transition: 0.7s linear;
  width: 15px;
}

/* Responsive font sizes for mobile */
@media (max-width: 700px) {
  #ui-flex-container > *:not(.title) {
    font-size: 18px !important;
  }
  .game-input {
    font-size: 18px !important;
    padding: 12px !important;
  }
  .eightbit-btn {
    font-size: 16px !important;
    padding: 12px 18px !important;
  }
  #ui-flex-container > .title,
  .title {
    font-size: 56px !important;
    top: 10vh !important;
    line-height: 1.1 !important;
  }
}

/* Prevent background image repeat on mobile and fill screen */
@media (max-width: 700px) {
  canvas {
    background-repeat: no-repeat !important;
    background-size: cover !important;
    background-position: center center !important;
  }
}