*, *:before, *:after {
  box-sizing: border-box;
  touch-action: manipulation;
}

body {
  overflow: hidden;
  background-color: #9db1d4;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  margin: 0;
  padding: 0;
  font-family: 'Arial', sans-serif;
  font-size: 16px;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  cursor: default;
}

#menu {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border: 2px solid #ffffff;
  z-index: 2;
  background-image: url(/imgs/background.png)
}


#canvas {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: 100%;
  max-height: calc(100vh - 5px); /* 20px für den Rand */
  border: 2px solid  #ffffff;
  z-index: 1;
  width: auto;
  height: auto;
}

#main {
  position: relative;
  width: 100vw; /* Breite auf 80% des Viewports setzen */
  height: auto;
  aspect-ratio: 16 / 9; /* Seitenverhältnis 16:9 festlegen */
  max-width: 800px; /* Maximale Breite setzen */
  max-height: 450px; /* Maximale Höhe setzen */
}

#leaderboard {
  position: relative;
}


ul {
  list-style: none;
  padding: 0;
  margin: 0
}
li {
  padding: 10px 0;
}

a {
  text-decoration: none;
  color: inherit;
}

.wrapper {
  position: relative;
  max-width: 800px; /* Maximale Breite */
  width: 100%; /* Sorgt dafür, dass es auf kleineren Bildschirmen skaliert */
  margin: auto; /* Zentriert das Element horizontal */

}

.wrapper:before {
  content: '';
  display: block;
  padding-top: 56.25%; /* Erzeugt ein 16:9 Verhältnis 56.25*/
}



#progress {
  height: 12%;
  margin: auto;
  position: absolute;
  top: 0; bottom: 0;
  transform: translate(-50%, -50%);
  left: 50%;
}
#percent {
  color: white;
  font-weight: bold;
  text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
}
#progress-bar {
  width: 15vw;
}


.button {
  display: block;
  width: 150px;
  margin: 0 auto;
  height: 30px;
  line-height: 30px;
  border: 1px solid #222;
  color: #ffffff;
  background-color: #222;
  cursor: pointer;
}

.button:hover {
  background-color: #b8cce7;
}




.back, .back:hover {
  margin-top: 10px;
}

#game-over {
  background-image: url(/imgs/background.png);
  display: none;
  text-align: center;
  z-index: 4;
  position: absolute;
  width: 100vw; /* Breite auf 80% des Viewports setzen */
  height: auto;
  aspect-ratio: 16 / 9; /* Seitenverhältnis 16:9 festlegen */
  max-width: 800px; /* Maximale Breite setzen */
  max-height: 450px; /* Maximale Höhe setzen */
  border: 1px solid  #ffffff;
  transform: translate(-50%, -50%);
  top: 50%;
  left: 50%;
}






@font-face{
  font-family: "TiedUp W00 Regular";
  src: url("https://db.onlinewebfonts.com/t/1abf94d9b0ef43f8192297973864a3ab.eot");
  src: url("https://db.onlinewebfonts.com/t/1abf94d9b0ef43f8192297973864a3ab.eot?#iefix")format("embedded-opentype"),
      url("https://db.onlinewebfonts.com/t/1abf94d9b0ef43f8192297973864a3ab.woff")format("woff"),
      url("https://db.onlinewebfonts.com/t/1abf94d9b0ef43f8192297973864a3ab.woff2")format("woff2"),
      url("https://db.onlinewebfonts.com/t/1abf94d9b0ef43f8192297973864a3ab.ttf")format("truetype"),
      url("https://db.onlinewebfonts.com/t/1abf94d9b0ef43f8192297973864a3ab.svg#TiedUp W00 Regular")format("svg");
  font-weight:normal;
  font-style:normal;
  font-display:swap;
}


.losescore2 {
  position: relative;
  top: 50px; /* Passen Sie den Wert nach Bedarf an, um die Position über den Items zu justieren */

  font-size: 40px;
  font-weight: bold;
  color: white;
}

#meterscore {
  position: relative;
  top: 80px; /* Passen Sie den Wert nach Bedarf an, um die Position über den Items zu justieren */

  color: white;
  margin-top: 20px;
}

#score{
  position: relative;
  top: 80px; /* Passen Sie den Wert nach Bedarf an, um die Position über den Items zu justieren */
  color: #b9cde8;
  font-size: 130px;
  font-family: "TiedUp W00 Regular";
}


