/* ── Minesweeper Board ── */
.board-container {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100vw;
  max-height: calc(100dvh - 200px);
  display: flex;
  justify-content: center;
  padding: var(--sp-sm);
}

.board {
  display: inline-grid;
  gap: var(--cell-gap);
  background: var(--bg-secondary);
  padding: 6px;
  border: 1px solid rgba(0, 245, 255, 0.2);
  box-shadow:
    var(--glow-cyan),
    inset 0 0 30px rgba(0, 0, 0, 0.5);
  border-radius: 4px;
  touch-action: manipulation;
}

/* ── Cell ── */
.cell {
  width: var(--cell-size);
  height: var(--cell-size);
  background: var(--bg-cell);
  border: 1px solid rgba(0, 245, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-family: var(--font-primary);
  font-weight: bold;
  font-size: 14px;
  transition: background var(--t-fast), border-color var(--t-fast), transform 0.08s ease;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  position: relative;
}

.cell:hover:not(.cell--revealed):not(.cell--disabled) {
  background: var(--bg-cell-hover);
  border-color: rgba(0, 245, 255, 0.25);
}

.cell:active:not(.cell--revealed):not(.cell--disabled) {
  transform: scale(0.92);
}

/* Revealed cell */
.cell--revealed {
  background: var(--bg-cell-revealed);
  cursor: default;
  border-color: rgba(255, 255, 255, 0.03);
  animation: cellReveal 0.2s ease;
}

/* Mine cell */
.cell--mine {
  background: rgba(255, 7, 58, 0.3) !important;
  border-color: var(--neon-red) !important;
  animation: explode 0.35s ease;
}

.cell--mine-hit {
  background: rgba(255, 7, 58, 0.6) !important;
  box-shadow: var(--glow-red);
}

/* Flagged cell */
.cell--flagged {
  background: rgba(255, 45, 149, 0.08);
  border-color: rgba(255, 45, 149, 0.2);
}
.cell--flagged::after {
  content: '⚑';
  color: var(--neon-pink);
  text-shadow: var(--glow-pink);
  font-size: 16px;
}

/* Cell disabled (online mode, not your turn) */
.cell--disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

/* Number colors */
.cell[data-adjacent="1"] { color: var(--num-1); }
.cell[data-adjacent="2"] { color: var(--num-2); }
.cell[data-adjacent="3"] { color: var(--num-3); }
.cell[data-adjacent="4"] { color: var(--num-4); }
.cell[data-adjacent="5"] { color: var(--num-5); }
.cell[data-adjacent="6"] { color: var(--num-6); }
.cell[data-adjacent="7"] { color: var(--num-7); }
.cell[data-adjacent="8"] { color: var(--num-8); }

/* Mine content (after game over reveal) */
.cell--mine-content::after {
  content: '💣';
  font-size: 14px;
}

/* Competitive mode: bomb found by player 1 */
.cell--found-p1 {
  background: rgba(0, 245, 255, 0.15) !important;
  border-color: var(--neon-cyan) !important;
}
.cell--found-p1::after {
  content: '💣';
  font-size: 14px;
}

/* Competitive mode: bomb found by player 2 */
.cell--found-p2 {
  background: rgba(255, 45, 149, 0.15) !important;
  border-color: var(--neon-pink) !important;
}
.cell--found-p2::after {
  content: '💣';
  font-size: 14px;
}

/* Wrong flag (shown on game over) */
.cell--wrong-flag {
  background: rgba(255, 7, 58, 0.15) !important;
  border-color: rgba(255, 7, 58, 0.3) !important;
}
.cell--wrong-flag::after {
  content: '✕';
  color: var(--neon-red);
  font-size: 18px;
  text-shadow: var(--glow-red);
}
