/* Shared SVG board. Square colors are deliberately neutral, independent of arcade branding. */
#board.chess-board,#network-board.chess-board{display:grid;grid-template-columns:18px minmax(0,1fr);grid-template-rows:minmax(0,1fr) 18px;gap:0;width:100%;max-width:620px;aspect-ratio:1;border:1px solid #515a6b;border-radius:4px;background:#202633;padding:5px;overflow:visible;align-self:start;min-width:0;isolation:isolate}
.chess-grid{grid-column:2;grid-row:1;display:grid;grid-template-columns:repeat(8,minmax(0,1fr));grid-template-rows:repeat(8,minmax(0,1fr));gap:0;min-width:0;min-height:0;aspect-ratio:1;touch-action:none;user-select:none;-webkit-user-select:none}
.chess-square,.chess-square:disabled,.chess-square:hover{position:relative;display:grid;place-items:center;width:100%;height:100%;min-width:0;min-height:0;margin:0!important;padding:0!important;border:0!important;border-radius:0!important;background:#e2e5e6;color:#111a24;opacity:1!important;overflow:hidden;box-shadow:none;text-shadow:none;touch-action:none;cursor:pointer}
.chess-square.dark,.chess-square.dark:disabled,.chess-square.dark:hover{background:#89969f}.chess-square:disabled{cursor:default}
.chess-piece{display:grid;place-items:center;width:92%;height:92%;aspect-ratio:1;pointer-events:none;position:relative;flex:0 0 auto;filter:none!important;text-shadow:none!important}.chess-piece img{display:block;width:100%;height:100%;object-fit:contain;pointer-events:none;filter:none!important;box-shadow:none!important;-webkit-user-drag:none}
.piece-fallback{display:none;width:72%;height:72%;border:2px solid #131a25;border-radius:5px;place-items:center;font:700 clamp(10px,2.5vw,20px) system-ui;letter-spacing:-1px;background:#fff;color:#111}.piece-fallback.black{background:#111;color:#fff;border-color:#d1d6dc}.asset-error .piece-fallback{display:grid}
.chess-square.previous-move{background:#d6d7b7}.chess-square.dark.previous-move{background:#a6af8b}.chess-square.previous-move::before{content:'';position:absolute;inset:3px;border:1px solid #65713c;pointer-events:none}
.chess-square.selected,.chess-square.dark.selected{background:#b6c8e8}.chess-square.selected::before{content:'';position:absolute;inset:2px;border:3px solid #395a9d;pointer-events:none}
.chess-square.legal-destination::after{content:'';position:absolute;width:24%;height:24%;border-radius:50%;background:#273747a8;border:2px solid #f7f9fc80;pointer-events:none}
.chess-square.capture-target::after{content:'';position:absolute;inset:3px;border:4px solid #a44b1d;border-radius:50%;pointer-events:none}
.chess-square.in-check{background:#eeb8b5}.chess-square.in-check::after{content:'';position:absolute;inset:2px;border:3px dashed #a52536;pointer-events:none}.chess-square:focus-visible{outline:3px solid #3d55a8!important;outline-offset:-3px;z-index:2}.chess-square.drag-source .chess-piece{opacity:.3}
.piece-drag-ghost{position:fixed;z-index:1000;transform:translate(-50%,-50%);pointer-events:none;width:60px;height:60px;opacity:1}
.board-ranks{grid-column:1;grid-row:1;display:grid;grid-template-rows:repeat(8,1fr)}.board-files{grid-column:2;grid-row:2;display:grid;grid-template-columns:repeat(8,1fr)}.board-ranks span,.board-files span{display:grid;place-items:center;font:500 10px system-ui;color:#d0d6e1;line-height:1;user-select:none}
.board-legend{display:flex;flex-wrap:wrap;gap:8px 13px;font-size:10px;color:#bac3d5;line-height:1.5;margin:12px 0}.board-legend span{display:inline-flex;align-items:center;gap:5px}.board-legend i{width:11px;height:11px;display:inline-block;background:#a8b4c6}.board-legend .selected{border:2px solid #739de9;background:#b6c8e8}.board-legend .legal-destination{border-radius:50%;background:#91a0b6;width:8px;height:8px}.board-legend .capture-target{background:transparent;border:2px solid #de8f61;border-radius:50%}.board-legend .previous-move{background:#a6af8b}.board-legend .in-check{background:#eeb8b5;border:2px dashed #ac2b3b}
.board-context{margin:0 0 12px;padding:10px 12px;background:#171e30;border:1px solid #303a52;border-radius:9px;display:flex;gap:5px 16px;flex-wrap:wrap;align-items:center;font-size:12px;color:#b9c4df}.board-context strong{color:#f0f3ff}.board-context span{overflow-wrap:anywhere}.board-context .board-turn{flex-basis:100%;font-size:14px}.board-column{min-width:0;width:100%}
#modalActions.promotion-options{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin:16px 0}#modalActions.promotion-options button{display:flex;align-items:center;flex-direction:column;gap:7px;min-width:0;padding:10px 3px;font-size:12px;background:#d9dfe7;color:#151c2a;border:2px solid #7e8bb0}#modalActions.promotion-options .chess-piece{width:60px;max-width:100%;height:auto}#modalActions.promotion-options button:focus-visible{outline:3px solid #ac92ff;outline-offset:2px}
@media(max-width:700px){#table{padding-top:18px}.tablehead{margin:18px 0}.tablehead h1{font-size:28px}.tablehead button{font-size:12px;padding:10px}.board-context{font-size:11px;padding:9px 10px}.board-context .board-turn{font-size:13px}.playlayout{grid-template-columns:minmax(0,1fr)!important;gap:18px}#board.chess-board,#network-board.chess-board{grid-template-columns:15px minmax(0,1fr);grid-template-rows:minmax(0,1fr) 15px;padding:3px;border-width:1px}.board-ranks span,.board-files span{font-size:9px}.board-legend{gap:7px 10px;font-size:9px}.chess-square.capture-target::after{border-width:3px}.chess-square.selected::before{border-width:2px}#modalActions.promotion-options{gap:5px}#modalActions.promotion-options button{font-size:11px}}
.asset-loading .piece-fallback{display:grid}.asset-loading img{opacity:0}.chess-piece .piece-fallback{position:absolute;inset:14%;width:auto;height:auto}
