:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #17243b;
  background: #f5f7fb;
  font-synthesis: none;
}

* { box-sizing: border-box; }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  display: grid;
  place-items: center;
  padding: 32px 18px;
  background: radial-gradient(ellipse at 50% 5%, #e8f0ff 0, #f5f7fb 52%);
}

.game-shell { width: min(100%, 440px); text-align: center; }
.heading { margin-bottom: 25px; }
.eyebrow { margin: 0 0 9px; color: #526a91; font-size: .73rem; font-weight: 800; letter-spacing: .16em; }
h1 { margin: 0; font-size: clamp(2.15rem, 9vw, 3rem); letter-spacing: -.055em; }
.intro { margin: 9px 0 0; color: #69768c; font-size: .98rem; }

.game-card {
  padding: clamp(20px, 6vw, 30px);
  border: 1px solid #e4e9f2;
  border-radius: 22px;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 18px 55px rgba(27, 49, 86, .10);
}

.status { min-height: 28px; margin: 0 0 17px; color: #283b5d; font-weight: 750; }
.board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
  aspect-ratio: 1;
}

.cell {
  display: grid;
  place-items: center;
  min-width: 0;
  border: 1px solid #e4eaf3;
  border-radius: 14px;
  background: #f8faff;
  color: #315fd4;
  font: inherit;
  font-size: clamp(3rem, 17vw, 5.5rem);
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  transition: background .15s ease, transform .15s ease, border-color .15s ease;
}
.cell:hover:not(:disabled) { transform: translateY(-2px); border-color: #9eb6f5; background: #eef3ff; }
.cell[data-mark="O"] { color: #e27a45; }
.cell:disabled { cursor: default; }
.cell:focus-visible, .reset-button:focus-visible { outline: 3px solid #f5a642; outline-offset: 3px; }

.message { min-height: 21px; margin: 11px 0 2px; color: #b43a36; font-size: .88rem; }
.reset-button {
  min-height: 46px;
  margin-top: 12px;
  padding: 0 25px;
  border: 0;
  border-radius: 12px;
  background: #315fd4;
  color: white;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
  transition: background .15s ease, transform .15s ease;
}
.reset-button:hover { transform: translateY(-1px); background: #244eb8; }
footer { margin-top: 20px; color: #778398; font-size: .85rem; }

@media (max-width: 380px) {
  body { padding-inline: 12px; }
  .game-card { padding: 18px; border-radius: 18px; }
  .board { gap: 7px; }
  .cell { border-radius: 11px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
