:root {
  color-scheme: light dark;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI',
    sans-serif;
  background: radial-gradient(circle at top, #f5f7ff, #ebefff 40%, #d8dcff 100%);
  min-height: 100%;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 2rem;
  color: #1a2142;
}

.page {
  max-width: 960px;
  width: min(960px, 100%);
  display: grid;
  gap: 2rem;
}

.hero {
  text-align: center;
  display: grid;
  gap: 0.75rem;
}

.hero h1 {
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  margin: 0;
}

.tagline {
  margin: 0 auto;
  max-width: 520px;
  color: #48507f;
  font-size: 1.05rem;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: center;
}

.control {
  display: grid;
  gap: 0.25rem;
  font-weight: 600;
  color: #37417a;
}

select {
  border-radius: 0.75rem;
  border: 1px solid #c5cbff;
  padding: 0.5rem 0.75rem;
  font-size: 1rem;
  background: white;
  min-width: 120px;
}

.button {
  border: none;
  border-radius: 999px;
  padding: 0.65rem 1.5rem;
  background: #f1f3ff;
  color: #28306a;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 10px 25px rgba(63, 80, 179, 0.15);
}

.button:hover,
.button:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(63, 80, 179, 0.2);
}

.button:active {
  transform: translateY(0);
}

.button.primary {
  background: linear-gradient(135deg, #5b6bff, #3245ff);
  color: white;
}

.status {
  min-width: 180px;
  text-align: center;
  font-weight: 600;
  color: #3245ff;
}

.board {
  display: flex;
  justify-content: center;
}

.grid {
  display: grid;
  grid-template-columns: repeat(9, min(60px, 11vw));
  grid-template-rows: repeat(9, min(60px, 11vw));
  gap: 2px;
  background: #3245ff;
  border-radius: 1rem;
  padding: 6px;
  box-shadow: 0 25px 60px rgba(18, 30, 108, 0.22);
}

.cell {
  position: relative;
  background: white;
  border-radius: 0.75rem;
  overflow: hidden;
  display: flex;
  align-items: stretch;
}

.cell:nth-child(3n) {
  margin-right: 4px;
}

.cell:nth-child(9n) {
  margin-right: 0;
}

.cell input {
  border: none;
  width: 100%;
  height: 100%;
  text-align: center;
  font-size: clamp(1.6rem, 3vw, 2rem);
  font-weight: 600;
  color: #1a2142;
  background: transparent;
}

.cell input:disabled {
  color: #3e4a8d;
  background: rgba(90, 104, 255, 0.12);
  cursor: default;
}

.cell input:focus-visible {
  outline: 3px solid rgba(50, 69, 255, 0.45);
}

.cell.invalid input {
  background: rgba(238, 100, 121, 0.2);
  color: #b2172d;
}

.instructions {
  background: rgba(255, 255, 255, 0.75);
  border-radius: 1.5rem;
  padding: 1.5rem;
  box-shadow: 0 15px 40px rgba(22, 30, 98, 0.12);
}

.instructions h2 {
  margin-top: 0;
  font-size: 1.5rem;
}

.instructions ul {
  padding-left: 1.25rem;
  margin: 0;
  color: #4a5489;
  display: grid;
  gap: 0.5rem;
}

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

@media (max-width: 600px) {
  body {
    padding: 1.5rem;
  }

  .controls {
    justify-content: stretch;
  }

  .button,
  select {
    width: 100%;
  }
}
