/* SPDX-License-Identifier: GPL-3.0-or-later */
:root{--bg:#f6f5f0;--paper:#fffefa;--ink:#283c34;--muted:#82877d;--green:#284f43;--line:#dedfd4;--wood:#ead7b6;--orange:#b96b46;--serif:"Yu Mincho","Hiragino Mincho ProN","Noto Serif CJK JP",serif;--sans:"Yu Gothic UI","Hiragino Kaku Gothic ProN",Meiryo,sans-serif}*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--ink);font-family:var(--sans);font-size:14px}button,input,select,textarea{font:inherit}button,a,input,select,textarea{-webkit-tap-highlight-color:transparent}button{cursor:pointer;border:0;color:inherit;background:none;transition:background .15s,box-shadow .15s}button:disabled{opacity:.35;cursor:not-allowed}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline:3px solid #8fae85;outline-offset:3px}button:hover:not(:disabled){filter:brightness(.96)}a{color:inherit;text-decoration:none}button,select{min-height:40px}button[hidden],[hidden]{display:none!important}.topbar{height:102px;border-bottom:1px solid var(--line);display:flex;align-items:center;gap:30px;padding:0 max(32px,calc((100vw - 1310px)/2))}.brand{display:flex;align-items:center;gap:13px;font:600 23px var(--serif);letter-spacing:2px;white-space:nowrap}.brand-icon{display:grid;place-items:center;width:42px;height:48px;background:var(--green);color:#fff;font-size:25px;clip-path:polygon(50% 0,95% 18%,100% 100%,0 100%,5% 18%)}.brand small{display:block;letter-spacing:2.2px;font:9px var(--sans);margin-top:6px}.tagline{margin-left:auto;font:13px var(--serif);letter-spacing:2px;color:#767e70}.topbar .quiet{margin-left:32px;font-size:12px}.topbar .quiet span{margin-left:12px}.layout{max-width:1310px;margin:0 auto;display:grid;grid-template-columns:230px minmax(360px,1fr) 270px;gap:58px;padding:50px 32px 55px}.eyebrow{font-size:9px;letter-spacing:2.2px;color:var(--muted)}h1{font:500 43px/1.6 var(--serif);letter-spacing:5px;margin:16px 0 18px}.intro{color:#7c8277;line-height:2.1;font-size:13px;letter-spacing:.6px;margin-bottom:30px}.mode-tabs{display:flex;border-bottom:1px solid var(--line);margin-bottom:22px}.mode-tabs button{font-size:12px;flex:1;padding:7px 1px 12px;color:var(--muted);border-bottom:2px solid transparent}.mode-tabs .active{border-color:var(--green);color:var(--green);font-weight:700}.settings label,.saved-layouts label,.file-section label,.editor-label{display:block;font-size:11px;color:#6f796c;margin-bottom:15px}select,input,textarea{width:100%;border:1px solid var(--line);border-radius:5px;background:var(--paper);padding:10px 11px;color:var(--ink);margin-top:7px;min-width:0}select{font-size:12px}textarea{font-family:monospace;font-size:11px;resize:vertical}.primary{background:var(--green);color:white;border-radius:5px;padding:13px 16px;font-size:12px;letter-spacing:.5px}.primary span{float:right}.wide{width:100%}.outline{border:1px solid var(--line);border-radius:5px;padding:9px 12px;background:var(--paper);font-size:12px}.quiet{font-size:12px;padding:8px 10px;color:#7a8175}.settings .wide+.wide{margin-top:10px}.engine-note{border-top:1px solid var(--line);margin-top:28px;padding-top:23px;display:flex;gap:10px;align-items:center}.dot{width:7px;height:7px;border-radius:50%;background:#b7b7a8}.dot.ready{background:#789572}.dot.error{background:#bb775b}.engine-note strong{font-size:11px;font-weight:500}.engine-note small{display:block;font-size:9px;letter-spacing:.6px;color:var(--muted);margin-top:4px}.free-note{font-size:10px;color:var(--muted);line-height:1.8;margin-top:25px}.free-note span{display:block;font-size:9px;margin-top:5px}.game-panel{min-width:0}.board-heading{display:flex;justify-content:space-between;align-items:center;margin-bottom:28px}.badge{font-size:9px;letter-spacing:1.9px;color:var(--orange)}h2{font:500 21px var(--serif);letter-spacing:1px;margin:9px 0 0}.icon-button{border:1px solid var(--line);border-radius:50%;width:36px;height:36px;min-height:36px;font-size:24px}.player-line{display:flex;align-items:center;gap:10px}.player-icon{font-size:20px;color:var(--green);width:32px;height:32px;background:#e6e9dd;border-radius:50%;display:grid;place-items:center}.player-line strong{font-size:12px;font-weight:600}.player-line small{display:block;font-size:9px;color:var(--muted);margin-top:2px}.turn-pill{margin-left:auto;font-size:10px;color:#62785b;background:#e7ecdf;padding:4px 10px;border-radius:3px}.hand{display:flex;gap:5px;align-items:center;min-height:48px;padding:6px 0;flex-wrap:wrap}.hand .no-hand{font-size:10px;color:#a0a494}.hand button{display:flex;align-items:center;justify-content:center;gap:5px;border:1px solid var(--line);min-height:34px;border-radius:4px;min-width:45px;background:var(--paper);padding:4px 8px}.hand .selected{background:#dbe5cf;border-color:#6e8969}.hand-char{font:20px var(--serif)}.hand .count{font-size:10px;color:var(--muted)}.board-frame{margin-right:0}.files{display:grid;grid-template-columns:repeat(5,1fr);margin:0 19px 8px 0;text-align:center;color:#999b8c;font-size:11px}.board-wrap{display:flex;align-items:stretch}.ranks{width:19px;flex-shrink:0;display:grid;grid-template-rows:repeat(5,1fr);text-align:right;color:#999b8c;font-size:11px}.ranks span{display:grid;place-items:center end}.board{display:grid;grid-template-columns:repeat(5,1fr);grid-template-rows:repeat(5,1fr);aspect-ratio:1;flex:1;min-width:0;background:var(--wood);border:2px solid #a98d67;box-shadow:0 7px 18px #553f2510}.cell{position:relative;display:flex;align-items:center;justify-content:center;border-right:1px solid #aa8a5d99;border-bottom:1px solid #aa8a5d99;min-width:0;min-height:0;padding:4px;background:linear-gradient(105deg,#fff1 40%,#b38a4310 60%,#fff1 80%);aspect-ratio:1}.cell:nth-child(5n){border-right:0}.cell:nth-child(n+21){border-bottom:0}.cell.last{background:#c4c89a88}.cell.selected{background:#a3b489}.cell.legal::after{content:"";position:absolute;width:13px;height:13px;background:#335d47a0;border-radius:50%;z-index:2}.cell.capture::after{width:80%;height:80%;background:transparent;border:2px solid #55764c;border-radius:50%}.cell.in-check{background:#d0947899}.piece{width:78%;height:86%;max-width:69px;position:relative;display:grid;place-items:center;background:linear-gradient(120deg,#fff1c8,#f1ce8e);clip-path:polygon(50% 0,89% 17%,100% 100%,0 100%,11% 17%);filter:drop-shadow(1px 2px 1px #77542033);font:bold clamp(22px,2.5vw,38px) var(--serif);color:#383025;line-height:1;padding-top:11%;user-select:none;pointer-events:none}.piece::before{content:"";position:absolute;inset:4px;border:1px solid #a67c4d55;clip-path:polygon(50% 0,89% 17%,100% 100%,0 100%,11% 17%)}.piece.enemy{transform:rotate(180deg)}.piece.promoted{color:#b14e37}.bottom-hand{padding-top:12px;min-height:54px}.bottom-player{margin-top:0}.status{margin-top:23px;min-height:45px;padding:13px 12px;text-align:center;color:#69765f;background:#eaece1;border-radius:4px;font-size:12px;line-height:1.65}.status.warning{background:#f2e5d8;color:#a2643e}.status.result{background:#284f43;color:#fff}.game-actions{display:flex;justify-content:center;gap:8px;flex-wrap:wrap;margin-top:15px}.game-actions button{font-size:11px;min-height:36px;padding:8px 12px}.board-caption{font-size:10px;color:#969b8b;text-align:center;line-height:1.8;margin:14px 0}.section-label{display:flex;align-items:center;justify-content:space-between;padding:8px 0 18px;border-bottom:1px solid var(--line)}.section-label h2{font:600 13px var(--sans);letter-spacing:.8px;margin:0}.section-label>span{font-size:10px;color:var(--muted)}.history{margin:0;padding:0;list-style:none;height:295px;overflow:auto}.history li:not(.empty-history){display:flex;align-items:center;border-bottom:1px solid #e5e5db;padding:11px 7px;font-size:12px}.history li:not(.empty-history) span{font-size:10px;width:32px;color:var(--muted)}.history li:last-child:not(.empty-history){background:#e9eddf}.empty-history{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;font-size:11px;color:#909684}.empty-mark{font:34px var(--serif);color:#c6cbbc;letter-spacing:4px;margin-bottom:18px}.empty-history small{font-size:9px;color:#a3a795;margin-top:10px}.tip-card{margin-top:25px;padding:24px 19px;background:#ecede4;border-radius:5px}.tip-card .eyebrow{font-size:9px;color:#8d967d}.tip-card h3{font:500 14px/1.9 var(--serif);margin:13px 0}.tip-card p{font-size:11px;color:#848c79;line-height:2}.text-link{font-size:10px;padding:8px 0;color:var(--green);margin-top:6px}.file-section{margin-top:28px;border-top:1px solid var(--line);padding-top:17px;color:#7c8573;font-size:11px}.file-section summary{cursor:pointer;padding:5px 0}.file-section p{font-size:10px;line-height:1.8}.file-section label{margin-top:15px}.editor-row{display:flex;gap:8px;margin-bottom:12px}.editor-row>*{flex:1}.editor-intro{font-size:11px;color:#8b917f;line-height:1.9;margin:15px 0}.editor-tools{display:flex;gap:8px;margin-bottom:17px}.editor-tools button{flex:1;border:1px solid var(--line);border-radius:5px;font-size:11px}.editor-tools .active,.palette .active{border-color:#6c8560;background:#dce5d1}.palette{display:grid;grid-template-columns:repeat(5,1fr);gap:6px;margin-bottom:20px}.palette button{border:1px solid var(--line);border-radius:4px;background:var(--paper);font:24px var(--serif);padding:7px 0;min-height:45px}.palette button.promoted{color:#af6245}.hand-editor{font-size:11px;color:#78816b;margin-bottom:20px}.hand-editor summary{cursor:pointer;padding:5px 0 10px}.hand-editor .hand-row{display:grid;grid-template-columns:30px repeat(5,1fr);gap:5px;align-items:center;margin-top:9px}.hand-row input{font-size:12px;padding:6px 2px;margin:0;text-align:center;min-width:0}.hand-row label{font:14px var(--serif);text-align:center}.hand-row label input{display:block;margin-top:5px;width:100%;font-family:var(--sans)}.validation{font-size:11px;line-height:1.8;white-space:pre-line;margin-top:12px;color:#a25d3f}.validation.success{color:#627c56}.saved-layouts{border-top:1px solid var(--line);padding-top:20px;margin-top:20px}.saved-layouts button.wide{margin-bottom:15px}footer{max-width:1246px;margin:0 auto;border-top:1px solid var(--line);padding:22px 0 30px;display:flex;justify-content:space-between;font-size:10px;color:#959b8b;gap:15px}footer>div{display:flex;gap:24px}.footer-cross{padding:0 8px;color:#bec1b4}dialog{border:1px solid var(--line);border-radius:12px;padding:35px;background:var(--paper);color:var(--ink);max-width:540px;width:calc(100% - 32px);max-height:85vh;overflow:auto;box-shadow:0 15px 80px #122a3330}dialog::backdrop{background:#26372c66;backdrop-filter:blur(3px)}dialog h2{font-size:25px;margin:12px 0 20px}dialog p,dialog li{font-size:13px;line-height:2;color:#747e68}.dialog-actions{display:flex;gap:10px;margin-top:25px}.close-dialog{position:absolute;right:15px;top:10px;font-size:24px}.toast{position:fixed;bottom:30px;left:50%;transform:translateX(-50%);background:#284f43;color:white;padding:14px 25px;border-radius:6px;font-size:12px;box-shadow:0 5px 25px #26382826;z-index:10;max-width:90vw}.busy .dot{animation:pulse 1.2s infinite}@keyframes pulse{50%{opacity:.3}}@media(min-width:1500px){.layout{gap:70px}}@media(max-width:1150px){.layout{gap:28px;grid-template-columns:195px minmax(320px,1fr) 230px;padding-left:25px;padding-right:25px}.topbar{padding:0 25px}.piece{font-size:31px}footer{margin:0 25px}.tagline{display:none}}@media(max-width:900px){.layout{grid-template-columns:185px minmax(300px,1fr);max-width:760px;gap:35px}.right-panel{grid-column:1/-1;display:grid;grid-template-columns:1fr 1fr;gap:30px}.right-panel>section{grid-column:1}.file-section{grid-column:2;margin-top:0}.history{height:240px}.tip-card{display:none}.piece{font-size:34px}footer{font-size:9px}footer>div{gap:10px}}@media(max-width:600px){.topbar{height:78px;padding:0 20px;gap:5px}.brand{font-size:20px;letter-spacing:1px;gap:10px}.brand-icon{width:33px;height:39px;font-size:21px}.brand small{font-size:7px;letter-spacing:1.5px}.topbar .quiet{margin-left:auto;padding:4px;font-size:10px}.topbar .quiet span{display:none}.layout{display:flex;flex-direction:column;padding:25px 20px 35px;gap:28px;max-width:480px}.left-panel{display:contents}.left-panel>.eyebrow,.left-panel>h1,.intro,.free-note{display:none}.mode-tabs{order:0;margin:0}.settings{order:1;display:grid;grid-template-columns:1fr 1fr;gap:8px 12px}.settings>label{grid-column:1}.settings label{margin:0}.settings #cpuSettings{display:contents}.settings #cpuSettings label:first-child{grid-column:2;grid-row:1}.settings #cpuSettings label:last-child{grid-column:1;grid-row:2}.settings .primary{grid-column:2;grid-row:2;align-self:end;height:40px;padding:10px;font-size:11px}.settings #resumeBtn{grid-column:1/-1;margin-top:3px}.settings.local .primary{grid-column:2;grid-row:1}.settings select{padding:8px 6px;font-size:11px}.game-panel{order:2}.board-heading{margin-bottom:20px}.board-heading h2{font-size:19px}.badge{font-size:8px}.piece{font-size:clamp(25px,8.1vw,38px)}.hand{min-height:40px}.bottom-hand{min-height:46px}.player-line small{font-size:9px}.status{margin-top:20px}.right-panel{order:3;display:block}.engine-note{order:4;margin:0;padding-top:20px}.right-panel .file-section{margin-top:23px}.history{height:180px}.right-panel:has(#editorPanel:not([hidden])){order:2}.game-panel.editing{order:1}.palette{grid-template-columns:repeat(5,1fr);gap:6px}.palette button{font-size:20px;min-height:40px}.editor-tools{margin-bottom:14px}.editor-label{display:inline-block;width:48%;margin-right:1%}.hand-editor .hand-row{grid-template-columns:30px repeat(5,1fr)}.saved-layouts{margin-top:16px}.history li:not(.empty-history){padding:10px}.game-actions{gap:6px}.board-caption{margin-bottom:0}.status{font-size:11px}footer{margin:0 20px;display:block;font-size:9px;line-height:1.9}footer>div{display:flex;justify-content:space-between;margin-top:10px;gap:10px}.dialog-actions{flex-wrap:wrap}dialog{padding:26px}.toast{width:max-content;text-align:center}.player-icon{width:29px;height:29px}.engine-note small{font-size:9px}}
