*{box-sizing:border-box} :root{color-scheme:light;--bg:#eeeee5;--paper:#faf9f3;--text:#263e34;--muted:#53655a;--line:#cdd5c9;--light:#e6e5d5;--dark:#7d9585;--accent:#315b47;--button:#e2e8dc;--selected:#eedca1;--check:#a52e35}body{margin:0;background:var(--bg);color:var(--text);font:16px/1.6 system-ui,-apple-system,sans-serif}body[data-theme=night]{color-scheme:dark;--bg:#202a27;--paper:#293530;--text:#edeedf;--muted:#b6c4b8;--line:#4a5d50;--light:#a4ad98;--dark:#536c5f;--accent:#b8d6b6;--button:#3b4d42;--selected:#d3bd7b}button,select,input{font:inherit}button,select{min-height:44px;border:1px solid var(--line);border-radius:12px;background:var(--paper);color:var(--text);padding:9px 16px}button{cursor:pointer;font-weight:600}button:hover:not(:disabled){filter:brightness(.96)}button:disabled{opacity:.45;cursor:default}button:focus-visible,select:focus-visible,a:focus-visible{outline:3px solid #cf9a38;outline-offset:3px}a{color:inherit;text-underline-offset:4px}header,footer{max-width:1200px;margin:auto;display:flex;align-items:center;justify-content:space-between;gap:16px;padding:22px 24px}header{border-bottom:1px solid var(--line)}.brand{font-weight:750;letter-spacing:2px;text-decoration:none;font-size:16px}.brand span{font-weight:450;font-size:12px;letter-spacing:3px}#language{max-width:180px}main{max-width:1150px;margin:auto;padding:28px 24px 50px}.intro{margin-bottom:25px}.intro h1{font:500 clamp(32px,4vw,48px)/1.2 Georgia,serif;margin:5px 0 10px}.intro p{margin:0;color:var(--muted)}.eyebrow{font-size:11px;letter-spacing:2px;font-weight:650;color:var(--muted)}.surface{border:1px solid var(--line);border-radius:24px;background:var(--paper);padding:24px;display:grid;grid-template-columns:minmax(0,650px) minmax(200px,1fr);gap:34px;box-shadow:0 20px 70px #263e3409}.play{min-width:0}.board-frame{padding:9px;background:var(--button);border-radius:9px;border:1px solid var(--line)}.board{display:grid;grid-template-columns:repeat(8,1fr);aspect-ratio:1;direction:ltr;isolation:isolate}.square{border:0;border-radius:0;padding:0;min-height:0;aspect-ratio:1;background:var(--light);position:relative;touch-action:manipulation;overflow:hidden;color:#293d32}.square.dark{background:var(--dark)}.square:hover:not(:disabled){filter:none}.square.selected{box-shadow:inset 0 0 0 4px var(--selected)}.square.last:before{content:'';position:absolute;inset:0;background:#f2dc8a3b}.square.check{box-shadow:inset 0 0 0 4px var(--check)}.square.suggest{outline:3px dashed #945c14;outline-offset:-5px;z-index:1}.square.legal:after{content:'';position:absolute;width:22%;height:22%;border-radius:50%;background:#243e3866;inset:39%}.square.capture:after{width:88%;height:88%;inset:6%;background:none;border:4px solid #243e3899}.piece{position:relative;width:86%;height:86%;margin:7%;overflow:visible;user-select:none;pointer-events:none;filter:drop-shadow(0 2px 1px #20352c30)}.piece.w{fill:#fff6df;stroke:#34483f;stroke-width:2.5}.piece.b{fill:#293a34;stroke:#e6e2cf;stroke-width:1.9}.piece .detail{fill:none;stroke-width:2.6}.coord{position:absolute;font:600 clamp(8px,1vw,11px)/1 system-ui;z-index:2;opacity:.85}.file{bottom:3px;right:4px}.rank{left:3px;top:4px}.player{display:flex;gap:10px;align-items:center;padding:0 0 14px;min-height:58px}.player.lower{padding:14px 0 0}.player strong{font-size:15px}.player div span{display:block;font-size:12px;color:var(--muted)}.avatar{width:36px;height:36px;display:grid;place-items:center;border:1px solid var(--line);border-radius:50%;font-size:24px}.player button,.player #save-note{margin-inline-start:auto}.small{font-size:13px;padding:7px 12px}.player #save-note{font-size:11px;color:var(--muted);max-width:45%;text-align:end}.status{font-weight:600;text-align:center;margin:15px 0 0;min-height:26px}.notice{font-size:13px;text-align:center;color:var(--muted);margin:3px 0 12px;min-height:21px}.tools{display:grid;grid-template-columns:repeat(3,1fr);gap:9px}.tools button{background:var(--button)}.primary{background:#315b47;color:#fffaf0;border-color:#315b47}.secondary{background:var(--button)}#claim,#retry{width:100%;margin-top:12px}.aside-heading{margin-top:35px}.aside-heading h2{font:500 30px/1.35 Georgia,serif;margin:10px 0 25px}.aside-actions{display:grid;gap:10px}.aside-note{font-size:14px;color:var(--muted)}details{margin-top:25px;border-block:1px solid var(--line);padding:13px 0}summary{cursor:pointer;font-size:15px;font-weight:600}#history{max-height:220px;overflow:auto;padding-left:35px;font-variant-numeric:tabular-nums;font-size:14px}#history li{padding-inline-start:8px;white-space:pre-wrap}.social{display:flex;flex-wrap:wrap;gap:8px;margin-top:25px}.guide{max-width:850px;margin:45px auto;color:var(--muted)}.guide h2{color:var(--text);font:500 27px Georgia,serif}.guide p{line-height:1.85}footer{justify-content:center;flex-wrap:wrap;font-size:13px;border-top:1px solid var(--line);color:var(--muted)}dialog{width:min(440px,calc(100vw - 30px));max-height:90dvh;overflow:auto;border:1px solid var(--line);border-radius:22px;background:var(--paper);color:var(--text);padding:26px;box-shadow:0 22px 80px #0003}dialog::backdrop{background:#172c2466;backdrop-filter:blur(3px)}dialog h2{font:500 27px Georgia,serif;margin:0 0 22px}dialog label{display:grid;gap:8px;margin:20px 0;font-weight:550}dialog label.inline{display:flex;justify-content:space-between;align-items:center}dialog input[type=checkbox]{width:23px;height:23px;accent-color:#315b47}dialog input[type=range]{width:100%;accent-color:#315b47;min-height:35px}.dialog-actions{display:flex;gap:10px;justify-content:end;margin-top:25px}.more-actions{display:grid;gap:10px}#promotions{display:grid;grid-template-columns:repeat(4,1fr);gap:5px;margin-bottom:20px}#promotions button{padding:0;background:var(--light)}#promotions .piece{width:90%;height:auto;margin:5%}#promotions span{display:block;font-size:11px;color:#293d32}.result{text-align:center;padding:20px;margin-top:16px;background:var(--button);border-radius:16px}.result h2{font:500 30px Georgia,serif;margin:0}.skip{position:absolute;left:-9999px}.skip:focus{left:16px;top:10px;z-index:20;background:var(--paper);padding:10px}.focus-mode header,.focus-mode .intro,.focus-mode .guide,.focus-mode footer{display:none}.focus-mode main{padding-top:15px}.arrived .piece{animation:arrive .18s ease-out}@keyframes arrive{from{opacity:.6;transform:translateY(-4px)}to{opacity:1;transform:none}}[hidden]{display:none!important}@media(max-width:740px){header{padding:14px 16px}main{padding:20px 10px 30px}.intro{padding:0 6px;margin-bottom:18px}.intro h1{font-size:32px}.intro .eyebrow{font-size:9px}.surface{padding:12px;border-radius:18px;display:block}.board-frame{padding:4px}.surface aside{margin-top:20px}.aside-heading,.aside-note{display:none}.aside-actions{display:flex;flex-wrap:wrap;gap:8px}.aside-actions button{font-size:13px;flex:1}.player{padding-bottom:10px}.player.lower{padding-top:10px}.notice{min-height:20px;font-size:12px}.social{margin-top:16px}.guide{padding:0 8px;margin-top:30px}.square.selected,.square.check{box-shadow:inset 0 0 0 3px var(--selected)}.square.check{box-shadow:inset 0 0 0 3px var(--check)}}@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation:none!important;transition:none!important}}@media(max-width:350px){.tools button{padding:9px 5px}.player #save-note{font-size:10px}.board-frame{padding:2px}.surface{padding:8px}#language{max-width:135px}}
body>.skip{position:fixed;left:0;top:0;transform:translateY(-200%)}body>.skip:focus{left:16px;top:10px;transform:none}@media(max-width:740px){body main{padding-inline:6px}body .surface{padding:8px}body .board-frame{padding:3px}}

/* Chess-only clarity palette: shared stylesheet also serves other tabletop games. */
body[data-game=chess]{--light:#e8d3ae;--dark:#a77b53;--selected:#f6d46c;--check:#a52e40}
body[data-game=chess][data-theme=night]{--light:#d5c09d;--dark:#95704e;--selected:#edcc73;--check:#922f40}
body[data-game=chess] .board-frame{padding:4px;background:#201c18;border-color:#665441;border-radius:5px}
body[data-game=chess] .piece{width:92%;height:92%;margin:4%;filter:drop-shadow(0 1px 1px #20170f66)}
body[data-game=chess] .piece.w{fill:#fff8e7;stroke:#44382c;stroke-width:3}
body[data-game=chess] .piece.b{fill:#252321;stroke:#e1cba5;stroke-width:1.8}
body[data-game=chess] .piece.b .detail{stroke:#d8c7ac;stroke-width:2.2}
body[data-game=chess] .piece.w .detail{stroke:#5c4b37;stroke-width:2.4}
body[data-game=chess] .square{color:#56422c}
body[data-game=chess] .square.dark{color:#302318}
body[data-game=chess] .square.last:before{background:#f8d34f40;box-shadow:inset 0 0 0 2px #72531566}
body[data-game=chess] .square.selected{box-shadow:inset 0 0 0 4px var(--selected)}
body[data-game=chess] .square.selected:before{content:'';position:absolute;inset:0;background:#f7d35740}
body[data-game=chess] .square.legal:after{background:#4e3a25a8;border:1px solid #fff3d9c9;width:23%;height:23%;inset:38.5%}
body[data-game=chess] .square.capture:after{background:none;inset:6%;width:88%;height:88%;border:3px solid #643c18;box-shadow:0 0 0 1px #fff1c5d0}
body[data-game=chess] .square.suggest{outline-color:#714a14}
body[data-game=chess] .square.check{box-shadow:inset 0 0 0 4px var(--check)}
body[data-game=chess] .square.check:before{content:'';position:absolute;inset:0;background:#a52e4045}
body[data-game=chess] .coord{opacity:1;text-shadow:none;font-weight:750}
body[data-game=chess] #promotions span{color:#44382c}
body[data-game=chess][data-theme=night] .square.suggest{outline-color:#f2cf81}
@media(max-width:740px){body[data-game=chess] .square.selected,body[data-game=chess] .square.check{box-shadow:inset 0 0 0 3px var(--selected)}body[data-game=chess] .square.check{box-shadow:inset 0 0 0 3px var(--check)}}

body[data-game="chess"] .chess-match-result[hidden]{display:none}
body[data-game="chess"] .chess-match-result{margin-block:10px;padding:12px;text-align:start;border:1px solid var(--line)}
.chess-match-result h2{font-size:clamp(1.25rem,3vw,1.65rem)}
.chess-match-result p:empty{display:none}
.chess-match-result button{min-height:44px;margin-block-start:6px;margin-inline-end:6px}
.board .square.mated-king{outline:3px solid #ffcf79;outline-offset:-3px;z-index:1}
@media(max-width:600px){
 body[data-game="chess"] .board-frame{box-sizing:border-box;padding:2px}
}
.chess-key-move{box-sizing:border-box;width:min(94vw,36rem);max-height:94vh;padding:clamp(8px,3vw,20px);border:1px solid #8a6d52;border-radius:14px;background:#fff8eb;color:#332719}
.chess-key-move::backdrop{background:#231c16a0}
.chess-key-move .board{width:100%}
.chess-key-move h2{margin:0}
.chess-key-move [role=status]{min-height:1.4em}
.chess-key-move > button{min-height:44px;margin-inline-end:8px}
.chess-match-result button[hidden]{display:none}
