:root {
  --win95-silver: #c0c0c0;
  --win95-light: #ffffff;
  --win95-mid: #808080;
  --win95-dark: #000000;
  --win95-blue: #000080;
  --base-cell-size: 26px;
  --cell-size: var(--base-cell-size);
  --cell-border: clamp(1px, calc(var(--cell-size) * .15), 4px);
  --cell-font-size: clamp(8px, calc(var(--cell-size) * .65), 17px);
  --window-columns: 9;
}

.minesweeper-page,
.minesweeper-page * {
  box-sizing: border-box;
}

.minesweeper-page {
  width: 100%;
  max-width: 1460px;
  margin: 0;
  padding: 0 12px 30px;
}

.minesweeper-shell {
  width: 100%;
  max-width: 100%;
  margin: 0;
}

.minesweeper-page .tool-page-heading--flush {
  width: 100% !important;
  margin-inline: 0 !important;
}

.minesweeper-page:is(.is-dreadnought, .is-hundred) {
  --base-cell-size: 16px;
  --cell-border: 2px;
  max-width: none;
}

.minesweeper-page.is-hundred {
  --base-cell-size: 12px;
}

.win95-window {
  width: min(calc(var(--window-columns) * var(--cell-size) + 34px), 100%);
  min-width: 0;
  max-width: 100%;
  margin: 0;
  padding: 3px;
  overflow: hidden;
  color: #000;
  background: var(--win95-silver);
  border: 2px solid;
  border-color: var(--win95-light) var(--win95-dark) var(--win95-dark) var(--win95-light);
  box-shadow: 2px 2px 0 rgba(0, 0, 0, .28);
  font-family: "MS Sans Serif", Tahoma, "Segoe UI", sans-serif;
}

.minesweeper-page:is(.is-dreadnought, .is-hundred) .win95-window {
  width: min(calc(var(--window-columns) * var(--cell-size) + 34px), 100%);
  max-width: 100%;
}

html.has-manual-board-size,
body.has-manual-board-size {
  min-width: var(--manual-page-width);
  overflow-x: auto;
}

.minesweeper-page.is-manual-cell-size {
  width: 100%;
  max-width: none;
}

.minesweeper-page.is-manual-cell-size .win95-window {
  width: calc(var(--window-columns) * var(--cell-size) + 34px);
  min-width: calc(var(--window-columns) * var(--cell-size) + 34px);
  max-width: none;
  flex: 0 0 calc(var(--window-columns) * var(--cell-size) + 34px);
}

.minesweeper-page.is-manual-cell-size .board-scroll {
  max-width: none;
}

.title-bar {
  min-height: 27px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 3px 3px 5px;
  color: #fff;
  background: var(--win95-blue);
  font-size: 14px;
  font-weight: 700;
}

.title-icon { font-size: 15px; line-height: 1; }

.title-zoom {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-left: auto;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", sans-serif;
  font-size: 15px;
}

.title-zoom select {
  width: 62px;
  height: 21px;
  padding: 0 2px;
  color: #000;
  background: var(--win95-silver);
  border: 1px solid #fff;
  border-right-color: #000;
  border-bottom-color: #000;
  border-radius: 0;
  font: 12px/1 "MS Sans Serif", Tahoma, sans-serif;
}

.menu-bar {
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 4px 6px;
  border-bottom: 1px solid var(--win95-mid);
}

.difficulty-buttons { display: flex; gap: 4px; }

.win95-window button {
  min-height: 0 !important;
  padding: 4px 9px !important;
  color: #000 !important;
  background: var(--win95-silver) !important;
  border: 2px solid !important;
  border-color: var(--win95-light) var(--win95-dark) var(--win95-dark) var(--win95-light) !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  font: 13px "MS Sans Serif", Tahoma, sans-serif !important;
}

