body {
  font-family: Arial, sans-serif;
  background: #f0f0f0;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  margin: 0;
}

#game {
  text-align: center;
}

#controls {
  margin-bottom: 10px;
}

#board {
  display: grid;
  gap: 2px;
  background: #333;
  padding: 2px;
}

.cell {
  width: 32px;
  height: 32px;
}

.floor { background: #ddd; }
.wall { background: #444; }
.goal { background: #ffc107; }
.box { background: #795548; }
.player { background: #03a9f4; }
.box-goal { background: #ff5722; }
.player-goal { background: #80d8ff; }

#instructions {
  margin: 20px;
  padding: 10px;
  background: #f2f2f2;
  border: 1px solid #ccc;
  border-radius: 6px;
  max-width: 400px;
  font-family: sans-serif;
}

#instructions h2,
#instructions h3 {
  margin-top: 0.5em;
}

#instructions ul {
  padding-left: 20px;
}

.legend {
  display: inline-block;
  width: 24px;
  height: 24px;
  text-align: center;
  line-height: 24px;
  font-weight: bold;
  border: 1px solid #333;
  margin-right: 8px;
}

.legend.wall {
  background-color: #444;
  color: white;
}

.legend.box {
  background-color: brown;
  color: white;
}

.legend.goal {
  background-color: gold;
}

.legend.box-goal {
  background-color: darkorange;
  color: white;
}

.legend.player {
  background-color: dodgerblue;
  color: white;
}

.legend.player-goal {
  background-color: lightblue;
  color: black;
}

.legend.floor {
  background-color: #eee;
}

#timer-container {
  display: inline-block;
  margin-left: 20px;
  font-weight: bold;
}

#game-wrapper {
  display: flex;
  flex-wrap: nowrap; /* 🛑 prevents instructions from dropping down */
  justify-content: center;
  align-items: flex-start;
  gap: 40px;
  padding: 20px;
  max-width: 100%;
  overflow-x: auto;
}

#game-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-height: 90vh;
  overflow-y: auto;
}

#board {
  display: grid;
  margin-bottom: 20px;
    margin-top: 20px;
}

#controls {
  text-align: center;
}

#instructions {
  max-width: 300px;
  background: #f8f8f8;
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 15px;
  font-family: sans-serif;
}

#timer-container {
  margin-top: 10px;
  font-weight: bold;
}

