/* Global styles */
body {
  font-family: Arial, Helvetica, sans-serif;
  background-color: #f3f3f3;
  margin: 0;
  padding: 0;
  text-align: center;
}

h1 {
  margin: 20px 0 10px;
  font-weight: 600;
}

.header {
  background-color: #ffffff;
  padding: 10px 20px;
  border-bottom: 1px solid #ccc;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Controls layout */
.controls {
  margin: 10px 0;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.controls label {
  font-size: 0.9rem;
}

.controls input {
  width: 60px;
  padding: 2px 4px;
  margin-left: 4px;
}

.controls button {
  padding: 6px 12px;
  font-size: 0.9rem;
  background-color: #2196f3;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.controls button:hover {
  background-color: #1976d2;
}

/* Status bar */
.status-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  margin-top: 10px;
  font-size: 1rem;
  flex-wrap: wrap;
}

.status-item {
  min-width: 100px;
}

/* Board grid */
.board {
  display: inline-grid;
  margin: 20px auto;
  background-color: #888;
  border: 2px solid #555;
  user-select: none;
}

/* Each cell */
.cell {
  width: 30px;
  height: 30px;
  background-color: #c0c0c0;
  border: 1px solid #999;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  cursor: pointer;
  font-size: 18px;
  transition: background-color 0.1s;
}

/* Appearance when revealed */
.cell.revealed {
  background-color: #e0e0e0;
  border-color: #bdbdbd;
  cursor: default;
}

/* Appearance when flagged */
.cell.flagged {
  color: #d32f2f;
}

/* Disable pointer events when game over */
.cell.disabled {
  pointer-events: none;
}

/* Colors for neighbour counts */
.cell[data-neighbors="1"] { color: #1976d2; }
.cell[data-neighbors="2"] { color: #388e3c; }
.cell[data-neighbors="3"] { color: #d32f2f; }
.cell[data-neighbors="4"] { color: #7b1fa2; }
.cell[data-neighbors="5"] { color: #f57c00; }
.cell[data-neighbors="6"] { color: #0288d1; }
.cell[data-neighbors="7"] { color: #c2185b; }
.cell[data-neighbors="8"] { color: #303f9f; }

/* Message styling */
#message {
  font-size: 1.2rem;
  font-weight: bold;
  color: #d32f2f;
}

/* Responsive adjustments */
@media (max-width: 600px) {
  .controls {
    flex-direction: column;
    align-items: stretch;
  }
  .controls label,
  .controls button {
    width: 100%;
    text-align: left;
  }
  .status-bar {
    flex-direction: column;
    gap: 5px;
  }
}