.win95-window button:hover { background: #d2d2d2 !important; }

.win95-window button:active,
.difficulty-buttons button[aria-pressed="true"] {
  padding: 5px 8px 3px 10px !important;
  background: #b7b7b7 !important;
  border-color: var(--win95-dark) var(--win95-light) var(--win95-light) var(--win95-dark) !important;
}

.difficulty-buttons button[aria-pressed="true"] {
  outline: 1px dotted #000;
  outline-offset: -5px;
  font-weight: 700 !important;
}

.difficulty-buttons button { padding: 4px 7px !important; }
.difficulty-buttons button[aria-pressed="true"] { padding: 5px 6px 3px 8px !important; }

.win95-window .title-icon-command {
  all: unset;
  flex: 0 0 auto;
  min-height: 0 !important;
  padding: 0 !important;
  color: inherit !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  font: inherit !important;
  font-size: 15px !important;
  line-height: 1 !important;
  cursor: default !important;
}

.win95-window .title-icon-command:hover {
  background: transparent !important;
}

.win95-window .title-icon-command:active {
  padding: 0 !important;
  transform: none;
}

.win95-window .title-icon-command:focus-visible {
  outline: 1px dotted #fff !important;
  outline-offset: 1px;
}

.game-panel { padding: 8px; }

.continue-overlay {
  position: fixed;
  z-index: 1000;
  inset: 0;
  background: rgba(0, 0, 0, .35);
}

.continue-overlay[hidden],
.continue-dialog-body[hidden],
.continue-commercial[hidden] { display: none; }

.continue-dialog {
  position: fixed;
  width: min(390px, calc(100% - 16px));
  padding: 3px;
  color: #000;
  background: var(--win95-silver);
  border: 2px solid;
  border-color: var(--win95-light) var(--win95-dark) var(--win95-dark) var(--win95-light);
  box-shadow: 2px 2px 0 #000;
  font: 13px/1.4 "MS Sans Serif", Tahoma, sans-serif;
}

.continue-title-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 22px;
  padding: 3px 5px;
  color: #fff;
  background: #000080;
  font-weight: 700;
  cursor: move;
  touch-action: none;
  user-select: none;
}

.continue-dialog .continue-close-button {
  width: 20px;
  height: 18px;
  display: grid;
  place-items: center;
  padding: 0 0 2px !important;
  background: var(--win95-silver);
  font-weight: 700;
  line-height: 1;
}

.continue-dialog-body {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  padding: 16px 14px 13px;
}

.continue-icon {
  width: 34px;
  font-size: 34px;
  text-align: center;
}
.continue-dialog p { margin: 0 0 7px; }
.continue-heading { font-weight: 700; }
.continue-progress {
  display: grid;
  gap: 5px;
  margin-top: 10px;
  font-variant-numeric: tabular-nums;
  line-height: 1.4;
}

.continue-progress-bar {
  position: relative;
  height: 21px;
  padding: 1px;
  overflow: hidden;
  background: #fff;
  border: 1px solid;
  border-color: #000 #fff #fff #000;
}

.continue-progress-fill {
  display: block;
  width: 0;
  height: 100%;
  background: #0000a0;
}

.continue-progress-value {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff;
  font: 12px/1 "MS Sans Serif", Tahoma, sans-serif;
  line-height: 1;
  pointer-events: none;
}

.continue-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 4px;
  padding-left: 44px;
}

#continue-end-button {
  margin-right: auto;
  font-size: 12px !important;
}

#continue-watch-button {
  min-width: 11em;
  padding-inline: calc(10px + 1em) !important;
}

.continue-dialog button {
  min-height: 27px !important;
  padding: 4px 10px !important;
  color: #000 !important;
  background: var(--win95-silver) !important;
  border: 2px solid !important;
  border-color: var(--win95-light) var(--win95-dark) var(--win95-dark) var(--win95-light) !important;
  border-radius: 0 !important;
  box-shadow: 1px 1px 0 #000 !important;
  font: 13px "MS Sans Serif", Tahoma, sans-serif !important;
}

