/* Gomoku (five in a row) — plateau family (design/Jeu - Gomoku). A wooden goban on
   the warm leather surface (the same band the arcade games use, in leather brown),
   the same in light and dark. Stones sit on the intersections; a side panel keeps
   the game state and the recent moves. Scoped under .gmk-root. */

.gmk-root { display: flex; flex-direction: column; align-items: stretch; inline-size: 100%; color: var(--color-text); --gmk-cell: 30px; }

.gmk-surface {
  inline-size: 100%; box-sizing: border-box;
  background: #43302b; border-block: 1px solid #2c1f1b;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07);
  padding: var(--space-6) 0; color: #f4ece5;
}
.gmk-inner { max-inline-size: 1040px; margin-inline: auto; padding-inline: var(--space-4); box-sizing: border-box; display: flex; flex-wrap: wrap; gap: var(--space-6); align-items: center; justify-content: center; }

/* The goban: a lit board of warm wood, sitting on the leather. */
.gmk-goban {
  flex: none; padding: 26px; border-radius: 4px; box-sizing: border-box;
  background: linear-gradient(168deg, #e2b878 0%, #d3a765 40%, #c2924f 78%, #b8873f 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), inset 0 0 0 1px rgba(90, 60, 25, 0.5), inset 0 -3px 0 rgba(90, 60, 25, 0.45), 0 22px 44px rgba(0, 0, 0, 0.40);
}
.gmk-board { display: grid; gap: 0; }

/* Each cell draws the two grid lines crossing at its centre; the outer halves of
   the border cells are suppressed so the grid stops at the edge. */
.gmk-cell { position: relative; inline-size: var(--gmk-cell); block-size: var(--gmk-cell); display: grid; place-items: center; }
.gmk-cell::before, .gmk-cell::after { content: ""; position: absolute; background: rgba(60, 42, 18, 0.6); }
.gmk-cell::before { inline-size: 1px; inset-block: 0; inset-inline-start: 50%; }
.gmk-cell::after { block-size: 1px; inset-inline: 0; inset-block-start: 50%; }
.gmk-cell.edge-top::before { inset-block-start: 50%; }
.gmk-cell.edge-bottom::before { inset-block-end: 50%; }
.gmk-cell.edge-left::after { inset-inline-start: 50%; }
.gmk-cell.edge-right::after { inset-inline-end: 50%; }
.gmk-cell.hoshi { background-image: radial-gradient(circle at 50% 50%, rgba(60, 42, 18, 0.8) 0 3px, transparent 3px); }

.gmk-cell.playable { cursor: pointer; }
.gmk-cell.playable:hover::after, .gmk-cell.playable:hover::before { background: var(--color-accent-600); }
.gmk-board.locked .gmk-cell { cursor: default; }
.gmk-cell.hint { box-shadow: inset 0 0 0 2px var(--color-accent-400); border-radius: 50%; }

.gmk-stone { position: relative; z-index: 1; inline-size: calc(var(--gmk-cell) * 0.86); block-size: calc(var(--gmk-cell) * 0.86); border-radius: 50%; }
.gmk-stone.black { background: radial-gradient(circle at 34% 28%, #55504733, #24211c 42%, #100e0b 100%); background-color: #17140f; box-shadow: 0 2px 3px rgba(0, 0, 0, 0.5), inset 0 2px 2px rgba(255, 255, 255, 0.12); }
.gmk-stone.white { background: radial-gradient(circle at 34% 28%, #ffffff, #f2ecdd 46%, #d3c9b4 100%); box-shadow: 0 2px 3px rgba(0, 0, 0, 0.4), inset 0 2px 2px rgba(255, 255, 255, 0.7); }
.gmk-stone.last::after { content: ""; position: absolute; inset: 38%; border-radius: 50%; background: rgba(255, 244, 224, 0.9); }
.gmk-stone.black.last::after { background: rgba(255, 244, 224, 0.85); }
.gmk-stone.win { box-shadow: 0 0 0 2px var(--color-accent-400), 0 2px 3px rgba(0, 0, 0, 0.5); }

@media (prefers-reduced-motion: no-preference) { .gmk-stone { animation: gmk-place 0.16s ease-out; } }
.gmk-root.no-motion .gmk-stone { animation: none; }
@keyframes gmk-place { from { transform: scale(0.4); opacity: 0.3; } to { transform: none; opacity: 1; } }

/* Side panel: game state + recent moves. */
.gmk-side { flex: 0 1 230px; display: flex; flex-direction: column; gap: var(--space-4); color: #f4ece5; }
.gmk-turn { border: 1px solid var(--color-accent-400); border-radius: var(--radius-md); padding: var(--space-3); background: rgba(233, 196, 132, 0.10); font-size: 15px; color: #f4ece5; min-block-size: 1.4em; }
.gmk-turn.over { font-family: var(--font-heading); font-weight: 600; color: var(--color-accent-300); }
.gmk-side-k { font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: rgba(244, 236, 229, 0.78); padding-block-end: 8px; }
.gmk-log-row { display: grid; grid-template-columns: 26px 16px 1fr; gap: 8px; align-items: center; font-size: 12.5px; font-variant-numeric: tabular-nums; padding-block: 3px; color: rgba(244, 236, 229, 0.9); }
.gmk-log-n { color: rgba(244, 236, 229, 0.55); }
.gmk-pastille { inline-size: 12px; block-size: 12px; border-radius: 50%; }
.gmk-pastille.black { background: #17140f; box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.12); }
.gmk-pastille.white { background: #f2ecdd; box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.6); }

.gmk-hint { text-align: center; font-size: 12px; color: var(--color-neutral-600); max-inline-size: 560px; margin-inline: auto; padding-block-start: var(--space-3); }
.lz-variants.gmk-inline-chips { margin: 0; }
