:root {
  color-scheme: light dark;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: linear-gradient(160deg, #1f2937, #111827);
}

.game {
  width: min(92vw, 520px);
  background: rgba(255, 255, 255, 0.09);
  backdrop-filter: blur(8px);
  border-radius: 16px;
  padding: 1.4rem;
  color: #f9fafb;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}

h1 {
  margin-top: 0;
  text-align: center;
}

.controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.7rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.controls p {
  margin: 0;
}

button {
  border: 0;
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  font-weight: 600;
  cursor: pointer;
  background: #22c55e;
  color: #052e16;
}

button:hover {
  filter: brightness(1.1);
}

.board {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  gap: 3px;
  background: #334155;
  padding: 3px;
  border-radius: 10px;
}

.cell {
  aspect-ratio: 1;
  border: none;
  font-weight: 700;
  font-size: clamp(0.8rem, 2.7vw, 1rem);
  border-radius: 5px;
  cursor: pointer;
  background: #94a3b8;
  color: #0f172a;
}

.cell:hover:not(.revealed) {
  background: #cbd5e1;
}

.cell.revealed {
  background: #e2e8f0;
  cursor: default;
}

.cell.mine {
  background: #ef4444;
  color: #fff;
}

.cell.flagged {
  background: #facc15;
}

.cell.n1 { color: #2563eb; }
.cell.n2 { color: #15803d; }
.cell.n3 { color: #dc2626; }
.cell.n4 { color: #4f46e5; }
.cell.n5 { color: #78350f; }
.cell.n6 { color: #0f766e; }
.cell.n7 { color: #111827; }
.cell.n8 { color: #701a75; }

.help {
  margin-bottom: 0;
  font-size: 0.92rem;
  opacity: 0.9;
}
