/* -------------------------------------------------
   * Design Tokens – match the brand palette from the brief
   * ------------------------------------------------- */
:root {
  --color-primary: #9E7FFF;
  --color-secondary: #38bdf8;
  --color-accent: #f472b6;
  --color-bg: #171717;
  --color-surface: #262626;
  --color-text: #ffffff;
  --color-text-secondary: #a3a3a3;
  --color-border: #2f2f2f;
  --color-success: #10b981;
  --color-warning: #f59e0b;
  --color-error: #ef4444;
  --radius: 1rem;
}

/* Global resets and basics */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html, body {
  height: 100%;
  font-family: 'Inter', sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.5;
}
body {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Layout */
.container {
  max-width: 420px;
  width: 90%;
  text-align: center;
  padding: 2rem;
}
.title {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  color: var(--color-primary);
}

/* Status */
.status {
  margin: 1rem 0;
  font-size: 1.2rem;
}
.player {
  font-weight: 700;
}
.player.X { color: var(--color-primary); }
.player.O { color: var(--color-secondary); }

/* Board */
.board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin: 1rem 0;
}
.cell {
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  aspect-ratio: 1;
  font-size: 3rem;
  font-weight: 700;
  color: var(--color-text);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}
.cell:hover {
  background: var(--color-primary);
  color: var(--color-bg);
}
.cell:active {
  transform: scale(0.96);
}
/* Focus style for keyboard navigation */
.cell:focus {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
}

/* Winning highlight */
.cell.winning {
  background: var(--color-success);
  color: var(--color-bg);
}

/* Reset button */
.reset-btn {
  margin-top: 1rem;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  background: var(--color-accent);
  color: var(--color-bg);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.2s;
}
.reset-btn:hover {
  background: var(--color-primary);
}
/* Focus style for reset button */
.reset-btn:focus {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
}

/* Footer */
.footer {
  margin-top: 2rem;
  font-size: 0.8rem;
  color: var(--color-text-secondary);
}

/* Responsive tweaks */
@media (max-width: 480px) {
  .title { font-size: 2rem; }
  .cell { font-size: 2.5rem; }
}
