/* ===========================================================
   Noughts & Crosses · vs CPU — game-specific styles only.
   Chrome, buttons, #status, .stat chips etc. come from shared.css.
   =========================================================== */

body { gap: 18px; }

/* ---------- scoreboard row ---------- */
#score {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

/* ---------- difficulty button group ---------- */
#difficulty {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}
.diff-btn {
  /* smaller than the default shared button */
  padding: 8px 18px;
  font-size: 0.9rem;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: 0 2px 8px var(--shadow);
}
.diff-btn:hover { opacity: 1; background: var(--surface-3); }
/* the currently-selected difficulty */
.diff-btn.active {
  background: var(--accent);
  color: var(--accent-text);
  border-color: transparent;
}

/* ---------- the board ---------- */
#board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  background: var(--surface);
  padding: 10px;
  border-radius: 14px;
  box-shadow: 0 10px 40px var(--shadow);
  /* responsive: shrink to fit narrow screens but never overflow */
  width: min(330px, 92vw);
}

/* ---------- individual cells ---------- */
.cell {
  /* square cells via aspect-ratio so they scale with the grid */
  aspect-ratio: 1 / 1;
  width: 100%;
  background: var(--cell-blue);
  border: none;
  border-radius: 10px;
  /* font scales with viewport on small screens */
  font-size: clamp(2.2rem, 12vw, 3.2rem);
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, transform 0.1s;
  line-height: 1;
  color: var(--text);
}
.cell:hover:not(.taken) { background: var(--cell-blue-hover); }
.cell:active:not(.taken) { transform: scale(0.95); }
.cell.x { color: var(--red); }
.cell.o { color: var(--green); }
.cell.taken { cursor: default; }

/* winning line highlight */
.cell.win { background: var(--accent); color: var(--accent-text); }

/* keyboard focus ring for accessibility */
.cell:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* board is dimmed + non-interactive while the CPU "thinks" */
#board.locked { pointer-events: none; }

/* simple pop-in animation when a mark is placed */
@keyframes pop {
  from { transform: scale(0.4); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}
.cell.placed { animation: pop 0.18s ease-out; }