.continue-dialog button:active {
  padding: 5px 9px 3px 11px !important;
  border-color: var(--win95-dark) var(--win95-light) var(--win95-light) var(--win95-dark) !important;
  box-shadow: none !important;
}

#continue-watch-button:active {
  padding-inline: calc(10px + 1em) !important;
}

.continue-dialog button:focus,
.continue-dialog button:focus-visible { outline: 1px dotted #000; outline-offset: -5px; }

.continue-commercial { padding: 10px; text-align: center; }
.continue-commercial p { margin: 8px 0 1px; }

.continue-ad-placeholder {
  min-height: 150px;
  display: grid;
  place-content: center;
  gap: 8px;
  color: #fff;
  background: #111;
  border: 2px solid;
  border-color: #000 #fff #fff #000;
  font-size: 18px;
}

.continue-ad-placeholder strong { color: #ffdf00; font-size: 11px; letter-spacing: .12em; }
.continue-ad-actions { justify-content: center; margin-top: 10px; }

.design-panel {
  display: grid;
  gap: 7px;
  margin-bottom: 8px;
  padding: 8px;
  background: #c8c8c8;
  border: 2px solid;
  border-color: var(--win95-mid) var(--win95-light) var(--win95-light) var(--win95-mid);
  font-size: 12px;
}

.design-panel[hidden] { display: none; }

.design-settings {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 8px;
  font-weight: 700;
}

.design-settings input {
  width: 58px;
  height: 26px;
  padding: 2px 4px;
  color: #000;
  background: #fff;
  border: 2px solid;
  border-color: #000 #fff #fff #000;
  border-radius: 0;
  font: 13px "MS Sans Serif", Tahoma, sans-serif;
}

.design-settings output {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.design-instruction {
  min-height: 2.8em;
  margin: 0;
  line-height: 1.4;
}

.design-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.win95-window button:disabled {
  color: #777 !important;
  text-shadow: 1px 1px #fff;
  cursor: default;
}

.win95-window button:disabled:hover { background: var(--win95-silver) !important; }

.auto-row,
.status-panel {
  border: 2px solid;
  border-color: var(--win95-mid) var(--win95-light) var(--win95-light) var(--win95-mid);
}

.auto-row {
  min-height: 54px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 7px;
  margin-bottom: 8px;
  padding: 7px 9px;
  background: #c8c8c8;
}

.auto-title {
  display: block;
  font-size: 14px;
  font-weight: 700;
}

.auto-heading {
  display: flex;
  align-items: center;
  gap: 8px;
}

.auto-switch {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  color: #000 !important;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.auto-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.auto-stop-options {
  display: grid;
  gap: 5px;
}

.minesweeper-page.has-wide-game .auto-stop-options {
  display: flex;
  flex-wrap: nowrap;
  gap: 12px;
}

.minesweeper-page.has-wide-game .auto-option-switch {
  white-space: nowrap;
}

.auto-option-switch {
  font-weight: 400;
}

.auto-option-switch .switch-track {
  width: 34px;
  height: 20px;
  padding: 2px;
}

.auto-option-switch .switch-knob {
  width: 12px;
  height: 12px;
}

.speed-control {
  position: relative;
  display: flex;
  align-items: center;
  gap: 5px;
  color: #000 !important;
  font-size: 12px;
  font-weight: 700;
}

#speed-label {
  flex: 0 0 auto;
  white-space: nowrap;
  writing-mode: horizontal-tb;
}

.speed-control select {
  display: none;
}

.speed-description {
  min-width: 11em;
  font-weight: 400;
  white-space: nowrap;
}

.speed-select-button,
.speed-menu button {
  min-width: 70px;
  height: 25px;
  padding: 1px 20px 1px 4px !important;
  color: #000 !important;
  background-color: #fff !important;
  border: 2px solid !important;
  border-color: #000 #fff #fff #000 !important;
  border-radius: 0 !important;
  font: 12px "MS Sans Serif", Tahoma, sans-serif !important;
}

.speed-select-button {
  position: relative;
  text-align: left;
}

.speed-select-button::after {
  content: "";
  position: absolute;
  top: 9px;
  right: 7px;
  border: 4px solid transparent;
  border-top-color: #000;
}

.speed-menu {
  position: absolute;
  top: calc(100% + 2px);
  left: 29px;
  z-index: 20;
  display: grid;
  min-width: 86px;
  background: #fff;
  border: 2px solid;
  border-color: #000 #fff #fff #000;
  box-shadow: 2px 2px 0 rgba(0, 0, 0, .28);
}

.speed-menu[hidden] {
  display: none;
}

.speed-menu button {
  width: 100%;
  min-width: 0;
  border-width: 0 !important;
  text-align: left;
}

.speed-menu button[aria-selected="true"],
.speed-menu button:focus {
  color: #fff !important;
  background: var(--win95-blue) !important;
  outline: 0;
}

.auto-switch input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
}

.switch-track {
  width: 46px;
  height: 24px;
  display: block;
  padding: 3px;
  background: #7d7d7d;
  border: 2px solid;
  border-color: #000 #fff #fff #000;
}

.switch-knob {
  width: 16px;
  height: 14px;
  display: block;
  background: var(--win95-silver);
  border: 2px solid;
  border-color: #fff #000 #000 #fff;
  transition: transform .12s ease;
}

.auto-switch input:checked + .switch-track { background: #000080; }
.auto-switch input:checked + .switch-track .switch-knob { transform: translateX(20px); }
.auto-option-switch input:checked + .switch-track .switch-knob { transform: translateX(14px); }
.auto-switch input:focus-visible + .switch-track { outline: 3px solid rgba(0, 0, 128, .32); outline-offset: 2px; }

.minesweeper-page:not(.is-auto-enabled) :is(.speed-control, .auto-option-switch) {
  color: #666 !important;
  cursor: default;
}

.minesweeper-page:not(.is-auto-enabled) :is(.speed-select-button, .auto-option-switch .switch-track) {
  opacity: .55;
  filter: grayscale(1);
}

.status-panel {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  min-height: 60px;
  margin-bottom: 8px;
  padding: 6px 8px;
}

.counter-wrap { justify-self: start; }
.counter-wrap--right { justify-self: end; text-align: right; }
.digital {
  min-width: 70px;
  min-height: 39px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 3px 5px;
  background: #050505;
  border: 2px solid;
  border-color: var(--win95-mid) var(--win95-light) var(--win95-light) var(--win95-mid);
}

.digital-digit {
  position: relative;
  width: 16px;
  height: 29px;
  flex: 0 0 16px;
}

.digital-segment {
  position: absolute;
  display: block;
  background: #300000;
}

.digital-segment.a,
.digital-segment.d,
.digital-segment.g {
  left: 3px;
  width: 10px;
  height: 3px;
  clip-path: polygon(15% 0, 85% 0, 100% 50%, 85% 100%, 15% 100%, 0 50%);
}

.digital-segment.a { top: 0; }
.digital-segment.g { top: 13px; }
.digital-segment.d { bottom: 0; }

.digital-segment.b,
.digital-segment.c,
.digital-segment.e,
.digital-segment.f {
  width: 3px;
  height: 11px;
  clip-path: polygon(50% 0, 100% 15%, 100% 85%, 50% 100%, 0 85%, 0 15%);
}

.digital-segment.b { top: 2px; right: 0; }
.digital-segment.c { bottom: 2px; right: 0; }
.digital-segment.e { bottom: 2px; left: 0; }
.digital-segment.f { top: 2px; left: 0; }

.digital-digit[data-value="0"] :is(.a,.b,.c,.d,.e,.f),
.digital-digit[data-value="1"] :is(.b,.c),
.digital-digit[data-value="2"] :is(.a,.b,.d,.e,.g),
.digital-digit[data-value="3"] :is(.a,.b,.c,.d,.g),
.digital-digit[data-value="4"] :is(.b,.c,.f,.g),
.digital-digit[data-value="5"] :is(.a,.c,.d,.f,.g),
.digital-digit[data-value="6"] :is(.a,.c,.d,.e,.f,.g),
.digital-digit[data-value="7"] :is(.a,.b,.c),
.digital-digit[data-value="8"] .digital-segment,
.digital-digit[data-value="9"] :is(.a,.b,.c,.d,.f,.g),
.digital-digit[data-value="-"] .g {
  background: #ff1b12;
  box-shadow: 0 0 4px rgba(255, 0, 0, .7);
}

.win95-window .face-button {
  width: 39px;
  height: 39px;
  display: grid;
  place-items: center;
  padding: 0 !important;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", sans-serif !important;
  font-size: 22px !important;
  line-height: 1 !important;
}

.win95-window .face-button:active { padding: 2px 0 0 2px !important; }

.play-layout {
  width: 100%;
  max-width: 100%;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: start;
  gap: 12px;
}

.board-scroll {
  position: relative;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  border: 3px solid;
  border-color: var(--win95-mid) var(--win95-light) var(--win95-light) var(--win95-mid);
  background: var(--win95-silver);
}

.minesweeper-page:is(.is-dreadnought, .is-hundred) .board-scroll {
  max-width: 100%;
}

.minefield {
  position: relative;
  width: calc(var(--window-columns) * var(--cell-size));
  display: grid;
  margin: 0 auto;
  background: var(--win95-mid);
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  touch-action: pan-y pinch-zoom;
}

.extended-panel {
  width: min(300px, calc(var(--window-columns) * var(--cell-size) + 26px), 100%);
  flex: 0 0 min(300px, calc(var(--window-columns) * var(--cell-size) + 26px), 100%);
  min-width: 0;
  display: grid;
  gap: 3px;
  padding: 3px;
  color: #000;
  background: var(--win95-silver);
  border: 2px solid;
  border-color: var(--win95-light) var(--win95-dark) var(--win95-dark) var(--win95-light);
  box-shadow: 2px 2px 0 rgba(0, 0, 0, .28);
  font-size: 12px;
  font-family: "MS Sans Serif", Tahoma, "Segoe UI", sans-serif;
}

.play-layout.is-stacked .extended-panel {
  width: min(calc(var(--window-columns) * var(--cell-size) + 34px), 100%);
  flex-basis: min(calc(var(--window-columns) * var(--cell-size) + 34px), 100%);
}

.extended-title {
  min-height: 27px;
  display: flex;
  align-items: center;
  margin: 0;
  padding: 3px 5px;
  color: #fff;
  background: var(--win95-blue);
  font-size: 14px;
  line-height: 1.2;
  font-weight: 700;
}

.board-stats {
  display: grid;
  gap: 0;
  margin: 0;
  border: 2px solid;
  border-color: var(--win95-mid) var(--win95-light) var(--win95-light) var(--win95-mid);
  background: #c8c8c8;
}

.board-stats div {
  position: relative;
  display: grid;
  grid-template-columns: minmax(94px, 1fr) minmax(80px, auto);
  gap: 8px;
  padding: 5px 7px;
}

.board-stats .board-stat-progress {
  isolation: isolate;
  overflow: hidden;
}

.board-stat-progress::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0 auto 0 0;
  width: calc(var(--progress, 0) * 1%);
  background: #86bd86;
}

.board-stat-progress dt,
.board-stat-progress dd {
  position: relative;
  z-index: 1;
}

.board-stat-progress dd {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
}

.board-stats div + div {
  border-top: 1px solid var(--win95-mid);
}

.board-stats dt {
  font-weight: 700;
}

.board-stats dd {
  margin: 0;
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

#minefield .cell {
  position: relative;
  width: var(--cell-size) !important;
  height: var(--cell-size) !important;
  min-width: var(--cell-size) !important;
  min-height: var(--cell-size) !important;
  display: grid !important;
  place-items: center !important;
  padding: 0 !important;
  overflow: hidden;
  color: #000 !important;
  background: var(--win95-silver) !important;
  border: var(--cell-border) solid !important;
  border-color: var(--win95-light) var(--win95-mid) var(--win95-mid) var(--win95-light) !important;
  border-radius: 0 !important;
  outline-offset: -2px !important;
  font: 800 var(--cell-font-size)/1 Arial, sans-serif !important;
}

.minesweeper-page.has-small-cells {
  --cell-border: 1px;
}

#minefield .auto-cursor {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 3;
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
  font-size: 60px;
  line-height: 1;
  transition: transform 160ms ease-out, opacity 80ms linear;
  filter: drop-shadow(2px 2px 0 #fff) drop-shadow(-2px -2px 0 #fff);
}

#minefield .auto-cursor.is-slow {
  transition: transform 700ms ease-in-out, opacity 80ms linear;
}

