@font-face {
  font-family: 'Zabars';
  src: url('font/ZABARS/zabars.ttf') format('truetype');
}

body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-image: url('img/background-image-desert.jpg');
  background-position: center;
  min-height: 100vh;
  margin: 0;
  font-family: 'Zabars', Arial, Helvetica, sans-serif;
}

a {
  text-decoration: none;
  color: black;
  font-size: 20px;
}

h1 {
  text-align: center;
  font-size: 64px;
  letter-spacing: 3px;
  text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.5);
}

canvas {
  background-color: black;
  display: block;
  will-change: transform;
}

.impressum-container {
  max-width: 900px;
  margin: 20px auto;
  padding: 20px;
  box-sizing: border-box;
  font-size: 16px;
}

.explanationButton {
  display: inline-block;
  padding: 10px 10px;
  background-color: transparent;
  font-family: 'Zabars';
  color: black;
  text-decoration: none;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  font-size: 20px;
  margin-top: 370px;
  margin-right: 10px;
  width: 120px;
  height: 40px;
}

.explanationButton:hover {
  background-color: rgba(243, 158, 0, 0.196);
}

#impressumOverlay {
  display: none;
  position: fixed;
  inset: 0;
  background-image: url('img/background-image-desert.jpg');
  color: black;
  z-index: 3000;
  overflow: auto;
  padding: 20px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
}

#impressumOverlay h2 {
  margin-top: 20px;
  font-size: 32px;
}

#impressumOverlay button {
  margin-top: 30px;
  padding: 10px 20px;
  font-family: 'Zabars';
  font-size: 20px;
  background: orange;
  color: black;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

#impressumOverlay button:hover {
  background: darkorange;
}

#touchControls {
  display: none;
  position: fixed;
  width: 100%;
  height: 100%;
  pointer-events: none;
  background-color: transparent;
  z-index: 200;
}

#leftControls {
  position: fixed;
  bottom: 20px;
  left: 20px;
  pointer-events: auto;
  background-color: transparent;
}

#leftControls button {
  width: 60px;
  height: 60px;
  font-size: 24px;
  margin: 5px;
  background-color: transparent;
}

#rightControls {
  position: fixed;
  bottom: 20px;
  right: 20px;
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  background-color: transparent;
}

#touchControls {
  display: none;
}

#rightControls button {
  width: 60px;
  height: 60px;
  font-size: 16px;
  margin: 5px;
  background-color: transparent;
}

.muteButton {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  pointer-events: auto;
  font-size: 20px;
}

.homeButton {
  position: fixed;
  top: 20px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  pointer-events: auto;
  font-size: 20px;
}

#btnMuteDesktop {
  right: 20px;
}

#btnHomeDesktop {
  right: 70px;
}

#btnMuteMobile {
  right: 20px;
}

#btnHomeMobile {
  right: 70px;
}

#restartButton {
  position: fixed;
  bottom: 8vh;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1003;
  font-size: 18px;
  padding: 12px 24px;
  border-radius: 8px;
  width: 140px;
  background-color: transparent;
  color: white;
  border: none;
  display: none;
}

#restartButton:hover {
  background-color: rgb(248, 166, 13);
}

#desktopImpressum {
  display: block;
}

#btnImpressum {
  width: 120px;
  height: 40px;
  font-family: 'Zabars';
  font-size: 20px;
  background: transparent;
  border: none;
  color: black;
  cursor: pointer;
  text-align: center;
  padding: 0;
}

#btnImpressum:hover {
  background-color: rgba(243, 158, 0, 0.196);
}

#startScreenButtons {
  position: absolute;
  left: 50%;
  transform: translate(-50%);
  z-index: 1001;
  display: flex;
  gap: 20px;
}

/*Smartphones */
@media only screen and (max-width: 720px) {
  canvas {
    width: 100%;
  }
}

/*Smartphones */
@media only screen and (max-height: 480px) {
  canvas {
    height: 100vh;
  }

  h1 {
    display: block;
  }
}

@media screen and (orientation: portrait) and (max-width: 768px) {
  #orientationOverlay {
    display: block;
  }
}

@media (max-width: 768px) and (orientation: landscape) {
  body {
    overflow: hidden;
    height: 100vh;
  }

  #fullscreen {
    width: 100vw;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    background-color: black;
    z-index: 1;
  }

  .explanationButton {
    margin-bottom: 8vh;
    margin-top: 92vh;
  }

  canvas {
    width: 100vw !important;
    height: 100vh !important;
  }

  footer {
    display: none;
  }
}

@media (max-width: 768px) and (hover: none) and (pointer: coarse) {
  #touchControls {
    display: block !important;
  }
}

@media (hover: none) and (pointer: coarse) {
  #desktopImpressum {
    display: none;
  }
}

@media (max-width: 3000px) {
  #desktopImpressum {
    display: none;
  }
}

@media (hover: none) and (pointer: coarse) and (orientation: landscape) {
  html,
  body {
    margin: 0;
    padding: 0;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    background: none;
    background-color: #000;
  }

  #mobileImpressumLink {
    position: fixed;
    bottom: 5vh;
    right: 3vw;
    font-size: 10px;
    text-align: center;
    width: 10%;
    z-index: 1002;
  }

  #mobileImpressumLink a {
    color: black;
    text-decoration: none;
  }

  #startScreenButtons {
    position: fixed;
    bottom: 5vh;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 20px;
    z-index: 1002;
  }

  .explanationButton {
    margin: 0;
  }

  #fullscreen,
  canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw !important;
    height: 100vh !important;
  }

  body {
    background-image: none;
  }
}

@media (hover: none) and (pointer: coarse) and (orientation: portrait) {
  #orientationOverlay {
    display: flex !important;
    align-items: center;
    justify-content: center;
    position: fixed;
    inset: 0;
    background: #000;
    color: #fff;
    font: 20px/1.4 Zabars, Arial;
    text-align: center;
    z-index: 2000;
  }
}
canvas {
  will-change: transform;
}
