body {
  font-family: sans-serif;
  text-align: center;   /* fix spelling + handles centring */
  background: white;
  margin: 0;
  padding: 10px;
}

h1 {
  margin-bottom: 10px;
}

.controls {
  margin-bottom: 10px;
}

button {
  margin: 0 5px;
  padding: 6px 12px;
  cursor: pointer;
}

canvas {
  border: 1px solid #ccc;
  display: block;
  margin: 0 auto;       /* centres the canvas itself */

  max-width: 95vw;   /* key mobile fix */
  height: auto;
}

.rules {
  margin-top: 20px;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
  text-align: left;
}

.rules h2 {
  margin-bottom: 5px;
}

.rules ul {
  padding-left: 20px;
}

/* Prevent button overflow on mobile devices */
.controls {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 5px;
}

.layout {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 40px;
  padding: 20px;
  flex-wrap: wrap; /* important for mobile */
}

.game {
  text-align: center;
}

.instructions {
  max-width: 300px;
  text-align: left;
}

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

.instructions h2 {
  margin-bottom: 10px;
}