* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: sans-serif;
  background-color: #111;
  color: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100vh;
}

#game-container {
  display: flex;
  flex-direction: row;
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
  flex: 1;
  position: relative;
}

#buttons-left, #buttons-right {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 120px;
  padding: 10px;
}

.color-button {
  width: 100%;
  height: 48%;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  position: relative;
}

.red {
  background-color: #e62419;
}

.green {
  background-color: #00a04f;
}

.blue {
  background-color: #4ca1d7;
}

.yellow {
  background-color: #f5da49;
}

.vertical-text {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-weight: bold;
  font-size: 1.2em;
  color: white;
  text-shadow: 1px 1px 2px black;
  user-select: none;
  pointer-events: none;
}

#playfield {
  flex: 1;
  background-color: white;
  position: relative;
  overflow: hidden;
}

.ball {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  position: absolute;
  top: -50px;
  left: 50%;
  transform: translateX(-50%);
  animation: fall 2s ease-in forwards;

  /* 3D-Effekt */
  box-shadow:
    inset -8px -8px 12px rgba(0, 0, 0, 0.3),
    inset 4px 4px 8px rgba(255, 255, 255, 0.4),
    0 6px 12px rgba(0, 0, 0, 0.5);

  background-image: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.6), transparent);
}

/* Farben für Bälle separat, falls du unterschiedliche Styles brauchst */

.ball.red {
  background-color: #e62419;
}

.ball.green {
  background-color: #00a04f;
}

.ball.blue {
  background-color: #4ca1d7;
}

.ball.yellow {
  background-color: #f5da49;
}

@keyframes fall {
  0% {
    top: -50px;
  }
  100% {
    top: 100%;
  }
}

#score {
  height: 40px;
  font-size: 1.2em;
  padding: 10px;
}

#game-over {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.1);
  font-size: 64px;
  font-weight: bold;
  color: red;
  text-shadow: 2px 2px 0 black, -2px -2px 0 black, 2px -2px 0 black, -2px 2px 0 black;
  z-index: 10;
  pointer-events: none;
  opacity: 0;
}

.hidden {
  display: none;
}

@keyframes gameOverPop {
  0% {
    transform: translate(-50%, -50%) scale(0.1) rotate(0deg);
    opacity: 1;
  }
  50% {
    transform: translate(-50%, -50%) scale(1.5) rotate(15deg);
    opacity: 0.6;
  }
  100% {
    transform: translate(-50%, -50%) scale(3) rotate(30deg);
    opacity: 0;
  }
}

#intro-title {
  position: absolute;
  top: -20%;
  left: 50%;
  transform: translateX(-50%) rotate(-90deg);
  font-size: 48px;
  font-weight: bold;
  background: linear-gradient(to right, red, yellow, green, blue);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: slideDown 4s linear forwards;
  z-index: 5;
  white-space: nowrap;
}

@keyframes slideDown {
  0% { top: -20%; }
  100% { top: 220%; }
}

#countdown {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 64px;
  font-weight: bold;
  background: linear-gradient(to right, red, yellow, green, blue);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  z-index: 5;
}


@media (max-width: 600px) {
  #buttons-left,
  #buttons-right {
    width: 100px;
  }

  .ball {
    width: 30px;
    height: 30px;
  }
}
