body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  font-family: system-ui, -apple-system, sans-serif;
}

main {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  padding: 20px;
  box-sizing: border-box;
}

.game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
}

@media (max-width: 450px) {
  .game-header {
    flex-direction: column;
    align-items: stretch;
  }
}

.game-header h1 {
  margin: 0;
  display: flex;
  align-items: center;
  font-size: 2.5rem;
}

#game-controls {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.settings {
  display: flex;
  gap: 15px;
  align-items: center;
}

.new-game-btn {
  width: 100%;
  padding: 8px;
  cursor: pointer;
  margin-top: 10px;
}

#puzzle {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  margin-top: 20px;
}

#puzzle th {
  padding: 0;
  font-size: 1.8rem;
  text-align: center;
  vertical-align: middle;
  box-sizing: border-box;
}

#puzzle input {
  width: 100%;
  aspect-ratio: 1 / 1;
  border: none;
  text-align: center;
  font-size: 1.8rem;
  font-family: inherit;
  background: transparent;
  box-sizing: border-box;
  padding: 0;
  margin: 0;
}

.cell-value {
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 1 / 1;
}

#puzzle input::-webkit-outer-spin-button,
#puzzle input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

#puzzle input[type=number] {
  -moz-appearance: textfield;
}

#spinner {
  width: 50px;
  height: 50px;

  display: block;
  margin: 40px auto;

  border: 5px solid #f3f3f3;
  border-top: 5px solid #3498db;
  border-radius: 50%;

  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}