.minesweeper-cell {
  min-width: 0;
  touch-action: manipulation;
  user-select: none;
}

[data-game] button:focus-visible {
  outline: 3px solid #2573a7;
  outline-offset: 2px;
}

[data-game] [role="gridcell"] {
  touch-action: manipulation;
  user-select: none;
}

.wordsearch-board {
  gap: 2px;
  padding: 4px;
}

.minesweeper-scroll {
  overscroll-behavior-x: contain;
}

.minesweeper-cell--hidden {
  background: #dce8e3;
}

.minesweeper-cell--hidden:hover,
.minesweeper-cell--hidden:focus-visible {
  background: #a9d8cf;
}

.minesweeper-cell--flagged {
  background: #f4bd4f;
  color: #183333;
}

.minesweeper-cell--mine {
  background: #e16043;
  color: #fff;
}

.minesweeper-number-1 { color: #2573a7; }
.minesweeper-number-2 { color: #2f7c55; }
.minesweeper-number-3 { color: #d9573d; }
.minesweeper-number-4 { color: #6747a5; }
.minesweeper-number-5 { color: #9a542e; }
.minesweeper-number-6 { color: #25777a; }
.minesweeper-number-7 { color: #183333; }
.minesweeper-number-8 { color: #697977; }

.maze-board {
  max-width: 760px;
}

.maze-board canvas {
  display: block;
  max-width: 100%;
  touch-action: none;
}

.nonogram-board {
  grid-template-columns: 50px repeat(10, minmax(24px, 1fr));
  min-width: 290px;
  width: 100%;
}

.nonogram-row-clue {
  padding-right: .4rem;
}

.hiddenword-board {
  display: grid;
  gap: .5rem;
  margin-inline: auto;
  max-width: 390px;
}

.hiddenword-shell {
  max-width: 460px;
}

.hiddenword-clue {
  background: rgba(244, 189, 79, .4);
}

.hiddenword-clue-label {
  color: #8a432f;
}

.progress-empty {
  border-color: rgba(24, 51, 51, .25);
  border-style: dashed;
}

@media (min-width: 40rem) {
  .progress-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 64rem) {
  .progress-history-grid {
    grid-template-columns: 1fr .8fr;
  }
}

.hiddenword-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: .5rem;
}

.hiddenword-cell {
  align-items: center;
  aspect-ratio: 1;
  background: #fffdf7;
  border: 2px solid #c9cfc9;
  border-radius: .75rem;
  color: #183333;
  display: flex;
  font-size: clamp(1.25rem, 5vw, 1.85rem);
  font-weight: 900;
  justify-content: center;
  line-height: 1;
  text-transform: uppercase;
}

.hiddenword-cell--filled {
  border-color: #183333;
  transform: translateY(-1px);
}

.hiddenword-cell--exact,
.hiddenword-key--exact {
  background: #e16043;
  border-color: #b6432e;
  color: #fff;
}

.hiddenword-cell--present,
.hiddenword-key--present {
  background: #f4bd4f;
  border-color: #c89327;
  color: #183333;
}

.hiddenword-cell--absent,
.hiddenword-key--absent {
  background: #d6dedb;
  border-color: #b8c3bf;
  color: #405552;
}

.hiddenword-keyboard {
  display: grid;
  gap: .4rem;
  margin-inline: auto;
  max-width: 600px;
}

.hiddenword-keyboard-row {
  display: flex;
  gap: .3rem;
  justify-content: center;
}

.hiddenword-key {
  align-items: center;
  background: #efe9dc;
  border: 0;
  border-radius: .55rem;
  color: #183333;
  display: flex;
  flex: 1 1 0;
  font-size: clamp(.7rem, 2.6vw, .9rem);
  font-weight: 900;
  justify-content: center;
  max-width: 48px;
  min-height: 46px;
  min-width: 0;
  padding: .25rem;
}

.hiddenword-key--wide {
  flex-basis: 72px;
  max-width: 78px;
}

@media (max-width: 420px) {
  .game-page-shell {
    padding-left: .5rem;
    padding-right: .5rem;
  }

  .nonogram-board button {
    font-size: .9rem;
  }

  .wordsearch-board {
    margin-left: -.5rem;
    width: calc(100% + 1rem);
  }

  .nonogram-column-clue,
  .nonogram-row-clue {
    font-size: .65rem;
  }

  .minesweeper-cell {
    font-size: .7rem;
  }

  .hiddenword-board,
  .hiddenword-row {
    gap: .35rem;
  }

  .hiddenword-cell {
    border-radius: .55rem;
  }

  .hiddenword-keyboard-row {
    gap: .18rem;
  }
}
