@font-face {
  font-family: "UnifrakturCook";
  src: url("fonts/UnifrakturCook/UnifrakturCook-Bold.ttf") format("truetype");
}

body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: #2a0808;
  background-image: url("img/9_intro_outro_screens/start/startscreen not with name-min.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  margin: 0;
  height: 100vh;
  font-family: "UnifrakturCook", sans-serif;
}

canvas {
  background-color: transparent;
}

.game-container {
  position: relative;
  width: min(calc(100vw - 40px), calc((100vh - 40px) * 720 / 480), 720px);
  height: min(calc(100vh - 40px), calc((100vw - 40px) * 480 / 720), 480px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  border-radius: 10px;
  overflow: hidden;
  background-color: transparent;
}

.game-container:fullscreen {
  width: 100vw;
  height: 100vh;
  border-radius: 0;
}

.game-container:fullscreen canvas {
  width: 100%;
  height: 100%;
  object-fit: fill;
}

.button-container {
  display: flex;
  gap: 20px;
}

.btn {
  padding: 15px 35px;
  font-size: 18px;
  font-weight: bold;
  color: white;
  background-color: #f44336;
  border: none;
  border-radius: 30px;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(244, 67, 54, 0.4);
  transition:
    transform 0.2s,
    box-shadow 0.2s;
}

.btn:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(244, 67, 54, 0.6);
}

.btn-secondary {
  background-color: #8f8f8f;
  box-shadow: 0 4px 15px rgba(100, 100, 100, 0.4);
}

.btn-secondary:hover {
  box-shadow: 0 6px 20px rgba(100, 100, 100, 0.6);
}

.overlay-btn {
  background-color: rgba(0, 0, 0, 0.5);
  color: white;
  border: none;
  border-radius: 5px;
  padding: 5px 10px;
  font-size: 24px;
  cursor: pointer;
  margin-left: 5px;
  transition: background-color 0.2s;
}

.overlay-btn:hover {
  background-color: rgba(0, 0, 0, 0.8);
}

.back-btn {
  margin-top: 30px;
}

.back-btn-imp {
  margin-top: 30px;
  display: inline-block;
  text-decoration: none;
}

.impressum-btn {
  color: white;
  text-decoration: none;
  font-size: 18px;
  background: rgba(0, 0, 0, 0.5);
  padding: 5px 10px;
  border-radius: 5px;
  margin-top: 15px;
  z-index: 100;
  transition: background-color 0.2s;
}

.impressum-btn:hover {
  background: rgba(0, 0, 0, 0.8);
}

.keys p {
  font-size: 20px;
  margin: 10px 0;
  display: flex;
  align-items: center;
}

.keys span {
  background-color: #333;
  padding: 5px 15px;
  border-radius: 5px;
  margin-right: 15px;
  border: 2px solid #555;
  font-weight: bold;
  min-width: 40px;
  text-align: center;
  display: inline-block;
}

.instructions-desc {
  margin-top: 20px;
  font-size: 22px;
  color: #ccc;
}

#startScreen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url("img/9_intro_outro_screens/start/startbildschirm.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding-bottom: 40px;
  box-sizing: border-box;
  z-index: 10;
}

#instructionsPanel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  max-width: 800px;
  max-height: 90vh;
  overflow-y: auto;
  background-color: rgba(0, 0, 0, 0.9);
  color: white;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 30px;
  box-sizing: border-box;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

#instructionsPanel h2 {
  font-size: 50px;
  margin-bottom: 30px;
  color: #ff9800;
}

#endScreen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 30;
}

#endScreen img {
  max-width: 80%;
  max-height: 50%;
  object-fit: contain;
  margin-bottom: 10px;
}

#finalScoreDisplay {
  font-size: 36px;
  color: #ff9800;
  margin-bottom: 20px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
  font-weight: bold;
  text-align: center;
}

.new-highscore-anim {
  animation: pulse-highscore 1s infinite alternate;
}

@keyframes pulse-highscore {
  0% {
    transform: scale(1);
    color: #ff9800;
    text-shadow: 0 0 10px #ff9800, 2px 2px 4px rgba(0, 0, 0, 0.8);
  }

  100% {
    transform: scale(1.1);
    color: #ffd700;
    text-shadow: 0 0 25px #ffd700, 0 0 10px #ff9800, 2px 2px 4px rgba(0, 0, 0, 0.8);
  }
}

