body {
  background-color: black;
  font-family: 'Arial', sans-serif;
  max-height: 100%;
}

.map-container,
.navbar,
.main-menu,
.character,
.box,
.touch-control {
  display: none;
}

.map-container {
  position: relative;
  max-width: 120vh;
  max-height: 90vh;
  top: 5vh;
  aspect-ratio: 3/2;
  margin: 0 auto;
  align-items: center;
  z-index: 0;
}


#map {
  width: 100%;
  height: auto;
  display: block;
  position: relative;
  z-index: 1;
}

.overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
}

#characterSprite {
  margin-top: -150%;
  margin-left: -150%;
  width: 400%;
}

#demonSprite {
  margin-top: -150%;
  margin-left: -150%;
  width: 250%;
}

.fade-in-out {
  opacity: 0;
  animation: fadeInOut 4s ease-in-out forwards;
}

.main-menu {
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 100vh;
  background-image: url('../Assets/MainMenu.png');
  background-size: cover;
  background-position: center;
  opacity: 0;
  animation: fadeIn 1s ease-in-out forwards;
}

.navbar {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  height: 80%;
}

.nav-item {
  width: 300px;
  padding-block: 5px;
  padding-inline: 5px;
  font-size: 20px;
  background: rgb(32, 32, 32);
  border-radius: 10px;
  text-decoration: none;
  color: white;
  text-align: center;
  margin: 1px;
}

.nav-item a {
  text-decoration: none;
  color: white;
}

.nav-item:hover {
  color: #fff;
  background: rgb(39, 10, 10);
}

.box {
  position: fixed;
  z-index: 1;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background-color: #f9f9f9;
  border: 1px solid #888;
  padding: 5px;
  width: 20%;
  max-height: 80%;
  overflow-y: auto;
}

.box h2, p {
  margin: 4%;
  margin-left: 4%;
}

.close {
  float: right;
  cursor: pointer;
  margin-right: 1%;
}

.gameInfo {
  position: absolute;
  width: 100%;
  text-align: center;
  color: green;
  font-size: 24px;
  z-index: 10;
}

.timer,
.keysObtained {
  position: relative;
}

.touch-control {
  position: fixed;
  width: 50%;
  height: 50%;
  opacity: 0;
  pointer-events: auto;
  background-color: white;
  z-index: 999;
}

#upControl {
  top: 0;
  left: 0;
  height: 30%;
  width: 100%;
}

#downControl {
  bottom: 0;
  left: 0;
  height: 30%;
  width: 100%;
}

#leftControl {
  top: 0;
  left: 0;
  width: 30%;
  height: 100%;
}

#rightControl {
  top: 0;
  right: 0;
  width: 30%;
  height: 100%;
}

#landscapeOverlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0);
  z-index: 9999;
}

.overlayContent {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: white;
}

@keyframes fadeIn {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

@media (max-width: 768px) {
  .navbar {
    margin-top: 5%;
    flex-direction: column;
    position: absolute;
    width: 100%;
    height: auto; 
  }
}