html {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  margin: 0;
  padding: 8px;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  background-image: url("./assets/img/bg-image-canyon.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  font-family: Center, sans-serif;
  box-sizing: border-box;
}

@font-face {
  font-family: Center;
  src: url("./assets/fonts/Supply\ Center.ttf") format("opentype");
}

h1 {
  color: white;
  margin-bottom: 24px;
  text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.7);
}

.game-container {
  position: relative;
  width: min(100vw - 16px, calc((100vh - 16px) * (750 / 480)), 750px);
  aspect-ratio: 750 / 480;
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
  background-color: black;
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.start-screen {
  position: absolute;
  inset: 0;
  border-radius: 12px;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 20;
}

.menu-box {
  position: relative;
  background: rgba(34, 34, 34, 0.95);
  border-radius: 16px;
  padding: 24px;
  text-align: center;
  color: white;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  background-image: url("./assets/img/9_intro_outro_screens/start/startscreen_1.png");
  background-size: cover;
  background-position: center;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.menu-box h2 {
  margin-top: 0;
  margin-bottom: 8px;
  font-size: 32px;
}

.menu-text {
  margin-bottom: 24px;
  color: #dddddd;
}

.menu-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.menu-btn {
  border: none;
  border-radius: 12px;
  padding: 14px 18px;
  font-size: 18px;
  cursor: pointer;
  color: black;
  background: none;
  transition:
    transform 120ms ease,
    opacity 120ms ease;
}

.menu-btn:hover {
  transform: scale(1.05);
  opacity: 0.95;
}

#btn-start {
  background-image: url("./assets/img/9_intro_outro_screens/start/start.gif");
  background-size: cover;
  background-position: center;
  width: 200px;
  height: 80px;
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
}

#btn-anleitung {
  background-image: url("./assets/img/9_intro_outro_screens/start/info.png");
  background-size: 48px 48px;
  background-repeat: no-repeat;
  background-position: center;
  width: 48px;
  height: 48px;
  position: absolute;
  top: 16px;
  left: 16px;
}

#btn-impressum {
  background-image: url("./assets/img/9_intro_outro_screens/start/impressum.png");
  background-size: 48px 48px;
  background-repeat: no-repeat;
  background-position: center;
  width: 48px;
  height: 48px;
  position: absolute;
  top: 16px;
  left: 80px;
}

#btn-fullscreen {
  background-image: url("./assets/img/9_intro_outro_screens/start/fullscreen.png");
  background-size: 48px 48px;
  background-repeat: no-repeat;
  background-position: center;
  width: 48px;
  height: 48px;
  position: absolute;
  top: 16px;
  right: 16px;
}

#btn-ton {
  background-image: url("./assets/img/9_intro_outro_screens/start/volumen.png");
  background-size: 48px 48px;
  background-repeat: no-repeat;
  background-position: center;
  width: 48px;
  height: 48px;
  position: absolute;
  top: 16px;
  left: 144px;
}

.info-panel {
  position: absolute;
  top: 76px;
  right: 24px;
  bottom: 76px;
  left: 24px;
  box-sizing: border-box;
  padding: 14px 16px;
  border-radius: 14px;
  text-align: left;
  color: #ffd400;
  background: rgba(0, 0, 0, 0.8);
  overflow-y: auto;
  overflow-x: hidden;
  font-size: 14px;
  line-height: 1.35;
  overscroll-behavior: contain;
  scrollbar-color: #ffd400 rgba(0, 0, 0, 0.35);
  scrollbar-width: thin;
}

.info-panel h3 {
  margin-top: 0;
  margin-bottom: 8px;
}

.info-panel p {
  margin: 8px 0;
}

.info-panel a {
  color: #ffffff;
  overflow-wrap: anywhere;
}

.info-panel::-webkit-scrollbar {
  width: 8px;
}

.info-panel::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.35);
  border-radius: 8px;
}

