:root {
  --bg: #1a1c2b;
  --panel: #23263a;
  --text: #eef0fb;
  --muted: #9aa0c3;
  --accent-x: #6ee7b7;
  --accent-o: #f0abfc;
  --line: #3a3f5c;
  --win: #ffd166;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at top, #262a42 0%, #14151f 70%);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--text);
}

.app {
  width: min(420px, 92vw);
  background: var(--panel);
  border-radius: 20px;
  padding: 28px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  text-align: center;
}

h1 {
  margin: 0 0 18px;
  font-size: 1.8rem;
  letter-spacing: 0.02em;
}

.mode-select {
  display: flex;
  gap: 8px;
  background: #181a29;
  padding: 4px;
  border-radius: 12px;
  margin-bottom: 16px;
}

.mode-btn {
  flex: 1;
  padding: 8px 10px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.mode-btn.active {
  background: var(--line);
  color: var(--text);
}

.status {
  min-height: 1.4em;
  margin-bottom: 16px;
  font-size: 1.05rem;
  color: var(--muted);
}

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

.cell {
  aspect-ratio: 1 / 1;
  background: #1e2033;
  border: 2px solid var(--line);
  border-radius: 14px;
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, transform 0.1s, border-color 0.15s;
}

.cell:hover:not(:disabled) {
  background: #262940;
  border-color: #4a5079;
}

.cell:active:not(:disabled) {
  transform: scale(0.96);
}

.cell:disabled {
  cursor: default;
}

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

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

.cell.win {
  border-color: var(--win);
  background: rgba(255, 209, 102, 0.12);
}

.controls {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.controls button {
  flex: 1;
  padding: 10px;
  border: none;
  border-radius: 10px;
  background: var(--line);
  color: var(--text);
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.2s;
}

.controls button:hover {
  background: #4a5079;
}

.scoreboard {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

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

.score-label {
  font-size: 0.8rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.score-value {
  font-size: 1.4rem;
  font-weight: 700;
}
