.board-match{--board-ink:#17243c;--board-dark:#789d9b;--board-light:#f2e8cf;max-width:670px;margin:auto;padding:12px 0 6px;color:var(--board-ink);text-align:center}
.board-players{display:flex;justify-content:center;flex-wrap:wrap;gap:8px;margin-bottom:8px}
.board-players>span{display:flex;align-items:center;gap:7px;border:1px solid #dfe5e9;border-radius:999px;background:#fff;padding:6px 12px;font-weight:650;min-width:0;overflow-wrap:anywhere}
.board-players>span.active{background:#e5f4ea;border-color:#76a992}
.board-mark{width:24px;height:24px;display:grid;place-items:center;border-radius:50%;color:#fff;background:#285c70}
.board-mark.side-0{color:#152841;background:#ecd6a5}
.board-status{font-weight:750;margin:7px 0 12px;min-height:1.55em}
.board-squares{width:min(100%,560px);margin:auto;aspect-ratio:1;display:grid;grid-template-columns:repeat(var(--board-size),minmax(0,1fr));grid-template-rows:repeat(var(--board-size),minmax(0,1fr));border:clamp(3px,.9vw,8px) solid #213e4d;border-radius:10px;overflow:hidden;background:#213e4d;box-shadow:0 12px 32px #1a34431f;touch-action:manipulation}
.board-cell{position:relative;display:grid;place-items:center;min-width:0;min-height:0;padding:0;border:0;border-radius:0;background:var(--board-light);color:#142238;font:700 clamp(20px,7vw,52px)/1 system-ui,sans-serif;cursor:pointer;text-shadow:0 1px 1px #0005}
.board-cell.dark{background:var(--board-dark)}
.board-cell[data-side="0"]{color:#fff9ea;-webkit-text-stroke:1px #2b3b44;text-shadow:0 2px 0 #233b4d80}
.board-cell:focus-visible{outline:3px solid #542e9e;outline-offset:-3px;z-index:1}
.board-cell.last{box-shadow:inset 0 0 0 3px #f4c858}
.board-cell.picked{background:#fad06e}
.board-cell.available::after{content:'';position:absolute;inset:30%;border-radius:50%;background:#102e4c45;border:2px solid #fff9;pointer-events:none}
.board-cell.available[data-side="0"]::after,.board-cell.available[data-side="1"]::after{inset:5%;background:transparent;border:4px solid #f9d775}
.board-cell.captured{color:#102a4666;filter:saturate(.4)}
.board-draughts .board-cell{font-size:clamp(15px,5.4vw,36px)}
.board-tic-tac-toe{--board-light:#f7f3ff;--board-dark:#e7f2ef}
.board-tic-tac-toe .board-squares{width:min(100%,390px);gap:4px}
.board-tic-tac-toe .board-cell{font-size:clamp(32px,14vw,92px);font-weight:900}
.board-tic-tac-toe .board-cell[data-side="0"]{color:#287466;text-shadow:none;-webkit-text-stroke:0}
.board-tic-tac-toe .board-cell[data-side="1"]{color:#8e3f63;text-shadow:none}
.board-promotion{display:flex;justify-content:center;gap:7px;margin:12px auto}
.board-promotion[hidden]{display:none}
.board-promotion button{display:grid;place-items:center;gap:2px;border:1px solid #aeb8c4;background:#fff;border-radius:9px;min-width:48px;min-height:46px;padding:4px 5px 5px;font-size:.73rem;font-weight:700;cursor:pointer;color:var(--board-ink)}
.board-promotion button:focus-visible{outline:2px solid #542e9e;outline-offset:2px}
.board-promotion .board-piece{width:36px;height:36px}
.board-actions{margin-top:13px}
.board-chess.board-premium{--board-light:#b98957;--board-dark:#2d2429}
.board-draughts.board-premium{--board-light:#dbe5d2;--board-dark:#4b8679}
.board-premium .board-squares{border-color:#a47c51;box-shadow:0 12px 30px #17262150,0 0 0 2px #302022}
.board-premium .board-cell{background-image:linear-gradient(135deg,#fff3,#0001 68%,#0003)}
.board-premium .board-cell[data-side="0"]{--piece:#ffdb8d;--piece-edge:#67401c;--piece-light:#fff3c2}
.board-premium .board-cell[data-side="1"]{--piece:#aabed2;--piece-edge:#25354c;--piece-light:#e4f2ff}
.board-draughts.board-premium .board-cell[data-side="0"]{--piece:#eaf3cb;--piece-edge:#5b6644;--piece-light:#fffddc}
.board-draughts.board-premium .board-cell[data-side="1"]{--piece:#166356;--piece-edge:#102c32;--piece-light:#7fd5ba}
.board-piece{width:85%;height:85%;overflow:visible;filter:drop-shadow(0 2px 2px #0006);pointer-events:none}
.board-chess [data-side="0"]{--classic-fill:#fcf1d7;--classic-rim:#304440;--classic-line:#855b34;--classic-highlight:#fffdf6}
.board-chess [data-side="1"]{--classic-fill:#192e3c;--classic-rim:#d7e5df;--classic-line:#adc8c3;--classic-highlight:#e2f0eb}
.classic-chess-piece{width:91%;height:91%;filter:drop-shadow(0 1px 1px #0007)}
.classic-piece-shell{fill:var(--classic-fill);stroke:var(--classic-rim);stroke-width:1.75;stroke-linecap:round;stroke-linejoin:round}
.classic-piece-line,.classic-piece-highlight{fill:none;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
.classic-piece-line{stroke:var(--classic-line)}
.classic-piece-highlight{stroke:var(--classic-highlight)}
.piece-depth{fill:var(--piece-edge)}
.piece-face{fill:var(--piece);stroke:var(--piece-edge);stroke-width:2.1;stroke-linecap:round;stroke-linejoin:round}
.piece-shine{fill:none;stroke:var(--piece-light);stroke-width:1.55;stroke-linecap:round}
.piece-emblem{fill:var(--piece-light)}

.board-chess.board-premium{--board-light:#bfa27b;--board-dark:#282f45}
.imperial-frame{--inlay:clamp(15px,3vw,26px);position:relative;width:min(100%,570px);margin:auto;padding:var(--inlay);border-radius:8px;background:repeating-linear-gradient(3deg,#2c1a21,#301d23 3px,#342126 5px,#3e272a 8px);border:1px solid #a4774d;box-shadow:0 12px 30px #27214365,inset 0 0 0 2px #4d302c,inset 0 0 0 3px #92704e}
.imperial-frame::before{content:'';position:absolute;inset:calc(var(--inlay)*.31);border:1px solid #a87c48;pointer-events:none}
.imperial-corner{position:absolute;width:calc(var(--inlay)*.52);aspect-ratio:1;transform:rotate(45deg);background:linear-gradient(130deg,#f9df97,#aa7848 53%,#64423a);border:1px solid #724b30}
.imperial-corner:nth-child(1){top:3px;left:3px}.imperial-corner:nth-child(2){top:3px;right:3px}.imperial-corner:nth-child(3){bottom:3px;right:3px}.imperial-corner:nth-child(4){bottom:3px;left:3px}
.imperial-files,.imperial-ranks{position:absolute;display:grid;align-items:center;color:#fcdea5;font:700 clamp(9px,1.5vw,13px)/1 Georgia,serif;text-transform:uppercase;pointer-events:none}
.imperial-files{grid-template-columns:repeat(8,1fr);left:var(--inlay);right:var(--inlay);bottom:4px}
.imperial-ranks{grid-template-rows:repeat(8,1fr);top:var(--inlay);bottom:var(--inlay);left:4px}
.imperial-frame .board-squares{width:100%;border:1px solid #d5ab73;border-radius:1px;background:#282135;box-shadow:0 0 0 2px #160f18}
.imperial-frame .board-cell{background-image:linear-gradient(131deg,#fff3 1%,transparent 38%,#46355242 99%),repeating-linear-gradient(154deg,transparent 0 9px,#e6e2d617 10px,#e0af8d18 11px,transparent 13px 22px);box-shadow:inset 0 0 0 1px #5f413e3a}
.imperial-frame .board-cell.dark{background-image:linear-gradient(140deg,#4155748a 0%,transparent 58%,#171a3b91 100%),repeating-linear-gradient(31deg,transparent 0 12px,#9ab7eb1f 13px,transparent 15px 26px)}
.imperial-frame .board-cell.picked{background-color:#c99c5a;box-shadow:inset 0 0 0 3px #fff0a5}
.imperial-frame .board-cell.last{box-shadow:inset 0 0 0 2px #ffcf65}
.imperial-frame .board-cell.available::after{z-index:2;background:#162942a8}
.imperial-frame .board-cell.available:not([data-side="-1"])::after{background:transparent}
.imperial-frame .board-cell:focus-visible{outline-color:#fed772}
.imperial-frame .board-cell[data-side="0"],.board-chess.board-premium .board-promotion [data-side="0"]{--piece:#d7a148;--piece-light:#fff2ba;--piece-edge:#67401d;--piece-shadow:#8f521e;--gem:#ab4661}
.imperial-frame .board-cell[data-side="1"],.board-chess.board-premium .board-promotion [data-side="1"]{--piece:#586d9e;--piece-light:#cfdef0;--piece-edge:#161c32;--piece-shadow:#2d3658;--gem:#78dbc7}
.imperial-gem{fill:var(--gem);stroke:var(--piece-edge);stroke-width:.73}
.imperial-piece{width:93%;height:93%;filter:drop-shadow(1px 3px 1.5px #0f0a2180)}

@media(min-width:1024px) and (hover:hover) and (pointer:fine), (min-width:740px) and (pointer:coarse), (orientation:landscape) and (max-height:560px) and (pointer:coarse){
 .board-match{
  --board-extent:max(320px,calc(var(--round-space) - 20px));
  --board-rail:clamp(175px,17vw,248px);
  display:grid;
  grid-template-columns:minmax(0,1fr) var(--board-rail);
  grid-template-areas:"board players" "board status" "board promotion" "board actions";
  grid-template-rows:repeat(3,auto) 1fr;
  max-width:calc(var(--board-extent) + var(--board-rail) + 15px);
  gap:7px 15px;
  padding:0;
  align-items:start;
 }
 .play-shell:not(.solo-play) .board-match{--board-extent:max(310px,calc(var(--round-space) - 56px))}
 .board-match .board-players{grid-area:players;display:grid;grid-template-columns:1fr;margin:0;text-align:left}
 .board-match .board-status{grid-area:status;margin:0}
 .board-match>:is(.board-squares,.imperial-frame){grid-area:board;width:100%;margin:0}
 .board-match .board-promotion{grid-area:promotion;margin:0;flex-wrap:wrap}
 .board-match .board-actions{grid-area:actions;display:flex;flex-direction:column;gap:6px;margin:0}
 .board-tic-tac-toe{max-width:calc(min(var(--board-extent),480px) + var(--board-rail) + 15px)}
}

@media (orientation:landscape) and (max-height:560px) and (pointer:coarse){
 .board-match{--board-extent:max(220px,calc(100dvh - 80px))}
 .play-shell:not(.solo-play) .board-match{--board-extent:max(205px,calc(100dvh - 106px))}
}
@media (orientation:portrait) and (max-width:739px){
 .board-match{padding:0;max-width:min(100%,max(254px,calc(100dvh - 236px)))}
 .board-match .board-players{gap:4px;margin-bottom:4px}
 .board-match .board-players>span{padding:4px 7px;font-size:.81rem}
 .board-match .board-status{margin:4px 0 6px;font-size:.88rem}
 .board-match .board-actions{margin-top:5px}
 .board-cell{font-size:clamp(16px,7vw,46px)}
}

.board-squares .board-cell{min-height:0}
