.ms-layout { display: flex; flex-wrap: wrap; gap: 24px; align-items: center; }
.ms-console { width: 238px; max-width: 100%; flex: none; }
.ms-scoreboard {
  background: var(--face);
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--sunken);
  padding: 8px;
  margin-bottom: 9px;
}
.ms-meter { display: grid; gap: 2px; text-align: center; }
.ms-meter > span { color: #333; font-size: 10px; line-height: 1.3; }
.ms-meter output {
  background: #180000;
  color: #ff4b4b;
  box-shadow: inset 1px 1px #808080, inset -1px -1px #fff;
  font: 600 29px/1 var(--pixel);
  font-variant-numeric: tabular-nums;
  min-width: 58px;
  padding: 3px 4px;
}
.ms-reset { padding: 5px; min-width: 36px; min-height: 36px; }
.ms-reset svg { display: block; }
.ms-lock-open, .ms-lock-error { display: none; }
.ms-reset[data-face="won"] .ms-lock-open,
.ms-reset[data-face="lost"] .ms-lock-error { display: block; }
.ms-reset[data-face="won"] .ms-lock-closed,
.ms-reset[data-face="lost"] .ms-lock-keyhole { display: none; }
.ms-reset[data-face="won"] .ms-lock-body { fill: #a0df90; }
.ms-reset[data-face="lost"] .ms-lock-body { fill: #ffa0a0; }
.ms-board { background: var(--face); box-shadow: var(--sunken); padding: 3px; user-select: none; }
.ms-row { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); }
.ms-cell {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  border: 0;
  padding: 0;
  border-radius: 0;
  box-shadow: var(--raised);
  background: var(--face);
  color: #000;
  font: 700 19px/1 var(--pixel);
  touch-action: manipulation;
  background-position: center;
  background-image: url("../img/sealed-share.svg");
  background-size: 14px 14px;
  background-repeat: no-repeat;
}
.ms-cell:not(.is-open):not([aria-disabled="true"]):active { box-shadow: var(--pressed); }
.ms-cell.is-open {
  box-shadow: inset 1px 1px #909090;
  background-color: #c0c0c0;
  background-image: none;
}
.ms-cell.is-flagged { background-image: url("../img/warning-seal.svg"); background-size: 20px 20px; }
.ms-cell.is-mine { background-image: url("../img/broken-key.svg"); background-size: 20px 20px; }
.ms-cell.is-wrong { background-image: none; }
.ms-cell.is-exploded { background-color: #ff5555; }
.ms-cell.is-wrong::after { content: "×"; color: #a00000; font: bold 26px/1 Tahoma, sans-serif; }
.ms-cell[data-count="1"] { color: #0000ff; }
.ms-cell[data-count="2"] { color: #006800; }
.ms-cell[data-count="3"] { color: #c00000; }
.ms-cell[data-count="4"] { color: #000080; }
.ms-cell[data-count="5"] { color: #800000; }
.ms-cell[data-count="6"] { color: #006868; }
.ms-cell[data-count="7"] { color: #000; }
.ms-cell[data-count="8"] { color: #555; }
.ms-cell:focus-visible { position: relative; z-index: 1; outline-offset: -4px; }
.ms-flag-mode { margin-top: 9px; width: 100%; }
.ms-flag-mode[aria-pressed="true"] { box-shadow: var(--pressed); background: #dfdfdf; }
.ms-instructions { flex: 1 1 170px; min-width: 0; font-size: 12px; color: #333; }
.ms-instructions h3 { font: 600 21px/1.2 var(--pixel); margin: 0 0 10px; color: #000080; }
.ms-instructions p { margin: 0 0 10px; }
.ms-keyboard, .ms-tip { font-size: 11px; }
.ms-keyboard kbd { font: inherit; border: 1px solid #808080; padding: 0 3px; background: #dfdfdf; }
.ms-status {
  margin: 14px 0 0;
  padding-top: 10px;
  border-top: 1px solid #d4d4d4;
  color: #555;
  font-size: 11px;
}
@media (max-width: 600px) {
  .ms-layout { justify-content: center; gap: 14px; }
  .ms-instructions { flex-basis: 100%; }
  .ms-flag-mode { min-height: 36px; }
}
