html, body {
  width: 100vw;
  height: 100vh;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

/* Ladebildschirm Styles */
#loadingScreen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(224, 224, 224, 0.97);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

#loadingLogo {
  width: 412.5px;
  height: auto;
  margin-bottom: 30px;
  cursor: default;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

#loadingLogo.active {
  cursor: pointer;
}

#loadingLogo.active:hover {
  transform: scale(1.1);
}

#loadingBarContainer {
  width: 300px;
  height: 20px;
  background: #ccc;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 20px;
}

#loadingBar {
  width: 0%;
  height: 100%;
  background: #000;
  transition: width 0.3s ease;
}

#loadingText {
  font-family: 'NokiaFC22', Arial, sans-serif;
  font-size: 0.9em;
  color: #333;
}
body {
  background: #000;
  font-family: 'Segoe UI', Arial, sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0;
  min-height: 100vh;
}

h1 {
  margin-top: 32px;
  margin-bottom: 8px;
  color: #333;
}

#scoreboard {
  display: none !important;
  gap: 32px;
  font-size: 1.2em;
  margin-bottom: 12px;
}

#gameCanvas {
  position: absolute;
  top: 0;
  left: 0;
  /* Die Größe wird per JavaScript gesetzt, um 16:9 beizubehalten */
  z-index: 1;
  background: #fff;
  border: none;
  box-shadow: none;
}

#gameOver {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 15;
  box-shadow: none;
  border: none;
    pointer-events: none;
  transform: translateY(0);
 }

#gameOver * {
  pointer-events: auto;
}

#restartBtn {
  margin-top: 16px;
  padding: 10px 28px;
  font-size: 1.1em;
  background: #4caf50;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
}
#restartBtn:hover {
  background: #388e3c;
}

.imgBtn {
  background: none;
  border: none;
  padding: 0;
  margin: 0 8px;
  cursor: pointer;
  outline: none;
  box-shadow: none;
  transition: filter 0.2s;
}
.imgBtn img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  display: block;
}
#menuBtn {
  position: absolute;
  top: 18px;
  z-index: 20;
  background: none;
  border: none;
}
#menuBtn img {
  width: 176px;
  height: 176px;
  object-fit: contain;
  background: none;
  border: none;
  box-shadow: none;
  display: block;
}
#menuBtn {
  right: 50px;
}
#menuBtn.visible {
  display: inline-block;
}
#logoImg {
  width: 220px;
  margin-bottom: 18px;
  margin-top: -18px;
}

#startBg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 5;
  background: rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  display: block;
}
#startMenu {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(255,255,255,0.0);
  box-shadow: none;
  border: none;
  z-index: 10;
  text-align: center;
}
#characterSelect {
  display: flex;
  gap: 32px;
  justify-content: center;
  margin: 18px 0 24px 0;
}
.bigStartBtn {
  position: relative;
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0;
  margin: 0 auto;
  display: block;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  outline: none;
  transition: all 0.2s ease;
  transform: scale(1);
  font-weight: normal;
}
.bigStartBtn:hover, .bigStartBtn:focus {
  transform: scale(1.1);
  font-weight: 700;
  text-shadow: -4px -4px 0 #000, 4px -4px 0 #000, -4px 4px 0 #000, 4px 4px 0 #000, -3px -3px 0 #000, 3px -3px 0 #000, -3px 3px 0 #000, 3px 3px 0 #000 !important;
}
.bigStartBtn.inactive {
  cursor: default;
  transform: scale(1) !important;
  font-weight: normal !important;
  text-shadow: -3px -3px 0 #000, 3px -3px 0 #000, -3px 3px 0 #000, 3px 3px 0 #000, -2px -2px 0 #000, 2px -2px 0 #000, -2px 2px 0 #000, 2px 2px 0 #000 !important;
}

