/* The board. Its default is the garden board (the owner's own idea, 27 Nov 2026): plain cream light
   squares, and dark squares of a soft garden green with a very faint grass of a few blades and dots,
   quiet enough that every man stays clear on it; small boards have the plain green, without grass; at
   night the green is a little deeper and the cream a touch dimmer. Ivory and slate, approved earlier
   (prototypes/living-pieces, 24 Nov 2026), stays a choice under Board. The rest, as the owner approved it:
   ivory and slate-blue squares with the coordinates inside, rounded corners, highlights for
   the last move and the selection, dots and rings for legal moves, a red glow on a shah in
   check, a white frame on the target square while dragging, a faint ghost on the start
   square, and a soft shadow under every man. "Plain" is the one-colour historical board. */

:root {
  --sq-l: #ece7da; --sq-d: #86a96f; --sq-plain: #e5d1aa; --grid: rgba(60, 45, 30, .35);
  --hl: rgba(255, 214, 90, .52); --board-mark: #f0b429; --dot: rgba(24, 34, 32, .26); --check: 214, 38, 38;
}

.cb { position: relative; width: 100%; aspect-ratio: 1; border-radius: 10px; container-type: inline-size; touch-action: pan-y pinch-zoom; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; box-shadow: 0 10px 30px rgba(0, 0, 0, .35); outline: none; }
.cb:focus-visible { box-shadow: 0 0 0 3px var(--board-mark), 0 10px 30px rgba(0, 0, 0, .35); }
.cb .sq, .cb .mk, .cb .hover, .cb .ghost, .cb .pc { position: absolute; width: 12.5%; height: 12.5%; }
.cb .sq.l { background: var(--sq-l); } .cb .sq.d { background: var(--sq-d); }
/* the colourings: the garden board (above) by default; ivory and slate, and the others, by choice */
[data-board="slate"] { --sq-l: #ece7da; --sq-d: #8ba2ae; }
:root:not([data-theme="light"])[data-board="garden"] { --sq-l: #e2dccd; --sq-d: #779a63; }
/* the grass: real tufts on each green square (js/board.js GRASS), so that a man landing can bend them; the same
   blades, dots and strength as before; not on tiny boards */
.cb .sq .grass { display: none; position: absolute; inset: 0; width: 100%; height: 100%; overflow: hidden; pointer-events: none; }
[data-board="garden"] .cb:not(.tiny) .sq.d .grass { display: block; }
.cb .grass .gt { fill: none; stroke: #3f6635; stroke-width: 1.5; stroke-linecap: round; opacity: .78; vector-effect: non-scaling-stroke; transform-box: fill-box; transform-origin: 50% 100%; }
.cb .grass .gt path { vector-effect: non-scaling-stroke; }
.cb .grass .gd { fill: #b4d49c; opacity: .7; }
.cb .grass .gt.new { opacity: 0; } .cb .grass .gt.new.grown { opacity: .78; }
/* a man landing on a light square of the garden board: a faint soft shadow pulses under his foot */
.cb .sq .foot { position: absolute; left: 20%; right: 20%; bottom: 6%; height: 16%; border-radius: 50%; pointer-events: none; opacity: 0;
  background: radial-gradient(closest-side, rgba(70, 55, 30, .28), rgba(70, 55, 30, 0)); }
:root:not([data-theme="light"]) .cb .sq .foot { background: radial-gradient(closest-side, rgba(225, 245, 210, .45), rgba(225, 245, 210, 0)); }
@media (prefers-reduced-motion: reduce) { .cb .sq .foot { display: none; } }
/* a right move's mark is green: on green squares it also gets a ring, so that it is seen */
[data-board="garden"] .cb .mk.good { background: rgba(120, 225, 150, .5); box-shadow: inset 0 0 0 3px rgba(18, 104, 56, .8); }
[data-board="rose"] { --sq-l: #f3ebe6; --sq-d: #c9a2a8; }
[data-board="plain"] .cb .sq { background: var(--sq-plain); box-shadow: inset 0 0 0 .5px var(--grid); }
/* the square names on the board's edge (a-h, 1-8): dark ink of each board's own hue, at least 4.5:1 against the
   square each stands on, on every board and at night too (the site check of 29 Nov 2026: they were the other
   square's colour, about 2.4:1, and small); a little larger and bolder, still tucked in the corner clear of the men */
:root { --co-l: #3b5a2c; --co-d: #16280f; }
:root:not([data-theme="light"])[data-board="garden"] { --co-d: #122009; }
[data-board="slate"] { --co-l: #3a5260; --co-d: #13232c; }
[data-board="rose"] { --co-l: #7a3f4a; --co-d: #3a1820; }
[data-board="plain"] { --co-l: #4f3b22; --co-d: #4f3b22; }
.cb .co { position: absolute; font: 800 clamp(10px, 2.15cqi, 14px)/1 var(--font); pointer-events: none; }
.cb .co.rank { left: 4%; top: 4%; } .cb .co.file { right: 5%; bottom: 3%; }
.cb .sq.l .co { color: var(--co-l); } .cb .sq.d .co { color: var(--co-d); }
.cb .c-tl { border-top-left-radius: 10px; } .cb .c-tr { border-top-right-radius: 10px; } .cb .c-bl { border-bottom-left-radius: 10px; } .cb .c-br { border-bottom-right-radius: 10px; }

/* highlights */
.cb .mk { pointer-events: none; }
/* the two players' board turning (js/board.js turnTo): the marks' layer covers the board, so it turns round its centre */
.cb.turning .mks { position: absolute; inset: 0; pointer-events: none; }
/* while it turns, a man going round past the board's side is clipped there, so a phone's page never grows wider */
.cb.turning { overflow-x: clip; overflow-clip-margin: 6px; }
.cb .mk.last, .cb .mk.sel { background: var(--hl); }
.cb .mk.dot::after { content: ""; position: absolute; left: 36%; top: 36%; width: 28%; height: 28%; border-radius: 50%; background: var(--dot); }
.cb .mk.cap { background: radial-gradient(transparent 0 61%, var(--dot) 62% 100%); }
/* a move set in advance (a premove), and the squares a raised man could be sent to in advance */
.cb .mk.pre { background: rgba(92, 132, 214, .58); }
.cb .mk.dot.ahead::after { background: rgba(60, 96, 180, .34); }
.cb .mk.cap.ahead { background: radial-gradient(transparent 0 61%, rgba(60, 96, 180, .34) 62% 100%); }
.cb .mk.check { background: radial-gradient(circle, rgba(var(--check), .85) 0%, rgba(var(--check), .4) 45%, transparent 72%); }
.cb .mk.good { background: rgba(72, 190, 120, .5); }
.cb .mk.bad { background: rgba(224, 80, 60, .55); }
.cb .mk.diff { box-shadow: inset 0 0 0 4px rgba(224, 70, 50, .95); }
.cb .mk.hint::after { content: ""; position: absolute; inset: 7%; border-radius: 50%; box-shadow: 0 0 0 4px var(--board-mark); animation: hint-pulse 1.2s ease-in-out infinite; }
@keyframes hint-pulse { 50% { box-shadow: 0 0 0 8px color-mix(in srgb, var(--board-mark) 45%, transparent); } }
/* the keyboard's frame on a square: a dark line inside an amber one, so it is clear on light and dark squares alike */
.cb .mk.kcur { box-shadow: inset 0 0 0 2px rgba(20, 22, 26, .9), inset 0 0 0 5px var(--board-mark); }
.cb .hover { pointer-events: none; box-shadow: inset 0 0 0 4px rgba(255, 255, 255, .75); display: none; z-index: 1; }
.cb .ghost { pointer-events: none; opacity: .3; display: none; z-index: 1; transform-origin: 50% 97%; -webkit-user-drag: none; user-select: none; }

/* the men: the owner's pictures, with a shadow under each and the eyes as separate dots */
.cb .pcs { position: absolute; inset: 0; pointer-events: none; }
.cb .pc { z-index: 2; will-change: transform; pointer-events: auto; }
/* A finger that lands on a man the visitor may move holds it (a drag); anywhere else on the board a swipe scrolls the
   page as it does off the board (the site check, 29 Nov 2026: the board stopped every swipe), and a tap still plays. */
.cb.mine .pc.own { touch-action: none; }
.cb .pc.up { z-index: 8; }
.cb.mine .pc.own { cursor: grab; }
.cb.grabbing, .cb.grabbing .pc { cursor: grabbing; }
.cb .pc .body { position: absolute; inset: 0; transform-origin: 50% 97%; will-change: transform; }
.cb .pc .shadow { position: absolute; left: 21%; right: 21%; bottom: .5%; height: 12%; border-radius: 50%; background: radial-gradient(closest-side, rgba(12, 18, 24, .42), rgba(12, 18, 24, 0)); pointer-events: none; }
.cb .pc img { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; -webkit-user-drag: none; user-select: none; }
.cb .pc .pc-fig { position: absolute; pointer-events: none; }
.cb .pc .eye { position: absolute; border-radius: 50%; pointer-events: none; }
.cb .pc.new .body img, .cb .pc.new .eye { animation: man-in .2s ease-out; }
@keyframes man-in { from { opacity: 0; } }

/* circles and arrows drawn with the right mouse button; the arrows take the shape of the man's move */
.cb svg.ann { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 9; overflow: visible; }
.cb .an { opacity: .8; }
.cb circle.an { fill: none; stroke-width: 9; }
.an-gold { stroke: #f0b429; fill: #f0b429; } .an-red { stroke: #e2412b; fill: #e2412b; }
.an-green { stroke: #35b98a; fill: #35b98a; } .an-blue { stroke: #3f8de8; fill: #3f8de8; }
.an-hint { stroke: #f0b429; fill: #f0b429; opacity: .7; }
/* small still boards */
svg.mini { display: block; width: 100%; height: auto; overflow: visible; }
svg.mini rect.l { fill: var(--sq-l); } svg.mini rect.d { fill: var(--sq-d); }
svg.mini rect.last { fill: color-mix(in srgb, var(--sq-l) 45%, #f2cf5a); }
svg.mini rect.d.last { fill: color-mix(in srgb, var(--sq-d) 45%, #f2cf5a); }
svg.mini rect.mk-diff { fill: none; stroke: #e2412b; stroke-width: 10; }
svg.mini rect.mk-good { fill: rgba(72, 190, 120, .5); } svg.mini rect.mk-bad { fill: rgba(224, 80, 60, .55); }
[data-board="plain"] svg.mini rect.l, [data-board="plain"] svg.mini rect.d { fill: var(--sq-plain); stroke: var(--grid); stroke-width: 2; }

/* the bars above and below the board: who plays, the men they have taken, and their lead */
.strip { display: flex; align-items: center; gap: 12px; min-height: 54px; padding: 2px; }
/* the faces beside the board: big enough to know who it is (the owner, 26 Nov 2026) */
.strip .av { width: 50px; height: 50px; border-radius: 10px; overflow: hidden; flex: none; background: var(--panel-3); display: grid; place-items: center; }
.strip .av.red { background: #f1e4c8; } .strip .av.black { background: #c9b48f; }
.strip .av .man { width: 84%; height: 84%; }
.strip .who { display: grid; line-height: 1.15; min-width: 0; }
.strip .who b { font-weight: var(--w-title); font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* a bot's name: "· bot" (and his title) always in sight; a long name gives way first, with its "…" (the owner's rule: every bot is labelled) */
.strip .who b:has(> .who-n) { display: flex; align-items: baseline; min-width: 0; }
.strip .who-n { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.strip .who b > .lad-bot { flex: none; white-space: pre; }
.strip .who b:has(> .who-n) > .tbadge { flex: none; margin-left: .3em; align-self: center; }
.strip .who small { font-weight: var(--w-meta); font-size: 12.5px; color: var(--text-3); }
.strip .thinking { color: var(--sec, var(--text-2)); font-size: 12.5px; font-weight: var(--w-label); opacity: 0; transition: opacity .2s; white-space: nowrap; }
.strip .thinking.on { opacity: 1; }
.strip .caps { display: flex; align-items: center; margin-left: auto; min-height: 24px; }
.strip .caps .man { width: 22px; height: 22px; margin-left: -6px; flex: none; }
.strip .caps .man.black { filter: drop-shadow(0 0 1px rgba(255, 255, 255, .85)); }   /* a taken black man stays visible on the dark page */
:root[data-theme="light"] .strip .caps .man.black { filter: none; }
.strip .caps .adv { color: var(--text-3); font-weight: var(--w-label); font-size: 13px; margin-left: 8px; }

/* a painted frame around the board, if one is ever put in its art slot (site/art/board/frame.png) */
.art-board-frame .board-box { padding: 6.5%; background: var(--board-frame) center / 100% 100% no-repeat; }
