:root{color-scheme:dark;--bg:#111b21;--panel:#19282e;--ink:#f4ecdb;--muted:#a5b0ae;--gold:#dbb585;--line:#34464a;font:15px system-ui,-apple-system,sans-serif}*{box-sizing:border-box}html,body{margin:0;width:100%;height:100%;overflow:hidden;background:#0d161b;color:var(--ink);overscroll-behavior:none}button,input{font:inherit}button{min-height:44px;cursor:pointer;border:1px solid var(--line);background:#24363b;color:var(--ink);border-radius:10px;font-weight:650;touch-action:manipulation}button:disabled{opacity:.45;cursor:default}button:focus-visible,input:focus-visible,.point:focus-visible{outline:2px solid var(--gold);outline-offset:3px}[hidden]{display:none!important}h1,h2,p{margin:0}small{color:var(--muted);font-size:11px}.app{height:var(--vh,100dvh);max-width:660px;width:100%;margin:auto;display:grid;grid-template-rows:60px 66px auto minmax(0,1fr) auto;gap:8px;padding:env(safe-area-inset-top) 16px env(safe-area-inset-bottom);background:radial-gradient(ellipse at 50% 48%,#203339,#111b21 70%);position:relative;overflow:hidden}header{display:flex;align-items:center;gap:8px}.brand{display:flex;gap:10px;align-items:center;flex:1}.brand img{width:39px;height:39px}.brand h1{font-size:21px;letter-spacing:3px;line-height:1}.brand h1 span{color:var(--gold)}.brand small{font-size:8px;letter-spacing:1.4px}.icon{width:44px;height:44px;min-width:44px;font-size:22px;padding:0;background:transparent}.players{display:grid;grid-template-columns:1fr 24px 1fr;align-items:center;gap:5px}.player{display:flex;align-items:center;gap:8px;padding:8px;border:1px solid var(--line);border-radius:12px;background:#19292e;min-width:0;min-height:60px}.player.current{border-color:#c7a77d;box-shadow:inset 0 0 15px #dcb68712}.player>div{flex:1;min-width:0}.player b{display:block;font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.player small{font-size:10px;display:block;margin-top:3px}.player strong{font-size:18px;font-variant-numeric:tabular-nums}.piece{width:27px;height:27px;border-radius:50%;flex:none;box-shadow:0 3px 4px #0007,inset 0 -3px 4px #0004}.ivory{background:radial-gradient(circle at 33% 25%,#fff8df,#b5a480)}.copper{background:radial-gradient(circle at 33% 25%,#e9aa7c,#88472f)}.versus{text-align:center;font-size:9px;color:var(--muted);font-weight:700}.turn{text-align:center;min-height:65px}.turn>span{font-size:9px;color:var(--gold);letter-spacing:2px;font-weight:700}.turn h2{font-size:23px;letter-spacing:-.6px;line-height:1.2;margin-top:2px}.turn p{font-size:12px;color:var(--muted);line-height:1.4;margin-top:3px}.board-wrap{display:grid;place-items:center;min-height:0;min-width:0;overflow:hidden}#board{display:block;width:100%;height:100%;max-width:540px;max-height:540px;overflow:visible}.lines{stroke:#a4a58c;stroke-width:2.2}.point{cursor:pointer;outline:none}.point .hit{fill:transparent}.point .dot{fill:#7f9189;stroke:#203137;stroke-width:1.5}.point .legal{fill:#e3c293;opacity:.9}.point .disc{filter:url(#shadow);stroke:#191f22;stroke-width:1}.point .ring{fill:none;stroke:#f8dba1;stroke-width:2.7}.point .target{fill:none;stroke:#ed9579;stroke-width:2.5;stroke-dasharray:3 3}.point:focus-visible .hit{stroke:#fff;stroke-width:2;fill:none}.point .shine{fill:none;stroke:#fff;stroke-opacity:.19;stroke-width:1.5}.mill-line{stroke:#d9bc8b;stroke-opacity:.6;stroke-width:5;stroke-linecap:round}.mode{display:flex;align-items:center;gap:6px;color:var(--muted);font-size:10px;letter-spacing:.6px;padding:5px 2px 8px}.mode i{width:7px;height:7px;border-radius:50%;background:#9cc8aa}.mode #moves{margin-left:auto;letter-spacing:0}.actions{display:grid;grid-template-columns:1fr 1.3fr;gap:9px}.actions button{min-height:51px;font-size:15px}.primary{background:#d9b487!important;color:#202b2e!important;border-color:#e9c69b!important}.primary span{float:right;margin-right:4px}.version{display:block;text-align:center;font-size:9px;padding:7px 0;color:#829391}.overlay{position:absolute;inset:0;z-index:5;background:#081216d9;display:grid;place-items:center;padding:16px}.dialog{background:#1b2b32;border:1px solid #52615d;border-radius:17px;padding:18px;width:100%;max-width:430px;max-height:100%;overflow:auto;box-shadow:0 16px 60px #0009}.dialog-head{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:14px}.dialog h2{font-size:23px}.dialog p{line-height:1.55;color:#cad3ce;margin-bottom:12px;font-size:14px}.wide{display:block;width:100%;text-align:left;padding:11px 14px;margin:8px 0;min-height:46px}.wide span{float:right}.dialog label{display:block;font-size:12px;color:#bec9c3;margin:10px 0 4px}.dialog input{width:100%;min-height:44px;background:#111e25;color:var(--ink);border:1px solid #4b5f62;padding:8px;border-radius:8px;font-size:14px}.dialog .note{font-size:11px;color:var(--muted)}#toast{position:absolute;bottom:90px;left:50%;transform:translateX(-50%);z-index:8;background:#e2ccaa;color:#243233;padding:9px 15px;max-width:90%;border-radius:9px;font-size:13px;text-align:center;box-shadow:0 3px 20px #0008}@media(max-height:680px){.app{grid-template-rows:48px 54px auto minmax(0,1fr) auto;gap:4px;padding-inline:11px}.player{min-height:50px;padding:5px}.turn{min-height:52px}.turn h2{font-size:19px}.turn p{font-size:11px}.actions button{min-height:44px}.version{padding:3px 0}.mode{padding:3px 0}}@media(orientation:landscape) and (max-height:520px){.app{max-width:860px;grid-template-columns:minmax(0,1fr) 280px;grid-template-rows:46px 60px minmax(0,1fr) auto;gap:6px}.app header{grid-column:1/-1}.players{grid-column:2;grid-row:2}.turn{grid-column:2;grid-row:3;align-self:center}.board-wrap{grid-column:1;grid-row:2/5}.app footer{grid-column:2;grid-row:4}}
#board{touch-action:manipulation;user-select:none}.point{cursor:default}.point.interactive{cursor:pointer}.point .destination{fill:#dbb58520;stroke:#dbb58599;stroke-width:1.5}.point .legal{fill:#ffe0a5}.point .movable{fill:none;stroke:#e1c28e;stroke-width:1.2;stroke-dasharray:3 3;opacity:.6}.point .last-ring{fill:none;stroke:#d8c5a0;stroke-width:1.5;opacity:.8}.point .target{stroke:#ffae8d;stroke-width:2.8;animation:pulse 1.1s infinite}.new-mill{stroke:#f5cf8e;stroke-opacity:1;animation:mill-glow .65s ease-out}.motion-piece .disc{filter:url(#shadow);stroke:#172126;stroke-width:1.2}.motion-piece .shine{fill:none;stroke:white;stroke-opacity:.23;stroke-width:1.5}.turn p{min-height:16px}.player.current{background:#263932;border-color:#dbb585}.dialog select{width:100%;min-height:44px;background:#111e25;color:#f4ecdb;border:1px solid #4b5f62;border-radius:8px;padding:8px;font:inherit}@keyframes pulse{50%{stroke-opacity:.4}}@keyframes mill-glow{from{stroke-width:11}to{stroke-width:5}}@media(prefers-reduced-motion:reduce){.point .target,.new-mill{animation:none}}@media(max-width:360px){.brand img{width:29px;height:29px}.brand h1{font-size:17px;letter-spacing:2px}.brand small{font-size:7px}.brand{gap:5px}.app header{gap:4px}}
/* Full-viewport shell: use the layout viewport, not visualViewport.height.
   Safe areas belong INSIDE the shell; its background extends behind them. */
html,body{background:#111b21;min-height:100%;margin:0;-webkit-text-size-adjust:100%}
body{position:fixed;inset:0;width:100%;height:100%;height:100dvh}
.app{position:fixed;inset:0;margin:0 auto;width:100%;height:auto;min-height:0;max-height:none;box-sizing:border-box;padding-top:env(safe-area-inset-top,0px);padding-bottom:max(8px,env(safe-area-inset-bottom,0px));grid-template-rows:60px 66px auto minmax(0,1fr) auto}
footer{min-width:0;align-self:end}.version{padding:5px 0 0}
.board-wrap{container-type:size}
@supports(width:1cqw){#board{width:min(100cqw,100cqh,540px);height:min(100cqw,100cqh,540px);max-width:100%;max-height:100%}}
@media(max-width:660px){.app{max-width:none;padding-inline:12px;gap:7px}.board-wrap{margin-inline:-2px}footer{padding-bottom:0}.actions button{min-height:50px}}
@media(max-height:680px){.app{grid-template-rows:48px 54px auto minmax(0,1fr) auto;gap:4px}.actions button{min-height:44px}}
@media(orientation:landscape) and (max-height:520px){.app{max-width:860px;grid-template-rows:46px 60px minmax(0,1fr) auto;padding-left:max(11px,env(safe-area-inset-left,0px));padding-right:max(11px,env(safe-area-inset-right,0px));grid-template-columns:minmax(0,1fr) 280px}}
@media(display-mode:standalone){html,body{background:#111b21}.app{inset:0;min-height:100dvh}}
.update-banner{position:absolute;top:max(7px,env(safe-area-inset-top,0px));left:50%;transform:translateX(-50%);z-index:10;max-width:95%;white-space:nowrap;padding:5px 12px;background:#d9b487;color:#202b2e;border-color:#e9c69b;font-size:12px;box-shadow:0 3px 20px #0008}

/* Match tools stay outside the playing surface. */
.history-button,.text-button{font-size:11px;min-height:28px;padding:3px 6px;background:transparent;border:0;color:#b9c5bf;font-weight:600;letter-spacing:0}.history-button{margin-left:auto}.text-button{color:#d7b88f}.footer-meta{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:0 2px}.footer-meta .version{padding:0}.draw-info{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-bottom:12px}.draw-info>div{border:1px solid #40535a;background:#14252c;border-radius:10px;padding:10px}.draw-info small{font-size:9px;letter-spacing:.5px;display:block}.draw-info b{display:block;font-size:16px;color:#e9c79b;margin-top:5px}.move-log{padding:0;list-style:none;max-height:40vh;overflow:auto;margin:0}.move-log li{padding:9px 4px;border-bottom:1px solid #34484e;font-size:13px;color:#e0e5db}.point .destination{stroke-width:1.1;fill:#dbb58512}.turn h2{font-size:clamp(19px,5.2vw,25px)}.turn p{max-width:95%;margin-inline:auto}.player.current{box-shadow:inset 0 0 14px #dbb58516}.mode{padding:0 2px 4px}.actions button:active{transform:scale(.98)}.point.interactive:active .hit{fill:#fff1ce14}@media(max-height:680px){.footer-meta .text-button{min-height:22px;font-size:10px}.history-button{min-height:22px}.turn h2{font-size:19px}}
