/* Delve · Shadow. 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:#262626;--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:#121212;--sub:#606060;--line:#dedede;--frame:#121212;--scrim:rgba(255,255,255,.8)}
@media(prefers-color-scheme:light){:root[data-theme=system]{color-scheme:light;--bg:#fff;--ink:#000;--text:#121212;--sub:#606060;--line:#dedede;--frame:#121212;--scrim:rgba(255,255,255,.8)}}
*{box-sizing:border-box;border-radius:0}
html,body{touch-action:manipulation}
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{font:inherit;color:inherit}button{cursor:pointer}button:disabled{opacity:.35;cursor:default}[hidden]{display:none!important}
button:focus-visible,select:focus-visible,.cell: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}
#restart-btn{position:fixed;top:max(0px,env(safe-area-inset-top));left:8px;color:var(--sub);z-index:3}
.toolbar{position:fixed;bottom:max(6px,env(safe-area-inset-bottom));left:8px;right:8px;display:flex;justify-content:space-between;z-index:3}
.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)}
.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)}.ib:hover,.ib:focus-visible{color:var(--ink)}
#stage{position:absolute;inset:56px 12px 60px;display:flex;flex-direction:column;align-items:center;gap:0}
#board-wrap{position:relative;flex:none}
#board{display:grid;border:1px solid var(--line);background:var(--bg)}
.cell{position:relative;border:0;border-right:1px solid var(--line);border-bottom:1px solid var(--line);background:var(--bg);padding:0;min-width:0;aspect-ratio:1;display:grid;place-items:center;color:var(--ink)}
.cell.wall{background:var(--ink)}
.cell.hint{box-shadow:inset 0 0 0 3px var(--ink);background:var(--line)}
.cell svg{width:62%;height:62%;stroke:currentColor;fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;pointer-events:none}
.cell .foe-mini{fill:var(--ink);stroke:none}
.cell .heart-ic{fill:var(--ink);stroke:none}
.cell.focus-ring{box-shadow:inset 0 0 0 3px var(--ink)}
#mark{position:absolute;width:calc(var(--cw,40px)*.58);height:calc(var(--cw,40px)*.58);border:3px solid var(--ink);background:var(--bg);pointer-events:none;z-index:2;transform:translate(-50%,-50%);transition:left .11s linear,top .11s linear}
#mark::after{content:"";position:absolute;inset:28%;background:var(--ink)}
#next-slot{height:48px;flex:none;display:flex;align-items:center;justify-content:center}
#next-btn{color:var(--ink);border:1px solid var(--line)}
#duel{flex:none;width:min(92vw,380px);border-top:1px solid var(--line);display:flex;flex-direction:column;align-items:stretch}
#duel-top{height:28px;display:flex;align-items:center;justify-content:space-between;gap:8px;padding-top:4px}
#hearts,#pips{display:flex;gap:5px;align-items:center;min-width:70px}
#pips{justify-content:flex-end}
.hdot{width:14px;height:14px;flex:none}
.hdot svg{width:100%;height:100%;fill:var(--ink)}
.hdot.off svg{fill:none;stroke:var(--ink);stroke-width:1.5}
.pdot{width:11px;height:11px;border-radius:50%;background:var(--ink);flex:none}
.pdot.off{background:none;border:1px solid var(--ink)}
#hint-shown{display:flex;gap:6px;align-items:center;justify-content:center;flex:1}
#hint-shown svg{width:18px;height:18px;fill:var(--ink)}
#silhouette{height:148px;display:grid;place-items:center}
#silhouette svg{height:142px;width:142px}
#silhouette.shake{animation:shake .18s}
#silhouette.drop{animation:drop .25s forwards}
@keyframes shake{25%{transform:translateX(-6px)}75%{transform:translateX(6px)}}
@keyframes drop{to{transform:translateY(10px);opacity:.15}}
#answers{display:flex;gap:8px}
.answer{flex:1;height:64px;min-height:48px;background:none;border:1px solid var(--line);display:grid;place-items:center;color:var(--ink);padding:8px}
.answer svg{width:40px;height:40px;fill:var(--ink)}
.answer:active{transform:scale(.97)}
.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)}
.sheet-head h2{margin:0;font:500 16px/1.3 var(--mono)}.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}
.sheet-body p{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;text-decoration:underline;text-underline-offset:4px}
.sheet-foot{padding:12px 24px;border-top:1px solid var(--line);flex:none;color:var(--sub);font-size:14px}.sheet-foot a{color:inherit}
@media(orientation:landscape) and (max-height:500px){
  #stage{inset:52px 64px 8px 12px;flex-direction:row;justify-content:center;align-items:center;gap:16px}
  .toolbar{left:auto;right:8px;top:12px;bottom:12px;flex-direction:column;width:48px}.toolbar>div{flex-direction:column}
  .readout{left:calc(50% - 28px)}
  #duel{width:300px} #silhouette{height:118px} #silhouette svg{height:112px;width:112px}
  #next-slot{width:48px;height:auto}
}
@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}