#minefield .auto-cursor.is-falling {
  transition: transform 760ms cubic-bezier(.55, 0, 1, 1), opacity 760ms ease-in;
}

#minefield .auto-cursor.is-visible {
  opacity: 1;
}

.minesweeper-page:is(.is-dreadnought, .is-hundred) #minefield .cell {
  border-width: var(--cell-border) !important;
  font-size: clamp(4px, calc(var(--cell-size) * .7), 12px) !important;
}

.minesweeper-page:is(.is-dreadnought, .is-hundred) #minefield .auto-cursor {
  width: 72px;
  height: 72px;
  font-size: 60px;
}

#minefield .cell:hover:not(.revealed) { background: #cecece !important; }

#minefield .cell.revealed,
#minefield .cell.pressed {
  padding: 0 !important;
  background: var(--win95-silver) !important;
  border: 0 !important;
  box-shadow: inset -1px 0 var(--win95-mid), inset 0 -1px var(--win95-mid) !important;
}

#minefield .cell.flagged { font-size: clamp(7px, calc(var(--cell-size) * .46), 12px) !important; }

#minefield .cell.mine,
#minefield .cell.wrong { font-size: clamp(7px, calc(var(--cell-size) * .58), 15px) !important; }

#minefield .cell.design-mine {
  padding: 0 !important;
  background: #fff27a !important;
  border: 0 !important;
  box-shadow: inset 0 0 0 2px #000080, inset -3px -3px #d2b900 !important;
  font-size: clamp(10px, calc(var(--cell-size) * .68), 18px) !important;
}

