:root {
  --bg: #0d0f14;
  --panel: #181c26;
  --line: #2c3344;
  --ink: #e8ecf4;
  --muted: #98a1b6;
  --accent: #f5c542;
  --accent-ink: #1a1405;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: radial-gradient(1200px 600px at 50% -10%, #1e2740 0%, var(--bg) 60%);
  color: var(--ink);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.city-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.6rem 1rem;
  background: rgba(11, 13, 19, 0.85);
  border-bottom: 1px solid var(--line);
  font-size: 0.9rem;
}
.city-link { color: var(--accent); text-decoration: none; }
.city-link:hover { text-decoration: underline; }
.biz-name { color: var(--muted); }
.practice-badge {
  margin-left: auto;
  border: 1px solid var(--accent);
  color: var(--accent);
  border-radius: 999px;
  padding: 0.1rem 0.6rem;
  font-size: 0.75rem;
}

.table {
  flex: 1;
  width: min(96vw, 46rem);
  margin: 0 auto;
  padding: 1.5rem 0 2.5rem;
  text-align: center;
}
h1 { margin: 0.5rem 0 0.25rem; font-size: 1.8rem; }
.sub { color: var(--muted); margin: 0 0 1.25rem; font-size: 0.95rem; }
.sub code, .sub kbd { background: var(--panel); padding: 0 0.3rem; border-radius: 0.3rem; }

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  justify-content: center;
  align-items: center;
  margin-bottom: 1rem;
}
fieldset {
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
  color: var(--muted);
}
legend { padding: 0 0.3rem; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; }
label { margin: 0 0.5rem 0 0; color: var(--ink); cursor: pointer; }

button {
  background: var(--accent);
  color: var(--accent-ink);
  border: none;
  border-radius: 0.4rem;
  padding: 0.55rem 1.1rem;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.95rem;
}
button:hover { filter: brightness(1.08); }
button:disabled { opacity: 0.5; cursor: default; }

.status { min-height: 1.4rem; font-weight: 600; margin: 0.75rem 0; }

.board {
  display: grid;
  grid-template-columns: repeat(var(--cols, 9), 1fr);
  gap: 2px;
  width: min(94vw, 34rem);
  margin: 0 auto;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  padding: 2px;
}
.board.hard { width: min(96vw, 46rem); }
.cell {
  aspect-ratio: 1;
  background: var(--panel);
  border: none;
  border-radius: 0.2rem;
  font-weight: 700;
  font-size: clamp(0.7rem, 2.4vw, 1rem);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}
.cell:hover:not(:disabled) { filter: brightness(1.25); }
.cell:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.cell.open { background: #10141d; cursor: default; }
.cell.flagged { color: var(--accent); }
.cell.mined { background: #4a1520; color: #ff8a8a; }
.cell.one { color: #7dd3fc; }
.cell.two { color: #6ee7a0; }
.cell.three { color: #fca5a5; }
.cell.four { color: #c4b5fd; }
.cell.five { color: #fbbf24; }
.cell.six { color: #5eead4; }
.cell.seven, .cell.eight { color: var(--muted); }

.score {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 1.25rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.api-note {
  margin-top: 2rem;
  text-align: left;
  color: var(--muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--line);
  padding-top: 1rem;
}
.api-note pre {
  background: #0a0d13;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  padding: 0.75rem;
  overflow-x: auto;
  color: var(--ink);
}
.api-note a { color: var(--accent); }

.footer {
  border-top: 1px solid var(--line);
  padding: 0.9rem 1rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.8rem;
}
.footer a { color: var(--accent); }