.restart {
  position: relative;
  top: 130px; /* Passen Sie den Wert nach Bedarf an, um die Position über den Items zu justieren */
  font-size: 14px; /* Startgröße */
  text-align: center; /* Zentriert den Text innerhalb des Elements */
  align-items: center; /* Zentriert den Inhalt vertikal */
  justify-content: center; /* Zentriert den Inhalt horizontal */
  display: flex; /* Verwenden Sie Flexbox für die Zentrierung */
  width: 155px; /* Stellt sicher, dass die Breite sich über den gesamten Container erstreckt */
  background-color: transparent;
  border: 2px solid white;
  border-radius: 25px;
}

.restart:hover {
  background-color: #b9cde8;
}


.mobileShow { display: none;}
/* Smartphone Portrait and Landscape */
@media only screen
and (min-device-width : 320px)
and (max-device-width : 480px){ .mobileShow { display: inline;}}

.mobileHide { display: inline;}
/* Smartphone Portrait and Landscape */
@media only screen
and (min-device-width : 320px)
and (max-device-width : 480px){  .mobileHide { display: none;}}



h1 {
  font-family: 'Arial', sans-serif;
  font-size: 0.85rem;
  color: #141a39;
  text-transform: uppercase;
  cursor: default;
}


* {
  font-size: 62, 5%;
  box-sizing: border-box;
  margin: 0;
}

.play{
  position: relative;
  top: 320px; /* Passen Sie den Wert nach Bedarf an, um die Position über den Items zu justieren */
  font-size: 14px; /* Startgröße */
  text-align: center; /* Zentriert den Text innerhalb des Elements */
  align-items: center; /* Zentriert den Inhalt vertikal */
  justify-content: center; /* Zentriert den Inhalt horizontal */
  display: flex; /* Verwenden Sie Flexbox für die Zentrierung */
  width: 155px; /* Stellt sicher, dass die Breite sich über den gesamten Container erstreckt */
  background-color: transparent;
  border: 2px solid white;
  border-radius: 25px;
}
#headline {
  color: black;
  position: relative;
  top: 50px; /* Passen Sie den Wert nach Bedarf an, um die Position über den Items zu justieren */
  font-size: 30px; /* Startgröße */
  text-align: center; /* Zentriert den Text innerhalb des Elements */
  width: 100%; /* Stellt sicher, dass die Breite sich über den gesamten Container erstreckt */
}

#subtitle {
  color: black;
  position: relative;
  top: 50px; /* Passen Sie den Wert nach Bedarf an, um die Position über den Items zu justieren */
  font-size: 15px; /* Startgröße */
  text-align: center; /* Zentriert den Text innerhalb des Elements */
  width: 100%; /* Stellt sicher, dass die Breite sich über den gesamten Container erstreckt */
}




#logo {
  position: absolute;
  width: 450px;
  top: 170px;
  left: 50%;
  transform: translate(-50%, -50%);
}

#char{
  position: absolute;
  width: 200px;
  left: 50%;
  transform: translate(-50%, -50%);
  top: 35em;
}

@media (max-width: 730px) {


  .restart{
    top: 80px;
  }
}

@media (max-width: 640px) {

  #logo{
    top: 140px;
  }
  .play{
    top: 280px;
  }

  .restart{
    top: 80px;
  }
  .losescore2{
    font-size: 35px;
  }
  #meterscore{
    top: 60px;
  }
  #score{
    top: 60px;
    font-size: 100px;
  }
}

@media (max-width: 570px) {

  #logo{
    top: 120px;
  }
  .play{
    top: 240px;
  }

  .restart{
    top: 50px;
  }
  .losescore2{
    top: 40px;
    font-size: 30px;
  }
  #meterscore{
    top: 40px;
  }
  #score{
    top: 40px;
    font-size: 100px;
  }
}

@media (max-width: 500px) {

  #logo{
    width: 350px;
    top: 110px;
  }
  .play{
    top: 210px;
  }

  .restart{
    top: 30px;
  }
  .losescore2{
    top: 20px;
    font-size: 30px;
  }
  #meterscore{
    top: 20px;
  }
  #score{
    top: 20px;
    font-size: 100px;
  }
}