.minesweeper-page:is(.is-dreadnought, .is-hundred) #minefield .cell.flagged { font-size: clamp(4px, calc(var(--cell-size) * .7), 12px) !important; }

.minesweeper-page:is(.is-dreadnought, .is-hundred) #minefield .cell.mine,
.minesweeper-page:is(.is-dreadnought, .is-hundred) #minefield .cell.wrong { font-size: clamp(4px, calc(var(--cell-size) * .7), 12px) !important; }

#minefield .cell.exploded { background: #f00 !important; }
#minefield .cell[data-number="1"] { color: #0000ff !important; }
#minefield .cell[data-number="2"] { color: #008000 !important; }
#minefield .cell[data-number="3"] { color: #ff0000 !important; }
#minefield .cell[data-number="4"] { color: #000080 !important; }
#minefield .cell[data-number="5"] { color: #800000 !important; }
#minefield .cell[data-number="6"] { color: #008080 !important; }
#minefield .cell[data-number="7"] { color: #000 !important; }
#minefield .cell[data-number="8"] { color: #666 !important; }

.game-number {
  display: grid;
  place-items: center;
  color: inherit;
}

.game-number-standard {
  width: 10px;
  height: 14px;
  display: grid;
  grid-template-columns: repeat(5, 2px);
  grid-template-rows: repeat(7, 2px);
}

