/* ---------- Mines ---------- */

.stage { justify-content: center; gap: 10px; padding: 8px 10px; }

/* ---------- status bar ---------- */

.statusbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  max-width: 420px;
  font-variant-numeric: tabular-nums;
}

.chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: var(--r-pill);
  background: var(--surface);
  border: 1px solid var(--line-soft);
  font-size: 14px;
  font-weight: 700;
}
.chip svg { width: 15px; height: 15px; }
.chip--mines { color: var(--bad); }
.chip--time  { color: var(--text-2); }

/* Flag mode: a reliable alternative to long-press. */
.chip--toggle {
  color: var(--text-2);
  transition: background .15s, color .15s, border-color .15s;
}
.chip--toggle.is-on {
  background: var(--warn);
  border-color: transparent;
  color: #2a1f00;
}

/* ---------- board ---------- */

.board-wrap {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.board {
  display: grid;
  gap: var(--m-gap, 3px);
  grid-template-columns: repeat(var(--cols, 8), var(--cell, 40px));
  grid-auto-rows: var(--cell, 40px);
  touch-action: manipulation;
  position: relative;
}

.mcell {
  border: 0;
  padding: 0;
  border-radius: 4px;
  background: var(--surface-3);
  display: grid;
  place-items: center;
  font-size: calc(var(--cell, 40px) * .5);
  font-weight: 800;
  line-height: 1;
  color: var(--text);
  transition: background .1s;
}
.mcell:active { background: #414a5a; }

.mcell.is-open {
  background: var(--bg-2);
  box-shadow: inset 0 0 0 1px var(--line-soft);
}
.mcell.is-open:active { background: var(--bg-2); }

/* One colour per count, the way everyone expects. */
.n1 { color: #6fa8ff; }
.n2 { color: #5fc07a; }
.n3 { color: #e0574a; }
.n4 { color: #a97ae0; }
.n5 { color: #d9a92f; }
.n6 { color: #3fae94; }
.n7 { color: #d9d9d9; }
.n8 { color: #8e96a6; }

.mcell.is-flag { color: var(--warn); font-size: calc(var(--cell, 40px) * .52); }
.mcell.is-boom { background: var(--bad); color: #2d0b07; }
.mcell.is-mine { background: var(--surface-2); color: var(--bad); }
.mcell.is-wrong { background: var(--surface-2); color: var(--muted); }

.mcell svg { width: 62%; height: 62%; }

/* ---------- overlay ---------- */

.overlay {
  position: absolute;
  inset: -8px;
  border-radius: var(--r);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgb(14 16 20 / .86);
  z-index: 5;
  animation: fade-in .25s var(--ease);
}
.overlay[hidden] { display: none; }
.overlay b { font-size: 25px; font-weight: 800; }
.overlay p { margin: 0; font-size: 14px; color: var(--text-2); }

/* ---------- controls ---------- */

.pad { display: flex; gap: 8px; justify-content: center; }
.pad .btn { flex: 1 1 0; min-width: 0; padding: 0 6px; font-size: 14px; }
.pad .btn.is-on { background: var(--accent); border-color: transparent; color: #0b0e14; }
