:root {
  --bg: #101820;
  --panel: #182631;
  --tile: #d8e2dc;
  --open: #eef5f0;
  --line: #2f4351;
  --text: #f8fafc;
  --muted: #b9c6ce;
  --accent: #f6bd60;
  --danger: #ef476f;
  --ok: #06d6a0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); }
button { border: 0; color: inherit; font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.app-shell { width: min(760px, 100%); min-height: 100dvh; margin: 0 auto; padding: 16px 14px 22px; }
.topbar, .status-panel, .controls { display: flex; gap: 12px; align-items: center; justify-content: space-between; }
.eyebrow, .status-label { margin: 0 0 4px; color: var(--accent); font-size: .76rem; font-weight: 900; text-transform: uppercase; }
h1 { margin: 0; font-size: clamp(2rem, 9vw, 3.25rem); line-height: .95; }
.icon-button, .secondary, .segments button { min-height: 42px; border-radius: 8px; background: var(--panel); border: 1px solid var(--line); font-weight: 900; }
.icon-button { width: 46px; }
.status-panel { margin-top: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.status-text, .note { margin: 0; color: var(--muted); line-height: 1.35; }
.stats { color: var(--ok); font-weight: 1000; white-space: nowrap; }
.controls { margin-top: 12px; align-items: stretch; }
.segments { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; flex: 1; }
.segments button.active { background: var(--accent); color: #101820; }
.secondary { padding: 0 12px; }
.board-wrap { margin-top: 14px; overflow: auto; padding-bottom: 6px; }
.board { display: grid; gap: 3px; width: min(100%, 620px); margin: 0 auto; touch-action: manipulation; }
.cell { display: grid; place-items: center; aspect-ratio: 1; min-width: 28px; border-radius: 6px; background: var(--tile); color: #17212b; font-weight: 1000; box-shadow: inset 0 -3px 0 rgba(0,0,0,.14); }
.cell.open { background: var(--open); box-shadow: none; }
.cell.flagged { background: var(--accent); }
.cell.mine { background: var(--danger); color: white; }
.cell.n1 { color: #2563eb; }
.cell.n2 { color: #059669; }
.cell.n3, .cell.n4, .cell.n5, .cell.n6, .cell.n7, .cell.n8 { color: #dc2626; }
.note { margin-top: 10px; text-align: center; }
@media (max-width: 520px) { .controls { flex-direction: column; } .cell { min-width: 24px; } }