.game-number-compact { display: none; }
.game-number-pixel { width: 2px; height: 2px; }
.game-number-pixel.on {
  background: currentColor;
  box-shadow: 1px 0 currentColor, 0 1px currentColor;
}

.minesweeper-page.has-small-cells .game-number-standard {
  width: 5px;
  height: 7px;
  grid-template-columns: repeat(5, 1px);
  grid-template-rows: repeat(7, 1px);
}

.minesweeper-page.has-small-cells .game-number-standard .game-number-pixel {
  width: 1px;
  height: 1px;
}

.minesweeper-page.has-small-cells .game-number-standard .game-number-pixel.on {
  box-shadow: none;
}

.minesweeper-page.has-compact-cells .game-number-standard { display: none; }
.minesweeper-page.has-compact-cells .game-number-compact {
  width: 3px;
  height: 5px;
  display: grid;
  grid-template-columns: repeat(3, 1px);
  grid-template-rows: repeat(5, 1px);
}

.minesweeper-page.has-compact-cells .game-number-compact .game-number-pixel {
  width: 1px;
  height: 1px;
}

.minesweeper-page.has-compact-cells .game-number-compact .game-number-pixel.on {
  box-shadow: none;
}

.minesweeper-page.has-compact-cells #minefield .cell:is(.flagged, .mine, .wrong) {
  font-size: 0 !important;
}

