* {
  box-sizing: border-box;
  font-family: "Segoe UI", sans-serif;
}

:root {
  --vh: 100vh;
}

html,
body {
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: #000;
  color: white;
  height: calc(var(--vh, 1vh) * 100);
}

canvas {
  display: block;
  margin: 0 auto;
  object-fit: contain;
  background: #111;
}

/* Bildhintergrund für alle drei Screens */
#intro-screen,
#player-setup,
#lobby-screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: url("../img/intro.png") no-repeat center center;
  background-size: cover;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10;
}

.screen-overlay {
  padding: 30px;
  border-radius: 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 15px;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
  max-width: 500px;
  width: 90%;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  max-height: 100vh;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.screen-overlay h1,
.screen-overlay h2 {
  font-size: 2em;
  letter-spacing: 2px;
  text-shadow: 0 0 5px white;
  margin: 0;
}

.logo {
  max-width: 80px;
  margin-bottom: 0px;
  filter: drop-shadow(0 0 6px white);
}

input[type="text"],
input[type="color"] {
  padding: 10px;
  margin-top: 10px;
  width: 90%;
  border: none;
  border-radius: 6px;
  font-size: 1em;
}

.screen-overlay input,
.screen-overlay label,
.screen-overlay button {
  font-size: 1rem;
  text-align: left;
  margin: 0;
}

.screen-overlay input {
  padding: 5px 10px;
  width: 100%;
}

.screen-overlay button {
  padding: 10px 20px;
  cursor: pointer;
}

button {
  margin-top: 0px;
  padding: 10px 20px;
  font-size: 1.1em;
  background-color: #444;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.2s;
}

button:hover {
  background-color: #666;
}

#player-list {
  list-style: none;
  padding: 0;
  margin: 20px 0 0;
}

#player-list li {
  margin-bottom: 5px;
  font-weight: bold;
}

/* Mobile-Steuerung (auch für Desktop testbar) */
#mobile-controls {
  display: flex;
  justify-content: center;
  gap: 6px;
  background: rgba(0, 0, 0, 0.3);
  padding: 4px 10px;
  border-radius: 10px;
  box-shadow: 0 0 6px #000;
  transform: translateX(-50%) scale(0.6);
  position: absolute;
  bottom: 20px;
  left: 50%;
  z-index: 1000;
}

#mobile-controls button {
  font-size: 0.9em;
  padding: 4px 8px;
  background-color: rgba(255, 255, 255, 0.07);
  color: white;
  border: 1px solid #888;
  border-radius: 6px;
  cursor: pointer;
  min-width: 40px;
  min-height: 28px;
  line-height: 1;
  transition: background-color 0.2s, transform 0.1s;
}

#mobile-controls button:hover {
  background-color: rgba(255, 255, 255, 0.15);
  transform: scale(1.05);
}

#mobile-controls button:active {
  background-color: rgba(255, 255, 255, 0.25);
  transform: scale(0.95);
}

.hiscore-list {
  list-style: none;
  margin: 0;
  padding: 0;
  text-align: right;
  font-family: monospace;
}

.hiscore-list li {
  display: flex;
  justify-content: space-between;
  padding: 2px 0;
  border-bottom: 1px dotted rgba(255, 255, 255, 0.1);
  align-items: baseline;
}

.hiscore-list .rank {
  width: 30px;
  text-align: left;
  color: #aaa;
}

.hiscore-list .name {
  flex: 1;
  text-align: left;
  color: #ccc;
}

.hiscore-list .time {
  width: 70px;
  text-align: right;
  color: #6cf;
}

@media (min-width: 768px) {
  #mobile-controls {
    /* display: none !important; */
  }
  .logo {
    width: 120px;
  }
}

@media (max-width: 768px) {
  .screen-overlay {
    padding: 20px;
    font-size: 1rem;
  }
}
