html,
body {
  margin: 0;
  padding: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: #111;
  font-family: sans-serif;
}
body {
  background-image: url(bilder/background.png);
  background-position: center top;
  background-size: cover;
  background-repeat: no-repeat;
}

#startButton {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.5em;
  padding: 1em 2em;
  background: #00ffff;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  z-index: 10;
}

#connectionLostMsg {
  display: none;
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: red;
  color: white;
  padding: 10px;
  border-radius: 5px;
  font-weight: bold;
  z-index: 10;
}

canvas {
  width: 100vw;
  height: 100vh;
  display: block;
  touch-action: none;
}

/*===========================*/
h1 {
  font-size: 4em;
  font-family: verdana;
  color: #1d566e;
}
p {
  line-height: 25px;
}
input,
button {
  width: 90%;
  max-width: 400px;
  min-width: 160px;
  box-sizing: border-box;
  margin: 0.5em;
  padding: 0.7em 1em;
  font-size: 1.1em;
}
.scene {
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  background-color: rgba(17, 17, 17, 0.6);
  color: white;
  position: absolute;
  top: 0;
}

input {
  font-size: 1.2em;
  margin: 0.5em;
  padding: 0.5em;
}

#connectionLostMsg {
  display: none;
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: red;
  color: white;
  padding: 10px;
  border-radius: 5px;
  font-weight: bold;
  z-index: 10;
}

canvas {
  display: block;
  width: 100vw;
  height: 100vh;
}
#canvasWrapper {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}
#gameCanvas {
  display: block;
  width: 100vw;
  height: 100vh;
  background: #222;
}

#desktopControls {
  position: absolute;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: row;
  gap: 5px;
  z-index: 20;
}

#desktopControls button {
  font-size: 2em;
  padding: 10px;
}

#livesDisplay {
  position: absolute;
  top: 10px;
  left: 10px;
  font-size: 24px;
  font-weight: bold;
  color: #fff;
  z-index: 20;
}

.livesList {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.5);
  padding: 8px;
  border-radius: 8px;
  font-size: 14px;
  color: #fff;
  z-index: 20;
}

#messageBoard {
  position: fixed;
  top: 5vh; /* Leicht vom oberen Rand */
  left: 50%;
  transform: translateX(-50%);
  width: 90vw; /* 90% der Viewport-Breite */
  max-width: 1000px; /* Optional: Obergrenze, falls großer Bildschirm */
  min-height: 80px;
  padding: 32px 24px;
  background: rgba(
    34,
    34,
    34,
    0.93
  ); /* Halbtransparent, damit Canvas sichtbar bleibt */
  color: #fff;
  border-radius: 18px;
  font-size: 2em;
  text-align: center;
  box-shadow: 0 6px 32px #000a;
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}
#messageBoard.show {
  opacity: 1;
}
.outlined-text {
  color: #1d566e; /* Füllfarbe */
  text-shadow: -2px -2px 0 white, 2px -2px 0 white, -2px 2px 0 white,
    2px 2px 0 white, 0 -2px 0 white, -2px 0 0 white, 2px 0 0 white,
    0 2px 0 white;
}

#gyroStartBtn {
  position: absolute;
  top: 5%; /* 5% von Canvas-Höhe */
  left: 50%;
  transform: translateX(-50%, 0);
  z-index: 20;
  display: none; /* Erst sichtbar machen, wenn benötigt! */
  padding: 12px 28px;
  border-radius: 20px;
  background: #3181cc;
  color: white;
  font-size: 1.1em;
  border: none;
  cursor: pointer;
  box-shadow: 0 2px 8px #19558b33;
  text-align: center;
  width: 180px;
  transition: top 0.2s;
}

/* Mobile Geräte: Buttons ausblenden */
/*
@media (hover: none) and (pointer: coarse) {
  #desktopControls {
    display: none;
  }
}
*/
@media (max-width: 1024px) {
  #desktopControls {
    display: none;
  }

  input,
  button {
    width: 98%;
    max-width: none;
    min-width: 0;
    font-size: 1em;
  }
  h1 {
    font-size: 3em;
  }
}

.scene {
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  background-color: rgba(17, 17, 17, 0.6);
  color: white;
  position: fixed;
  top: 0;
  left: 0;
  overflow: auto;
}

#gyroStartBtn {
  position: absolute;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  display: none;
  padding: 10px 18px;
  border-radius: 20px;
  background: #3181cc;
  color: white;
  font-size: 1.1em;
  border: none;
  cursor: pointer;
  box-shadow: 0 2px 8px #19558b33;
  text-align: center;
  width: 150px;
}