/* Für Bildschirme mit einer maximalen Breite von 450px */
@media (max-width: 450px) {
  #logo {
    width: 350px; /* Ändere die Breite des Logos */
    top: 150px; /* Passe die Position des Logos an */
  }
  .play {
    top: 230px; /* Passe die Position des Spiels an */
  }

  .restart{
    top: 70px;
  }
  .losescore2{
    top: 50px;
    font-size: 25px;
  }
  #meterscore{
    font-size: 20px;

    top: 50px;
  }
  #score{
    top: 50px;
    font-size: 80px;
  }
}

/* Für Bildschirme mit einer maximalen Breite von 400px */
@media (max-width: 400px) {
  #logo {
    width: 350px; /* Ändere die Breite des Logos */
    top: 150px; /* Passe die Position des Logos an */
  }
  .play {
    top: 250px; /* Passe die Position des Spiels an */
  }

  .restart{
    top: 70px;
  }
  .losescore2{
    top: 50px;
    font-size: 25px;
  }
  #meterscore{
    font-size: 20px;

    top: 50px;
  }
  #score{
    top: 50px;
    font-size: 80px;
  }
}

/* Für Bildschirme mit einer maximalen Breite von 370px */
@media (max-width: 370px) {
  #logo {
    width: 350px; /* Ändere die Breite des Logos */
    top: 150px; /* Passe die Position des Logos an */
  }
  .play {
    top: 250px; /* Passe die Position des Spiels an */
  }

  .restart{
    top: 70px;
  }
  .losescore2{
    top: 50px;
    font-size: 25px;
  }
  #meterscore{
    font-size: 20px;

    top: 50px;
  }
  #score{
    top: 50px;
    font-size: 80px;
  }
}

/* Für Bildschirme mit einer maximalen Breite von 340px */
@media (max-width: 340px) {
  #logo {
    width: 350px; /* Ändere die Breite des Logos */
    top: 150px; /* Passe die Position des Logos an */
  }
  .play {
    top: 250px; /* Passe die Position des Spiels an */
  }

  .restart{
    top: 20px;
  }
  .losescore2{
    top: 20px;
    font-size: 15px;
  }
  #meterscore{
    font-size: 15px;

    top: 20px;
  }
  #score{
    top: 20px;
    font-size: 55px;
  }
}

/* Für Bildschirme mit einer maximalen Breite von 300px */
@media (max-width: 300px) {
  #logo {
    width: 140px; /* Ändere die Breite des Logos */
    top: 60px; /* Passe die Position des Logos an */
  }
  .play {
    top: 120px; /* Passe die Position des Spiels an */
  }

  .restart{
    top: 5px;
  }
  .losescore2{
    top: 10px;
    font-size: 15px;
  }
  #meterscore{
    font-size: 15px;

    top: 5px;
  }
  #score{
    top: 5px;
    font-size: 55px;
  }
}

/* Für Bildschirme mit einer maximalen Breite von 280px */
@media (max-width: 280px) {
  #logo {
    width: 120px; /* Ändere die Breite des Logos */
    top: 60px; /* Passe die Position des Logos an */
  }
  .play {
    top: 110px; /* Passe die Position des Spiels an */
  }

  .restart{
    top: 10px;
  }
  .losescore2{
    top: 10px;
    font-size: 15px;
  }
  #meterscore{
    font-size: 15px;

    top: 5px;
  }
  #score{
    top: 5px;
    font-size: 40px;
  }
}

/* Für Bildschirme mit einer maximalen Breite von 260px */
@media (max-width: 260px) {
  #logo {
    width: 100px; /* Ändere die Breite des Logos */
    top: 50px; /* Passe die Position des Logos an */
  }
  .play {
    top: 100px; /* Passe die Position des Spiels an */
  }

  .restart{
    top: 5px;
  }
  .losescore2{
    top: 10px;
    font-size: 15px;
  }
  #meterscore{
    font-size: 15px;

    top: 5px;
  }
  #score{
    top: 5px;
    font-size: 40px;
  }
}

/* Für Bildschirme mit einer maximalen Breite von 240px */
@media (max-width: 240px) {
  #logo {
    width: 100px; /* Ändere die Breite des Logos */
    top: 50px; /* Passe die Position des Logos an */
  }
  .play {
    width: 100px; /* Verkleinere die Breite des Spiels */
    top: 80px; /* Passe die Position des Spiels an */
  }

  .restart{
    top: -5px;
  }
  .losescore2{
    top: 10px;
    font-size: 15px;
  }
  #meterscore{
    font-size: 15px;

    top: -5px;
  }
  #score{
    top: -5px;
    font-size: 40px;
  }
}

