:root {
  --bg: #f4f5f7;
  --cell: #ffffff;
  --text: #1f2933;
  --x: #2563eb;
  --o: #dc2626;
  --win: #bbf7d0;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

main { text-align: center; padding: 1rem; }

h1 { margin: 0 0 .5rem; }

#status { min-height: 1.5em; font-size: 1.2rem; margin: 0 0 1rem; }

#board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  width: min(90vw, 360px);
  margin: 0 auto 1rem;
}

.cell {
  aspect-ratio: 1;
  border: none;
  border-radius: 8px;
  background: var(--cell);
  font-size: clamp(2.5rem, 14vw, 4rem);
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
}

.cell:hover:not(:disabled) { background: #eef2ff; }
.cell:focus-visible, #restart:focus-visible { outline: 3px solid var(--x); outline-offset: 2px; }
.cell:disabled { cursor: default; }
.cell.X { color: var(--x); }
.cell.O { color: var(--o); }
.cell.win { background: var(--win); }

.scores { display: flex; justify-content: center; gap: 1.5rem; margin-bottom: 1rem; }

#restart {
  padding: .6rem 1.4rem;
  font-size: 1rem;
  border: none;
  border-radius: 8px;
  background: var(--text);
  color: #fff;
  cursor: pointer;
}
