html,
body {
  font-family: sans-serif;
  overflow-x: hidden;
  margin: 0;
  padding: 0;
  height: 100vh;
  text-align: center;
  background-color: #333;
  color: #fff;
  background-image: url("../images/bg.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transition: background 0.3s ease;
}

#background-box {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: -1;
}

h1 {
  font-size: 2vh;
  text-shadow: 1px 1px 4px #000;
}

#pagewrapper {
  width: 100%;
  margin: auto;
}

@media (min-width: 1080px) {
  #pagewrapper {
    width: 60%;
    margin: auto;
  }
}

@media (orientation: landscape) {
    #pagewrapper {
    width: 100%;
    margin: auto;
  }
}

#name {
  max-width: 100%;
  text-shadow: 1px 1px 2px #000;
  color: white;
  margin-bottom: 0.5rem;
  background-color: gray;
  border-radius: 10px;
  border: 3px solid white;
  text-align: center;
}

#game {
  max-width: 100%;
  margin-bottom: 0.5rem;
}

@media (min-width: 1080px) {
  #name {
    max-width: 60%;
    margin-left: 20%;
    margin-right: 20%;
    text-shadow: 1px 1px 2px #000;
    margin-bottom: 0.5rem;
    background-color: gray;
    border-radius: 10px;
    border: 3px solid white;
    text-align: center;
  }

  #game {
    max-width: 60%;
    margin-left: 20%;
    margin-right: 20%;
    margin-bottom: 0.5rem;
  }
}

#gamemode {
  margin-bottom: 0.5rem;
  text-align: center;
}

#scoreboard {
  display: flex;
  align-items: center;
  /* vertikal */
  justify-content: center;
  /* horizontal */
  max-width: 100%;
  padding-top: 10px;
  background-color: #cfcfcf;
  color: #000;
  font-weight: bold;
  border-radius: 10px;
  border: 3px solid white;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

@media (min-width: 1080px) {
  #scoreboard {
    display: block;
    max-width: 100%;
    padding: 5px 0% 0px 9%;
    background-color: #cfcfcf;
    color: #000;
    font-weight: bold;
    border-radius: 10px;
    border: 3px solid white;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  }
}

.row {
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

@media (min-width: 1080px) {
  .row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
  }
}

.row div {
  font-size: 14px;
  flex: 1;
  /* Alle Elemente gleichmäßig verteilen */
  text-align: left;
  /* Die Texte in jedem Element zentrieren */
}

.row div:first-child {
  font-size: 14px;
}

.row div svg {
  width: 20px;
  height: 20px;
  margin-right: 5px;
}

/* #beercontainer {
    padding-top: 10px;
} */

@media (min-width: 1080px) {
  #beercontainer {
    display: flex;
    justify-content: flex-start;
    padding-top: 10px;
  }
}

#beerbutton {
  align-items: center;
  justify-content: center;
}

@media (min-width: 1080px) {
  #beerbutton {
    margin-right: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

#beerclicker {
  width: 200px;
  margin: 15px auto 15px auto;
  /* oben:15px, unten:10px, horizontal:auto */
  cursor: crosshair;
  transition: transform 0.1s;
  /*background-color: #FFD100;*/
  background-color: #fff;
  border-radius: 10px;
  border: 3px solid gray;
  display: block;
  /* wichtig für margin auto */
}

#beerclicker:hover {
  transform: scale(1.05);
}

#beerclicker:active {
  transform: scale(0.95);
  /*background-color: #FFD100;*/
  background-color: #fff;
  border-radius: 10px;
  border: 3px solid gray;
}

#upgrades {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  text-align: center;
  background-color: #fff;
  padding: 8px;
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  margin: 0 auto;
}

@media (min-width: 1080px) {
  #upgrades {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    text-align: center;
    background-color: #fff;
    padding: 8px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    margin: 0 auto;
  }
}

