/* Gomoku — a wooden goban on the jade cloth. The board itself is drawn in canvas (game.js). */
.gk-col { gap: 6px; padding: 6px; }
.gk-wrap { direction: ltr; }
.gk-board {
  max-width: 820px;
  max-height: 820px;
  border-radius: 9px;
  box-shadow: 0 0 0 1px rgba(11, 31, 28, 0.7), 0 3px 0 1px #6B4423, 0 18px 36px rgba(0, 0, 0, 0.42);
  cursor: pointer;
  outline-offset: 5px;
}

/* Where the browser can measure the stage in CSS, the board's box is exactly the square that fits, so the status
   line sits right on top of the board instead of at the top of the stage. Elsewhere the board is simply centred. */
@supports (width: 1cqw) {
  .gk-col { container-type: size; }
  .gk-col .gk-wrap { flex: none; width: min(100cqw, 100cqh - 38px, 820px); aspect-ratio: 1; }
}

/* whose turn: a little stone beside the status line */
.gk-status { min-height: 32px; }
.gk-dot { width: 16px; height: 16px; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.45); }
.gk-dot[hidden] { display: none; }
.gk-dot[data-p="1"] { background: radial-gradient(circle at 34% 30%, #7C8B87, #1A2422 62%, #0A1211); }
.gk-dot[data-p="2"] { background: radial-gradient(circle at 34% 30%, #FFFFFF, #F1EAD6 55%, #C8BB97); }

/* dock: Place is the main action on a phone, so it is wider and lights up when a stone is aimed */
.fa-dock .kit-dock-btn[hidden] { display: none; }
.gk-place { min-width: 104px; }
html[data-world] .kit-dock-btn.gk-place.is-ready { background: var(--gold); color: var(--lapis); box-shadow: 0 0 0 4px rgba(234, 217, 168, 0.16); }

/* new-game and start panels */
.gk-setup { display: grid; gap: 14px; }
.gk-setup .fa-howto { margin: 0; }
.gk-setup .fa-seg { display: flex; }
.gk-setup .fa-seg button { flex: 1 1 0; min-width: 0; min-height: 42px; padding: 0 6px; line-height: 1.15; }
.gk-opt[hidden] { display: none; }
.gk-label { display: block; margin-bottom: 6px; font-size: 12px; font-weight: 650; letter-spacing: 0.1em; text-transform: uppercase; color: var(--mist); }
html[lang="ar"] .gk-label { letter-spacing: 0; text-transform: none; font-size: 13px; }

@media (max-width: 360px) {
  .gk-col { padding: 4px 6px; }
  .gk-wins { display: none; }
}

/* A phone on its side: the dock moves beside the board so the board keeps its height. */
@media (orientation: landscape) and (max-height: 520px) {
  body[data-game="gomoku"] { --bar-h: 44px; }
  body[data-game="gomoku"] .fa-app { display: grid; grid-template: "bar bar" auto "stage dock" minmax(0, 1fr) / minmax(0, 1fr) auto; }
  body[data-game="gomoku"] .fa-bar { grid-area: bar; }
  body[data-game="gomoku"] .fa-stage { grid-area: stage; }
  body[data-game="gomoku"] .fa-dock { grid-area: dock; flex-direction: column; gap: 6px; padding: 4px 10px 8px 4px; }
  .gk-place { min-width: 64px; }
  .gk-col { flex-direction: row; padding: 4px 8px 8px; gap: 8px; }
  .gk-col .gk-status { flex: 0 0 22%; flex-direction: column; padding: 0; }
  .gk-col .gk-wrap { flex: 1 1 0; width: auto; min-width: 0; aspect-ratio: auto; align-self: stretch; }
}