.bigStartBtn.inactive:hover, .bigStartBtn.inactive:focus {
  transform: none !important;
  font-weight: normal !important;
  text-shadow: -3px -3px 0 #000, 3px -3px 0 #000, -3px 3px 0 #000, 3px 3px 0 #000, -2px -2px 0 #000, 2px -2px 0 #000, -2px 2px 0 #000, 2px 2px 0 #000 !important;
  transition: none !important;
}
.charPreviewImg {
  width: 140px;
  height: 140px;
  object-fit: cover;
  background: #fff;
  border: 3px solid #000;
  box-shadow: 0 0 0 2px #000;
  display: block;
  margin-bottom: 8px;
  border-radius: 0;
  transition: background 0.2s ease, transform 0.2s ease;
}
.charBtn {
  background: none;
  border: none;
  border-radius: 0;
  padding: 8px 12px 4px 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  outline: none;
  box-shadow: none;
}
.charBtn:hover .charPreviewImg {
  background: #ff6b6b;
  transform: scale(1.05);
  border: 3px solid #000; /* Schwarze Outline beibehalten beim Hover */
}
.charBtn.selected .charPreviewImg, .charBtn:focus .charPreviewImg {
  background: #ff6b6b;
  border: 3px solid #000; /* Schwarze Outline beibehalten bei Auswahl */
}
.charBtn div {
  font-family: 'NokiaFC22', Arial, sans-serif;
  font-size: 1.75em;
  font-weight: bold;
  color: #000;
  margin-top: 4px;
  text-shadow: -2px -2px 0 #fff, 2px -2px 0 #fff, -2px 2px 0 #fff, 2px 2px 0 #fff, -1px -1px 0 #fff, 1px -1px 0 #fff, -1px 1px 0 #fff, 1px 1px 0 #fff;
}
.charBtn canvas {
  margin-bottom: 6px;
  background: #fff;
  border-radius: 6px;
  border: 1px solid #ccc;
}

.gameOverImg {
  width: 600px;
  max-width: 90vw;
  height: auto;
  display: block;
  margin: 0 auto 32px auto;
}
#gameOver p {
  font-size: clamp(1.8em, 4.5vw, 3em);
  font-weight: bold;
  margin: 0 0 32px 0;
  color: #222;
  text-align: center;
}
#finalScore {
  font-size: 1.2em;
  color: #1976d2;
}
#restartBtn.imgBtn img {
  width: 540px;
  height: 180px;
  object-fit: contain;
  background: none;
  border: none;
  box-shadow: none;
  display: block;
  margin: 0 auto;
}
#restartBtn.imgBtn {
  background: none;
  border: none;
  box-shadow: none;
  margin-top: 0;
  padding: 0;
  display: block;
  margin-left: auto;
  margin-right: auto;
  transition: transform 0.2s ease;
}

#restartBtn.imgBtn:hover {
  transform: scale(1.1);
  filter: brightness(1.2);
}
#scorePlus {
  position: absolute;
  top: 24px;
  left: 32px;
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}
#scoreLabel {
  font-size: 2.2em;
  font-weight: bold;
  color: #222;
  margin-bottom: 0;
  letter-spacing: 1px;
}
#lives {
  position: static;
  top: unset;
  left: unset;
  z-index: auto;
  display: flex;
  gap: 16px;
}
.life-heart {
  width: clamp(28px, 4.5vw, 56px);
  height: clamp(28px, 4.5vw, 56px);
  object-fit: contain;
  display: block;
}

/* -------------------- Responsive Typografie & Elemente -------------------- */
:root {
  /* Grundschriftgröße ähnlich wie vorher, skaliert nur leicht auf kleinen Displays */
  font-size: clamp(10px, 1.25vw, 16px);
}

#loadingLogo {
  width: clamp(200px, 32vw, 412.5px) !important;
}

#loadingBarContainer {
  width: clamp(160px, 24vw, 300px) !important;
}

#menuBtn img {
  width: clamp(80px, 13.5vw, 176px);
  height: auto;
}

#logoImg {
  width: clamp(120px, 17vw, 220px);
  height: auto;
}

.gameOverImg {
  width: clamp(300px, 50vw, 600px);
}

.charPreviewImg {
  width: clamp(70px, 11vw, 140px);
  height: clamp(70px, 11vw, 140px);
}

#restartBtn.imgBtn img {
  width: clamp(270px, 42vw, 540px);
  height: auto;
}

#scoreLabel, #menuText {
  font-size: clamp(16px, 3vw, 44px) !important;
}

h1 {
  font-size: 2em !important;
}

h2 {
  font-size: 1.5em !important;
}

/* -------- Landscape Orientation Tweaks -------- */
@media (orientation: landscape) {
  #gameOver p {
    font-size: clamp(1.6em, 4vw, 3em) !important;
  }
  #gameOverInfo {
    margin-top: 5px !important; /* 20px - 15px */
  }
  #gameOverInfo > div {
    font-size: clamp(1.1em, 6vw, 2.2em) !important;
    line-height: 1.1;
  }
}
 