:root{font-family:"Hiragino Mincho ProN","Yu Mincho",serif;color:#504333;background:#d9b78b;font-synthesis:none;--size:clamp(168px,19vw,254px);--ink:#665444;--orange:#b8773e}
*{box-sizing:border-box}html,body{margin:0;width:100%;height:100%;overflow:hidden;overscroll-behavior:none}body{background:#d9b78b;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none}button,input,a{font:inherit;color:inherit;-webkit-tap-highlight-color:transparent}button{border:0;background:none;cursor:default}button,a,input{touch-action:manipulation}button:focus-visible,a:focus-visible,input:focus-visible{outline:2px solid #9c6e42;outline-offset:4px}button:disabled{opacity:.22}[hidden]{display:none!important}svg{width:27px;height:27px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round;pointer-events:none}
#game{position:relative;z-index:1;height:100dvh;min-height:0;display:grid;grid-template-rows:74px minmax(0,1fr) 54px;padding:env(safe-area-inset-top) max(25px,env(safe-area-inset-right)) env(safe-area-inset-bottom) max(25px,env(safe-area-inset-left))}body:not(.window-mode) #game{background:#f9efdc28}header{display:flex;justify-content:space-between;align-items:center;z-index:5}nav,.header-actions{display:flex;align-items:center;gap:6px}nav{padding:4px 10px;background:#f5eddd;clip-path:polygon(1% 5%,18% 1%,37% 5%,57% 1%,75% 4%,99% 1%,100% 34%,98% 64%,100% 96%,79% 100%,57% 97%,32% 100%,12% 96%,0 100%,1% 65%,0 28%);filter:drop-shadow(0 2px 2px #53432818)}.icon{height:44px;width:44px;display:inline-flex;align-items:center;justify-content:center;padding:8px;border-radius:3px}.icon:hover{background:#fbf5e33d}.icon:active{background:#f8efd963}.header-actions>.icon,footer>.icon{background:#f5eddddc;box-shadow:1px 2px 2px #57422d1a;clip-path:polygon(3% 4%,33% 1%,66% 4%,97% 1%,100% 31%,97% 67%,99% 97%,67% 100%,34% 97%,0 100%,2% 66%,0 34%)}.stage-number{font-family:Georgia,serif;font-size:35px;min-width:45px;min-height:44px;padding:0 5px;white-space:nowrap;touch-action:none}.stage-number .word-art{background:none;padding:0;font-size:inherit;box-shadow:none;clip-path:none}.problem-source{font-size:25px;min-width:60px;min-height:44px;padding:0 4px;touch-action:none;white-space:nowrap}.problem-source .word-art{background:none;box-shadow:none;clip-path:none;padding:0;font-size:inherit}.problem-source[data-kind="art"]{width:64px;height:55px}.problem-source .art,.text-source .art{width:100%;height:100%;object-fit:contain}
#desk{position:relative;overflow:hidden;min-height:0;touch-action:none;contain:paint}#world{position:absolute;inset:0;transform-origin:0 0;will-change:transform}.zone{position:absolute;width:100%;height:100%;pointer-events:none}.zone:before{content:"";position:absolute;inset:6% 5% 5%;border:1px solid #72583d23;border-radius:46% 3% 44% 3%/2% 45% 2% 45%;opacity:.5}.zone.current:before{border-color:#6d4e326b;opacity:.9}.goal{position:absolute;left:50%;top:5%;transform:translateX(-50%) rotate(-3deg);width:150px;height:150px;pointer-events:none}.goal:after{content:"";position:absolute;inset:0;border:2px dashed #7e674359;border-radius:47% 51% 48% 52%;transform:rotate(10deg)}.goal-art{position:absolute;inset:9%;filter:grayscale(.8);opacity:.6}.goal-art .art{width:100%;height:100%;object-fit:contain}.goal.solved .goal-art{filter:none;opacity:.95}.goal.solved:after{border-color:#a96f3b;border-style:solid}.goal-check{display:none;position:absolute;right:2px;bottom:0;color:#915b2e;background:#f6eede;border-radius:50%;width:31px;height:31px;padding:4px}.goal.solved .goal-check{display:block}.goal-check svg{width:100%;height:100%}.final-mark{display:grid;place-items:center;height:100%}.final-mark svg{width:56px;height:56px}
.item{position:absolute;width:var(--size);height:var(--size);transform:translate(-50%,-50%) rotate(-3deg);padding:0;border-radius:5px;touch-action:none;display:grid;place-items:center;isolation:isolate}.item:nth-of-type(even){transform:translate(-50%,-50%) rotate(3deg)}.item .art{width:100%;height:100%;object-fit:contain;pointer-events:none;filter:drop-shadow(1px 5px 3px #50371b35)}.word-art{text-align:center;letter-spacing:.06em;line-height:1.65;overflow-wrap:anywhere;background:#f9f1e4;box-shadow:2px 5px 4px #523c2423;padding:20px 25px;clip-path:polygon(0 7%,22% 1%,43% 6%,68% 1%,98% 5%,100% 32%,97% 66%,100% 96%,76% 100%,52% 95%,26% 100%,1% 94%,3% 63%,0 34%)}.item .word-art{font-size:clamp(25px,3.4vw,42px);min-width:90px;max-width:320px;white-space:nowrap}.item[data-kind="text"]{width:clamp(180px,23vw,300px)}.item.peek-paper{transform:translate(-50%,-50%) rotate(0deg);width:var(--size)}.peek-paper .word-art{width:100%;height:100%;display:grid;place-items:center;font-family:Georgia,serif;font-size:80px}.item.origin,[data-source].origin{opacity:.13}.item.candidate,[data-source].candidate{filter:drop-shadow(0 0 7px #e4bb7ca0)}[data-source]{touch-action:none}
.drag-ghost{position:fixed;left:0;top:0;z-index:50;pointer-events:none;transform:translate(-50%,-50%) rotate(-5deg);filter:drop-shadow(3px 12px 6px #49341d35);will-change:transform;display:grid;place-items:center}.drag-ghost .art{width:100%;height:100%;object-fit:contain}.drag-ghost .word-art{font-size:30px;min-width:70px;white-space:nowrap;padding:15px 20px}.sliding #desk{cursor:default}footer{display:flex;align-items:center;justify-content:space-between;z-index:3}#completion{color:#9d642e}
#settings{position:fixed;z-index:30;top:max(76px,calc(env(safe-area-inset-top) + 65px));right:max(25px,env(safe-area-inset-right));width:246px;padding:12px 15px 10px;background:#fcf4e6;border:1px solid #b59a745c;border-radius:2px;box-shadow:2px 12px 20px #5d412723}.settings-top{display:flex;align-items:center;gap:4px}.settings-top #closeSettings{margin-left:auto;width:36px;height:36px}.text-source{font-size:22px;min-width:65px;min-height:44px;padding:0 5px;white-space:nowrap;touch-action:none}.text-source .word-art{font-size:inherit;box-shadow:none;background:none;padding:0;clip-path:none}.mute-check{display:none}.muted .mute-check{display:block}.volume-row{display:flex;align-items:center;min-height:48px;padding:7px 4px}#volume{width:100%;height:34px;margin:0;accent-color:#927047;touch-action:none}#volume.quiet{accent-color:#afa69a;opacity:.55}.settings-bottom{display:flex;justify-content:space-between;margin-top:8px;color:#968267}.settings-bottom .icon{height:35px;width:35px}.settings-bottom svg{width:23px;height:23px}
#effects{position:fixed;inset:0;pointer-events:none;z-index:80;overflow:hidden}.merge-formula{position:absolute;transform:translate(-50%,-50%);display:flex;gap:18px;align-items:center;padding:12px 18px;background:#fcf7edee;white-space:nowrap;box-shadow:0 5px 18px #49341d18;font-size:clamp(22px,3vw,30px);animation:formula 1.3s both}.letters{display:flex;gap:3px}.removed{color:#acaa9a;animation:vanish .8s .1s both}.complete-toast{position:absolute;transform:translate(-50%,-50%) rotate(-3deg);display:flex;align-items:center;gap:7px;padding:6px 13px;background:#fcf5e6;color:#81623e;box-shadow:1px 3px 8px #49341d18;font-size:25px;white-space:nowrap;animation:stamp 1.1s both;pointer-events:none}.complete-toast svg{width:25px;height:25px}.system-toast{position:absolute;left:50%;bottom:15%;transform:translateX(-50%);width:max-content;max-width:calc(100vw - 40px);padding:12px 18px;font-size:16px;line-height:1.6;background:#fbf4e8f5;border:1px solid #a38b694a;box-shadow:0 4px 16px #4f351c20}.sr-only{position:absolute;width:1px;height:1px;margin:-1px;overflow:hidden;clip:rect(0,0,0,0)}
dialog{border:1px solid #baa584;border-radius:3px;padding:35px 25px 25px;width:min(390px,calc(100vw - 36px));max-height:calc(100dvh - 36px);background:#fbf3e5;text-align:center;box-shadow:0 20px 70px #4f351c28;color:#66513c}dialog::backdrop{background:#6b4d313b;backdrop-filter:blur(3px)}dialog h2{font-size:22px;font-weight:500;margin:5px 0 25px}.close-dialog{position:absolute;right:6px;top:6px}.paper-button{padding:11px 20px;font-size:18px;background:#fcf7ed;border:1px solid #b49c7966;border-radius:2px;white-space:nowrap;min-height:44px}.paper-button:active{background:#efe0c8}.dialog-choices{display:flex;justify-content:center;gap:18px;margin-top:20px}#completeArt{margin:10px auto;width:140px;height:140px}#completeArt .art{width:100%;height:100%;object-fit:contain}.large-check{width:42px;height:42px;color:#8b805d;margin:6px auto}.share-button{display:block;padding:13px 20px;background:#171717;color:#fff;border-radius:3px;text-decoration:none;font-size:17px;margin:20px auto 0}.small-note{font-size:12px;line-height:1.7;color:#8b7c67;margin:15px 0 0}.utility-link{display:block;text-align:left;padding:18px 0;border-bottom:1px solid #baa58460;text-decoration:none;font-size:18px}.utility-link small{display:block;font-size:12px;line-height:1.8;margin-top:8px;color:#897b69}.record-grid{display:grid;grid-template-columns:1fr auto;gap:14px 20px;font-size:16px;text-align:left}.record-grid dt,.record-grid dd{margin:0}.record-grid dd{font-family:Georgia,serif;font-variant-numeric:tabular-nums}#splitMenu{position:fixed;z-index:45;transform:translateX(-50%);filter:drop-shadow(1px 6px 7px #49341d27)}#splitMenu:before{content:"";position:absolute;left:calc(50% - 7px);top:-7px;border-left:7px solid transparent;border-right:7px solid transparent;border-bottom:8px solid #fcf7ed}#connection{position:fixed;z-index:90;left:50%;top:45%;transform:translate(-50%,-50%);padding:22px 28px;background:#fbf3e5;border:1px solid #baa584;box-shadow:0 8px 30px #4f351c28;white-space:nowrap}#connection button{display:block;margin:15px auto 0}
#outdoors{position:fixed;inset:0;z-index:0;background:#081020 center/cover no-repeat;opacity:0;pointer-events:none}#outdoorLamp{position:absolute;inset:12% 0 8%;background:center/contain no-repeat;opacity:.6;filter:grayscale(.8);transition:opacity .5s,filter .5s}#outdoorLamp.colored{opacity:1;filter:none}.window-mode{background-image:none;background-color:#081020}.window-mode #outdoors{opacity:1}.window-mode #game{background:none}.outside-zone:before,.outside-zone .goal:after,.outside-zone .goal-art{display:none}.outside-zone .goal{height:40px;top:3%}.outside-zone .goal-check{left:calc(50% - 15px);right:auto;bottom:0}#sceneVeil{position:fixed;inset:0;z-index:35;background:#eee5d5;opacity:0;pointer-events:none}
@keyframes vanish{to{opacity:0;transform:translateY(-12px) scale(.6)}}@keyframes formula{0%{opacity:0;translate:0 8px}15%,65%{opacity:1;translate:0 0}100%{opacity:0;translate:0 -12px}}@keyframes stamp{0%{opacity:0;scale:1.12}14%,60%{opacity:1;scale:1}100%{opacity:0;translate:0 -9px}}
@media(max-width:600px){:root{--size:clamp(142px,40vw,170px)}#game{padding-left:10px;padding-right:10px;grid-template-rows:65px minmax(0,1fr) 52px}.icon{width:41px;height:41px}nav{gap:0;padding:3px 5px}.stage-number{font-size:31px;min-width:36px;min-height:43px}.problem-source{font-size:22px;min-width:48px;padding:0 2px}.problem-source[data-kind="art"]{width:52px;height:48px}.goal{width:124px;height:124px;top:7%}#settings{right:12px;top:max(65px,calc(env(safe-area-inset-top) + 56px));width:240px}.item .word-art{font-size:30px;padding:17px 23px}.item[data-kind="text"]{width:240px}.item.peek-paper{width:var(--size)}.peek-paper .word-art{font-size:65px}.complete-toast{font-size:22px}.outside-zone .goal{top:1%}}
@media(max-height:510px){#game{grid-template-rows:51px minmax(0,1fr) 40px}:root{--size:145px}.goal{width:88px;height:88px;top:2%}.stage-number{font-size:28px}.icon{width:36px;height:36px}.item .word-art{font-size:25px}#outdoorLamp{inset:6% 0 7%}dialog{padding-top:29px;padding-bottom:18px}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation-duration:.01ms!important;transition-duration:.01ms!important}}
.outdoor-hit{position:fixed;z-index:2;left:calc(50% - 85px);width:170px;top:12%;bottom:8%;padding:0;touch-action:none;background:none}.outdoor-hit:focus-visible{outline:1px dashed #92704766}

#deskTexture{position:fixed;z-index:0;left:0;top:0;width:200vw;height:200dvh;background:url("assets/oak-desk.webp") 0 0/100% 100%;pointer-events:none;will-change:transform}.window-mode #deskTexture{opacity:0}