.upgrade {
  padding: 10px;
  background-color: #4cb113;
  color: black;
  border-radius: 5px;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.2s, opacity 0.2s;
}

.upgrade:hover {
  background-color: #45a049;
}

.upgrade.disabled {
  background-color: #999;
  cursor: not-allowed;
  opacity: 0.5;
  pointer-events: none;
}

/* Forschungslayout */
#branches {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  text-align: center;
  background-color: #fff;
  padding: 8px;
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  margin: 0 auto;
  margin-top: 10px;
}

.branch {
  padding: 10px;
  background-color: #4cb113;
  color: black;
  border-radius: 5px;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.2s, opacity 0.2s;
}

.branch:hover {
  background-color: #45a049;
}

.branch.disabled {
  background-color: #006305;
  cursor: not-allowed;
  opacity: 0.5;
  pointer-events: none;
}

.branch.bought {
  padding: 10px;
  background-color: #4882ff;
  color: black;
  border-radius: 5px;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.2s, opacity 0.2s;
}

.branch.bought:hover {
  background-color: #426aec;
}

.branch.expensive {
  background-color: #999;
  cursor: not-allowed;
  opacity: 0.5;
  pointer-events: none;
}

.beer {
  padding: 10px;
  background-color: #4cb113;
  color: black;
  border-radius: 5px;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.2s, opacity 0.2s;
}

.beer.disabled {
  background-color: #999;
  cursor: not-allowed;
  opacity: 0.5;
  pointer-events: none;
}

#log {
  max-width: 100%;
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
  padding: 10px;
  font-size: 1.5rem;
  text-shadow: 1px 1px 2px #000;
  background-color: gray;
  border-radius: 10px;
  border: 3px solid white;
}

.logbox {
  position: relative;
  /* für das Pseudo-Element */
  height: 250px;
  background-color: #222;
  color: #0f0;
  /* Terminal-Grün */
  font-family: monospace;
  font-size: 14px;
  border-radius: 5px;
  overflow-y: auto;
  box-shadow: inset 0 0 10px #0008;
  margin-bottom: 20px;
  border: 1px solid #444;
  text-align: left;
  direction: ltr;
  white-space: pre-wrap;
  line-height: calc(1em + 3px);
  padding: 2px;

  white-space: pre-wrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (min-width: 1080px) {
  #log {
    max-width: 100%;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
    padding: 10px;
    font-size: 1.5rem;
    text-shadow: 1px 1px 2px #000;
    background-color: gray;
    border-radius: 10px;
    border: 3px solid white;
  }

  .logbox {
    position: relative;
    /* für das Pseudo-Element */
    height: 250px;
    background-color: #222;
    color: #0f0;
    /* Terminal-Grün */
    font-family: monospace;
    font-size: 14px;
    border-radius: 5px;
    overflow-y: auto;
    box-shadow: inset 0 0 10px #0008;
    margin-bottom: 20px;
    border: 1px solid #444;
    text-align: left;
    direction: ltr;
    white-space: pre-wrap;
    line-height: calc(1em + 3px);
    padding: 2px;
  }

  /* blinkender Cursor als Pseudo-Element */
  .logbox::after {
    content: "";
    display: inline-block;
    width: 0.8ch;
    /* Block-Breite in Zeichen */
    height: 1em;
    background-color: currentColor;
    vertical-align: bottom;
    margin-left: 2px;
    animation: blink 1s steps(1) infinite;
  }

  /* Keyframes für das Blinken */
  @keyframes blink {
    0%,
    50% {
      opacity: 1;
    }

    51%,
    100% {
      opacity: 0;
    }
  }

  /* Breite des Scrollbars */
  .logbox::-webkit-scrollbar {
    width: 12px;
  }

  /* Track (Schiene) */
  .logbox::-webkit-scrollbar-track {
    background: #111;
    /* volle Rundung oben wie unten */
    border-top-right-radius: 10px;
    border-bottom-right-radius: 10px;
  }

  /* Scroll-Daumen */
  .logbox::-webkit-scrollbar-thumb {
    background-color: #eeeeee;
    /* runde Ecken des Daumens */
    border-radius: 10px;
    /* Innenabstand, damit Daumen nicht bis zum Rand reicht */
    border: 3px solid #111;
  }

  /* Ecke unten rechts (wenn sowohl horizontal als auch vertikal Scrollbars) */
  .logbox::-webkit-scrollbar-corner {
    background: #111;
    border-bottom-right-radius: 10px;
  }
}

