.mx-public-sudoku {
  color: #293d35;
  font-family: system-ui, sans-serif;
  width: 100%;
  max-width: 27rem;
  margin: 0 auto;
}
.mx-sudoku__title { margin: 0 0 .4rem; color: #293d35; font-size: 1.4rem; }
.mx-sudoku__status, .mx-sudoku__message { min-height: 1.5rem; margin: .3rem 0 .6rem; color: #53635a; font-size: 1rem; }
.mx-sudoku__grid {
  box-sizing: border-box;
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  border: 2px solid #293d35;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  aspect-ratio: 1;
  touch-action: manipulation;
}
.mx-sudoku__cell {
  display: grid;
  place-items: center;
  min-width: 0;
  padding: 0;
  border: 0;
  border-right: 1px solid #d6d1c5;
  border-bottom: 1px solid #d6d1c5;
  background: #fffdf7;
  color: #293d35;
  font: inherit;
  font-size: clamp(1rem, 5vw, 1.55rem);
  cursor: pointer;
}
.mx-sudoku__cell:nth-child(3n) { border-right: 3px solid #293d35; }
.mx-sudoku__cell:nth-child(9n) { border-right: 0; }
.mx-sudoku__cell:nth-child(n+19):nth-child(-n+27),
.mx-sudoku__cell:nth-child(n+46):nth-child(-n+54) { border-bottom: 3px solid #293d35; }
.mx-sudoku__cell.is-given { color: #293d35; font-weight: 750; background: #f0eee4; }
.mx-sudoku__cell.is-error { color: #7b3029; background: #f8e5de; box-shadow: inset 0 0 0 1px #a45343; }
.mx-sudoku__cell.is-related { background: #edf0df; }
.mx-sudoku__cell.is-same { background: #e1efbe; }
.mx-sudoku__cell.is-selected { outline: 3px solid #293d35; outline-offset: -3px; background: #e8f0d3; box-shadow: inset 0 0 0 2px #c7e582; z-index: 1; }
.mx-sudoku__cell:focus-visible, .mx-sudoku__digit:focus-visible, .mx-sudoku__action:focus-visible { outline: 3px solid #8eb641; outline-offset: 1px; z-index: 2; }
.mx-sudoku__cell:disabled { opacity: 1; cursor: default; }
.mx-sudoku__notes { color: #536b49; font-size: clamp(.45rem, 2vw, .7rem); line-height: 1; }
.mx-sudoku__keypad { display: grid; grid-template-columns: repeat(5, minmax(44px, 1fr)); gap: .2rem; max-width: 24rem; margin-inline: auto; padding: .5rem 0; }
.mx-sudoku__digit, .mx-sudoku__action {
  box-sizing: border-box;
  min-width: 44px;
  min-height: 44px;
  border: 1px solid #aeb9a8;
  border-radius: .6rem;
  background: #fcfbf7;
  color: #293d35;
  font: inherit;
  font-size: 1rem;
  cursor: pointer;
}
.mx-sudoku__actions { display: flex; flex-wrap: wrap; gap: .4rem; }
.mx-sudoku__action { padding: .45rem .7rem; }
.mx-sudoku__digit:disabled, .mx-sudoku__action:disabled { opacity: .55; cursor: default; }
@media (max-width: 22rem) {
  .mx-sudoku__keypad { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .mx-sudoku__actions { gap: .25rem; }
  .mx-sudoku__action { padding-inline: .45rem; }
}
@media (max-width: 15rem) {
  .mx-sudoku__keypad { grid-template-columns: repeat(3, minmax(44px, 1fr)); }
}
