:root {
  --background-color: #000000;
  --surface-color: #1c1c1c;
  --text-color: #ffffff;
  --wall-color: #1919a6; /* Classic Pacman Blue */
  --path-color: #000000;
  --dot-color: #ffb8ae;
  --pacman-color: #ffff00;
  --ghost-color: #ff0000;
  --grid-gap: 0px;
}

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

body {
  font-family: 'Outfit', sans-serif;
  background-color: var(--background-color);
  color: var(--text-color);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 1rem;
}

.app-container {
  width: 100%;
  max-width: 800px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
}

.title-row {
  text-align: center;
}

h1 {
  font-size: 2.5rem;
  color: #ffff00;
  text-shadow: 0 0 10px #ffff00;
  margin-bottom: 0.5rem;
}

.tagline {
  color: #ccc;
}

.controls {
  display: flex;
  justify-content: space-between;
  width: 100%;
  align-items: center;
  background: var(--surface-color);
  padding: 1rem;
  border-radius: 8px;
  border: 1px solid #333;
}

button {
  padding: 0.75rem 1.5rem;
  border-radius: 4px;
  border: none;
  background: #ffff00;
  color: #000;
  font-weight: 800;
  font-size: 1.1rem;
  cursor: pointer;
  transition: transform 0.1s;
}

button:hover {
  transform: scale(1.05);
  box-shadow: 0 0 15px #ffff00;
}

.score-board {
  font-size: 1.5rem;
  font-weight: bold;
  font-family: monospace;
}

#game-status {
  margin-left: 1rem;
  font-size: 1rem;
  color: #aaa;
}

.visualization-area {
  background: #000;
  padding: 10px;
  border: 4px solid var(--wall-color);
  border-radius: 4px;
  box-shadow: 0 0 20px var(--wall-color);
}

#game-grid {
  display: grid;
  /* Columns will be set in JS */
}

.cell {
  width: 20px;
  height: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.cell.wall {
  background-color: var(--wall-color);
  border-radius: 2px;
}

.cell.dot::after {
  content: '';
  width: 4px;
  height: 4px;
  background-color: var(--dot-color);
  border-radius: 50%;
}

.cell.pacman {
  background-color: var(--pacman-color);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--pacman-color);
  /* Simple mouth animation could be added here */
}

.cell.ghost {
  background-color: var(--ghost-color);
  border-top-left-radius: 50%;
  border-top-right-radius: 50%;
  box-shadow: 0 0 10px var(--ghost-color);
}

.info-panel {
  background: var(--surface-color);
  padding: 1rem;
  border-radius: 8px;
  width: 100%;
  text-align: center;
}

.legend {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
}

.legend-item {
  display: inline-block;
  width: 15px;
  height: 15px;
  margin-right: 5px;
  vertical-align: middle;
}

.pacman-legend { background: var(--pacman-color); border-radius: 50%; }
.ghost-legend { background: var(--ghost-color); border-radius: 50% 50% 0 0; }
.wall-legend { background: var(--wall-color); }
.path-legend { background: #000; border: 1px solid #555; position: relative; }
.path-legend::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 4px; height: 4px;
  background: var(--dot-color);
  border-radius: 50%;
}