body {
  font-family: sans-serif;
  text-align: center;
  background-color: white;
  color: #fff;
  height: 800px;           /* Höhe passend zum iFrame */
  margin: 0;
  padding: 0;
  overflow: hidden;
}

#direction-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
}

#level {
  color: #7ab51d; 
}

/* Spielfeld – jetzt responsiv */
#game-container {
  width: 90vmin;
  height: 90vmin;
  display: grid;
  grid-template-columns: repeat(30, 1fr);
  grid-template-rows: repeat(30, 1fr);
  position: relative;
  z-index: 1;
  background-color: #000;
}


.cell {
  width: 100%;
  height: 100%;
  background-color: #2364a7;
  position: relative;
}

.wall {
  background-color: #444;
}

.point::after {
  content: '';
  width: 5px;
  height: 5px;
  background: #7ab51d;
  border-radius: 50%;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* Bilder werden dynamisch gesetzt */
.pacman,
.ghost {
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

.status-bar {
  margin: 10px;
  padding: 0;
  color: #7ab51d; 
}

#touch-controls {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.touch-row {
  display: flex;
  gap: 20px;
  justify-content: center;
}

#touch-controls button {
  font-size: 32px;
  padding: 15px 25px;
  border: none;
  border-radius: 12px;
  background-color: #444;
  color: white;
  cursor: pointer;
  box-shadow: 0 4px 8px rgba(0,0,0,0.3);
  transition: background 0.2s;
}

#touch-controls button:active {
  background-color: #666;
}

#overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.75);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

#overlay-content {
  text-align: center;
}

#start-button {
  font-size: 24px;
  padding: 15px 30px;
  background-color: rgba(255, 255, 255, 0.2);
  border: 2px solid #fff;
  color: #fff;
  border-radius: 12px;
  cursor: pointer;
  backdrop-filter: blur(5px);
  transition: background-color 0.3s;
}

#start-button:hover {
  background-color: rgba(255, 255, 255, 0.4);
}

@media (min-width: 768px) {
  #touch-controls {
    display: none;
  }
}