:root {
  --bg: #ffffff;
  --bg-alt: #f0f7ff;
  --card: #ffffff;
  --border: #e1e8f0;
  --accent: #2563eb;
  --accent-dark: #1e4fc4;
  --accent-light: #eaf1ff;
  --cyan: #06b6d4;
  --cyan-dark: #0891b2;
  --cyan-light: #e0fbff;
  --text: #0f172a;
  --muted: #64748b;
  --success: #16a34a;
  --success-light: #e7f9ee;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-alt);
  font-family: "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--text);
  padding: 20px;
}

.card {
  background: var(--card);
  border-radius: 20px;
  padding: 36px 32px;
  width: 100%;
  max-width: 420px;
  text-align: center;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.08);
  border: 1px solid var(--border);
}

h1 {
  font-size: 1.6rem;
  letter-spacing: 1px;
  margin-bottom: 16px;
  background: linear-gradient(120deg, var(--accent), var(--cyan));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.mode-select {
  margin-bottom: 16px;
}

.switch-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--muted);
  cursor: pointer;
}

.switch-label input {
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
}

.status {
  margin-bottom: 20px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--muted);
  min-height: 1.4em;
}

.board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 24px;
}

.cell {
  aspect-ratio: 1 / 1;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}

.cell:hover:not(:disabled) {
  background: var(--accent-light);
}

.cell:disabled {
  cursor: not-allowed;
}

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

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

.cell.win {
  background: var(--success-light);
  border-color: var(--success);
}

.scoreboard {
  display: flex;
  justify-content: space-between;
  margin-bottom: 20px;
}

.score {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.score span {
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.score strong {
  font-size: 1.4rem;
  color: var(--text);
}

.btn-restart {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 12px;
  background: var(--accent);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.25);
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.btn-restart:hover {
  background: var(--accent-dark);
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.3);
}
