*{box-sizing:border-box}
:root{color:#392b20;background:#f4dfad;font-family:Georgia,serif}body{margin:0;height:100vh;height:100svh;min-height:340px;display:flex;flex-direction:column}
header{height:clamp(62px,10vh,94px);flex:none;display:flex;align-items:center;justify-content:space-between;padding:0 clamp(16px,3vw,52px);border-bottom:2px solid #493421;background:#faeac5}
.mast{display:flex;align-items:center;gap:18px}.mast svg{width:clamp(40px,4vw,62px);transform:rotate(-8deg)}h1{font-size:clamp(40px,4.6vw,70px);line-height:1;letter-spacing:-.085em;font-weight:normal;margin:0 0 .08em}
.tiktok{display:grid;place-items:center;background:#412d1f;color:#ffedc4;border-radius:50%;width:42px;height:42px}.tiktok svg{width:19px}
main{position:relative;flex:1;min-height:0;display:flex;flex-direction:column}#stage{overflow:hidden;flex:1;min-height:0;background:#f6dea0;touch-action:none;cursor:grab;outline-offset:-4px}#stage.moving{cursor:grabbing}#world{width:100%;height:100%;display:block}.quarry{cursor:inherit}.halo{stroke:none;fill:none}.found .halo{stroke:#6d5722;fill:#fcdf6844;stroke-dasharray:2 4;stroke-width:2.7}.quarry:focus-visible .halo{stroke:#4e4021;stroke-width:3}
.dock{flex:none;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:8px clamp(12px,3vw,50px);border-top:2px solid #493421;background:#f8e9c8}.hunt,.controls{display:flex;gap:4px;align-items:center}button{color:inherit;cursor:pointer;display:grid;place-items:center;border:1px solid transparent;background:transparent;border-radius:6px;width:42px;height:42px;position:relative}.controls button{border-color:#553c2844}.controls svg{width:17px}.clue{width:52px;height:48px}.clue svg{width:46px;height:38px}.clue i{position:absolute;bottom:0;width:5px;height:5px;background:#a9976a;border-radius:50%}.clue.got{background:#d3bd83}.clue.got i{background:#493720}.clue.selected{border-color:#895d31}.clue:hover,.controls button:hover,.tiktok:hover{box-shadow:inset 0 0 0 2px #b58342}.sr{position:absolute;clip-path:inset(50%);width:1px;height:1px;overflow:hidden}.wiggle{transform-box:fill-box;transform-origin:50% 90%;animation:sway 5s ease-in-out infinite alternate}.done .dock{background:#eacc83}
@keyframes sway{from{transform:rotate(-4deg)}to{transform:rotate(4deg)}}@media(prefers-reduced-motion:reduce){:root:not([data-scene-motion="on"]) *,:root:not([data-scene-motion="on"]) *::before,:root:not([data-scene-motion="on"]) *::after{animation:none!important}}
@media(max-width:580px){.dock{gap:3px;padding:7px 4px}.clue{width:clamp(30px,9.8vw,44px);height:43px}.clue svg{width:100%;height:31px}.controls button{width:clamp(27px,9vw,38px);height:38px}.controls,.hunt{gap:1px}.mast{gap:10px}}
.hunt{overflow-x:auto;min-width:0;scrollbar-width:thin;scrollbar-color:#ab9061 transparent;padding:1px 2px 3px}.clue,.controls{flex-shrink:0}.token{width:39px;height:35px;object-fit:contain;border-radius:4px}.portrait-token{width:29px;height:36px;border:1px solid #795a33;object-position:50% 28%}.clue:first-child{margin-left:1px}.clue.selected{background:#f4d08b}
#photo-dialog{padding:7px;border:1px solid #715b39;background:#f7e6bd;border-radius:5px;max-height:92svh;max-width:92vw;overflow:visible;box-shadow:0 16px 80px #160e0aaa}
#photo-dialog::backdrop{background:#271d16d9}#full-photo{display:block;max-height:83svh;max-width:82vw;width:auto;height:auto}#photo-close{position:absolute;right:12px;top:12px;background:#38291ded;color:white;width:38px;height:38px;border-radius:50%;z-index:1}#photo-close svg{width:18px}
.puff{animation:vapour 4s ease-out infinite;transform-origin:center}.bubble{animation:surface 3.1s ease-out infinite}.puff,.bubble{pointer-events:none}g:nth-of-type(2n)>.puff,g:nth-of-type(2n)>.bubble{animation-delay:-1.5s}
@keyframes vapour{0%{opacity:.12;transform:translateY(0) scale(.7)}35%{opacity:.6}100%{opacity:0;transform:translate(6px,-20px) scale(1.35)}}
@keyframes surface{0%{opacity:0;transform:translateY(4px)}40%{opacity:.8}100%{opacity:0;transform:translate(2px,-14px)}}
@media(max-width:720px){.dock{padding:4px 7px;gap:6px;display:grid;grid-template-columns:minmax(0,1fr) auto}.clue{width:43px}.token{width:31px;height:30px}.portrait-token{width:24px;height:30px}.controls{gap:1px}.controls button{width:32px;height:40px}}
.mast{color:inherit;text-decoration:none}.mast h1{font-size:clamp(26px,4.1vw,58px)}header{gap:12px}.seals{display:flex;gap:7px;margin-left:auto}.seals i{width:13px;height:13px;transform:rotate(45deg);border:1.5px solid #8a6846}.seals .earned{background:#94682d}.seals .current{box-shadow:inset 0 0 0 2px #faeac5;background:#ca9c52}.quarry.inactive{pointer-events:none}.clue[hidden],button[hidden]{display:none}.clue.got:after{content:'✓';position:absolute;right:0;bottom:0;border-radius:50%;color:#fff;background:#445033;padding:0 3px;font:10px/14px sans-serif}
#milestone{border:3px double #8b6a43;border-radius:10px;background:#f8e9c8;color:#402a1b;padding:19px;max-width:90vw;box-shadow:0 12px 50px #241c1866}#milestone::backdrop{background:#30261c99}#reward-art{display:flex;align-items:center;justify-content:center;gap:12px;min-width:155px;color:#956626}#reward-art img{width:clamp(65px,14vw,115px);height:clamp(88px,19vw,154px);object-fit:cover;object-position:center 30%;border:4px solid #fff1cf;outline:1px solid #998259;transform:rotate(-3deg)}#reward-art img+img{transform:rotate(4deg)}#reward-art svg{width:58px;height:58px}.reward-actions{display:flex;justify-content:center;gap:8px;margin-top:18px}.reward-actions button{background:#422e20;color:#f6dfab;border-radius:50%;width:45px;height:45px}.reward-actions svg{width:21px}
@media(max-width:520px){.mast svg{width:30px}.mast{gap:7px}header{padding:0 10px;gap:7px}.seals{gap:4px}.seals i{width:8px;height:8px}.tiktok{width:35px;height:35px}.dock{grid-template-columns:minmax(0,1fr) auto}}
.reward-copy{max-width:29ch;text-align:center;line-height:1.45;margin:16px auto 6px;font:italic 19px/1.42 Georgia,serif;color:#503723}
header{padding-top:env(safe-area-inset-top)}.dock{padding-bottom:max(6px,env(safe-area-inset-bottom))}.clue,#photo-close{min-height:44px;min-width:44px}.hunt{overscroll-behavior-x:contain}
@media(max-width:650px){body{height:100dvh;min-height:240px}.dock{display:flex;flex-wrap:wrap;gap:1px;padding-inline:max(8px,env(safe-area-inset-left));justify-content:center}.hunt{width:100%;justify-content:safe center}.controls{justify-content:center;gap:8px}.controls button{width:44px;height:44px}.clue{flex:0 0 46px}.mast h1{font-size:clamp(20px,6.2vw,33px)}.mast svg{width:25px}.seals{gap:3px}}
@media(max-height:500px) and (orientation:landscape){header{height:40px}.mast h1{font-size:23px}.dock{display:flex;flex-wrap:nowrap}.hunt{width:auto}.controls{gap:0}.clue{height:42px}.tiktok{height:33px;width:33px}}
.mast small{font:600 9px/1 monospace;text-transform:uppercase;letter-spacing:.14em;color:#86592e;vertical-align:middle}.album-button{border:1px solid #95764c;border-radius:50%;width:44px;height:44px}.album-button svg{width:22px}
#sheet{width:min(680px,94vw);max-height:89dvh;overflow:auto;padding:20px;border:3px double #896741;background:#f7e9cb;color:#442e20;border-radius:6px}#sheet::backdrop{background:#261b14c7}#sheet header{height:auto;padding:0;border:none;background:none}#sheet h2{font:italic 32px Georgia,serif;letter-spacing:-.05em;margin:0}#sheet-count{font:11px monospace;letter-spacing:.06em}#close-sheet{background:#423223;color:#f9efd6;border-radius:50%;font-size:22px;width:44px;height:44px}#frames{display:grid;grid-template-columns:repeat(auto-fill,minmax(74px,1fr));gap:8px}.film-frame{height:85px;width:100%;padding:5px 5px 15px;background:#45392d;border:1px solid #30281e;border-radius:1px;color:#f7d995}.film-frame:disabled{opacity:.65;cursor:default}.film-frame img{width:100%;height:60px;object-fit:contain}.film-frame span{position:absolute;bottom:2px;right:5px;font:9px monospace}.film-frame:disabled:before{content:'◇';color:#c7b28a;font:17px Georgia}
@media(max-width:400px){.mast small{display:none}#sheet{padding:12px}#frames{grid-template-columns:repeat(3,minmax(0,1fr))}}
#sound-toggle .sound-off,#sound-toggle[aria-pressed="false"] .sound-on{display:none}
#sound-toggle[aria-pressed="false"] .sound-off{display:block}
#sound-toggle[aria-pressed="true"]{background:#e9d6a84d}

/* The open field note floats above the paper, leaving the player's framing alone. */
.scene-window{position:relative;display:flex;flex:1 1 0;min-height:0;flex-direction:column}
#riddle-panel{
 position:absolute;z-index:2;left:clamp(9px,2vw,28px);bottom:12px;width:min(354px,calc(100% - 18px));
 max-height:calc(100% - 16px);overflow:auto;padding:14px 44px 9px 17px;
 border:1px solid #775936;border-left:4px solid #945c2d;border-radius:2px;
 background:linear-gradient(116deg,#fff4d8,#f6e4b8);box-shadow:0 2px 1px #67451c44,0 5px 16px #30221538;color:#382b20;
}
#riddle-panel[hidden]{display:none}
.riddle-heading,.chapter-stamp{
 font:600 11px/1.2 ui-monospace,SFMono-Regular,Consolas,monospace;font-variant-numeric:tabular-nums;letter-spacing:.12em;
}
.riddle-heading{display:flex;align-items:center;gap:7px;color:#77502e;text-transform:uppercase}
.riddle-mark{color:#926522;font-size:12px}
#riddle-text{margin:7px 0 4px;font:italic 17px/1.32 Georgia,serif;text-wrap:pretty}
#riddle-close{position:absolute;right:1px;top:0;width:40px;height:40px}
#riddle-close svg{height:16px;fill:none;stroke:currentColor;stroke-width:1.5}
#riddle-more{display:block;width:auto;height:auto;min-height:34px;padding:5px 0;color:#724a27;text-decoration:underline;text-underline-offset:3px;font:600 12px/1.3 Georgia,serif}
#riddle-panel button:focus-visible,.clue:focus-visible{outline:2px solid #704d2b;outline-offset:-2px}
.chapter-stamp{display:inline-block;border-block:1px solid #ac8e59;padding:6px 9px;color:#6d4d2e;text-transform:uppercase}
.hunt{gap:3px}
.clue{padding:2px;border:1px solid #a58a5c;border-radius:3px;background:#f7e9c6}
.clue.selected{border-color:#674421;background:#eed298;box-shadow:inset 0 -3px #82572e}
.clue.got{border-color:#a58e5d}
@media(max-width:650px){
 #riddle-panel{left:8px;bottom:6px;padding:9px 36px 3px 13px;width:min(340px,calc(100% - 16px))}
 #riddle-text{font-size:16px;line-height:1.28;margin:4px 0 1px}
 #riddle-more{min-height:34px}#riddle-close{width:36px}
 .controls{gap:clamp(1px,1.1vw,7px)}
}
@media(max-height:500px) and (orientation:landscape){
 #riddle-panel{bottom:5px;padding:6px 34px 3px 10px;width:310px}
 #riddle-text{font-size:15px;margin:3px 0 0}
 #riddle-more{min-height:28px}
}
