/* Echo: black floor, one white dot, light that fades. 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;--band:rgba(255,255,255,.16);--mark:#666;--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:#111;--sub:#5e5e5e;--line:#d4d4d4;--frame:#1c1c1c;--band:rgba(0,0,0,.1);--mark:#999;--scrim:rgba(255,255,255,.84)}
@media(prefers-color-scheme:light){:root[data-theme=system]{color-scheme:light;--bg:#fff;--ink:#000;--text:#111;--sub:#5e5e5e;--line:#d4d4d4;--frame:#1c1c1c;--band:rgba(0,0,0,.1);--mark:#999;--scrim:rgba(255,255,255,.84)}}
*{box-sizing:border-box;border-radius:0}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{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);font-variant-numeric:tabular-nums;white-space:nowrap}
/* Pulses left are filled pips; spent ones are hollow. */
.pips{position:fixed;top:calc(max(0px,env(safe-area-inset-top)) + 38px);left:50%;transform:translateX(-50%);display:flex;gap:6px}.pip{width:8px;height:8px;border:1px solid var(--ink);border-radius:50%;background:var(--ink)}.pip.used{background:none}
#board-shell{--completion-space:96px;--completion-axis:y;position:absolute;inset:62px 12px 88px;display:flex;overflow:hidden;touch-action:none;padding:5px}.board-stage{flex:none;margin:auto;display:flex;flex-direction:column;align-items:center;position:relative;padding-bottom:var(--completion-space)}.board{display:flex;flex-direction:column;flex:none;position:relative;user-select:none;touch-action:none}.grid-row{display:flex;flex:none}.cell{width:var(--cell);height:var(--cell);flex:none;position:relative;overflow:hidden;touch-action:none}
/* Nothing is drawn until light touches it. The board's edge is where rays stop. */
.cell span{position:absolute;pointer-events:none}.disc{left:50%;top:50%;width:10%;height:10%;min-width:6px;min-height:6px;transform:translate(-50%,-50%);border-radius:50%;background:var(--ink);box-shadow:0 0 4px 2px color-mix(in srgb,var(--ink) 85%,transparent),0 0 14px 5px color-mix(in srgb,var(--ink) 35%,transparent),0 0 30px 9px color-mix(in srgb,var(--ink) 12%,transparent);z-index:2}.lamp-pool{inset:0;background:radial-gradient(circle at center,color-mix(in srgb,var(--ink) 14%,transparent),transparent 70%)}.floor{inset:0;background:var(--band);background-image:radial-gradient(circle calc(var(--cell)*4) at var(--light-x,50%) var(--light-y,50%),color-mix(in srgb,var(--ink) 26%,transparent),transparent)}.flash{animation:fade 1.4s linear forwards}
.memory,.step-target{left:50%;top:50%;width:3px;height:3px;transform:translate(-50%,-50%);border-radius:50%;background:var(--mark)}.step-target{background:var(--ink)}.ring{inset:27.5%;border:1px solid var(--ink);border-radius:50%;z-index:1}
.pulse-cue{inset:23%;border:1px solid var(--sub);border-radius:50%;animation:invite 1.2s ease-out 3}.pulse-cue::before,.pulse-cue::after{content:"";position:absolute;inset:-16%;border:1px solid var(--line);border-radius:50%}.pulse-cue::after{inset:-32%}@keyframes invite{from{opacity:.8}to{opacity:.15}}
.finish{animation:maze-reveal .6s ease-out both}.finish.floor{background:var(--band);background-image:radial-gradient(circle calc(var(--cell)*8) at var(--light-x) var(--light-y),color-mix(in srgb,var(--ink) 15%,transparent),transparent)}.finish.face{animation-name:wall-reveal;opacity:.45}@keyframes wall-reveal{from{opacity:0}to{opacity:.45}}@keyframes maze-reveal{from{opacity:0}to{opacity:1}}
.face{background:var(--ink)}.face-0{bottom:0;left:0;width:100%;height:2px}.face-1{top:0;left:0;width:2px;height:100%}.face-2{top:0;left:0;width:100%;height:2px}.face-3{top:0;right:0;width:2px;height:100%}
.tick{background:var(--mark)}.tick.face-0,.tick.face-2{left:40%;width:20%;height:1px}.tick.face-1,.tick.face-3{top:40%;width:1px;height:20%}.hint{inset:20%;border:1px solid var(--ink);border-radius:50%}@keyframes fade{from{opacity:1}to{opacity:0}}
.cell:focus{outline:none}.cell:focus-visible{outline:2px solid var(--ink);outline-offset:-3px}
#feedback{position:fixed;bottom:64px;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)}
.toolbar .ib{color:var(--sub)}.toolbar .ib:hover,.toolbar .ib:focus-visible{color:var(--ink)}#restart-btn{position:fixed;top:max(0px,env(safe-area-inset-top));left:8px;color:var(--sub);z-index:2}#restart-btn:hover,#restart-btn:focus-visible{color:var(--ink)}
.completion{position:absolute;bottom:0;height:80px;display:flex;flex-direction:column;align-items:center;animation:maze-reveal .45s both}.completion[hidden],#share-btn[hidden]{display:none}
.completion-actions{display:flex;gap:12px}.milestone{margin:4px 0 0;color:var(--sub);font:14px/1.3 var(--sans);text-align:center}.milestone[hidden]{display:none}
.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:8px 16px;gap:12px;flex:none;border-bottom:1px solid var(--line)}h2{font:500 16px/1.3 var(--mono);margin:0}.sheet-head form{margin:0}.sheet-x{width:44px;height:44px;min-width:44px;min-height:44px;padding:10px}.sheet-body{padding:20px 24px;overflow:auto;min-height:0;overscroll-behavior:contain;scroll-padding:12px}.sheet-body p{max-width:60ch;margin:0 0 16px}.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;margin-top:8px}.sheet-foot{padding:12px 24px;border-top:1px solid var(--line);flex:none;color:var(--sub);font-size:14px}.sheet-foot a{color:inherit}#settings-feedback a{overflow-wrap:anywhere}
.text-action{min-height:44px;padding:8px 12px;border:1px solid var(--line);background:none;font:500 14px/1.3 var(--mono);color:var(--text)}.text-action:focus-visible,.sheet summary:focus-visible{outline:2px solid var(--ink);outline-offset:2px}
.controls{border-top:1px solid var(--line);padding-top:16px}.controls p{margin:0 0 6px}.help-more{border-top:1px solid var(--line);margin-top:16px;padding-top:4px}.help-more summary{cursor:pointer;min-height:44px;padding:12px 0;color:var(--sub)}.help-more p{font-size:14px}.sheet-body .help-more p:last-child{margin-bottom:0}
@media(max-width:480px){.sheet-head{padding:8px 12px}.sheet-body{padding:16px}}
@media(orientation:landscape) and (max-height:500px){#board-shell{--completion-space:80px;--completion-axis:x;inset:52px 72px 12px 12px}.board-stage{padding:0 var(--completion-space) 0 0}.completion{bottom:auto;top:50%;right:0;width:64px;height:auto;transform:translateY(-50%)}.completion-actions{flex-direction:column;gap:0}.toolbar{left:auto;right:8px;top:12px;bottom:12px;flex-direction:column;width:48px}.toolbar>div{flex-direction:column}#feedback{left:12px;right:72px;bottom:4px;background:var(--bg);font-size:12px}.readout{left:calc(50% - 32px)}.pips{left:calc(50% - 32px)}}
/* Without motion, light holds for the same moment and then vanishes. */
@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:GrayText;--line:GrayText;--frame:CanvasText;--mark:CanvasText;--band:Highlight;--scrim:Canvas}.cell{forced-color-adjust:none}.floor{background:Highlight}.disc{background:CanvasText}.pip{border-color:CanvasText;background:CanvasText}.pip.used{background:Canvas}.toolbar .ib,#restart-btn{color:ButtonText}.sheet{border-color:CanvasText}.cell:focus-visible{outline:2px solid Highlight}}
/* Suppress Safari text selection and long-press callouts on play surfaces only. */
.board,.board *,header,.toolbar,.toolbar *,button,button *{-webkit-user-select:none;user-select:none;-webkit-touch-callout: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; }
