@font-face{font-family:Plex Mono;src:url('./fonts/IBMPlexMono-500.woff2')}@font-face{font-family:Plex Sans;src:url('./fonts/IBMPlexSans-400.woff2')}
:root{color-scheme:light;--bg:#fff;--ink:#000;--text:#111;--sub:#5e5e5e;--line:#d4d4d4;--guide:#8f8f8f;--frame:#1c1c1c;--band:rgba(0,0,0,.05);--scrim:rgba(255,255,255,.84)}
html[data-theme=dark]{color-scheme:dark;--bg:#000;--ink:#fff;--text:#ededed;--sub:#a6a6a6;--line:#2f2f2f;--guide:#8f8f8f;--frame:#ededed;--band:rgba(255,255,255,.06);--scrim:rgba(0,0,0,.8)}
@media(prefers-color-scheme:dark){:root:not([data-theme=light]){color-scheme:dark;--bg:#000;--ink:#fff;--text:#ededed;--sub:#a6a6a6;--line:#2f2f2f;--guide:#8f8f8f;--frame:#ededed;--band:rgba(255,255,255,.06);--scrim:rgba(0,0,0,.8)}}
*{box-sizing:border-box}html,body{margin:0;min-height:100%;background:var(--bg);color:var(--text)}
body{height:100svh;display:grid;grid-template-rows:56px minmax(0,1fr) 68px;font:16px/1.45 'Plex Sans',sans-serif;overflow:hidden;padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left)}
button,select{font:inherit;color:inherit}button{touch-action:manipulation;cursor:pointer;-webkit-tap-highlight-color:transparent}
header{display:flex;align-items:center;justify-content:center;padding:4px 16px;position:relative}header .ib{position:absolute;left:8px}
#readout{font:500 13px/1 'Plex Mono',monospace;color:var(--sub);letter-spacing:.02em;font-variant-numeric:tabular-nums}
main{position:relative;display:grid;place-items:center;min-height:0;min-width:0;overflow:hidden;padding:8px 16px 16px}
#stage{width:100%;height:100%;display:grid;place-items:center;min-height:0}
#board{display:flex;flex-direction:column;align-items:center;gap:clamp(20px,5vh,48px);max-width:100%}
/* Pictures and the line each string joins. */
#pictures{display:flex;justify-content:center;align-items:flex-end;gap:28px;max-width:100%}
.pic{margin:0;display:flex;flex-direction:column;align-items:center;gap:10px;transition:opacity .18s}
.pic[data-state=pending]{opacity:.38}
.art{display:block;height:auto;overflow:visible}
.art .ink{fill:none;stroke:var(--ink);stroke-width:2;stroke-linecap:round;stroke-linejoin:round;vector-effect:non-scaling-stroke}
.art .fill{fill:var(--bg)}.art .dot{fill:var(--ink);stroke:none}
.line{display:flex;justify-content:center;gap:0;min-height:66px;align-items:flex-end}
.cell,.slot{width:44px;height:66px;display:grid;place-items:center;position:relative;padding:0;border:0;background:none}
.cell::after,.slot::after{content:'';position:absolute;left:8px;right:8px;bottom:0;border-bottom:1px dashed var(--guide)}
.pic[data-state=joined] .cell::after,.pic[data-state=joined] .slot::after{border-bottom:1px solid var(--ink)}
.pic[data-state=pending] .cell::after{border-bottom-color:var(--line)}
.slot[data-next]::after{border-bottom:2px solid var(--ink)}
.pic[data-state=joined] .slot{cursor:default}
/* Glyphs: strokes of the invented script. */
.g{width:40px;height:56px;overflow:visible;display:block}
.g .st{fill:none;stroke:currentColor;stroke-width:2.4;stroke-linecap:round;stroke-linejoin:round;vector-effect:non-scaling-stroke}
.g .ring{fill:none;stroke:var(--ink);stroke-width:2;vector-effect:non-scaling-stroke}
.g .ring.ghost{stroke-dasharray:5 5}
.ring.fresh{animation:ring 650ms cubic-bezier(.3,.7,.2,1) 2}
@keyframes ring{0%{opacity:.15}50%{opacity:1}100%{opacity:1}}
/* Choices: whole strings to pick, or single marks to write. */
#choices{display:flex;flex-wrap:wrap;justify-content:center;gap:12px;max-width:min(100%,560px);min-height:76px}
.opt,.key{display:inline-flex;align-items:center;justify-content:center;gap:2px;background:none;border:1px solid var(--line);border-radius:0;color:var(--ink);transition:opacity .18s,transform .1s}
.opt{min-height:76px;min-width:64px;padding:6px 12px}
.key{width:52px;height:72px;padding:0}
.opt:active:not([aria-disabled=true]),.key:active,.slot:active{transform:scale(.94)}
@media(hover:hover) and (pointer:fine){.opt:not([aria-disabled=true]):hover,.key:hover{background:var(--band)}}
.opt[aria-disabled=true]{cursor:default;color:var(--sub);position:relative}
.opt[aria-disabled=true]::after{content:'';position:absolute;left:6px;right:6px;top:50%;border-top:1.5px solid var(--sub)}
.opt.gone,.key.gone{visibility:hidden}
.opt:focus-visible,.key:focus-visible,.slot:focus-visible{outline:2px solid var(--ink);outline-offset:2px}
.opt.hinted{outline:2px dashed var(--ink);outline-offset:4px}
[data-picked]{outline:2px solid var(--ink)!important;outline-offset:4px!important}
.solved #choices{pointer-events:none}
/* Bar and sheets. */
.ib{height:48px;width:48px;border:0;background:none;border-radius:0;padding:12px;display:inline-grid;place-items:center}
.ib svg{width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linejoin:round;stroke-linecap:round}
.ib:active{transform:scale(.94)}.ib:focus-visible,select:focus-visible{outline:2px solid var(--ink);outline-offset:2px}
.toolbar{display:flex;align-items:center;justify-content:space-between;padding:8px 14px;gap:8px}.toolbar>div{display:flex;gap:4px}
#next-btn{background:var(--ink);color:var(--bg);border-radius:50%}
[hidden]{display:none!important}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}
.sheet{color:var(--text);background:var(--bg);width:min(32rem,calc(100vw - 16px));max-height:calc(100svh - 24px);padding:0;border:1px solid var(--frame);border-radius:0;overflow:auto}.sheet::backdrop{background:var(--scrim)}
.sheet-head{position:sticky;top:0;background:var(--bg);display:flex;align-items:center;justify-content:space-between;gap:12px;padding:8px 12px 8px 24px;border-bottom:1px solid var(--line)}
h2{font:500 16px/1.2 'Plex Mono',monospace;margin:0}h3{font-size:1rem;font-weight:400}.sheet-body{padding:20px 24px}.sheet p{margin:0 0 12px;max-width:60ch}
kbd{font:500 14px 'Plex Mono',monospace}
.row{display:flex;align-items:center;justify-content:space-between;gap:16px;margin:0 0 16px;min-height:44px}select{padding:6px 12px;max-width:70%;min-height:44px;border:1px solid var(--line);border-radius:0;background:var(--bg)}
.sheet footer{padding:12px 24px;border-top:1px solid var(--line);font-size:13px;color:var(--sub)}a{color:inherit}.note{color:var(--sub);font-size:14px}
#catalog h4{font-size:14px;font-weight:400;color:var(--sub);margin:14px 0 6px}#catalog ol{list-style:none;padding:0;margin:0;display:grid;grid-template-columns:repeat(3,1fr);gap:8px}
#catalog button{width:100%;min-height:44px;border:1px solid var(--line);border-radius:0;background:none;padding:8px;font-family:'Plex Mono',monospace}#catalog button[aria-current]{outline:2px solid var(--ink);outline-offset:1px}#catalog .finished::after{content:' ✓'}
@media(max-height:520px) and (min-width:560px){body{grid-template-columns:56px minmax(0,1fr) 80px;grid-template-rows:100svh}header{writing-mode:vertical-rl}header .ib{position:static}#board{flex-direction:row;gap:32px}.toolbar{flex-direction:column;padding:12px 8px}.toolbar>div{flex-direction:column}}
html[data-motion=reduce] *{transition:none!important;animation:none!important}
@media(prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important}}
@media(forced-colors:active){:root,html[data-theme]{--bg:Canvas;--ink:CanvasText;--text:CanvasText;--sub:CanvasText;--line:GrayText;--guide:GrayText}.art .dot{fill:CanvasText}.art .fill{fill:Canvas}}
