:root {
  --cell-size: 100px;
  --gap: 8px;
  --x-color: #2563eb;
  --o-color: #dc2626;
  --bg: #f8fafc;
  --board-bg: #1e293b;
  --cell-bg: #ffffff;
  --text: #0f172a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--text);
}

.app {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 24px;
}

h1 {
  margin: 0;
  font-size: 2rem;
}

.mode-select {
  display: flex;
  gap: 16px;
  font-size: 0.95rem;
}

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

.board {
  display: grid;
  grid-template-columns: repeat(3, var(--cell-size));
  grid-template-rows: repeat(3, var(--cell-size));
  gap: var(--gap);
  background: var(--board-bg);
  padding: var(--gap);
  border-radius: 12px;
}

.cell {
  width: var(--cell-size);
  height: var(--cell-size);
  background: var(--cell-bg);
  border: none;
  border-radius: 8px;
  font-size: 2.5rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease;
}

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

.cell:disabled {
  cursor: default;
}

.cell.x {
  color: var(--x-color);
}

.cell.o {
  color: var(--o-color);
}

.cell.winning {
  background: #fde68a;
}

.reset-btn {
  padding: 10px 20px;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  background: var(--board-bg);
  color: white;
  cursor: pointer;
}

.reset-btn:hover {
  opacity: 0.9;
}

@media (max-width: 420px) {
  :root {
    --cell-size: 80px;
  }
  h1 {
    font-size: 1.5rem;
  }
}
