:root {--ink:var(--theme-ink,#454336);--paper:var(--theme-surface,#faf8ed);--quest-hud:#f4f2e9;--quest-muted:#756c54;--quest-checkpoint:#577755;}
* {box-sizing:border-box;}
body {margin:0;color:var(--ink);background:#f0eee3 url('../../images/paper.png');user-select:none;-webkit-user-select:none;}
header {display:flex;justify-content:space-between;padding:16px 25px;border-bottom:1px solid #7774;}
a {color:inherit;}
main {max-width:920px;margin:auto;padding:15px 24px 45px;}
.quest-intro>span,.ledge>span {font:10px/1.5 monospace;letter-spacing:1px;color:#827860;}
h1 {font-size:40px;font-weight:normal;margin:7px 0;}
.quest-intro p {font-size:18px!important;margin:0 0 16px;}
.quest-hud {position:sticky;top:0;z-index:30;padding:12px 0 6px;background:#f4f2e9;border-bottom:1px dashed #b4a88b;}
.quest-controls {display:flex;gap:10px;align-items:center;flex-wrap:wrap;}
.quest-controls button {font:13px system-ui;padding:9px 13px;border:1px solid #8a8266;border-radius:5px;background:#fffbed;color:#66532e;cursor:pointer;}
.quest-controls label,#quest-status,.quest-help,.route-key {font:12px/1.5 system-ui!important;}
#quest-status {min-height:36px;color:#7d683f;max-width:750px;margin:8px 0 0;}
#building-status {font:11px/1.5 system-ui!important;min-height:17px;margin:2px 0;color:#756c54;}
.quest-controls button:disabled{opacity:.5;cursor:default;}
.tape-peel-ghost {position:fixed;z-index:100;pointer-events:none;}
.tape-peel-ghost svg{display:block;width:100%;height:100%;overflow:visible;}
.quest-board {position:relative;height:2600px;margin:110px auto 0;max-width:760px;}
.ledge {position:absolute;width:35%;height:74px;padding:12px;border:1px solid #81795d66;border-top:3px solid #77745c;border-radius:4px 8px 3px 5px;box-shadow:3px 4px 0 #39342a12;background:var(--paper);}
.ledge p {font-size:18px!important;margin:5px 0;}
.start {left:5%;top:0;background:#f6f0dc;}
.west {left:57%;top:240px;}
.east {left:8%;top:510px;background:#f1f3e5;}
.rest {left:56%;top:1360px;}
.books {left:6%;top:1660px;background:#f1f3e5;}
.last {left:56%;top:2090px;}
.vault {left:14%;top:2460px;width:55%;background:#f8efd9;}
.course-note {position:absolute;font-size:22px!important;color:#9a8d6b;transform:rotate(-4deg);pointer-events:none;}
.gap-hint {top:850px;left:18%;}.treasure-hint{top:2260px;left:10%;}
.tape-barrier {position:absolute;left:0;width:100%;height:60px;padding:0;border:0;background:none;color:#705b36;font:13px monospace;cursor:grab;touch-action:none;user-select:none;-webkit-user-select:none;isolation:isolate;}
.tape-art,.tape-fold {position:absolute;inset:0;pointer-events:none;}.tape-art svg,.tape-fold svg{display:block;width:100%;height:100%;overflow:visible;}
.tape-art{z-index:0}.tape-copy{z-index:1}.tape-fold{z-index:2}.tape-tab{z-index:3}
.tape-copy {position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;pointer-events:none;letter-spacing:.07em;}
.tape-barrier small {font:11px system-ui;letter-spacing:0;}.tape-barrier[hidden]{display:none}
.tape-tab {position:absolute;top:7px;bottom:7px;width:27px;display:grid;place-items:center;font:24px Georgia;color:#8a7146;background:linear-gradient(90deg,#fff4d2,#d8bc81);border-radius:3px 14px 10px 3px;box-shadow:1px 2px 3px #6b512533;pointer-events:none;}
.tape-tab.left {left:3px;transform:rotate(-6deg);}.tape-tab.right{right:3px;transform:rotate(6deg) scaleX(-1);}
.tape-barrier:hover .tape-tab{color:#59401c;box-shadow:1px 3px 5px #6b512544;}
.tape-barrier.is-peeling {cursor:grabbing;z-index:41;}.tape-barrier.is-peeling .tape-tab{opacity:0;}
.tape-barrier.is-peeling:focus-visible {outline:none;}
.first-tape{top:125px}.second-tape{top:1850px}
#note-pile {touch-action:none;cursor:pointer;}
#note-pile[aria-disabled="true"]{opacity:.45;}
.sticky-platform {position:absolute;width:150px;height:72px;background:#fff09a;border-top:3px solid #d0ac43;border-radius:1px 2px 12px 1px;box-shadow:3px 5px 4px #46361b25;padding:8px 12px;color:#79663b;cursor:grab;touch-action:none;user-select:none;z-index:3;}
.sticky-platform>span:first-child{font:11px monospace}.note-doodle{display:block;font-size:25px;line-height:1;transform:rotate(-10deg);}
.sticky-platform::after{content:'';position:absolute;right:0;bottom:0;border-style:solid;border-width:0 0 12px 12px;border-color:transparent transparent #d9b85c transparent;}
.sticky-platform.is-moving{opacity:.75;cursor:grabbing;z-index:10006}.return-note{position:absolute;right:3px;top:2px;border:0;background:transparent;color:#8e733b;cursor:pointer;font:20px system-ui;}
.sticky-platform:focus-visible,.quest-controls button:focus-visible,.tape-barrier:focus-visible{outline:2px dashed #b82d3d;outline-offset:4px;}
.quest-help {color:#7c7764;}
.route-key {color:#827860;}.route-key span{color:#21968a}.route-key b{color:#a23fba;font-weight:normal}.route-key em{color:#b75c28;font-style:normal}
@media(max-width:550px){main{padding:15px 16px 40px}h1{font-size:32px}.ledge{width:43%;padding:8px}.west,.rest,.last{left:56%}.ledge>span{font-size:8px;letter-spacing:0}.ledge p{font-size:15px!important}.vault{width:60%}.quest-board{margin-top:105px}.sticky-platform{width:125px;height:65px}.quest-controls{gap:6px}.quest-controls button{padding:8px;font-size:12px}.quest-controls label{font-size:11px!important}}

/* The paper is the world; the tools stay with the player on either axis. */
html,body {width:100%;height:100%;overflow:hidden;}
.quest-viewport {position:fixed;inset:0;overflow:auto;overscroll-behavior:contain;background:inherit;background-attachment:local;}
header {position:fixed;inset:0 0 auto;min-height:48px;z-index:10004;gap:12px;align-items:center;padding:7px 14px;background:var(--quest-hud);font:12px/1.3 system-ui,sans-serif;}
header>a {white-space:nowrap;}
#level-label {flex:1;min-width:0;text-align:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--quest-muted);}
#quest-appearance .themeControls {padding:0;gap:5px;}
#quest-appearance button {min-height:30px;min-width:0;padding:5px 7px;font:11px/1.2 system-ui,sans-serif;}
#quest-appearance svg {width:14px;height:14px;}
main {width:max-content;min-width:100%;max-width:none;margin:0;padding:220px 24px 45px;}
.quest-intro,.quest-help,.route-key {max-width:min(680px,calc(100vw - 48px));}
.quest-hud {position:fixed;inset:48px 12px auto;z-index:10003;padding:8px 12px;border:1px solid #b4a88b88;border-radius:4px 7px;background:var(--quest-hud);box-shadow:0 3px 12px #0000000c;}
.quest-controls {gap:6px;}
.quest-controls button {padding:6px 9px;min-height:31px;font-size:12px;background:var(--paper);color:var(--ink);border-color:var(--theme-edge,#8a8266);}
.quest-controls button:hover,.win-actions button:hover {border-color:var(--theme-accent,#b82d3d);}
#quest-status {min-height:0;margin-top:6px;max-width:none;color:var(--quest-muted);}
#building-status,.quest-help,.route-key {color:var(--quest-muted);}
.pan-help {margin:3px 0 0;font:10px/1.4 system-ui,sans-serif!important;color:var(--quest-muted);}
.quest-board {max-width:none;margin:90px 0 0;cursor:grab;touch-action:none;}
.quest-board.is-panning {cursor:grabbing;}
.ledge {cursor:default;padding:9px 10px;}
.ledge>span {display:block;max-width:100%;font-size:9px;line-height:1.2;letter-spacing:.3px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.ledge>p {font-size:16px!important;line-height:1.25;margin:5px 0 0;overflow-wrap:anywhere;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;}
#quest-vault {background:#f6e9c7;border-color:#ab8b43;}
.quest-goal-pointer {position:fixed;z-index:10002;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1px;width:92px;height:54px;padding:4px;border:1px solid #a3813e;border-radius:8px;background:#fff0bf;color:#71501f;box-shadow:2px 3px 0 #0002;transform:translate(-50%,-50%);cursor:pointer;}
.quest-goal-pointer[hidden] {display:none;}
.quest-goal-pointer>svg {width:25px;height:25px;transform:rotate(var(--goal-angle,0rad));}
.quest-goal-pointer>span {font:600 10px/1.2 system-ui,sans-serif;letter-spacing:.6px;text-transform:uppercase;}
.quest-goal-pointer:focus-visible {outline:2px dashed var(--theme-accent,#b82d3d);outline-offset:4px;}
.missing-step {position:absolute;display:flex;flex-direction:column;justify-content:center;gap:5px;text-align:center;border:1.5px dashed #b3a56f88;border-radius:2px 3px 12px 3px;color:var(--quest-muted);pointer-events:none;}
.missing-step span {font:14px/1.3 Georgia,serif;}
.missing-step small {font:10px/1.3 system-ui,sans-serif;}
.tape-copy {padding:0 22px;font-size:8px;letter-spacing:0;line-height:1.1;}
.tape-copy small {display:none;}
.tape-tab {width:21px;font-size:18px;}
.quest-camera {position:fixed;right:14px;bottom:14px;z-index:10004;display:grid;grid-template-columns:repeat(3,30px);grid-template-rows:repeat(2,30px);gap:3px;}
.quest-camera button {border:1px solid var(--theme-edge,#8a8266);border-radius:4px;background:var(--paper);color:var(--ink);font:18px system-ui;cursor:pointer;}
.quest-camera button:first-child {grid-column:2;}.quest-camera button:nth-child(2){grid-column:1;grid-row:2}.quest-camera button:nth-child(3){grid-column:3;grid-row:2}.quest-camera button:last-child{grid-column:2;grid-row:2}
.quest-camera button:focus-visible {outline:2px dashed var(--theme-accent,#b82d3d);outline-offset:2px;}
#quest-win {width:min(430px,calc(100vw - 32px));max-height:calc(100dvh - 32px);padding:25px 28px 30px;border:2px solid var(--theme-edge,#81795d);border-radius:7px 15px 8px 12px;background:var(--paper);color:var(--ink);text-align:center;box-shadow:5px 8px 0 #00000020;}
#quest-win::backdrop {background:#1b18276b;backdrop-filter:blur(3px);}
#quest-win>svg {width:100px;height:85px;display:block;margin:0 auto 14px;}
.win-eyebrow {font:9px/1.6 ui-monospace,monospace;letter-spacing:1px;color:var(--quest-muted);}
#win-heading {margin:8px 0;font-size:54px;font-weight:normal;line-height:1.1;}
#win-details {margin:12px 0 22px;font:14px/1.6 system-ui,sans-serif;color:var(--quest-muted);}
.win-actions {display:flex;justify-content:center;flex-wrap:wrap;gap:8px;}
.win-actions button {padding:10px 15px;border:1px solid var(--theme-edge,#8a8266);border-radius:5px;background:var(--paper);color:var(--ink);font:14px system-ui;cursor:pointer;}
.win-actions #win-next {background:#b82d3d;color:#fff8e9;border-color:#b82d3d;}
:root[data-theme="dark"] {--quest-hud:#252629;--quest-muted:#c5baa4;--quest-checkpoint:#abd59d;}
html[data-theme="dark"] .ledge {background:#4b505a;border-color:#99998e;border-top-color:#b7ac89;box-shadow:3px 4px 0 #0005;}
.ledge.is-stamp-branch {background:#e6eef4;border-color:#8aabbc;border-top-color:#6589a0;}
html[data-theme="dark"] .ledge.is-stamp-branch {background:#354e60;border-color:#7899ad;border-top-color:#99bbce;}
.ledge.is-eraser-branch {background:#f2dfe5;border-color:#bc899a;border-top-color:#ab7186;}
html[data-theme="dark"] .ledge.is-eraser-branch {background:#5a3e4b;border-color:#b68b9d;border-top-color:#d1a2b6;}
html[data-theme="dark"] #quest-vault {background:#665535;border-color:#c0a15c;}
html[data-theme="dark"] .quest-goal-pointer {background:#665125;color:#fff0bf;border-color:#c9a65c;}
html[data-theme="dark"] .ledge>span,html[data-theme="dark"] .quest-intro>span {color:#c5baa4;}
html[data-theme="dark"] .sticky-platform {background:#655529;color:#fff1c3;border-top-color:#bca05b;}
html[data-theme="dark"] .return-note {color:#fff1c3;}
html[data-theme="dark"] .sticky-platform::after {border-bottom-color:#a38a43;}
@media(max-width:600px){header{gap:7px;padding-inline:9px;font-size:10px}.quest-hud{inset-inline:6px;padding:7px 8px}.quest-controls button{padding:5px 7px;font-size:11px;min-height:30px}.quest-controls label{font-size:10px!important}#quest-status{font-size:11px!important}.pan-help{font-size:9px!important}main{padding:240px 16px 40px}.quest-intro,.quest-help,.route-key{max-width:calc(100vw - 32px)}.ledge{padding:8px}.ledge>span{font-size:8px}.ledge>p{font-size:14px!important;line-height:1.25;margin-top:4px}.missing-step span{font-size:12px}.missing-step small{font-size:9px}}

/* A little object on the desk, with the button semantics kept for keyboards. */
.quest-controls #note-pile {--pile-paper:#fff09a;--pile-glue:#ead784;--pile-ink:#63522e;--pile-under:#d4b95c;--pile-middle:#e3cb76;--pile-fold:#d5b65b;position:relative;isolation:isolate;flex:0 0 88px;width:88px;height:66px;min-height:66px;margin:1px 4px 3px;padding:0;border:0;border-radius:0;background:transparent;box-shadow:none;overflow:visible;}
#note-pile::before,#note-pile::after {content:'';position:absolute;inset:5px 6px 2px 6px;background:var(--pile-under);border-radius:1px;box-shadow:1px 2px 2px #0002;transform:rotate(3deg);z-index:-1;}
#note-pile::after {inset:3px 7px 4px 4px;background:var(--pile-middle);transform:rotate(-1deg);}
.pile-sheet {position:absolute;inset:2px 7px 7px 3px;display:block;text-align:left;color:var(--pile-ink);background:linear-gradient(var(--pile-glue) 0 7px,var(--pile-paper) 7px);clip-path:polygon(0 0,100% 0,100% calc(100% - 10px),calc(100% - 10px) 100%,0 100%);transform:rotate(-4deg);transition:transform .15s ease;}
.pile-sheet::after {content:'';position:absolute;right:0;bottom:0;width:10px;height:10px;background:var(--pile-fold);clip-path:polygon(0 0,100% 0,0 100%);}
.pile-label {position:absolute;left:11px;top:7px;font:15px/1.1 'myhandwritingBold',Georgia,serif;}
#note-count {position:absolute;right:12px;bottom:4px;font:600 9px/1.2 system-ui,sans-serif;}
#note-pile:not([aria-disabled="true"]):hover .pile-sheet {transform:translateY(-2px) rotate(-6deg);}
#note-pile:not([aria-disabled="true"]):active .pile-sheet {transform:translateY(1px) rotate(-2deg);}
#note-pile.is-peeling .pile-sheet {transform:rotate(-4deg);}
.note-peel-transfer {position:fixed;z-index:10010;pointer-events:none;transform-origin:center;}
.note-peel-transfer svg {display:block;width:100%;height:100%;overflow:visible;}
html[data-theme="dark"] #note-pile {--pile-paper:#b9a363;--pile-glue:#a18b50;--pile-ink:#2d281b;--pile-under:#796638;--pile-middle:#96804a;--pile-fold:#826b35;}
@media(prefers-reduced-motion:reduce){.pile-sheet{transition:none;}}

/* Paper puzzle contraptions share the exact footprint of their generated step. */
.ledge {z-index:1;}
.tape-barrier {z-index:2;}
.ledge.quest-pressure-bridge {padding:0;border:0;background:transparent;box-shadow:none;perspective:450px;}
.quest-pressure-bridge::before {content:'';position:absolute;inset:0;border:1px dashed #a9916755;border-radius:3px;pointer-events:none;}
.quest-pressure-bridge::after {content:'';position:absolute;left:-3px;top:0;bottom:0;width:7px;border:1px solid #a58b58;border-radius:2px;background:repeating-linear-gradient(90deg,#d2bb85 0 2px,#f6e3b4 2px 4px);box-shadow:1px 2px 2px #0002;pointer-events:none;}
.bridge-front {position:absolute;inset:0;padding:9px 10px;border:1px solid #a58b58;border-top:3px solid #b99d65;border-radius:2px 6px 3px 3px;background:#f7e7c7;transform-origin:left center;backface-visibility:hidden;box-shadow:3px 3px 0 #0002;}
.bridge-front::after {content:'';position:absolute;right:8px;top:4px;bottom:4px;border-left:1px dashed #ad955955;}
.bridge-front>span {display:block;font:9px/1.2 monospace;letter-spacing:.3px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--quest-muted);}
.bridge-front>p {font-size:16px!important;line-height:1.25;margin:5px 0 0;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;overflow-wrap:anywhere;}
.mechanic-tag {position:absolute;left:0;top:calc(100% + 7px);color:var(--quest-muted);font:9px/1.3 monospace;white-space:nowrap;}
.ledge[data-mechanic="lift"] {background:#e2edef;border-color:#799598;z-index:2;}
.paperclip-rail {position:absolute;width:30px;pointer-events:none;z-index:0;color:#8f9598;}
.paperclip-rail svg {width:100%;height:100%;overflow:visible;}
.paperclip-rail::before,.paperclip-rail::after {content:'';position:absolute;left:-4px;width:32px;border-top:2px solid currentColor;top:35px;}
.paperclip-rail::after {top:auto;bottom:60px;}
.lift-tabs {position:absolute;top:calc(100% + 5px);left:0;display:flex;gap:4px;white-space:nowrap;}
.lift-tabs button {padding:4px 6px;min-height:27px;border:1px solid #809496;border-radius:5px 1px;background:var(--paper);color:var(--ink);font:10px system-ui,sans-serif;cursor:pointer;}
.lift-tabs button:disabled {opacity:.5;cursor:wait;}
.pressure-plate {position:absolute;left:50%;top:-6px;width:64px;height:6px;transform:translateX(-50%);border:1px solid #7d8980;background:#c6cebd;border-radius:3px 3px 0 0;font-size:0;}
.pressure-plate::after {content:'A';position:absolute;left:24px;top:-20px;width:16px;height:16px;border:1px solid #8eaa82;border-radius:50%;background:var(--paper);color:var(--quest-ink,#567149);font:10px/16px system-ui;text-align:center;}
[data-pressed="true"] .pressure-plate {background:#7ca66b;box-shadow:0 0 7px #75b55855;}
[data-pressed="true"] .pressure-plate::after {background:#658e53;color:#fff7de;}
.mechanic-wire {position:absolute;left:0;top:0;pointer-events:none;z-index:0;overflow:visible;}
.mechanic-wire path {fill:none;stroke:#8a9478;stroke-width:1.5;stroke-dasharray:4 5;opacity:.55;}
.mechanic-wire.is-powered path {stroke:#79a45e;opacity:1;stroke-dasharray:none;}
.eraser-tray {position:absolute;right:0;top:calc(100% + 12px);width:53px;height:24px;border:1px dashed #8a947866;border-top:0;border-bottom:2px solid #8a9478;border-radius:0 0 4px 4px;}
.quest-weight {position:absolute;width:44px;height:16px;padding:0;border:1px solid #9d6a76;border-radius:3px 1px;background:linear-gradient(105deg,#dc9fa9 0 63%,#78a6af 63%);box-shadow:1px 2px 2px #0003;transform:rotate(-6deg);z-index:5;cursor:grab;touch-action:none;}
.quest-weight>span {font:600 6px/1 system-ui,sans-serif;letter-spacing:.4px;color:#704550;position:absolute;left:4px;top:5px;}
.quest-weight.is-carried {z-index:10006;opacity:.9;cursor:grabbing;}
.quest-stamp {position:absolute;width:36px;height:40px;z-index:3;text-align:center;pointer-events:none;}
.quest-stamp svg {width:32px;height:32px;}
.quest-stamp small {display:block;font:8px/1 system-ui,sans-serif;color:#4b81ad;white-space:nowrap;margin-left:-5px;}
.quest-stamp[hidden] {display:none;}
#find-stamp {border-color:#678da7;color:#456d8e;}
#find-stamp.has-stamp {border-color:#789458;color:#5c7942;}
.sealed-door {position:absolute;width:74px;height:104px;padding:0;border:0;background:transparent;z-index:6;perspective:400px;cursor:help;}
.door-panel {position:absolute;inset:0;display:block;border:1px solid #9d875e;border-top:4px solid #af9568;border-radius:3px 5px 1px;background:linear-gradient(100deg,#d1bc8e,#f5e4b8 24%,#e8d7ab 88%,#cdb889);box-shadow:3px 3px 0 #0002;transform-origin:left center;transition:transform .4s ease,opacity .4s ease;}
.door-panel::before {content:'';position:absolute;inset:10px 9px;border:1px dashed #af976588;}
.wax-seal {position:absolute;left:19px;top:27px;width:34px;height:34px;border-radius:50%;background:#467faf;border:2px solid #315a7e;box-shadow:1px 2px 0 #315a7e77;}
.wax-seal svg {width:29px;height:29px;}
.door-panel>small {position:absolute;bottom:10px;left:0;right:0;font:7px/1.3 monospace;letter-spacing:.3px;color:#665337;}
.sealed-door[data-unlocked="true"] .wax-seal::after {content:'';position:absolute;inset:11px -3px;border-top:3px solid #e4d3a6;transform:rotate(-25deg);}
.sealed-door.is-open {pointer-events:none;}
.sealed-door.is-open .door-panel {transform:rotateY(-112deg);opacity:.2;}
.lift-tabs button:focus-visible,.quest-weight:focus-visible,.sealed-door:focus-visible {outline:2px dashed var(--theme-accent,#b82d3d);outline-offset:4px;}
html[data-theme="dark"] .ledge.quest-pressure-bridge {background:transparent;border:0;box-shadow:none;}
html[data-theme="dark"] .bridge-front {background:#72634b;border-color:#b4a275;border-top-color:#c6af7e;}
html[data-theme="dark"] .ledge[data-mechanic="lift"] {background:#405b65;border-color:#88a6ae;}
html[data-theme="dark"] #find-stamp {color:#aad0ec;}
html[data-theme="dark"] #find-stamp.has-stamp {color:#b7d49d;}
html[data-theme="dark"] .quest-stamp small {color:#aad0ec;}
@media(max-width:600px){.bridge-front{padding:8px}.bridge-front>span{font-size:8px}.bridge-front>p{font-size:14px!important}.lift-tabs{gap:3px}.lift-tabs button{font-size:9px;padding:4px}.mechanic-tag{font-size:8px}}
@media(prefers-reduced-motion:reduce){.door-panel{transition:none;}}
/* Short, visible lessons; only the current puzzle's tools are shown. */
.quest-controls [hidden] {display:none!important;}
.quest-tutorial {padding:1px 0 8px;margin-bottom:8px;border-bottom:1px dashed #9e947b66;max-width:950px;}
#tutorial-title {font:600 15px/1.3 system-ui,sans-serif;color:var(--ink);}
#tutorial-copy {margin:5px 0 0;font:12px/1.45 system-ui,sans-serif!important;color:var(--quest-muted);}
#lesson-objectives {display:flex;flex-wrap:wrap;gap:5px 12px;margin-top:6px;font:11px/1.4 system-ui,sans-serif;color:var(--quest-muted);}
#lesson-objectives:empty,#building-status:empty {display:none;}
#lesson-objectives .is-done {color:#688548;}
#quest-help-dialog {width:min(510px,calc(100vw - 28px));max-height:calc(100dvh - 30px);padding:22px;border:1px solid var(--theme-edge,#81795d);border-radius:5px 13px;background:var(--paper);color:var(--ink);box-shadow:5px 8px 0 #0002;}
#quest-help-dialog::backdrop {background:#1b182766;backdrop-filter:blur(2px);}
#quest-help-dialog h2 {font-size:32px;font-weight:normal;margin:0 0 12px;}
#quest-help-dialog p,#quest-help-dialog li {font:13px/1.6 system-ui,sans-serif!important;}
#quest-help-dialog ol {padding-left:22px;}
#quest-help-dialog li {padding-left:3px;margin-bottom:9px;}
#help-lesson {border-left:3px solid #b59a57;padding-left:12px;}
#quest-help-close {padding:8px 16px;border:1px solid #a67f39;border-radius:4px;background:#f0d89a;color:#5a4520;cursor:pointer;font:13px system-ui,sans-serif;}
html[data-theme="dark"] #lesson-objectives .is-done {color:#b6d493;}
@media(max-width:600px){.quest-tutorial{padding-bottom:6px;margin-bottom:6px}#tutorial-title{font-size:13px}#tutorial-copy{font-size:11px!important}#lesson-objectives{font-size:10px}.quest-controls{gap:5px}}
/* Inventory / objectives / level menu. */
header {gap:10px;}
#quest-menu {position:relative;flex:0 0 auto;}
#quest-menu>summary {list-style:none;display:grid;place-items:center;width:34px;height:32px;border:1px solid var(--theme-edge,#8a8266);border-radius:4px;background:var(--paper);color:var(--ink);font:22px/1 system-ui;cursor:pointer;}
#quest-menu>summary::-webkit-details-marker {display:none;}
.settings-panel {position:absolute;right:0;top:calc(100% + 9px);width:244px;max-height:calc(100dvh - 65px);overflow:auto;display:flex;flex-wrap:wrap;gap:7px;padding:14px;border:1px solid var(--theme-edge,#8a8266);border-radius:5px 2px 9px;background:var(--paper);box-shadow:3px 5px 15px #0003;color:var(--ink);}
#quest-menu:not([open]) .settings-panel {display:none;}
.settings-panel>strong {display:block;flex-basis:100%;font:600 11px/1.4 system-ui;text-transform:uppercase;letter-spacing:.8px;color:var(--quest-muted);}
.settings-panel button {padding:7px 9px;border:1px solid var(--theme-edge,#8a8266);border-radius:4px;background:var(--paper);color:var(--ink);font:12px system-ui;cursor:pointer;}
.settings-panel label {font:12px/1.5 system-ui;}.settings-panel hr {width:100%;border:0;border-top:1px dashed #8886;margin:5px 0;}
.settings-panel [hidden] {display:none!important;}
.settings-panel button:disabled {opacity:.45;cursor:default;}
#quest-appearance {width:100%;}#quest-appearance .themeControls {justify-content:flex-start;flex-wrap:wrap;}
.quest-hud {display:grid;grid-template-columns:minmax(410px,1fr) minmax(0,1.4fr);gap:4px 24px;padding:10px 14px;}
.quest-objectives {grid-column:2;grid-row:1/4;align-self:center;}
.hud-caption {display:block;color:var(--quest-muted);font:600 9px/1.3 system-ui;letter-spacing:1.4px;margin-bottom:5px;}
#tutorial-title {display:block;font-size:14px;}
#tutorial-copy {font-size:12px!important;max-width:760px;margin-top:4px;}
.inventory-bar {grid-column:1;grid-row:1;position:relative;padding-right:58px;}
.inventory-bar .quest-controls {gap:5px;flex-wrap:nowrap;align-items:center;}
.quest-controls .inventory-item {position:relative;flex:0 0 63px;width:63px;height:69px;padding:1px 2px 3px;border:1px solid transparent;border-radius:5px 5px 12px 4px;background:transparent;box-shadow:none;touch-action:none;}
.inventory-item>svg {display:block;width:55px;height:44px;overflow:visible;margin:auto;filter:drop-shadow(1px 2px 1px #0002);}
.inventory-item>span {font:10px/1.2 system-ui;color:var(--ink);display:block;white-space:nowrap;}
.inventory-item>small {position:absolute;right:1px;top:0;border-radius:8px;min-width:15px;padding:1px 3px;font:600 10px/1.2 system-ui;background:var(--paper);color:var(--ink);border:1px solid #9b8b6d88;}
.quest-controls .inventory-item:hover:not(:disabled),.quest-controls .inventory-item:focus-visible {border-color:#b89c68;background:#b79b5910;}
.quest-controls .inventory-item:disabled {opacity:.42;cursor:default;}.quest-controls .inventory-item.is-locked {opacity:.5;}
.quest-controls .coin-bag {cursor:pointer;}.coin-bag:not(:disabled):active>svg {transform:rotate(-8deg) translateY(2px);}
.quest-controls #note-pile {flex:0 0 63px;width:63px;height:69px;min-height:69px;margin:0;padding:0;}
#note-pile .pile-sheet {inset:5px 2px 7px 0;}#note-pile .pile-label {font-size:14px;left:7px;top:7px;}#note-pile #note-count{right:9px;bottom:4px;}
.find-tim-button {position:absolute;right:0;bottom:10px;padding:5px 6px;border:1px solid var(--theme-edge,#8a8266);border-radius:4px;background:var(--paper);color:var(--ink);font:10px/1.2 system-ui;cursor:pointer;}
#quest-status,#building-status {grid-column:1;min-height:0;font-size:10px!important;margin:1px 0;line-height:1.35;}
#quest-status:empty {display:none;}
.pan-help {display:none;}#lesson-objectives {font-size:10px;margin-top:5px;gap:3px 10px;}
.quest-weight[hidden] {display:none;}.quest-weight:disabled {cursor:help;box-shadow:0 0 0 4px #e7b3bc33;}.quest-weight.is-carried {z-index:10010;}
.quest-rope {position:absolute;inset:0;pointer-events:none;z-index:4;}
.quest-rope>svg {position:absolute;inset:0;width:100%;height:100%;overflow:visible;pointer-events:none;}
.rope-shadow {fill:none;stroke:#705338;stroke-width:4;stroke-linecap:round;stroke-linejoin:round;}
.rope-string {fill:none;stroke:#dfc798;stroke-width:2.6;stroke-linecap:round;stroke-linejoin:round;}
.rope-twist {fill:none;stroke:#a88651;stroke-width:.8;stroke-dasharray:2 5;}
.rope-hook {position:absolute;width:24px;height:26px;padding:0;border:0;background:none;pointer-events:auto;cursor:grab;touch-action:none;}
.rope-hook svg {width:100%;height:100%;overflow:visible;}.quest-rope.is-spent .rope-hook {pointer-events:none;}
.quest-rope.is-placing {z-index:10008;opacity:.75;}.quest-rope.is-placing .rope-hook {pointer-events:none;}
.quest-jump-pad {position:absolute;width:32px;height:46px;z-index:4;}
.quest-jump-pad button {width:100%;height:100%;padding:0;border:0;background:none;cursor:grab;touch-action:none;}.quest-jump-pad svg {width:100%;height:100%;overflow:visible;}
.quest-jump-pad.is-placing {z-index:10008;pointer-events:none;opacity:.8;}
.rope-hook:focus-visible,.quest-jump-pad button:focus-visible,#quest-menu>summary:focus-visible,.find-tim-button:focus-visible {outline:2px dashed var(--theme-accent,#b82d3d);outline-offset:3px;}
@media(max-width:1000px){.quest-hud{grid-template-columns:1fr}.quest-objectives{grid-column:1;grid-row:1}.inventory-bar{grid-row:2;padding-right:56px;margin-top:3px}#quest-status,#building-status{grid-column:1}#tutorial-copy{font-size:11px!important}.hud-caption{margin-bottom:3px}#lesson-objectives{margin-top:4px}.quest-controls .inventory-item,.quest-controls #note-pile{flex-basis:57px;width:57px;height:61px;min-height:61px}.inventory-item>svg{width:47px;height:37px}.inventory-item>span{font-size:9px}#note-pile .pile-sheet{inset:3px 2px 5px 0}}
@media(max-width:430px){.quest-hud{inset-inline:6px;padding:8px}.inventory-bar{padding-right:0}.find-tim-button{right:0;top:-24px;bottom:auto}#tutorial-copy{line-height:1.35}.quest-controls .inventory-item,.quest-controls #note-pile{flex-basis:54px;width:54px}#tutorial-title{font-size:13px}.quest-objectives>.hud-caption{display:none}.inventory-item>small{font-size:9px}.inventory-item>svg{width:44px}}

@media(max-width:600px){#tutorial-copy{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3;overflow:hidden}}

.level-jump {display:flex;flex-wrap:wrap;align-items:center;gap:6px;width:100%;margin:1px 0 5px;}
.level-jump>label {flex-basis:100%;font:12px/1.4 system-ui;color:var(--ink);}
.level-jump>select {flex:1;min-width:0;width:155px;min-height:32px;padding:5px 4px;border:1px solid var(--theme-edge,#8a8266);border-radius:4px;background:var(--paper);color:var(--ink);font:11px/1.3 system-ui;}
.level-jump>button {flex:0 0 auto;min-height:32px;}
.level-jump>select:focus-visible {outline:2px dashed var(--theme-accent,#b82d3d);outline-offset:2px;}

.quest-guide {position:fixed;inset:0;z-index:10005;pointer-events:none;color:#705027;}
.quest-guide[hidden],.quest-guide [hidden] {display:none!important;}
.guide-arrow {position:absolute;inset:0;width:100%;height:100%;overflow:visible;}
.guide-line {fill:none;stroke:currentColor;stroke-width:2.5;stroke-linecap:round;stroke-dasharray:5 5;}
#guide-arrowhead path {fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;}
.guide-target {position:absolute;border:2px dashed #b78b32;border-radius:12px;box-shadow:0 0 0 4px #edc35522;}
.guide-card {position:absolute;width:264px;max-width:calc(100vw - 24px);padding:14px 16px 12px;background:#fff5d6;border:1px solid #b69a5a;border-radius:4px 12px 7px 10px;box-shadow:3px 4px 0 #71542022,0 5px 20px #0001;pointer-events:auto;}
.guide-step {font:600 9px/1.4 system-ui,sans-serif;letter-spacing:1.2px;}
.guide-card h2 {font:23px/1.15 myhandwritingBold,Georgia,serif;margin:6px 0;}
.guide-card p {font:12px/1.5 system-ui,sans-serif!important;margin:0;}
.guide-actions {display:flex;flex-wrap:wrap;align-items:center;gap:6px 12px;margin-top:12px;}
.guide-actions button {font:600 11px/1.3 system-ui,sans-serif;padding:7px 9px;color:inherit;background:#f7e0a0;border:1px solid #b69a5a;border-radius:4px;cursor:pointer;}
.guide-actions [data-guide-skip] {font-weight:400;background:none;border-color:transparent;padding-inline:0;text-decoration:underline;text-underline-offset:3px;}
.guide-actions button:focus-visible {outline:2px dashed currentColor;outline-offset:3px;}
html[data-theme="dark"] .quest-guide {color:#ffedbb;}
html[data-theme="dark"] .guide-card {background:#403a2c;border-color:#b89e65;box-shadow:3px 4px 0 #0004,0 5px 20px #0003;}
html[data-theme="dark"] .guide-actions button {background:#5b4c2a;}
html[data-theme="dark"] .guide-actions [data-guide-skip] {background:none;}