/* Für Bildschirme mit einer maximalen Breite von 220px */
@media (max-width: 220px) {
  #logo {
    width: 100px; /* Ändere die Breite des Logos */
    top: 40px; /* Passe die Position des Logos an */
  }
  .play {
    width: 100px; /* Verkleinere die Breite des Spiels */
    top: 70px; /* Passe die Position des Spiels an */
  }

  .restart{
    top: -5px;
  }
  .losescore2{
    top: 10px;
    font-size: 15px;
  }
  #meterscore{
    font-size: 15px;

    top: -5px;
  }
  #score{
    top: -5px;
    font-size: 30px;
  }
}

/* Für Bildschirme mit einer maximalen Breite von 200px */
@media (max-width: 200px) {
  #logo {
    width: 80px; /* Ändere die Breite des Logos */
    top: 30px; /* Passe die Position des Logos an */
  }
  .play {
    width: 80px; /* Verkleinere die Breite des Spiels */
    top: 60px; /* Passe die Position des Spiels an */
    font-size: 10px;
  }
}


#footertext{
  position: absolute;
  text-align: center;
  color: rgb(0, 0, 0);
  font-size: 20px;
  font-weight: bold;
  bottom: 00px;
  left: 50%;
  transform: translate(-50%, -50%);
}

#footertext {
  display: flex;
  align-items: center;
  justify-content: center; /* Falls du den gesamten Inhalt horizontal zentrieren möchtest */
}
#footertext img {
  margin: 0 5px;
  height: 1.3em; /* Stellt sicher, dass das Logo die gleiche Höhe wie der Text hat */
}
#footertext a {
  text-decoration: none;
  color: inherit;
}

#leaderboard {
  width: 100%;
  position: relative;
}

#username {
  position: absolute;
  text-align: center;
  z-index: 4;
  display: none;
}

#username-submit{
  font-size: 20px;

  width: 150px;
  margin: 0 auto;
  height: 30px;
  line-height: 30px;
  border: 1px solid #222;
  color: #9E9E9E;
  background-color: #000000;
  cursor: pointer;
}

#username-input{
  font-size: 20px;

  margin: 30px;
  color: #000; 
  background-color: #FFF; 
  border:1px solid #FFF;  
  box-shadow: 1px 3px 5px #0000001a; 
  padding: 6px;
  outline: none;

}

#leaderboard {
  max-width: 100%;
  max-height: calc(100vh - 5px); /* 20px für den Rand */
  margin: 0 auto; /* Zentriert den Kasten horizontal */
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  overflow: hidden;
  background-color: white;
  border: 2px solid black;
}

#leaderboard-title {
  text-align: center;
  padding: 10px;
  font-weight: bold;
  font-size: 30px; /* Startgröße */
}

#leaderboard-btn {
  position: absolute; /* Ändern Sie von relative auf absolute */
  top: 30rem; /* Passen Sie die Position von unten an */
  left: 50%; /* Zentrieren Sie horizontal relativ zum #main */
  transform: translateX(-50%); /* Zentrieren Sie horizontal */
  font-size: 15px;
  text-align: center;
  background-color: #000;
  width: 350px;
  margin: 0 auto; /* Entfernen Sie dies */
}

#container {
  position: relative;
  width: 100%;
  height: calc(100% - 100px); /* Höhe des Kastens abzüglich des Titels und des Buttons */
  overflow-y: auto; /* Falls der Inhalt den Bereich überschreitet */
}


#leaderboard-back { 
  background-color: #000;
  margin: 15px auto;
}

.row {
  display: flex;
  align-items: center; /* Zentriert die Elemente vertikal */
  width: 100%;
  height: 40px;
  border-bottom: 1px solid #AFAFAF;
}

.number {
  width: 10%; /* Ändern Sie die Breite der Nummern */
  text-align: center; /* Zentrieren Sie den Text horizontal in den Nummern */
  font-size: 20px; /* Ändern Sie die Schriftgröße der Nummern */
  font-weight: bold;
}

.name {

  flex-grow: 1; /* Verwenden Sie flex-grow, um den Namen flexibel zu machen und den verbleibenden Platz einzunehmen */
  font-size: 18px; /* Ändern Sie die Schriftgröße der Namen */
}

.score {
  font-weight: bold;

  margin-right: 25px;
  width: 20%; /* Ändern Sie die Breite des Scores */
  text-align: right;
  font-size: 20px; /* Ändern Sie die Schriftgröße des Scores */
}
