/* ═══ Démineur — design system jeux.html ═══ */
.jeu-v-wrap { max-width: 520px; margin: 0 auto; }
#game-content { overflow: hidden; }

/* ── Diff bar ── */
.dm-diff-bar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.diff-btn,
.mode-btn {
  border: 1px solid var(--bd);
  background: var(--sf);
  color: var(--tx2);
  border-radius: 10px;
  min-height: 36px;
  padding: 8px 10px;
  font-weight: 700;
  font-size: 11px;
  cursor: pointer;
  transition: background .12s, color .12s;
}

.diff-btn.active,
.mode-btn.active {
  background: var(--a1);
  border-color: var(--a1);
  color: #fff;
}

.face-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--bd);
  background: var(--sf);
  color: inherit;
  font-size: 1.25rem;
  display: grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
}

/* ── Banner ── */
#banner {
  min-height: 30px;
  display: grid;
  place-items: center;
  padding: 0 14px;
}

.win-banner,
.lose-banner {
  padding: 6px 14px;
  border-radius: 999px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.78rem;
}

.win-banner {
  color: var(--ok);
  background: rgba(90,235,192,.08);
  border: 1px solid rgba(90,235,192,.3);
}

.lose-banner {
  color: var(--dg);
  background: rgba(242,128,114,.08);
  border: 1px solid rgba(242,128,114,.3);
}

/* ── Board frame ── */
.board-frame {
  width: 100%;
  max-width: 100%;
  display: flex;
  justify-content: center;
  padding: clamp(8px, 2vw, 12px);
  border-radius: 14px;
  background: var(--bg);
  border: 1px solid var(--bd);
  overflow: hidden;
  touch-action: manipulation;
}

#board {
  display: grid;
  gap: 0;
  width: max-content;
}

/* ── Cells ── */
.cell {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-family: var(--mono);
  cursor: pointer;
  user-select: none;
  border: 1px solid rgba(0,0,0,.35);
  background: linear-gradient(135deg, var(--dm-cell-hi, #3f4d7f) 0%, var(--dm-cell-lo, #2f395f) 100%);
  box-shadow: inset 1px 1px 0 rgba(255,255,255,.08), inset -1px -1px 0 rgba(0,0,0,.28);
  transition: transform .08s ease, background .08s ease;
  touch-action: manipulation;
}

.cell:active:not(.revealed) { transform: scale(0.97); }

.cell.revealed {
  background: #11172b;
  box-shadow: inset 0 0 0 1px rgba(132,153,208,.08);
  border-color: rgba(58,72,111,.38);
}

.cell.mine-hit  { background: #ff5f7a !important; }
.cell.mine-shown { background: #191f35; }

.cell.flag-preview {
  outline: 2px solid rgba(255,95,122,.7);
  outline-offset: -2px;
}

.cell.n1 { color: #73a4ff; }
.cell.n2 { color: #45d48f; }
.cell.n3 { color: #ff7b7b; }
.cell.n4 { color: #a994ff; }
.cell.n5 { color: #ffab6c; }
.cell.n6 { color: #59dbe2; }
.cell.n7 { color: #e5e9ff; }
.cell.n8 { color: #98a2c6; }

/* ── HTML page overlays (démarrage / fin) ── */
.jvdm-overlay {
  position: absolute;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  background: var(--cd, #fff);
  border-radius: var(--r2, 14px);
  overflow: hidden;
}

.jvdm-overlay.hidden { display: none; }

.jvdm-overlay > .snk-screen {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.jvdm-overlay .snk-screen {
  justify-content: center;
  align-items: center;
  padding-top: 20px;
  padding-bottom: 20px;
  width: 100%;
  min-height: 100%;
  box-sizing: border-box;
}

/* ── Responsive ── */
@media (max-width: 480px) {
  .jeu-v-wrap { max-width: none; }
}