.minesweeper-page.has-compact-cells #minefield .cell.flagged::before {
  content: "";
  width: 3px;
  height: 4px;
  border-left: 1px solid #000;
  border-bottom: 1px solid #000;
}

.minesweeper-page.has-compact-cells #minefield .cell.flagged::after {
  content: "";
  position: absolute;
  top: 1px;
  left: calc(50% - 1px);
  border-top: 1px solid transparent;
  border-bottom: 1px solid transparent;
  border-left: 2px solid #d40000;
}

.minesweeper-page.has-compact-cells #minefield .cell.mine::before {
  content: "";
  width: 3px;
  height: 3px;
  background: #000;
  border-radius: 50%;
}

.minesweeper-page.has-compact-cells #minefield .cell.wrong::after {
  content: "×";
  color: #d40000;
  font: 700 5px/1 Arial, sans-serif;
}

.game-log {
  width: 100%;
  margin: 0;
  padding: 5px;
  color: #000;
  background: #c8c8c8;
  border: 2px solid;
  border-color: var(--win95-mid) var(--win95-light) var(--win95-light) var(--win95-mid);
  font-size: 12px;
}

.game-log ol {
  height: calc(7 * 25px);
  margin: 0;
  padding: 0;
  overflow-y: auto;
  list-style: none;
}

.game-log li + li { border-top: 1px dotted var(--win95-mid); }

.game-log .log-entry {
  width: 100%;
  display: block;
  padding: 3px 2px !important;
  overflow: hidden;
  color: #000 !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  min-height: 25px !important;
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: left;
  font-size: 12px !important;
}

.game-log .log-entry:hover,
.game-log .log-entry[aria-current="true"] {
  color: #fff !important;
  background: var(--win95-blue) !important;
}

.empty-log { padding: 3px 2px; color: #555; }

.game-instructions span {
  display: block;
  line-height: 1.5;
}
.minefield.snapshot-view .cell { cursor: default !important; }

#minefield .cell.guess-choice {
  background: #ffe45c !important;
  box-shadow: inset 0 0 0 3px #ff2b1c !important;
}

#stat-ai-guess-trigger {
  cursor: default !important;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

@media (max-width: 1150px) {
  .minesweeper-shell { width: 100%; }
}

@media (max-width: 1440px) {
  .minesweeper-page:is(.is-dreadnought, .is-hundred) .minesweeper-shell { width: 100%; }
  .minesweeper-page:is(.is-dreadnought, .is-hundred) .extended-panel {
    margin-inline: 0;
  }
}

@media (max-width: 640px) {
  .minesweeper-page { padding-inline: 6px; }
  .minesweeper-page .tool-page-heading--flush { width: 100% !important; }
  .win95-window { margin-inline: 0; }
  .game-panel { padding: 6px; }
  .auto-controls { gap: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .switch-knob { transition: none; }
}
