* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family: system-ui, sans-serif;
  background: #f8fafc;
  color: #0f172a;
  text-align: center;
}

:focus-visible {
  outline: 2px solid #1d4ed8;
  outline-offset: 2px;
}

.hud {
  width: 100%;
  padding: 0.75rem;
  background: #0f172a;
  color: #f8fafc;
}

.hud h1 {
  margin: 0;
  font-size: 1.25rem;
}

.hud__score {
  margin: 0.25rem 0 0;
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
}

main {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(72px, 88px));
  grid-template-rows: repeat(3, minmax(72px, 88px));
  gap: 8px;
  padding: 8px;
  border-radius: 8px;
  background: #e2e8f0;
}

.cell {
  border: 0;
  border-radius: 6px;
  background: #fff;
  color: #0f172a;
  font: inherit;
  font-size: 2.25rem;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
}

.cell:hover:not(:disabled) {
  background: #f1f5f9;
}

.cell:disabled {
  cursor: default;
}

.cell.x {
  color: #1d4ed8;
}

.cell.o {
  color: #dc2626;
}

.cell.win {
  background: #fef08a;
}

.status {
  min-height: 1.5rem;
  margin: 0;
  font-weight: 600;
}

.button {
  padding: 0.5rem 1.25rem;
  border: 0;
  border-radius: 8px;
  background: #0f172a;
  color: #f8fafc;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
}

.button:hover {
  background: #1e293b;
}

.hint {
  margin: 0;
  color: #64748b;
  font-size: 0.875rem;
}
