/* Minesweeper — classic Win 95 raised/flat bevel via inset shadows. */

.ms-board {
  margin: 18px auto;
  padding: 8px;
  width: max-content;
  max-width: 100%;
  background: #c0c0c0;
  border-top:    3px solid #ffffff;
  border-left:   3px solid #ffffff;
  border-right:  3px solid #808080;
  border-bottom: 3px solid #808080;
}

.ms-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  margin-bottom: 8px;
  background: #c0c0c0;
  box-shadow: inset 2px 2px 0 #808080, inset -2px -2px 0 #ffffff;
}

.ms-counter {
  font-family: 'Courier New', 'Lucida Console', monospace;
  font-weight: bold;
  font-size: 22px;
  background: #000;
  color: #ff2020;
  padding: 2px 6px;
  letter-spacing: 2px;
  min-width: 56px;
  text-align: center;
  user-select: none;
}

.ms-reset {
  font-size: 22px;
  padding: 0;
  width: 36px;
  height: 36px;
  cursor: pointer;
  background: #c0c0c0;
  color: #000;
  border: none;
  box-shadow: inset 2px 2px 0 #ffffff, inset -2px -2px 0 #808080;
  border-radius: 0;
  font-weight: normal;
}
.ms-reset:hover { background: #c0c0c0; }
.ms-reset:active {
  box-shadow: inset 2px 2px 0 #808080, inset -2px -2px 0 #ffffff;
}

.ms-grid-wrap {
  overflow-x: auto;
  background: #c0c0c0;
  box-shadow: inset 2px 2px 0 #808080, inset -2px -2px 0 #ffffff;
  padding: 3px;
}

.ms-grid {
  --cell-size: 28px;
  display: grid;
  grid-template-columns: repeat(var(--cols, 9), var(--cell-size));
  width: max-content;
}

.ms-grid.beginner     { --cell-size: 36px; }
.ms-grid.intermediate { --cell-size: 30px; }
.ms-grid.expert       { --cell-size: 26px; }

@media (max-width: 600px) {
  .ms-grid.beginner     { --cell-size: 32px; }
  .ms-grid.intermediate { --cell-size: 24px; }
  .ms-grid.expert       { --cell-size: 22px; }
}
@media (max-width: 400px) {
  .ms-grid.beginner     { --cell-size: 28px; }
  .ms-grid.intermediate { --cell-size: 22px; }
  .ms-grid.expert       { --cell-size: 20px; }
}

.cell {
  width: var(--cell-size);
  height: var(--cell-size);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Tahoma', 'Verdana', sans-serif;
  font-weight: bold;
  font-size: calc(var(--cell-size) * 0.55);
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  cursor: pointer;
  background: #c0c0c0;
  color: #000;
  box-sizing: border-box;
  /* Raised bevel via inset shadows — width/height stays constant. */
  box-shadow: inset 2px 2px 0 #ffffff, inset -2px -2px 0 #808080;
}

.cell.revealed {
  /* Flat with a 1px gridline */
  box-shadow: inset 0 0 0 1px #808080;
  cursor: default;
}
.cell.mine.exploded { background: #ff2020; }
.cell.wrong-flag    { background: #c0c0c0; }

.cell.n1 { color: #0000ff; }
.cell.n2 { color: #008000; }
.cell.n3 { color: #ff0000; }
.cell.n4 { color: #000080; }
.cell.n5 { color: #800000; }
.cell.n6 { color: #008080; }
.cell.n7 { color: #000000; }
.cell.n8 { color: #404040; }
