.ch-stage{--ch-ink:#252d49;--ch-light:#fff2d4;--ch-dark:#b4c5e5;max-width:36rem;margin-inline:auto;color:var(--ch-ink)}
.ch-status,.ch-last-note{margin:.4rem 0 .6rem;line-height:1.4;font-size:.86rem}
.ch-status{font-weight:700}
.ch-last-note{color:#4d5063}
.ch-grid{display:grid;grid-template-columns:repeat(8,minmax(0,1fr));border:2px solid var(--ch-ink);border-radius:9px;overflow:hidden;background:var(--ch-ink);isolation:isolate}
.ch-grid .ch-square{position:relative;display:grid;place-items:center;min-width:0;min-height:0;width:100%;aspect-ratio:1;border-radius:0;border:0;padding:0;margin:0;line-height:1;touch-action:manipulation}
.ch-grid .ch-light,.ch-grid .ch-light:hover:enabled{background:var(--ch-light)}
.ch-grid .ch-dark,.ch-grid .ch-dark:hover:enabled{background:var(--ch-dark)}
.ch-grid .ch-last{box-shadow:inset 0 0 0 100px #e4b65b45}
.ch-grid .ch-selected{box-shadow:inset 0 0 0 4px #2751b3}
.ch-grid .ch-check{background:repeating-linear-gradient(-45deg,#ffc0bd 0 4px,#ffd8c8 4px 9px)!important}
.ch-grid .ch-square:focus-visible{z-index:2;outline:3px solid #1c3fae;outline-offset:-4px}
.ch-square.ch-can-move::after,.ch-square.ch-can-take::after{content:"";position:absolute;inset:35%;background:#274880a1;border:1px solid #1e3c75;border-radius:50%;pointer-events:none}
.ch-square.ch-can-take::after{inset:4%;border:3px dashed #243e75;background:transparent;border-radius:21%}
.ch-piece{width:76%;height:76%;display:block;pointer-events:none;position:relative;z-index:1}
.ch-piece g{fill:var(--figure);stroke:var(--edge);stroke-width:2.4;stroke-linejoin:round;stroke-linecap:round}
.ch-white{--figure:#fffdf6;--edge:#353c59;--line:#7b6b5a}
.ch-black{--figure:#303852;--edge:#151b32;--line:#c1cbea}
.ch-piece .ch-detail{fill:none;stroke:var(--line);stroke-width:2}
.ch-square small{position:absolute;z-index:1;font:700 clamp(8px,1.6vw,11px)/1 system-ui;color:#34405b;pointer-events:none}
.ch-rank{left:4%;top:5%}.ch-file{right:5%;bottom:3%}
.ch-promotion{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:5px;margin:.6rem 0}
.ch-promotion button{min-width:0;min-height:44px;padding:4px;display:grid;justify-items:center;gap:2px;font-size:.75rem}
.ch-promotion .ch-piece{width:31px;height:31px}
.ch-claim{display:block;margin:.6rem 0}
.ch-claim summary{padding:8px 0}
.ch-claim div{display:flex;gap:4px;flex-wrap:wrap}

/* Inlaid walnut around a maple board. Board coordinates stay inside their own squares. */
.ch-stage {
  --ch-ink:#2f271e; --ch-light:#f1dfbf; --ch-dark:#ac8b66;
  width:100%; max-width:none; padding:2px clamp(7px,1.3vw,18px) 10px; border-radius:10px;
  background:repeating-linear-gradient(3deg,transparent 0 9px,#e1c59609 10px,transparent 11px 28px),
    repeating-linear-gradient(-2deg,transparent 0 20px,#2018101a 21px,transparent 23px 42px),
    linear-gradient(115deg,#594737,#433328 64%,#4e3b2e);
  border:1px solid #392c24; box-shadow:inset 0 0 0 1px #c4a07848;
}
.ch-status,.ch-last-note { color:#fbefd4; margin:.4rem 0; }
.ch-status { display:flex; align-items:center; justify-content:center; gap:8px; min-height:29px; line-height:1.3; }
.ch-status::before { content:""; width:8px; height:8px; flex:none; border:1px solid #b79b71; background:#f4e4b9; border-radius:50%; }
.ch-stage:has(.ch-check) .ch-status::before { background:#f8ac94; border-color:#e4ad96; }
.ch-last-note { text-align:center; font-size:.82rem; }
.ch-stage .ch-grid {
  width:min(100%,570px); margin-inline:auto; border:clamp(4px,.7vw,8px) solid #7a5b40; border-radius:3px;
  background:#563b29; box-shadow:0 0 0 1px #c4ac82,0 0 0 3px #392d25,0 2px 5px 2px #231a1559;
}
.ch-grid .ch-square { border-radius:0; background-image:linear-gradient(16deg,#ffffff07,#5b362006); }
.ch-grid .ch-square:is(.ch-selected,.ch-selected:hover) { box-shadow:inset 0 0 0 3px #235146,inset 0 0 0 5px #fff2cbbf; }
.ch-grid .ch-square:is(.ch-last,.ch-last:hover):not(.ch-selected) { box-shadow:inset 0 0 0 100px #efd66c58; }
.ch-square.ch-can-move::after { background:#334c40a3; border-color:#344638; }
.ch-square.ch-can-take::after { border-color:#254538; }
.ch-square small { color:#43382e; }
.ch-grid .ch-square:focus-visible { outline-color:#0d4d5d; outline-offset:-3px; }
.ch-white { --figure:#fff6dd; --edge:#39352a; --line:#776f5c; }
.ch-black { --figure:#282d2b; --edge:#191e1d; --line:#d3d1bb; }
.ch-piece { width:77%; height:77%; filter:drop-shadow(0 1px .5px #44311f45); }
.ch-claim,.ch-claim summary { color:#fff0d3; }
.ch-claim:is(button) { color:#352e23; }
.ch-promotion button { color:#352f25; }
@media (min-width:900px) {
  .ch-stage { padding:2px 12px 12px; }
  .ch-stage .ch-grid { width:min(100%,clamp(280px,calc(100svh - 268px),573px)); }
  .play-room.is-expanded[data-play-room="szachy"] { background:#f1eada; }
  .play-room.is-expanded[data-play-room="szachy"] .ch-grid { width:min(100%,clamp(325px,calc(100dvh - 154px - env(safe-area-inset-top)),785px)); }
}
.play-room.is-expanded[data-play-room="szachy"]>.room-tools { background:#f1eada; border-color:#bcab8e; color:#46392a; }
.play-room.is-expanded[data-play-room="szachy"] .room-toggle { color:#513727; border-color:#a58c68; background:#fffaed; }
@media(forced-colors:active) {
  .ch-grid .ch-square { forced-color-adjust:none; }
  .ch-status,.ch-last-note,.ch-claim summary { color:CanvasText; }
}