.info-panel::-webkit-scrollbar-thumb {
  background: #ffd400;
  border-radius: 8px;
}

.hidden {
  display: none;
}

.fullscreen {
  width: 100vw;
  height: 100vh;
  border-radius: 0;
}

.game-end-overlay {
  position: absolute;
  inset: 0;
  border-radius: 16px;
  z-index: 30;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
}

.game-end-overlay.hidden {
  display: none;
}

.game-end-image {
  width: 42%;
  object-fit: contain;
}

.game-end-buttons {
  display: flex;
  gap: 16px;
}

.end-btn {
  background: rgba(0, 0, 0, 0.85);
  color: #ffd400;
  border: 2px solid #ffd400;
  border-radius: 14px;
  padding: 12px 28px;
  font-size: 18px;
  font-family: Center, sans-serif;
  cursor: pointer;
  letter-spacing: 0.5px;
  transition:
    transform 120ms ease,
    background 120ms ease;
}

.end-btn:hover {
  transform: scale(1.07);
  background: rgba(255, 212, 0, 0.2);
}

.game-ctrl-btn {
  position: absolute;
  top: 10px;
  right: 50%;
  transform: translateX(50%);
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.55);
  cursor: pointer;
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 120ms;
}

.game-ctrl-btn:hover {
  opacity: 0.75;
}

#btn-pause::before,
#btn-pause::after {
  content: "";
  display: block;
  width: 5px;
  height: 18px;
  background: white;
  border-radius: 2px;
  margin: 0 3px;
}

.pause-overlay {
  position: absolute;
  inset: 0;
  border-radius: 16px;
  z-index: 25;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
}

.pause-overlay.hidden {
  display: none;
}

.pause-box {
  background: rgba(20, 20, 20, 0.9);
  border: 2px solid rgba(255, 212, 0, 0.4);
  border-radius: 18px;
  padding: 32px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  min-width: 220px;
}

.pause-title {
  color: #ffd400;
  font-family: Center, sans-serif;
  font-size: 28px;
  margin: 0 0 8px 0;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.pause-sound-btn {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 12px;
  padding: 10px 24px;
  font-size: 16px;
  font-family: Center, sans-serif;
  cursor: pointer;
  width: 100%;
  transition:
    background 120ms,
    transform 120ms;
}

.pause-sound-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: scale(1.03);
}

.pause-action-btn {
  background: rgba(0, 0, 0, 0.7);
  color: #ffd400;
  border: 2px solid #ffd400;
  border-radius: 14px;
  padding: 11px 28px;
  font-size: 17px;
  font-family: Center, sans-serif;
  cursor: pointer;
  width: 100%;
  letter-spacing: 0.5px;
  transition:
    transform 120ms,
    background 120ms;
}

.pause-action-btn:hover {
  transform: scale(1.05);
  background: rgba(255, 212, 0, 0.18);
}

.rotate-screen {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100vw;
  height: 100vh;
  background: #000;
  color: white;
  display: none;
  justify-content: center;
  align-items: center;
  text-align: center;
  z-index: 9999;
  font-size: 24px;
  padding: 20px;
}

.difficulty-btn {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  min-width: 132px;
  height: 42px;
  padding: 0 16px;
  border: 2px solid #ffd400;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.72);
  color: #ffd400;
  font-family: Center, sans-serif;
  font-size: 15px;
  letter-spacing: 0;
}

.difficulty-btn:hover {
  background: rgba(255, 212, 0, 0.2);
  transform: translateX(-50%) scale(1.05);
}

.difficulty-btn[data-difficulty="easy"] {
  border-color: #74d680;
  color: #74d680;
}

.difficulty-btn[data-difficulty="normal"] {
  border-color: #ffd400;
  color: #ffd400;
}

.difficulty-btn[data-difficulty="hard"] {
  border-color: #ff6b4a;
  color: #ff6b4a;
}

