*{box-sizing:border-box}body{margin:0;background:#eef1e8;color:#274b43;font-family:Arial,sans-serif}button,select{font:inherit;touch-action:manipulation}button{cursor:pointer}header{display:flex;align-items:center;gap:25px;padding:14px 4%;background:#0c1b2d;color:#dcece8}header a{color:inherit;text-decoration:none}.brand{display:flex;align-items:center;gap:10px;font-weight:700}.brand img{width:44px}.brand small{display:block;color:#8bbcc7;letter-spacing:2px;font-size:9px;margin-top:5px}.back{font-size:13px}.tools{display:flex;gap:6px;margin-left:auto}.tools button{height:40px;width:40px;border-radius:12px;background:#173543;border:1px solid #496670;color:#dcece8}main{padding:20px 24px;max-width:1120px;margin:auto}.heading{display:flex;justify-content:space-between;align-items:center;margin-bottom:15px}.heading p{font-size:9px;letter-spacing:3px;color:#81917a;margin:0 0 5px}h1{margin:0;font-size:32px}.heading>button{border:1px solid #c0cdb4;border-radius:11px;background:#e0e7d8;color:#436343;padding:11px 20px;font-size:12px}.chess-layout{display:grid;grid-template-columns:minmax(0,600px) minmax(210px,1fr);gap:30px;align-items:start}.playerbar{display:flex;align-items:center;gap:10px;padding:9px 5px}.playerbar strong{display:block;font-size:14px}.playerbar small{display:block;margin-top:4px;font-size:10px;color:#82917d}.avatar{width:34px;height:34px;display:grid;place-items:center;background:#d4dfcc;border-radius:10px;font-size:25px;color:#345445}.avatar.light{color:#faf8df;background:#9cad92}#thinking{margin-left:auto;color:#8a794d;font-size:11px;animation:think 1.5s infinite}#thinking[hidden]{display:none}.board-wrap{position:relative;border:6px solid #59715b;border-radius:8px;box-shadow:0 8px 30px #23452c12;isolation:isolate}#board{display:grid;grid-template-columns:repeat(8,1fr);aspect-ratio:1;width:100%}.square{position:relative;border:0;border-radius:0;padding:0;min-width:0;display:grid;place-items:center;background:#ecedda;color:#284d3e;aspect-ratio:1}.square.dark{background:#96ad88}.piece{position:relative;z-index:1;width:89%;height:89%;filter:drop-shadow(0 2px 1px #20382833);pointer-events:none}.square.selected{background:#efcf7b}.square.legal:after{content:'';position:absolute;width:21%;height:21%;border-radius:100%;background:#2b54394d;z-index:2}.square.capture:after{width:87%;height:87%;background:none;border:4px solid #35573f66}.square.last{box-shadow:inset 0 0 0 4px #d0bc5888}.square.check{background:radial-gradient(#e6a18a,#c78872)}.square.hint{box-shadow:inset 0 0 0 4px #dba74d}.square:focus-visible{outline:3px solid #d5a54a;outline-offset:-3px;z-index:3}.coord{position:absolute;font-size:9px;font-weight:bold;pointer-events:none;color:#436447;z-index:2}.rank{top:3px;left:4px}.file{bottom:2px;right:4px}.dark .coord{color:#f1f2db}#flip{margin-left:auto;background:#e0e8d8;border:1px solid #c0cfb4;color:#4b6749;border-radius:10px;width:34px;height:34px;font-size:20px}aside{margin-top:10px;background:#f9faef;border:1px solid #cbd5bf;border-radius:20px;padding:20px}#status{font-size:15px;line-height:1.6;margin:0 0 16px;min-height:50px}.actions{display:flex;gap:8px}.actions button{border:1px solid #c2d0b7;border-radius:10px;background:#e7eddf;color:#436342;font-size:12px;padding:10px 14px;flex:1}.actions button:disabled{opacity:.4;cursor:default}.moves-panel{margin-top:28px}.eyebrow{font-size:9px;letter-spacing:2px;color:#889779}#history{padding:0;list-style:none;max-height:360px;overflow:auto;font-family:ui-monospace,monospace;font-size:13px;line-height:2.4}#history li{display:grid;grid-template-columns:28px 1fr 1fr;gap:9px;border-bottom:1px solid #e6ebdd}#history .number{color:#9aab8d}#empty-history{font-size:12px;color:#92a287}#empty-history[hidden]{display:none}.legend{font-size:9px;color:#8c9c82;margin:22px 0 0}.legend span{margin-left:15px}#welcome{position:absolute;inset:0;background:#22432e5e;z-index:5;display:grid;place-items:center;padding:15px}#welcome[hidden]{display:none}.panel{max-width:390px;background:#f7f8eaf5;border:1px solid #d8dbbd;border-radius:23px;padding:24px;text-align:center;box-shadow:0 10px 35px #173c2a33}.mark{font-size:53px;color:#526c4f}.panel h2{font-size:26px;line-height:1.1;margin:10px 0}.panel p:not(.eyebrow){font-size:13px;line-height:1.6;color:#7d8c72}.primary{background:#3c684e;color:#f3f5e2;font-weight:700;border:0;border-radius:11px;padding:13px 20px}.panel .primary{width:100%;margin-top:15px}.panel small{display:block;margin-top:12px;color:#8b9b80;font-size:9px}.setup{display:flex;gap:10px;margin-top:15px;text-align:left}.setup label{font-size:10px;color:#718569;flex:1}.setup select{display:block;width:100%;border:1px solid #c3d0b7;border-radius:9px;padding:9px 6px;background:#eef2e5;color:#38583d;margin-top:5px;font-size:12px}dialog{width:90%;max-width:460px;max-height:85dvh;border:1px solid #cad4bc;border-radius:21px;background:#f8f9ed;color:#355840;padding:25px;line-height:1.6}dialog::backdrop{background:#122c3b99}dialog h2{margin:0 0 13px;line-height:1.2}dialog p{font-size:13px}dialog>.primary{width:100%;margin-top:17px}.promotion{display:flex;gap:8px}.promotion button{border:1px solid #c0cdb2;background:#e2e9d8;border-radius:10px;width:25%;padding:8px;color:#315439}.promotion svg{width:100%;height:65px}.promotion small{display:block;font-size:9px}.note{font-size:10px!important;color:#83937c}button:focus-visible,select:focus-visible{outline:3px solid #d9b464;outline-offset:2px}@keyframes think{50%{opacity:.45}}@media(max-width:700px){header{padding:9px 10px;gap:10px}.brand span{display:none}.brand img{width:34px}.back{font-size:12px}.tools button{width:36px;height:36px}main{padding:10px 6px}.heading{padding:0 6px;margin-bottom:4px}h1{font-size:26px}.heading p{font-size:8px}.heading>button{padding:9px 14px}.chess-layout{display:flex;flex-direction:column;gap:5px}.play,aside{width:100%;margin:0}.board-wrap{border-width:4px}.playerbar{padding:6px}.playerbar strong{font-size:12px}.playerbar small{font-size:9px}.avatar{width:29px;height:29px}.coord{font-size:8px}.square.last{box-shadow:inset 0 0 0 3px #d0bc5888}aside{padding:10px 13px;border-radius:14px;display:grid;grid-template-columns:1fr;gap:8px}#status{min-height:0;margin:0;font-size:12px}.actions button{padding:9px 12px}.moves-panel{margin-top:0}.moves-panel .eyebrow{display:none}#history{max-height:80px;margin:0;font-size:11px;line-height:2}#history li{grid-template-columns:25px 1fr 1fr}#empty-history{margin:0;font-size:10px}.legend{display:none}.panel{padding:17px}.panel h2{font-size:23px}.mark{font-size:37px}.panel .eyebrow{display:none}.panel p:not(.eyebrow){font-size:12px}.setup{margin-top:10px}.panel .primary{margin-top:10px}.panel small{font-size:8px}.setup select{padding:7px 5px}}@media(max-height:500px) and (min-width:600px){header{padding:5px 14px}.brand img{width:30px}.brand small{display:none}.tools button{height:32px;width:33px}main{padding:5px 12px}.heading{margin-bottom:0}h1{font-size:19px}.heading p{display:none}.heading>button{padding:6px 12px}.chess-layout{display:grid;grid-template-columns:minmax(0,1fr) 240px;gap:18px;max-width:750px;margin:auto}.play{max-width:calc(100dvh - 153px);justify-self:center}.playerbar{padding:3px;gap:6px}.avatar{width:22px;height:22px;font-size:18px}.playerbar strong{font-size:10px}.playerbar small{font-size:8px;margin:2px 0}.board-wrap{border-width:3px}aside{padding:12px;margin-top:8px;display:block}#status{font-size:11px;min-height:35px;margin-bottom:9px}.actions button{font-size:10px;padding:7px}.moves-panel{margin-top:14px}#history{max-height:120px}.legend{display:none}.mark,.panel .eyebrow,.panel small{display:none}.panel{padding:12px}.panel h2{font-size:17px;margin:0}.panel p:not(.eyebrow){display:none}.setup{margin-top:5px;gap:5px}.setup label{font-size:8px}.setup select{font-size:9px;padding:4px}.panel .primary{padding:7px;font-size:10px;margin-top:9px}.coord{font-size:6px}}@media(prefers-reduced-motion:reduce){*{animation:none!important}}
