:root{color-scheme:dark;font-family:system-ui,-apple-system,"Segoe UI",sans-serif;background:#111b1c;color:#f5efdf;--gold:#dbb576;--muted:#a9b5ac}
*{box-sizing:border-box}body{margin:0;min-height:100vh;background:radial-gradient(ellipse at 22% 0%,#345148 0%,transparent 50%),linear-gradient(135deg,#192d29,#10191c 70%);overflow-x:hidden}
body:before{content:"";position:fixed;inset:0;pointer-events:none;opacity:.12;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='800' height='550' viewBox='0 0 800 550'%3E%3Cpath d='M0 550L180 170L280 330L440 60L700 550M180 170L230 300L280 330M440 60L400 240L465 208L500 310' fill='none' stroke='%23d5c29e' stroke-width='1'/%3E%3C/svg%3E");background-position:left bottom;background-size:cover}
main{max-width:1170px;margin:auto;padding:22px 26px;position:relative}header{display:flex;align-items:center;gap:18px;margin:0 0 18px;padding:0 0 16px;border-bottom:1px solid #d1bd8c28}header .brand-mark{width:52px;height:52px;flex:none;border:1px solid #b49b5b66;border-radius:50%;display:grid;place-items:center;color:var(--gold);background:#162522}header .brand-mark svg{width:31px;height:31px}small{font-size:10px;letter-spacing:2.2px;color:#c9b991;font-weight:650}h1{font:38px/1.12 Georgia,"Times New Roman",serif;font-weight:400;letter-spacing:-.8px;margin:5px 0 6px}h1 span{display:none}header p{font-size:12px;margin:0;color:#bcc7b9}header .edition{margin-left:auto;text-transform:uppercase;letter-spacing:2px;border:1px solid #bba06c55;padding:10px 15px;border-radius:25px;font-size:9px;color:#dbc79e}
.layout{display:grid;grid-template-columns:minmax(0,660px) minmax(260px,1fr);gap:28px;align-items:start}.table{min-width:0}.player{display:flex;align-items:center;justify-content:space-between;gap:10px;min-height:29px;padding:3px 6px;font-size:11px;color:#d1d8cd;letter-spacing:.2px}.player span:first-child{font-weight:650}.player span:last-child{color:#c1b99f;font-size:10px}#board{display:grid;grid-template-columns:repeat(8,minmax(0,1fr));border:12px solid #493627;border-radius:7px;aspect-ratio:1;position:relative;background:#453123;box-shadow:0 1px 0 1px #b9945a,0 6px 0 #32241d,0 8px 0 1px #8c6b3e,0 14px 0 #1c1b17,0 20px 28px #0008,inset 0 0 0 2px #dcbb78;touch-action:none;user-select:none;-webkit-user-select:none;margin:3px 0 18px}
.square{position:relative;min-width:0;width:100%;border:0;border-radius:0;padding:0;aspect-ratio:1;display:grid;place-items:center;overflow:visible;cursor:pointer;color:#26362b;background-color:#d8c7a3;background-image:repeating-linear-gradient(92deg,#71562a0a 0px,#71562a0a 1px,transparent 1px,transparent 9px),linear-gradient(125deg,#f3dfb7bb,#bda78322);box-shadow:inset 0 0 0 .5px #4c422b2b;touch-action:none}
.square.dark{background-color:#56705f;background-image:repeating-linear-gradient(92deg,#0f281a12 0px,#0f281a12 1px,transparent 1px,transparent 9px),linear-gradient(130deg,#728c6a66,#153c2a55);color:#f0dcb0}
.square:hover{filter:brightness(1.08)}.square.selected{background-color:#d9b759;background-image:linear-gradient(120deg,#ffdb8e70,#c08b2560);box-shadow:inset 0 0 0 2px #f6dc98;z-index:2}.square.last{box-shadow:inset 0 0 0 3px #ead28b80;background-color:#b9ae6d}.square.dark.last{background-color:#8b914c}.square.hint{box-shadow:inset 0 0 0 3px #ffd56c;background-color:#bea356}.square.check{background-color:#ad6155;background-image:radial-gradient(ellipse,#db7158,#723f39)}.square:focus-visible{outline:3px solid #fff1b9;outline-offset:-4px;z-index:4}.square.legal:after{content:"";position:absolute;width:21%;height:21%;border-radius:50%;background:#193d32a6;box-shadow:0 0 0 2px #e0dab044;pointer-events:none;z-index:3}.square.capture:after{width:86%;height:86%;background:none;border:3px solid #e2c17d;box-shadow:0 0 0 1px #3b2e22}.square.drop-target{outline:3px solid #ffe3a0;outline-offset:-4px;z-index:3}
.piece{pointer-events:none;position:absolute;width:108%;height:128%;bottom:0;left:-4%;object-fit:contain;object-position:center bottom;filter:drop-shadow(3px 5px 2px #10251b66);z-index:1;user-select:none;-webkit-user-drag:none}.square.selected .piece{filter:drop-shadow(3px 9px 3px #10251b88);translate:0 -4px}.coord{pointer-events:none;position:absolute;bottom:3px;right:4px;font:9px system-ui;opacity:.8;z-index:3}.rank{top:3px;left:4px;bottom:auto;right:auto}#board.dragging,#board.dragging .square{cursor:grabbing}
aside{background:linear-gradient(160deg,#243932e8,#162623f2);border:1px solid #bdac7850;border-radius:10px;box-shadow:0 12px 35px #0002;padding:24px;display:flex;flex-direction:column;margin-top:31px;min-height:560px}
.status{min-height:114px;border-bottom:1px solid #b3a67b30;margin-bottom:8px}h2{font:27px/1.2 Georgia,serif;margin:11px 0;color:#fff1cf}.status p,.help{font-size:11px;line-height:1.7;color:#b9c4b5}.status p{margin:7px 0 16px}label{font-size:10px;letter-spacing:1px;text-transform:uppercase;color:#d5d8c9;margin:15px 0 8px}select,button{font:inherit}select{width:100%;padding:12px 11px;background:#142822;color:#f3ead6;border:1px solid #75826688;border-radius:5px;font-size:12px;cursor:pointer}.actions{display:grid;grid-template-columns:1fr 1fr;gap:9px;margin-top:21px}.actions button,#choices button{padding:12px 6px;background:#2c4438;border:1px solid #8d9d7155;color:#efe5c9;border-radius:5px;cursor:pointer;font-size:12px}.actions button:hover{border-color:#dfbd77}.actions #hint{background:linear-gradient(135deg,#e9cc94,#c39b57);border-color:#e7c788;color:#263526;font-weight:650}button:disabled{opacity:.4;cursor:default}.help{margin:17px 0}.history{border-top:1px solid #b3a67b30;padding-top:16px;margin-top:0}#moves{font-size:12px;font-variant-numeric:tabular-nums;line-height:1.9;max-height:80px;overflow:auto;padding-left:30px;margin:8px 0;color:#dce3d5}footer{font-size:9px;color:#9eae9d;margin-top:auto;padding-top:18px}a{color:#d9c18c}dialog{background:#1b332a;color:#fff0cc;border:1px solid #bda577;border-radius:10px;max-width:95vw}dialog::backdrop{background:#0a1516b8;backdrop-filter:blur(4px)}#choices{display:flex;gap:8px}#choices button{width:70px;height:95px;position:relative;background:#56705f}#choices img{width:100%;height:100%;object-fit:contain;pointer-events:none}
@media(max-width:700px){main{padding:14px}header{gap:12px;margin-bottom:13px;padding-bottom:13px}.brand-mark{width:42px!important;height:42px!important}h1{font-size:29px}header small{font-size:8px;letter-spacing:1.6px}header p{font-size:10px}.edition{display:none}.layout{grid-template-columns:1fr;gap:6px}#board{border-width:8px;margin-bottom:15px}.player{font-size:10px;min-height:27px}.player span:last-child{font-size:9px}.coord{font-size:8px;bottom:2px;right:2px}.rank{top:2px;left:2px;bottom:auto;right:auto}.piece{width:106%;left:-3%;height:126%}aside{padding:18px;margin-top:6px;min-height:0}.status{min-height:90px}.actions{margin-top:16px}footer{padding-top:13px}}
@media(max-height:500px) and (min-width:700px){main{padding:8px 16px}header{display:none}.layout{grid-template-columns:minmax(230px,340px) 1fr;gap:24px}.player{min-height:21px}#board{border-width:8px;margin-bottom:12px}aside{margin-top:24px;padding:13px;min-height:0}.status{min-height:60px;margin-bottom:3px}h2{font-size:22px;margin:4px 0}.status p{margin:4px 0 8px}.help,.history,footer{display:none}label{margin:8px 0 4px}select{padding:8px}.actions{margin-top:10px}.actions button{padding:9px 6px}}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important}}