#gameOverlay {
  display: flex;
  position: absolute;
  top: 10px;
  right: 50%;
  transform: translateX(50%);
  z-index: 50;
}

.turn-device {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: black;
  color: white;
  z-index: 9999;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 24px;
  padding: 20px;
  box-sizing: border-box;
}

.impressum-container {
  background-color: rgba(0, 0, 0, 0.85);
  color: white;
  padding: 30px;
  border-radius: 10px;
  width: 90%;
  max-width: 800px;
  box-sizing: border-box;
  max-height: 90vh;
  margin: auto;
  text-align: left;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  font-family: Arial, sans-serif;
}

.impressum-container h1 {
  font-size: 28px;
  color: #ff9800;
  margin-bottom: 15px;
}

.impressum-container p {
  font-size: 16px;
  line-height: 1.4;
  margin-bottom: 10px;
}

.impressum-container a {
  color: #ff9800;
  text-decoration: none;
}

.impressum-container a:hover {
  text-decoration: underline;
}

.mobile-controls {
  display: none;
  position: absolute;
  bottom: 20px;
  left: 20px;
  right: 20px;
  justify-content: space-between;
  z-index: 20;
}

.left-controls,
.right-controls {
  display: flex;
  gap: 20px;
}

.mobile-btn {
  width: 60px;
  height: 60px;
  background-color: rgba(255, 255, 255, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  color: white;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  cursor: pointer;
}

.mobile-btn:active {
  background-color: rgba(255, 255, 255, 0.5);
}

#btnThrow img {
  height: 50px;
  vertical-align: middle;
}

#fullscreenBtn {
  display: none;
}

body.game-started #fullscreenBtn {
  display: block;
}

body.game-started .impressum-btn {
  display: none;
}

@media (max-width: 1366px) and (pointer: coarse) {
  .show-mobile {
    display: flex;
  }

  body.game-started #fullscreenBtn {
    display: none;
  }

  body .game-container {
    width: 100vw;
    height: 100vh;
    max-width: 100vw;
    max-height: 100vh;
    border-radius: 0;
  }

  body .game-container canvas {
    width: 100%;
    height: 100%;
    object-fit: fill;
  }
}

@media (max-width: 1366px) and (orientation: portrait) and (pointer: coarse) {
  body.game-started .turn-device {
    display: flex;
  }

  body.game-started .game-container {
    display: none;
  }

  body:not(.game-started) .game-container canvas {
    object-fit: cover;
  }

  body:not(.game-started) {
    background-image: none;
    background-color: #2a0808;
  }

  #startScreen {
    background-size: 100% 100%;
    background-position: center;
    justify-content: flex-end;
    padding-bottom: 80px;
    padding-top: 0;
  }

  #startScreen .button-container {
    flex-direction: column;
    gap: 7px;
  }

  #startScreen .button-container .btn {
    width: 220px;
    padding: 15px 20px;
    font-size: 18px;
  }

  .impressum-btn {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
  }
}



@media (max-width: 540px),
(max-height: 480px) {
  .button-container {
    flex-direction: column;
    align-items: center;
    gap: 3px;
    margin: -14px;
  }

  .button-container .btn {
    width: 160px;
    padding: 8px 15px;
    font-size: 14px;
  }

  #endScreen img {
    max-height: 40%;
    margin-bottom: 10px;
  }

  #finalScoreDisplay {
    font-size: 24px;
    margin-bottom: 10px;
  }

  #instructionsPanel {
    padding: 15px 10px;
    width: 95%;
  }

  #instructionsPanel h2 {
    font-size: 20px;
    margin-bottom: 12px;
  }

  .keys p {
    font-size: 14px;
    margin: 5px 0;
  }

  .keys span {
    padding: 4px 6px;
    margin-right: 6px;
    font-size: 13px;
    min-width: 30px;
  }

  .instructions-desc {
    margin-top: 12px;
    font-size: 12px;
    line-height: 1.3;
    text-align: center;
  }

  .back-btn {
    margin-top: 15px;
    padding: 10px 20px;
    font-size: 14px;
  }
}

@media (max-width: 630px) {
  #startScreen {
    background-image: url("img/9_intro_outro_screens/start/hochformat mobil phone.png");
    background-size: 100% 100%;
    justify-content: center;
    padding-bottom: 0;
  }
}