/* ═══════════════ Gamex / Checkers ═══════════════
   The board is an 8×8 grid of squares; only the dark ones are buttons. It is
   drawn from the human's side (flipped when they play white), so their men
   always head up the screen. Kings carry a crown glyph, not just a colour. */
.ck-pick[hidden], .ck-play[hidden] { display: none; }
.ck-play { display: flex; flex-direction: column; gap: 12px; }
.ck-pick, .ck-play { max-width: var(--w-form); }
.ck-pick { display: flex; flex-direction: column; gap: 12px; }
.ck-variants { border: 0; margin: 0; padding: 0; display: grid; gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); }
.ck-variants legend { padding: 0; margin-bottom: 8px; }
.ck-variant { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; align-items: baseline;
  padding: 10px 12px; border: 1px solid var(--gold-dim); border-radius: 6px; cursor: pointer; }
.ck-variant:has(input:checked) { border-color: var(--gold); background: var(--circuit); }
.ck-variant input { accent-color: var(--gold); margin: 0; }
.ck-variant-name { font-family: var(--serif); color: var(--text); }
.ck-variant-sub { grid-column: 2; font-family: var(--sans); font-size: 0.72rem;
  letter-spacing: 0.06em; color: var(--text-dim); }
.ck-diff { font-family: var(--sans); font-size: 0.8rem; color: var(--text-dim); }
.ck-diff summary { cursor: pointer; color: var(--gold); }
.ck-diff table { margin-top: 8px; border-collapse: collapse; width: 100%; }
.ck-diff th, .ck-diff td { text-align: left; padding: 4px 8px; border-bottom: 1px solid var(--circuit); }
.ck-diff th { color: var(--text); }

.ck-board {
  display: grid;
  /* Rows sized explicitly too: an auto row with no piece in it collapses. */
  grid-template-columns: repeat(8, minmax(0, 1fr));
  grid-template-rows: repeat(8, minmax(0, 1fr));
  width: min(100%, 34rem);
  aspect-ratio: 1;
  border: 2px solid var(--gold-dim);
  border-radius: 4px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  user-select: none;
}
.ck-sq {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding: 0;
  border: 0;
  background: #3a2a10;
}
.ck-sq.is-light { background: #b89a62; }
button.ck-sq { cursor: default; }
button.ck-sq.is-pick,
button.ck-sq.is-target { cursor: pointer; }
.ck-sq.is-last { background: #5a4414; }
.ck-sq.is-sel  { background: #6e5412; box-shadow: inset 0 0 0 3px var(--gold-lt); }
.ck-sq:focus-visible { outline: 2px solid var(--gold-lt); outline-offset: -2px; z-index: 1; }

.ck-coord {
  position: absolute;
  font-family: var(--sans);
  font-size: 0.6rem;
  line-height: 1;
  color: rgba(232, 213, 160, 0.45);
  pointer-events: none;
}
.ck-coord.is-rank { top: 3px; left: 3px; }
.ck-coord.is-file { bottom: 3px; right: 4px; }
.ck-sq.is-light .ck-coord { color: rgba(26, 16, 5, 0.55); }

.ck-piece {
  width: 76%;
  aspect-ratio: 1;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(0.8rem, 3.2vw, 1.35rem);
  line-height: 1;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.ck-piece.is-black {
  background: radial-gradient(circle at 35% 30%, #4a4038, #16110c 70%);
  border: 2px solid #6b5a3a;
  color: var(--gold-lt);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.6);
}
.ck-piece.is-white {
  background: radial-gradient(circle at 35% 30%, #fffaf0, #d9ccb0 70%);
  border: 2px solid #a8946a;
  color: #7a5a10;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.45);
}
.ck-sq.is-pick .ck-piece { box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.55), 0 3px 6px rgba(0, 0, 0, 0.6); }
.ck-sq.is-pick:hover .ck-piece { transform: translateY(-2px); }
.ck-sq.is-sel .ck-piece { transform: scale(1.06); }
/* A square the selected piece can go to next. */
.ck-sq.is-target::after {
  content: "";
  width: 30%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(255, 215, 0, 0.55);
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}
.ck-sq.is-target:hover::after { background: var(--gold-lt); }
/* Where the last move's jumped pieces stood. */
.ck-sq.is-taken::after {
  content: "×";
  font-family: var(--sans);
  font-size: 1.2rem;
  color: rgba(255, 120, 100, 0.8);
}

@media (prefers-reduced-motion: reduce) {
  .ck-piece { transition: none; }
}
