:root{color-scheme:light}
*{box-sizing:border-box}
body.chess-page{margin:0;background:#fff;color:#151515;font:15px/1.6 'Hanken Grotesk',system-ui,-apple-system,sans-serif}
.justin-chess{max-width:480px;margin:0 auto;padding:20px 12px}
.justin-chess h1{font-size:16px;font-weight:500;margin:0 0 7px}
.justin-chess p{margin:0 0 12px}
.justin-chess .intro{color:#444}
.justin-chess button{font:inherit;color:inherit;cursor:pointer}
.justin-chess button:focus-visible{outline:2px solid #111;outline-offset:3px;z-index:2}
.justin-chess .text-button{border:0;background:none;padding:4px 0;text-decoration:underline;text-underline-offset:4px}
.justin-chess .launch{min-height:40px;margin-bottom:8px}
.game-controls{display:flex;gap:12px;flex-wrap:wrap;justify-content:space-between;align-items:center;margin:8px 0 12px}
.game-actions{display:flex;gap:14px;align-items:center}
.color-controls{display:flex;border:1px solid #d8d8d3;border-radius:4px;overflow:hidden}
.color-controls button{border:0;background:#fff;padding:6px 12px;min-height:38px;font-size:13px}
.color-controls button[aria-pressed=true]{background:#ededE8}
.status{font-size:14px;min-height:23px;color:#555}
.download{margin:-3px 0 13px}
.download progress{display:block;width:100%;height:5px;appearance:none;border:0;border-radius:2px;overflow:hidden;background:#eee}
.download progress::-webkit-progress-bar{background:#eee}
.download progress::-webkit-progress-value{background:#687761}
.board-frame{position:relative;width:100%;max-width:448px}
.board{display:grid;grid-template-columns:repeat(8,1fr);width:100%;aspect-ratio:1;border:1px solid #8b9486;border-radius:3px;overflow:hidden;user-select:none;-webkit-user-select:none;touch-action:manipulation}
.board .square{position:relative;display:flex;align-items:center;justify-content:center;min-width:0;aspect-ratio:1;border:0;border-radius:0;padding:0;background:#edece5;isolation:isolate}
.board .square.dark{background:#8e9e86}
.board .square.last::before{content:'';position:absolute;inset:0;background:rgba(218,202,88,.35);z-index:-1}
.board .square.selected{box-shadow:inset 0 0 0 4px #3f5938}
.board .square.legal::after{content:'';position:absolute;width:24%;height:24%;border-radius:50%;background:rgba(31,52,25,.28)}
.board .square.legal.has-piece::after{width:88%;height:88%;background:none;border:4px solid rgba(31,52,25,.4)}
.piece{font-family:'Segoe UI Symbol','Apple Symbols','Noto Sans Symbols 2',serif;font-size:clamp(32px,8.8vw,49px);font-weight:400;line-height:1;color:#20241f;pointer-events:none}
.piece.white{-webkit-text-stroke:1px #252923;color:#fffdf7;text-shadow:0 1px 1px rgba(0,0,0,.15)}
.coord{position:absolute;bottom:1px;right:4px;font-size:10px;line-height:1.2;color:#52604d;pointer-events:none}
.coord.rank{top:2px;bottom:auto;left:3px;right:auto}
.dark .coord{color:#f4f5ed}
.justin-chess .hint,.justin-chess .footnote{font-size:12px;color:#777;margin-top:10px}
.justin-chess .footnote{margin-top:16px}
.source{font-size:13px;margin-top:12px}
.source a{color:inherit;text-decoration:underline;text-underline-offset:4px}
.moves{font-size:13px;color:#555;max-height:80px;overflow-y:auto;line-height:1.8;margin-top:10px}
.move-pair{display:inline-block;margin-right:12px;white-space:nowrap}
.promotion{position:absolute;inset:0;background:rgba(255,255,255,.95);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px}
.promotion[hidden]{display:none}
.promotion p{font-size:15px}
.promotion button{background:white;border:1px solid #bbb;border-radius:4px;padding:7px 10px;margin:4px;min-width:52px;font-size:32px;font-family:serif}
[hidden]{display:none!important}
.embedded .justin-chess{margin:0;padding:0;max-width:none}
.embedded h1,.embedded .intro,.embedded .footnote,.embedded .source{display:none}
@media(max-width:360px){.color-controls button{padding:6px 8px}.game-controls{gap:6px}.piece{font-size:32px}}
