/* Weigh by Luke Steuber. */
@font-face{font-family:"Plex Mono";src:url("fonts/IBMPlexMono-500.woff2") format("woff2");font-weight:500;font-display:swap}
@font-face{font-family:"Plex Sans";src:url("fonts/IBMPlexSans-400.woff2") format("woff2");font-weight:400;font-display:swap}
:root{color-scheme:dark;--bg:#000;--ink:#fff;--text:#ededed;--sub:#a6a6a6;--line:#2f2f2f;--frame:#ededed;--scrim:rgba(0,0,0,.8);--mono:"Plex Mono",monospace;--sans:"Plex Sans",sans-serif}
:root[data-theme=light]{color-scheme:light;--bg:#fff;--ink:#000;--text:#161616;--sub:#606060;--line:#d0d0d0;--frame:#161616;--scrim:rgba(255,255,255,.8)}
@media(prefers-color-scheme:light){:root[data-theme=system]{color-scheme:light;--bg:#fff;--ink:#000;--text:#161616;--sub:#606060;--line:#d0d0d0;--frame:#161616;--scrim:rgba(255,255,255,.8)}}
*{box-sizing:border-box}body{margin:0;height:100dvh;overflow:hidden;background:var(--bg);color:var(--text);font:16px/1.45 var(--sans);-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:transparent}
button,select,input{font:inherit;color:inherit}button{cursor:pointer}button:disabled{opacity:.35;cursor:default}button:focus-visible,select:focus-visible,input:focus-visible,summary:focus-visible,a:focus-visible{outline:2px solid var(--ink);outline-offset:2px}
.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}.readout{position:fixed;top:calc(max(0px,env(safe-area-inset-top)) + 18px);left:50%;transform:translateX(-50%);font:500 13px/1 var(--mono);letter-spacing:.02em;color:var(--sub);white-space:nowrap}#restart-btn{position:fixed;top:max(2px,env(safe-area-inset-top));left:8px}
#board-shell{position:absolute;inset:58px 12px calc(100px + var(--safe-lift)) 12px;display:flex;overflow:auto;overscroll-behavior:contain;padding:5px;scrollbar-width:thin}.board-stage{flex:none;margin:auto;display:flex;flex-direction:column;align-items:center;gap:8px}.board{position:relative;width:min(520px,calc(100vw - 34px));flex:none;color:var(--ink);user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;touch-action:none}
#balance{position:absolute;top:0;left:0;width:100%}#balance-lines{width:100%;height:100%;overflow:visible;fill:none;stroke:currentColor;stroke-width:1;stroke-linecap:round;stroke-linejoin:round}.support{fill:var(--bg)}#direction.heavy{fill:var(--ink);stroke:none}#direction.unknown{fill:none}#beam,#left-lines,#right-lines{transition:transform 300ms ease;transform-box:view-box}#beam{transform-origin:50% 45px}
.pan,#table{position:absolute;background:none;border:0;color:inherit;min-height:44px;min-width:44px;padding:0}.pan{transition:transform 300ms ease}.pan:focus-visible,#table:focus-visible{outline-offset:-2px}.pan.placing,#table.placing{outline:1px dashed var(--sub);outline-offset:-2px}#table{left:0;width:100%;border-top:1px solid var(--line)}
.stone{position:absolute;left:0;top:0;width:44px;height:44px;padding:0;display:grid;place-items:center;background:none;border:0;color:var(--ink);touch-action:none;transition:transform 300ms ease;z-index:2}.stone::before{content:'';width:20px;height:20px;border:1px solid currentColor;border-radius:50%;background:currentColor}.stone.eliminated::before,.stone.found::before{background:var(--bg)}.stone.found::after{content:'';position:absolute;width:6px;height:6px;background:currentColor;border-radius:50%}.stone.held::before{outline:1px solid var(--sub);outline-offset:5px}.stone.bump::before{outline:1px solid currentColor;outline-offset:5px;animation:bump 360ms ease}.stone.dragging{transition:none;z-index:4;pointer-events:none}.stone:focus-visible{border-radius:50%;outline-offset:-3px}
#ghosts{pointer-events:none}.ghost{position:absolute;width:44px;height:44px;display:grid;place-items:center;z-index:3}.ghost::before{content:'';width:26px;height:26px;border:1px dashed var(--ink);border-radius:50%;background:var(--bg)}
#weigh-btn{position:absolute;left:calc(50% - 24px)}#memory{position:absolute;left:0;width:100%;display:flex;align-items:center;justify-content:center;gap:16px;min-height:34px}#history{display:flex;gap:8px;overflow:auto;max-width:75%;padding:5px 2px}#history svg{width:54px;height:38px;flex:none;fill:var(--ink);stroke:var(--ink);stroke-width:1}#history .mini-beam{fill:none}#pips{display:flex;gap:5px;flex-wrap:wrap;max-width:64px}#pips span{width:6px;height:6px;flex:none;border:1px solid var(--sub);border-radius:50%}#pips .used{background:var(--sub)}
/* Safe area: the toolbar stands max(6px, inset) from the bottom, so the hint line and the board above it rise with it by --safe-lift (0px without an inset; until 2026-11-21 a long hint ran into the toolbar on an iPhone). */
:root{--safe-lift:calc(max(6px,env(safe-area-inset-bottom)) - 6px);--safe-side:0px}
#feedback{position:fixed;bottom:calc(64px + var(--safe-lift));left:16px;right:16px;margin:0;text-align:center;color:var(--sub);font:14px/1.3 var(--sans);pointer-events:none}.toolbar{position:fixed;bottom:max(6px,env(safe-area-inset-bottom));left:8px;right:8px;display:flex;justify-content:space-between}.toolbar>div{display:flex}.ib{display:inline-grid;place-items:center;width:48px;height:48px;min-width:48px;min-height:48px;border:0;background:none;padding:12px;color:var(--ink);transition:opacity .15s,transform .1s}.ib svg{width:24px;height:24px;stroke:currentColor;fill:none;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}.ib:active{transform:scale(.94)}
.completion{display:flex;flex-direction:column;align-items:center;animation:next-reveal .3s both}.completion>div{display:flex}.completion[hidden],[hidden]{display:none!important}.milestone{margin:0;color:var(--sub);font:14px/1.3 var(--sans);text-align:center}
.sheet{width:min(32rem,calc(100vw - 16px));max-height:calc(100dvh - 16px);border:1px solid var(--frame);padding:0;background:var(--bg);color:var(--text)}.sheet[open]{display:flex;flex-direction:column}.sheet::backdrop{background:var(--scrim)}.sheet-head{display:flex;justify-content:space-between;align-items:center;padding:0 10px 0 24px;flex:none;border-bottom:1px solid var(--line)}h2{font:500 16px/1 var(--mono)}.sheet-head form{margin:0}.sheet-body{padding:20px 24px;overflow:auto;min-height:0}.sheet-body p:first-child{margin-top:0}.sheet-body p{max-width:60ch}.row{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:52px;border-bottom:1px solid var(--line)}.row select{max-width:65%;min-height:44px;background:var(--bg);border:0;padding:4px 8px}.row button{min-height:44px;background:none;border:0;padding:8px}.row button:not(:disabled){text-decoration:underline;text-underline-offset:4px}.quiet{color:var(--sub);font:13px/1.4 var(--mono);overflow-wrap:anywhere}.sheet-foot{padding:12px 24px;border-top:1px solid var(--line);flex:none;color:var(--sub);font-size:14px}.sheet-foot a{color:inherit}.text-action{min-height:44px;background:none;border:0;padding:6px 0;text-align:left;text-decoration:underline;text-underline-offset:4px}.help-more summary{min-height:44px;cursor:pointer;display:flex;align-items:center}.help-more summary::before{content:'+';margin-right:10px}.help-more[open] summary::before{content:'−'}.help-more{border-top:1px solid var(--line)}#settings-feedback{overflow-wrap:anywhere}#settings-feedback input{width:100%;min-height:44px;background:var(--bg);border:1px solid var(--sub);padding:8px;user-select:text}
@keyframes bump{50%{outline-offset:8px}}@keyframes next-reveal{from{opacity:0;transform:translateY(4px)}to{opacity:1;transform:translateY(0)}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important}}:root[data-motion=reduce] *,:root[data-motion=reduce] *::before,:root[data-motion=reduce] *::after{animation:none!important;transition:none!important}
@media(forced-colors:active){:root,:root[data-theme]{--bg:Canvas;--ink:CanvasText;--text:CanvasText;--sub:CanvasText;--line:GrayText;--frame:CanvasText}.stone,.ghost,#balance-lines,#history svg,#pips span{forced-color-adjust:none}.sheet{border-color:CanvasText}}

.board:not(.ready) .stone{transition:none}

/* Double-tap zoom: touch-action is intersected across every ancestor, so
   manipulation on the root stops double-tap zoom page-wide (readouts, gaps
   between controls, sheet backdrops) while pinch zoom still works. */
html, body { touch-action: manipulation; }
