:root {
  --bg: #1b1f27;
  --panel: #262b36;
  --accent: #4cc9f0;
  --accent-o: #f72585;
  --text: #eef1f6;
  --muted: #9aa4b2;
  --win: #2ecc71;
}

* {
  box-sizing: border-box;
}

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

.app {
  background: var(--panel);
  border-radius: 16px;
  padding: 32px;
  width: 100%;
  max-width: 360px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

h1 {
  margin: 0 0 16px;
  font-size: 1.75rem;
}

.mode-select {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-bottom: 16px;
  font-size: 0.95rem;
  color: var(--muted);
}

.mode-select label {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}

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

.board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 0 auto 20px;
  max-width: 300px;
}

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

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

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

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

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

.cell.winning {
  background: rgba(46, 204, 113, 0.18);
  border-color: var(--win);
}

.new-game {
  background: var(--accent);
  color: #08151a;
  border: none;
  border-radius: 8px;
  padding: 10px 20px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 20px;
}

.new-game:hover {
  filter: brightness(1.1);
}

.scoreboard {
  display: flex;
  justify-content: space-around;
  border-top: 1px solid #363c49;
  padding-top: 16px;
  font-size: 0.95rem;
  color: var(--muted);
}

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

.score-label {
  font-weight: 600;
  color: var(--text);
}
