/* Chess — squares from the board skin (cellA light / cellB dark / frame / accent), armies from tokens p1 / p2. */
body { background: radial-gradient(120% 70% at 50% 0%, #3a2c4a 0%, #15111c 65%); }
.ch-opts { display: flex; justify-content: center; gap: 10px; margin: -2px 0 6px; font-size: 13px; color: var(--muted); }
.ch-opts[hidden] { display: none; }
.ch-opts label { display: flex; align-items: center; gap: 6px; font-weight: 700; }
.ch-opts select { background: var(--card); color: var(--text); border: 1px solid #ffffff22; border-radius: 10px; padding: 4px 8px; font: inherit; }
.ch-player { display: flex; align-items: center; gap: 8px; width: min(100%, 440px); min-height: 34px; padding: 4px 8px; border-radius: 12px; background: var(--card); border: 2px solid transparent; transition: border-color .2s, box-shadow .2s; }
.ch-player.top { margin-bottom: 6px; } .ch-player.bot { margin-top: 6px; }
.ch-player.turn { border-color: var(--gold); box-shadow: 0 0 12px #ffc53344; }
.ch-player .col { width: 16px; height: 16px; border-radius: 50%; flex: none; border: 2px solid #ffffff55; }
.ch-player .col.w { background: var(--sk-tokens-p1, #f7f2e8); } .ch-player .col.b { background: var(--sk-tokens-p2, #2e2a36); }
.ch-player .nm { font-weight: 800; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 38%; }
.ch-player .cap { flex: 1; display: flex; align-items: center; flex-wrap: wrap; min-width: 0; gap: 0; }
.ch-player .cap b { font-size: 11px; color: var(--muted); margin-left: 4px; }
.ch-player .mini { width: 15px; height: 15px; margin-right: -4px; stroke-width: 6; }
.ch-player .clk { font: 800 16px/1 ui-monospace, Menlo, Consolas, monospace; padding: 5px 8px; border-radius: 8px; background: #00000055; min-width: 58px; text-align: center; }
.ch-player .clk.run { background: #ffffff; color: #15111c; }
.ch-player .clk.low.run { background: #e5484d; color: #fff; animation: ch-blink 1s steps(2) infinite; }
@keyframes ch-blink { 50% { opacity: .65; } }
.ch-wrap { position: relative; width: min(100%, 440px); aspect-ratio: 1; padding: 6px; border-radius: 12px; background: var(--sk-board-frame, #5a3a22); box-shadow: 0 12px 30px #000a; box-sizing: border-box; }
.ch-board { position: relative; display: grid; grid-template-columns: repeat(8, 1fr); grid-template-rows: repeat(8, 1fr); width: 100%; height: 100%; border-radius: 6px; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; }
.ch-sq { position: relative; }
.ch-sq.lt { background: var(--sk-board-cellA, #efd9b4); } .ch-sq.dk { background: var(--sk-board-cellB, #b4865a); }
.ch-sq.last::before { content: ''; position: absolute; inset: 0; background: var(--sk-board-accent, #ffc533); opacity: .38; }
.ch-sq.sel::before { content: ''; position: absolute; inset: 0; background: var(--sk-board-accent, #ffc533); opacity: .62; }
.ch-sq.chk::before { content: ''; position: absolute; inset: 0; background: radial-gradient(circle, #ff3b3bee 0%, #ff3b3b99 38%, transparent 72%); }
.ch-sq.dot::after { content: ''; position: absolute; left: 50%; top: 50%; width: 30%; height: 30%; transform: translate(-50%, -50%); border-radius: 50%; background: #0000004d; z-index: 3; pointer-events: none; }
.ch-sq.cap::after { content: ''; position: absolute; inset: 5%; border-radius: 50%; border: 5px solid #0000004d; z-index: 3; pointer-events: none; }
.ch-rk, .ch-fl { position: absolute; font: 700 9px/1 system-ui, sans-serif; opacity: .65; pointer-events: none; }
.ch-rk { left: 2px; top: 2px; } .ch-fl { right: 3px; bottom: 2px; }
.ch-sq.lt .ch-rk, .ch-sq.lt .ch-fl { color: var(--sk-board-cellB, #b4865a); } .ch-sq.dk .ch-rk, .ch-sq.dk .ch-fl { color: var(--sk-board-cellA, #efd9b4); }
.ch-pieces { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.ch-pc { position: absolute; left: 0; top: 0; width: 12.5%; height: 12.5%; transition: transform .22s cubic-bezier(.3, .7, .3, 1), opacity .25s; will-change: transform; }
.ch-pc svg { display: block; width: 88%; height: 88%; margin: 6%; overflow: visible; stroke-width: 3.2; stroke-linejoin: round; stroke-linecap: round; filter: drop-shadow(0 2px 1px #0006); }
.ch-pc.w svg, svg.mini.w { fill: var(--sk-tokens-p1, #f7f2e8); stroke: var(--ch-w-edge, #26222e); }
.ch-pc.b svg, svg.mini.b { fill: var(--sk-tokens-p2, #2e2a36); stroke: var(--ch-b-edge, #f3ecdc); }
.ch-pc.drag { transition: none; z-index: 5; }
.ch-pc.gone { opacity: 0; transform-origin: center; }
.ch-promo { position: absolute; inset: 22% 8%; z-index: 10; background: var(--card); border: 2px solid var(--gold); border-radius: 16px; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; padding: 10px; box-shadow: 0 12px 30px #000c; }
.ch-promo[hidden] { display: none; }
.ch-promo p { width: 100%; text-align: center; margin: 0; font-weight: 800; }
.ch-promo button { position: static; width: 21%; height: auto; aspect-ratio: 1; border-radius: 12px; border: 1px solid #ffffff22; background: #ffffff10; cursor: pointer; padding: 0; transform: none; }
.ch-promo button svg { margin: 8%; width: 84%; height: 84%; }
.ch-promo button.x { width: auto; aspect-ratio: auto; padding: 6px 12px; font-size: 14px; color: var(--muted); }
.ch-offer { display: flex; align-items: center; gap: 8px; width: min(100%, 440px); margin-top: 8px; padding: 8px 10px; border-radius: 12px; background: #ffc53322; border: 2px solid var(--gold); font-weight: 800; font-size: 13px; }
.ch-offer[hidden] { display: none; }
.ch-offer span { flex: 1; }
.ch-offer button, .ch-btn { border: 0; border-radius: 10px; padding: 7px 10px; font: 800 13px/1 inherit; cursor: pointer; background: var(--card); color: var(--text); }
.ch-offer button[data-a="accept"] { background: var(--gold); color: #15111c; }
.ch-btn { border: 1px solid #ffffff22; flex: none; }
.ch-btn.on { background: var(--gold); color: #15111c; }
.ch-btn:disabled { opacity: .38; cursor: default; }
.ch-moves { display: flex; gap: 10px; width: min(100%, 440px); overflow-x: auto; white-space: nowrap; margin-top: 8px; padding: 6px 8px; border-radius: 10px; background: #00000033; font: 600 13px/1.3 ui-monospace, Menlo, Consolas, monospace; scrollbar-width: none; }
.ch-moves::-webkit-scrollbar { display: none; }
.ch-moves .mv i { font-style: normal; color: var(--muted); margin-right: 3px; }
.ch-moves .none { color: var(--muted); font-family: inherit; }
.ch-tools { display: flex; align-items: center; gap: 8px; width: min(100%, 440px); margin-top: 6px; }
.ch-turn { flex: 1; font-weight: 700; min-height: 22px; margin: 4px 0; text-align: center; font-size: 14px; }
.tnz-mp [data-tm] { display: none; }   /* the chess clocks replace the per-turn timer */
.tnz-tight .ch-wrap { width: min(100%, 360px); }
.tnz-tight .ch-player, .tnz-tight .ch-moves, .tnz-tight .ch-tools, .tnz-tight .ch-offer { width: min(100%, 360px); }
@media (prefers-reduced-motion: reduce) { .ch-pc { transition: none; } }
