/* Gomoku board. One grid unit (--u) is set by app.js to fit the screen. */
.game { display: flex; flex-direction: column; align-items: center; }
.game h1 { text-align: center; }
.controls { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; align-items: center; margin: 4px 0 14px; }
.controls label { color: var(--muted); font-size: 14px; display: flex; align-items: center; gap: 6px; }
#status { min-height: 22px; margin: 0 0 12px; color: var(--accent); font-weight: 600; text-align: center; }

#boardWrap {
  --u: 30px;
  background: #dcb36a;
  padding: calc(var(--u) * 0.7);
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  touch-action: manipulation;
}
#board { position: relative; width: calc(var(--u) * 14); height: calc(var(--u) * 14); }
.grid { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.grid line { stroke: #5a3d1c; stroke-width: 1px; }
.grid .star { fill: #5a3d1c; }

.cell {
  position: absolute; width: var(--u); height: var(--u);
  transform: translate(-50%, -50%);
  background: none; border: 0; padding: 0; margin: 0; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  -webkit-tap-highlight-color: transparent;
}
.cell:focus-visible { outline: 2px solid var(--accent); outline-offset: -3px; border-radius: 50%; }
.cell::before {
  content: ""; width: 88%; height: 88%; border-radius: 50%;
  transform: scale(0); transition: transform 0.12s ease-out;
}
.cell.black::before, .cell.white::before { transform: scale(1); }
.cell.black::before { background: radial-gradient(circle at 35% 30%, #555 0, #111 55%, #000 100%); box-shadow: 1px 2px 3px rgba(0, 0, 0, 0.45); }
.cell.white::before { background: radial-gradient(circle at 35% 30%, #fff 0, #eee 55%, #cfcfcf 100%); box-shadow: 1px 2px 3px rgba(0, 0, 0, 0.35); }
.cell:not(.black):not(.white):hover::before { transform: scale(0.5); background: rgba(0, 0, 0, 0.25); }
@media (hover: none) { .cell:not(.black):not(.white):hover::before { transform: scale(0); } }

/* the last stone played gets a small dot; the winning five glow */
.cell.last::after { content: ""; position: absolute; width: 22%; height: 22%; border-radius: 50%; background: #e5534b; }
.cell.win::before { box-shadow: 0 0 0 3px var(--accent), 1px 2px 3px rgba(0, 0, 0, 0.45); }

#count { margin-top: 12px; font-size: 13px; color: var(--muted); min-height: 18px; }
.how { max-width: 560px; margin-top: 18px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.how summary { cursor: pointer; color: var(--ink); font-weight: 600; }