#brauerei-modus,
#fass-modus {
  font-size: 1.6vh;
  color: gold;
  text-shadow: 1px 1px 3px #000;
  margin-bottom: 30px;
}

#event-message {
  font-size: 1.6vh;
  height: 25px;
  color: orange;
  text-shadow: 1px 1px 2px #000;
  margin-bottom: 20px;
}

#prestige-message {
  font-size: 1.6vh;
  height: 50px;
  color: orange;
  text-shadow: 1px 1px 2px #000;
}

#mouse-message {
  font-size: 1.6vh;
  color: white;
  text-shadow: 1px 1px 3px #000;
}

#settings {
  margin-top: 5px;
  max-width: 100%;
  text-shadow: 1px 1px 2px #000;
  color: white;
  margin-bottom: 0.5rem;
  background-color: gray;
  border-radius: 10px;
  border: 3px solid white;
  text-align: center;  
}

#sound-settings {
  padding-top: 10px;
  height: 30px;
  width: 300px;
  /* fixe Breite nötig für margin: auto bei horizontalem Zentrieren */
  margin: auto;
  text-align: center;
}

.btn-feedback {
  padding: 10px 20px;
  font-size: 16px;
  background-color: #4285f4;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  text-shadow: 1px 1px 4px #000;
}

.btn-feedback:hover {
  background-color: #1d46ad;
}

.btn-reset {
  padding: 10px 20px;
  font-size: 16px;
  background-color: yellow;
  color: black;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  text-shadow: 1px 1px 4px #000;
}

.btn-reset:hover {
  background-color: #a6af2c;
}

.btn-delete {
  padding: 10px 20px;
  font-size: 16px;
  background-color: #c51616;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  text-shadow: 1px 1px 4px #000;
}

.btn-delete:hover {
  background-color: #b10303;
}

.btn-scoreboard {
  padding: 10px 20px;
  font-size: 16px;
  background-color: #ffffff;
  color: rgb(0, 0, 0);
  border: none;
  border-radius: 5px;
  cursor: pointer;
  text-shadow: 1px 1px 4px #000;
}

.btn-scoreboard:hover {
  background-color: #b1b1b1;
}

.btn-jukebox {
  padding: 10px 20px;
  margin: 10px;
  font-size: 16px;
  background: #4caf50;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

.bubble {
  position: absolute;
  bottom: -50px;
  width: 20px;
  height: 20px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 50%;
  animation: rise 10s infinite ease-in;
  opacity: 0.7;
}

@keyframes rise {
  0% {
    transform: translateY(0) scale(0.5);
    opacity: 0.5;
  }

  100% {
    transform: translateY(-100vh) scale(1.2);
    opacity: 0;
  }
}

/* Überlagerung */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

/* Popup-Box */
.popup {
  background: white;
  color: black;
  padding: 20px 30px;
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  text-align: center;
}

.popup button {
  margin-top: 15px;
  padding: 8px 16px;
  border: none;
  background: yellow;
  color: black;
  border-radius: 5px;
  cursor: pointer;
}

.popup button:hover {
  background: #0056b3;
}

#footer {
  color: white;
  text-shadow: 1px 1px 2px #000;
}

#imprint {
  max-width: 100%;
  text-shadow: 1px 1px 2px #000;
  color: white;
  margin-bottom: 0.5rem;
  background-color: gray;
  border-radius: 10px;
  border: 3px solid white;
  text-align: left;
  padding-left: 20px;
}