/* Castle: stone, timber, brass, ink. All controls belong to the same world. */
#castle-canvas{position:absolute;inset:0;width:100%;height:100%;z-index:0;touch-action:none;outline:none}.arena>#canvas{position:relative;z-index:1}.immersive .arena>#canvas{pointer-events:none}.arena-overlay{z-index:5}#transition{z-index:4}.immersive .arena{background:#111b20}.immersive .game-header{z-index:8;height:56px;background:linear-gradient(#080d0ee8,transparent)}.immersive .game-brand{font-size:11px;letter-spacing:.12em}.immersive .mobile-controls,.direction-pad{display:none!important}
#castle-hud{position:absolute;inset:0;z-index:2;pointer-events:none;color:#eee2c3;background:radial-gradient(ellipse at 50% 45%,transparent 50%,#050b1460)}.castle-status{position:absolute;top:80px;left:28px}#castle-room{font:12px Georgia;letter-spacing:.18em;color:#dcc698}.seal-row{display:flex;align-items:center;gap:10px;margin-top:13px}.seal-icon{display:grid;place-items:center;width:30px;height:30px;background:#441e24;border:2px ridge #996546;border-radius:46% 49% 44% 48%;font:14px Georgia;color:#a78464}.seal-icon.done{background:#943e3b;color:#ffdfab;box-shadow:0 2px 10px #0005}.seal-icon:nth-child(3){display:none}#castle-seals{font:12px Georgia;margin-left:5px}.castle-stats{position:absolute;right:28px;top:83px;color:#cbb38a;font:11px Georgia;letter-spacing:.12em}#castle-time{display:none}#castle-objective{position:absolute;left:28px;bottom:28px;font:14px/1.5 Georgia;color:#e7dcc0;max-width:420px;text-shadow:0 2px 5px #000}#castle-toast{position:absolute;top:155px;left:50%;transform:translateX(-50%);width:min(590px,80%);text-align:center;font:20px/1.5 Georgia;color:#ffe9b9;opacity:0;text-shadow:0 2px 8px #000}.toast-in{animation:toast 4.5s ease both}
#castle-map{position:absolute;right:26px;top:122px;width:134px;height:134px;border:1px solid #b7a37130;border-radius:50%;background:#10191299;box-shadow:inset 0 0 30px #0005;font:7px Georgia;color:#b6b4a0}.map-n,.map-s,.map-c,.map-w,.map-e{position:absolute;display:grid;place-items:center;border:1px solid #68858a33;background:#c1b88109}.map-c{width:32px;height:38px;left:50px;top:48px}.map-n{width:32px;height:29px;left:50px;top:16px}.map-s{width:32px;height:29px;left:50px;top:89px}.map-w{width:39px;height:38px;left:8px;top:48px}.map-e{width:39px;height:38px;left:85px;top:48px}#map-player{position:absolute;width:6px;height:6px;border-radius:50%;background:#f4d599;box-shadow:0 0 5px #efd896;left:65px;top:72px}
#explore-pad{position:absolute;right:26px;bottom:52px;z-index:4;pointer-events:none}#castle-interact{pointer-events:auto;max-width:300px;min-height:52px;padding:12px 22px;background:#111c1dcc;border:1px solid #b6a57855;color:#aeb7ab;font:15px Georgia;border-radius:2px;box-shadow:0 7px 18px #0004}#castle-interact.available{color:#302314;background:linear-gradient(#efdbac,#c2a36c);border-color:#d8c493}.castle-keyboard{position:absolute;right:0;bottom:-25px;color:#b4b9ac;font:11px Georgia;white-space:nowrap}
#pocket-clues{position:absolute;bottom:96px;left:24px;z-index:3;display:flex;align-items:center;gap:16px;max-width:calc(100% - 48px);background:#ecddba;color:#49371e;padding:13px 20px;box-shadow:0 7px 20px #0004;transform:rotate(-1deg);font:15px Georgia}#pocket-clues>span{font:10px Georgia;max-width:48px;text-transform:uppercase;letter-spacing:.08em}#pocket-clues b{font-weight:normal;white-space:nowrap}#pocket-clues em{display:inline-block;font:26px Hand,cursive;margin-left:7px;color:#813932}
/* Three tactile choices replace native menus. */
.castle-intro .intro-panel{max-width:720px}.immersive .intro-panel h2{font:normal clamp(38px,5vw,68px)/1.02 Georgia;letter-spacing:-.04em;margin:16px 0 22px}.immersive .intro-panel p{font:17px/1.6 Georgia;color:#cfc7b3}.immersive .intro-panel .eyebrow{font:10px Georgia;letter-spacing:.23em}.immersive .arena-overlay:not(.reveal){background:radial-gradient(ellipse,#101b19b0,#050c13ec);backdrop-filter:blur(3px)}.difficulty-seals{border:0;display:flex;justify-content:center;gap:32px;margin:25px 0 16px;padding:0}.difficulty-seals legend{font:12px Georgia;color:#baac8a;letter-spacing:.08em;margin:0 auto 17px}.difficulty-seals button{border:0;background:none;color:#d4c5a3;padding:0 9px;display:flex;flex-direction:column;align-items:center;gap:7px;min-width:110px;cursor:pointer}.choice-seal{width:64px;height:64px;display:grid;place-items:center;border:6px ridge #68352e;border-radius:45% 48% 44% 49%;background:radial-gradient(at 40% 28%,#925247,#50221f);box-shadow:0 7px 9px #0007,inset 0 0 12px #301712;color:#bf8c70;font:26px Georgia;transition:transform .25s,color .25s,box-shadow .25s}.difficulty-seals button[aria-pressed=true] .choice-seal{border-color:#ba8052;color:#ffdf9f;transform:translateY(-5px);box-shadow:0 7px 9px #0007,0 0 0 2px #e2ba79}.difficulty-seals strong{font:18px Georgia}.difficulty-seals small{font:12px Georgia;color:#a99e86}.immersive .intro-panel .year-help{font:12px/1.7 Georgia;color:#b6b1a0;min-height:41px;margin:15px 0 20px}.castle-intro .intro-panel>small{display:block;font:12px/1.65 Georgia;color:#aeb7af;margin-top:18px}#castle-error{color:#ffd3ae}
/* Notes open with a paper motion. Mission props fill the scene, not a web card. */
#castle-task{position:absolute;inset:0;z-index:9;display:grid;place-items:center;padding:32px;overflow:auto;background:#040806cb;backdrop-filter:blur(7px);perspective:1200px;animation:veil .25s both}.task-frame{position:relative;width:min(790px,100%);margin:auto;background:radial-gradient(at 45% 30%,#f2e3c0,#d7c297);box-shadow:0 25px 90px #000b,inset 0 0 50px #81613920;border:1px solid #a99062;color:#3b2d20;text-align:center;padding:65px 45px 35px;animation:unroll .5s cubic-bezier(.2,.8,.2,1) both}.task-frame:before,.task-frame:after{content:'';position:absolute;left:-5px;right:-5px;height:10px;background:linear-gradient(#b49a68,#e4cea0 50%,#9c8051);border:1px solid #967c51}.task-frame:before{top:-3px}.task-frame:after{bottom:-3px}.task-exit{position:absolute;right:15px;top:10px;min-height:44px;padding:8px 14px;border:0;background:none;font:14px Georgia;color:#5a452b;cursor:pointer}.task-kicker{font:10px Georgia;letter-spacing:.18em;color:#806b46}.task-frame h2{font:normal clamp(27px,3.2vw,42px)/1.12 Georgia;letter-spacing:-.03em;margin:14px 0}.task-copy{font:16px/1.5 Georgia;color:#786245}.ink-label{font:11px Georgia;letter-spacing:.11em;color:#826a47;text-transform:uppercase}#task-feedback{font:16px/1.5 Georgia;min-height:25px;max-width:750px;margin:20px auto 0;color:#5e4025}.parchment-button{min-height:50px;border:1px solid #a0875d;padding:13px 25px;background:linear-gradient(#f2e3bf,#d8c092);color:#3b2a18;box-shadow:0 4px 12px #0003;font:16px Georgia;cursor:pointer}.hint-button{border:0;background:none;color:inherit;text-decoration:underline;text-underline-offset:5px;min-height:48px;padding:12px 15px;font:14px Georgia;cursor:pointer}.prop-actions{display:flex;align-items:center;justify-content:center;gap:20px;margin-top:22px;flex-wrap:wrap}.wax-action{display:inline-flex;align-items:center;justify-content:center;gap:15px;min-height:58px;border:0;background:none;color:inherit;font:18px Georgia;cursor:pointer}.wax-action>span{display:grid;place-items:center;background:radial-gradient(at 35% 25%,#ae5448,#69251f);border:5px ridge #a34f3d;border-radius:44% 49% 47% 46%;width:51px;height:51px;color:#e7b58b;box-shadow:0 4px 9px #0005}.seal-broken>span{animation:break-seal .7s both}
#castle-task.prop-scene{background:radial-gradient(ellipse at 55% 20%,#6a4c30a6,transparent 70%),repeating-linear-gradient(92deg,#241910 0,#302117 3px,#3b291c 92px,#20150f 94px);box-shadow:inset 0 0 130px #000b;padding:24px 30px}.prop-scene .task-frame{border:0;width:min(1080px,100%);background:none;box-shadow:none;color:#e4d1af;padding:50px 0 10px;animation:prop-in .5s ease both}.prop-scene .task-frame:before,.prop-scene .task-frame:after{display:none}.prop-scene .task-exit{color:#e4cda2;top:0;right:0}.prop-scene .task-kicker{color:#bca47a}.prop-scene .task-frame h2{color:#f0d9b2;font-size:clamp(28px,3vw,42px);margin-bottom:28px}.prop-scene #task-feedback{color:#f5dba9;text-shadow:0 2px 4px #000;min-height:30px}.prop-scene .hint-button{color:#d0b891}.desk-composition{display:grid;grid-template-columns:1fr 1.4fr;column-gap:55px;align-items:center;padding:0 20px}.desk-note{background:linear-gradient(110deg,#e8d5a9,#f1e1bc,#d9c294);padding:28px;box-shadow:1px 10px 20px #0005;color:#503d27;transform:rotate(-4deg);clip-path:polygon(1% 0,99% 1%,100% 99%,80% 98%,62% 100%,43% 98%,0 99%)}.desk-note p{font:30px/1.25 Hand,cursive;margin:16px 0}.desk-note small{font:14px/1.5 Georgia;color:#7b6340}.lock-chest{position:relative;background:repeating-linear-gradient(0deg,#453021,#513924 3px,#453021 72px,#251a12 74px);border:12px ridge #825f35;border-radius:80px 80px 8px 8px;padding:52px 18px 25px;box-shadow:0 25px 40px #0007,inset 0 0 35px #140f0a;transition:transform .8s,filter .8s;perspective:700px}.chest-lid{position:absolute;left:0;right:0;top:32px;height:8px;background:linear-gradient(#a9874e,#62492a);box-shadow:0 4px 5px #0006}.lock-plate{position:relative;border:6px ridge #a3824b;padding:16px 15px 12px;background:linear-gradient(120deg,#5d482c,#b09153 42%,#77613a);box-shadow:0 8px 10px #0005}.engraving{font:10px Georgia;letter-spacing:.15em;color:#362719;text-shadow:0 1px #d3b675}.combination{display:flex;justify-content:center;gap:14px;margin:16px 0}.number-wheel{width:60px;border:2px solid #4b3620;border-radius:3px;background:#342519;box-shadow:0 0 0 1px #caab71;overflow:hidden}.number-wheel button{display:block;width:100%;height:44px;border:0;background:linear-gradient(#674f31,#402e1b);color:#e5c692;font:24px Georgia;cursor:pointer}.number-wheel output{display:block;height:61px;line-height:61px;background:linear-gradient(#7e633b,#e0c48b 45%,#ab8a54);color:#342719;font:40px/61px Georgia;text-shadow:0 1px #efd398;box-shadow:inset 0 3px 8px #352917}.brass-button{border:2px ridge #d1b275;padding:11px 20px;background:linear-gradient(#c9ad76,#9c7a45);color:#3b2c1c;font:16px Georgia;min-height:48px;box-shadow:0 3px 7px #0004;cursor:pointer}.lock-chest.opened{transform:translateY(-14px) rotateX(-8deg);filter:brightness(1.6)}.found-clues{grid-column:1/-1;display:flex;justify-content:center;align-items:center;gap:15px;margin-top:27px}.found-clues>.ink-label{max-width:90px;color:#c3ac83;text-align:left}.clue-scrap{background:#d3bc91;color:#5b442a;padding:8px 16px;font:13px Georgia;transform:rotate(2deg);box-shadow:0 3px 6px #0004;min-width:83px}.clue-scrap:nth-child(3){transform:rotate(-2deg)}.clue-scrap b{display:block;font:30px Hand,cursive;margin-top:3px}.clue-scrap:not(.found){opacity:.55}.desk-composition>.prop-actions{grid-column:1/-1}
.riddle-table{max-width:830px;margin:auto}.riddle-paper{position:relative;width:min(580px,100%);margin:0 auto 28px;padding:26px 30px;background:radial-gradient(at 35% 30%,#f3e6c6,#d3bc8b);color:#44331f;box-shadow:0 10px 30px #0006;transform:rotate(-1deg);clip-path:polygon(0 2%,99% 0,100% 98%,72% 100%,52% 98%,27% 100%,0 98%)}.riddle-paper p{font:clamp(26px,3vw,35px)/1.22 Hand,cursive;margin:15px 0 0}.shadow-sketch{display:block;width:170px;height:0;opacity:0;margin:auto;transition:height .3s,opacity .3s}.shadow-sketch.shown{height:70px;opacity:1;margin-top:12px}.answer-tray{display:flex;gap:10px;justify-content:center;padding:11px;background:#1a120db0;border:2px inset #7f5a30;width:max-content;max-width:100%;margin:auto;box-shadow:0 8px 12px #0003}.letter-slot{width:56px;height:62px;background:#261b12;border:1px solid #ab89553d;color:#e1c090;font:32px Georgia;box-shadow:inset 0 2px 8px #0008;cursor:pointer}.letter-slot.filled{background:linear-gradient(135deg,#c7a674,#997343);color:#382918;border:2px ridge #c8a470;box-shadow:0 3px 5px #0004;animation:tile .2s ease}.tile-instruction{font:13px Georgia;color:#beaa86;margin:14px 0 20px}.letter-bank{display:flex;gap:12px;justify-content:center;flex-wrap:wrap}.wood-tile{width:58px;height:61px;border:3px ridge #c7a36b;background:linear-gradient(125deg,#b99a65,#d2b47f 43%,#a6824e);font:30px Georgia;color:#3e2b15;text-shadow:0 1px #edd29e;box-shadow:1px 6px 6px #0005;transform:rotate(-3deg);transition:transform .18s,opacity .18s;cursor:pointer}.wood-tile:nth-child(2n){transform:rotate(4deg)}.wood-tile:hover{transform:translateY(-4px)}.wood-tile:disabled{opacity:.15;transform:translateY(7px)}
.evidence-fragment{width:300px;max-width:100%;margin:25px auto;background:#f6e9c7;box-shadow:0 10px 20px #7b5a2533;padding:25px;transform:rotate(-3deg);clip-path:polygon(0 0,97% 1%,94% 18%,100% 32%,93% 46%,99% 64%,94% 81%,98% 100%,0 98%)}.evidence-fragment p{font:47px/1.15 Hand,cursive;margin:23px 0}.evidence-question{font:18px/1.5 Georgia;color:#725838}.joined-evidence{display:flex;justify-content:center;gap:45px;margin:40px auto;transition:gap 1s}.torn-half{padding:25px;background:#f5e6bd;font:42px/1.2 Hand,cursive;box-shadow:0 7px 16px #8c6d3744;transform:rotate(-6deg);transition:transform 1s;clip-path:polygon(0 0,96% 0,100% 17%,95% 34%,100% 51%,95% 68%,100% 85%,96% 100%,0 100%)}.torn-half+div{transform:rotate(7deg);clip-path:polygon(0 0,100% 0,100% 100%,0 100%,4% 85%,0 68%,5% 51%,0 34%,5% 17%)}.joined-evidence.joined{gap:0}.joined .torn-half{transform:rotate(0)}.witness-line{font:30px/1.4 Hand,cursive}.verdict-won{animation:veil-out .7s both}.sealed-letter{width:300px;min-height:180px;position:relative;background:#e5d3af;border:1px solid #b6a080;color:#4b3928;box-shadow:0 20px 40px #0009;transform:rotate(-4deg);animation:letter-land .9s ease both;margin:25px 0}.letter-flap{position:absolute;inset:0;clip-path:polygon(0 0,100% 0,50% 65%);background:linear-gradient(#eee0c0,#c6ad80)}.wax-seal{position:absolute;left:calc(50% - 24px);top:70px;width:48px;height:48px;display:grid;place-items:center;background:radial-gradient(#9d443e,#612320);color:#cfa07b;border:5px ridge #842f2b;border-radius:45% 50% 48% 42%;font:24px Georgia;box-shadow:0 3px 5px #53321d60}.letter-address{position:absolute;bottom:18px;left:10px;right:10px;font:21px Hand,cursive}.letter-signature{font:29px Hand,cursive;text-align:right;margin:22px 0}.script-dialog[open]{animation:unroll .5s both}.script-dialog.folding{animation:fold .24s both}.script-dialog::backdrop{animation:veil .25s both}.ending-message{font-size:30px;line-height:1.22}.ending-message p{margin:20px 0}.ending-message em{font-weight:bold;font-style:normal}.closing .task-frame{animation:fold .24s both}.closing{animation:veil-out .24s both}.arena-overlay .intro-panel{animation:prop-in .5s both}
@keyframes toast{0%{opacity:0;translate:0 8px}12%,78%{opacity:1;translate:0 0}100%{opacity:0}}@keyframes veil{from{opacity:0}to{opacity:1}}@keyframes veil-out{to{opacity:0}}@keyframes unroll{from{opacity:0;transform:translateY(25px) rotateX(-12deg);clip-path:inset(40% 0)}to{opacity:1;transform:none;clip-path:inset(0)}}@keyframes fold{to{opacity:0;transform:scale(.95);clip-path:inset(45% 0)}}@keyframes prop-in{from{opacity:0;transform:translateY(24px) scale(.97)}to{opacity:1;transform:none}}@keyframes tile{from{transform:translateY(-15px) scale(1.1)}to{transform:none}}@keyframes break-seal{to{transform:rotate(30deg) scale(1.2);opacity:0}}@keyframes letter-land{from{opacity:0;transform:translateY(-200px) rotate(15deg)}to{opacity:1;transform:translateY(0) rotate(-4deg)}}
@media(max-width:760px){.castle-status{left:18px;top:74px}.castle-stats{right:18px;top:77px;font-size:10px}#castle-map{top:107px;right:16px;transform:scale(.73);transform-origin:top right}#castle-toast{top:220px;font-size:17px}#castle-objective{left:16px;right:16px;bottom:10px;text-align:center;max-width:none;font-size:12px}#explore-pad{right:17px;bottom:56px}#castle-interact{font-size:13px;padding:11px 16px;max-width:220px}.castle-keyboard{font-size:10px}.immersive .game-header{padding:0 15px}.immersive .game-brand{font-size:9px}.difficulty-seals{gap:12px}.difficulty-seals button{min-width:80px;padding:0 4px}.choice-seal{width:58px;height:58px}.difficulty-seals strong{font-size:16px}.castle-intro{overflow:auto;align-items:start}.castle-intro .intro-panel{margin:auto;padding:25px 10px}.immersive .intro-panel h2{font-size:42px}.immersive .intro-panel p{font-size:15px}.immersive .intro-panel .year-help{font-size:11px}#castle-task{padding:18px 12px}.task-frame{padding:65px 22px 28px}.task-frame h2{font-size:29px}.task-exit{right:8px}.desk-composition{display:flex;flex-direction:column;gap:25px;padding:0}.desk-note{width:100%;max-width:400px;padding:18px 23px;transform:rotate(-2deg)}.desk-note p{font-size:26px;margin:10px 0}.lock-chest{width:min(400px,100%);padding-top:45px}.desk-composition>.prop-actions{margin-top:0}.found-clues{margin-top:0;gap:10px}.found-clues>.ink-label{font-size:9px;max-width:55px}.clue-scrap{min-width:65px;padding:8px 10px;font-size:12px}#castle-task.prop-scene{padding:18px 15px}.prop-scene .task-frame{padding-top:57px}.prop-scene .task-frame h2{font-size:31px;margin:12px 0 22px}.riddle-paper{padding:23px 15px}.riddle-paper p{font-size:28px}.answer-tray{gap:7px;padding:8px}.letter-slot{width:43px;height:53px;font-size:28px}.letter-bank{gap:8px}.wood-tile{width:45px;height:52px;font-size:26px}.prop-actions{gap:8px}.prop-scene #task-feedback{font-size:14px}.wax-action{font-size:16px}.hint-button{font-size:13px;padding:10px}.joined-evidence{gap:20px}.torn-half{font-size:33px;padding:18px}#pocket-clues{bottom:118px;left:16px;max-width:calc(100% - 32px);gap:11px;padding:10px 13px;font-size:12px}#pocket-clues em{font-size:23px}.ending-message{font-size:27px}.script-page{padding:30px 25px}}
@media(min-width:761px) and (max-height:790px){.prop-scene .task-frame{padding-top:32px}.prop-scene .task-frame h2{margin:8px 0 17px;font-size:30px}.desk-note p{font-size:28px}.riddle-paper{padding:19px 25px;margin-bottom:19px}.riddle-paper p{font-size:29px}.prop-actions{margin-top:15px}.prop-scene #task-feedback{margin-top:10px}.castle-intro .intro-panel h2{font-size:45px;margin:10px 0 15px}.difficulty-seals{margin-top:18px;gap:30px}.choice-seal{height:55px;width:55px}.castle-intro .intro-panel>small{margin-top:12px}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation-duration:.01ms!important;transition-duration:.01ms!important}.toast-in{opacity:1}.wood-tile:hover{transform:none}}
/* Keys and the final room. */
.seal-icon{border:0;background:none;border-radius:0;color:#716858;font-size:27px}.seal-icon.done{background:none;color:#ebc681;box-shadow:none}.seal-icon:nth-child(3){display:grid}#castle-task.key-scene{background:radial-gradient(at 50% 45%,#354136,#111a17 65%)}.earned-key{display:block;width:min(560px,90%);height:220px;margin:15px auto 30px;filter:drop-shadow(0 15px 14px #0009);animation:key-arrive .8s cubic-bezier(.2,.8,.2,1) both}.key-scene .task-frame{padding:35px}.key-scene h2{font-size:36px}.key-scene #task-feedback{display:none}.task-kicker:empty{display:none}.candle-instruction{font:22px Georgia;color:#e4cfa7;margin:10px 0 20px}.candle-table{max-width:820px;margin:auto}.memory-progress{display:flex;justify-content:center;gap:12px;margin:20px}.memory-progress i{width:12px;height:12px;border:1px solid #ab8650;border-radius:50%;background:#39241a;transition:background .2s,box-shadow .2s}.memory-progress i.done{background:#f6cb79;box-shadow:0 0 12px #f6bc67}.memory-candles{display:flex;justify-content:center;gap:50px;padding:22px 10px 5px}.memory-candles button{position:relative;display:flex;flex-direction:column;align-items:center;width:110px;height:216px;border:0;background:none;color:#d7c09b;padding:45px 0 0;font:16px Georgia;cursor:pointer;transition:filter .2s}.wax-body{display:grid;place-items:center;width:56px;height:125px;border-radius:8px 8px 3px 3px;background:linear-gradient(90deg,#756449,#ddd0aa 50%,#968465);box-shadow:inset 0 4px 5px #e5d6ae,4px 5px 10px #0006}.wax-body i{font:35px Georgia;color:#554229;text-shadow:0 1px #e9d5a8}.candle-foot{height:12px;width:84px;border-radius:50%;background:linear-gradient(#b49057,#46301c);box-shadow:0 6px 12px #0005}.memory-candles b{margin-top:15px;font-weight:normal}.memory-flame{position:absolute;top:17px;width:18px;height:35px;border-radius:50% 50% 45% 45%;background:radial-gradient(at 50% 70%,#fff8b4,#d37d24 50%,transparent 70%);opacity:.28;transform:scale(.6);transform-origin:50% 100%;transition:opacity .15s,transform .15s,box-shadow .15s}.lit .memory-flame{opacity:1;transform:scale(1.35);box-shadow:0 0 45px 22px #ffc55c77,0 0 90px #ff8d3333;animation:flame-dance .3s infinite alternate}.lit .wax-body{filter:brightness(1.45)}.memory-candles button:disabled{cursor:default}.memory-candles button:focus-visible{outline:2px solid #e3c387;outline-offset:6px}#memory-status{font:16px/1.4 Georgia;color:#e2caa1;min-height:25px;margin:20px auto}.candle-table>.hint-button{margin-left:20px}
.seal-workbench{display:grid;grid-template-columns:210px 1fr;gap:55px;align-items:center;max-width:740px;margin:auto}.seal-reference img{width:100%;border:6px ridge #a48449;transform:rotate(-4deg);box-shadow:0 12px 22px #0007}.seal-reference p{font:18px Hand,cursive;color:#e7d5ac;margin-top:20px}.mosaic-grid{width:360px;max-width:100%;aspect-ratio:1;display:grid;grid-template-columns:repeat(3,1fr);grid-template-rows:repeat(var(--rows),1fr);gap:5px;padding:6px;border:6px ridge #9e7b47;box-shadow:0 15px 25px #0008;background:#170f0b}.mosaic-grid button{border:0;padding:0;overflow:hidden;background:#241a10;position:relative;box-shadow:0 2px 5px #0009}.mosaic-grid button>span{display:block;width:100%;height:100%;background-image:url('assets/castle-jigsaw.png');transition:transform .3s;pointer-events:none}.mosaic-grid button.selected{outline:4px solid #e9c47c;outline-offset:-4px;filter:brightness(1.25);z-index:1}.mosaic-grid.restored{animation:restored .6s both}.mosaic-scene .tile-instruction{max-width:360px;font-size:13px;line-height:1.5}.shadow-cipher{max-width:600px;margin:auto}.shadow-cipher>p{font:18px Georgia;color:#e2ceaa;line-height:1.5}.cipher-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:0;padding:18px;background:#dbc49a;box-shadow:0 10px 25px #0007;border:1px solid #765638}.cipher-grid button{border:0;background:#e3cca2;color:#624e36;font:32px Georgia;height:62px;position:relative;cursor:pointer}.cipher-grid .in-shadow{background:#403728;color:#c4ab84;box-shadow:inset 0 0 18px #1d1810}.cipher-grid .picked:after{content:'';position:absolute;inset:8px;border:2px solid #e0a85d;border-radius:50%}.cipher-answer{min-height:42px;font:30px Hand,cursive;color:#efcf95;letter-spacing:.25em;margin:18px}.seal-icon[hidden]{display:none!important}
@media(min-width:761px){.riddle-table{display:grid;grid-template-columns:1.15fr 1fr;column-gap:35px;align-items:center;max-width:1000px}.riddle-paper{grid-column:1;grid-row:1/5;margin:0;padding:26px 20px}.riddle-paper p{font-size:29px}.answer-tray{grid-column:2;grid-row:1;margin:0 auto;gap:6px;padding:8px}.letter-slot{width:46px;height:55px;font-size:29px}.tile-instruction{grid-column:2;grid-row:2;margin:15px 0}.letter-bank{grid-column:2;grid-row:3;gap:8px;max-width:350px;margin:auto}.wood-tile{width:51px;height:54px;font-size:29px}.riddle-table>.prop-actions{grid-column:1/-1;grid-row:5;margin-top:26px}.riddle-table:has(.shadow-cipher){display:block}}
@media(max-width:760px){.memory-candles{gap:10px}.memory-candles button{width:74px}.wax-body{width:47px;height:110px}.candle-foot{width:67px}.memory-candles b{font-size:13px}.candle-instruction{font-size:19px}.candle-table>.hint-button{margin:5px 0}.seal-workbench{grid-template-columns:1fr;gap:15px}.seal-reference{display:flex;align-items:center;justify-content:center;gap:20px}.seal-reference img{width:95px}.seal-reference p{max-width:150px}.mosaic-grid{width:330px;margin:auto}.mosaic-scene .tile-instruction{margin:15px auto}.cipher-grid button{font-size:28px;height:54px}.earned-key{height:180px}.riddle-paper p{font-size:27px}}
@keyframes key-arrive{from{opacity:0;transform:translateY(-100px) rotate(-20deg) scale(.7)}to{opacity:1;transform:translateY(0) rotate(-8deg) scale(1)}}@keyframes flame-dance{from{rotate:-4deg}to{rotate:4deg}}@keyframes restored{to{box-shadow:0 0 60px #e5bb6488}}
@media(prefers-reduced-motion:reduce){.earned-key,.lit .memory-flame,.mosaic-grid.restored{animation:none}.memory-flame,.mosaic-grid button>span{transition:none}}
/* The gallery's miniature theatre: an optical puzzle for Years 7–8. */
#castle-task.mirror-scene{background:radial-gradient(ellipse at 60% 10%,#80654045,transparent 65%),repeating-linear-gradient(91deg,#211b17 0,#30261e 2px,#382b22 92px,#241c17 95px);padding:14px 25px}
.mirror-scene .task-frame{width:min(1180px,100%);padding:30px 0 0}.mirror-scene .task-frame h2{font-size:clamp(25px,3vw,36px);margin:5px 0 8px}.mirror-scene #task-feedback{display:none}.mirror-instruction{font:16px/1.4 Georgia;color:#decead;margin:0 0 10px}.mirror-board{position:relative;width:min(100%,calc((100dvh - 235px)*2.1));margin:auto;aspect-ratio:1000/476;filter:drop-shadow(0 17px 19px #0008)}.theatre-model{display:block;width:100%;height:100%;overflow:visible}.mirror-sockets{position:absolute;inset:0}.mirror-sockets button{position:absolute;display:grid;place-items:center;transform:translate(-50%,-50%);width:6.4%;height:13.45%;min-width:44px;min-height:44px;max-width:70px;max-height:70px;padding:4px;border:1px dashed #a8976a7a;border-radius:50%;background:#080e0e33;cursor:pointer;touch-action:manipulation;transition:background .2s,box-shadow .2s}.mirror-sockets button:hover{background:#a78d4433}.mirror-sockets button:focus-visible{outline:3px solid #fff0bc;outline-offset:4px}.mirror-sockets button.selected{border:2px solid #ffe0a0;box-shadow:0 0 0 4px #f5d8a633,0 0 24px #dab46a50}.mirror-disc{position:relative;display:block;width:100%;height:100%;border-radius:50%;opacity:0}.occupied .mirror-disc{opacity:1;background:radial-gradient(at 40% 35%,#bfa77d,#614b31 66%,#2e261d 70%,#bd9d63 74%,#4b3e2c 91%);box-shadow:0 5px 9px #0009}.mirror-disc i{position:absolute;width:86%;height:9%;left:7%;top:44%;background:linear-gradient(#fff9dd,#a3c5c3 40%,#e9ece1 70%,#6d7e77);border:1px solid #f0deb4;box-shadow:0 3px 4px #000b;transition:transform .3s}.mirror-disc b{position:absolute;bottom:4%;left:0;right:0;font:9px Georgia;color:#efe0b9;text-shadow:0 1px #271e14}.reached .mirror-disc{box-shadow:0 4px 10px #0008,0 0 14px #f1dca34d}.beam-halo,.beam-core,.beam-flow{fill:none;stroke-linecap:round;stroke-linejoin:round;pointer-events:none}.beam-halo{stroke:#f5c76b;stroke-width:13;opacity:.2;filter:blur(3px)}.beam-core{stroke:#fff2bf;stroke-width:2.8}.beam-flow{stroke:#fff;stroke-width:3;stroke-dasharray:5 35;opacity:.65;animation:beam-travel 2s linear infinite}.beam-tip{filter:drop-shadow(0 0 6px #ffdd8c)}.stage-curtain{transition:transform 1.6s cubic-bezier(.22,.7,.3,1)}.stage-spill,.stage-beam,.stage-key{opacity:0;transition:opacity 1.5s}.footlight{opacity:.12;transition:opacity 1.2s;filter:drop-shadow(0 0 6px #ffd587)}.illuminated .stage-spill,.illuminated .stage-key{opacity:1}.illuminated .stage-beam{opacity:.3}.illuminated .stage-receiver{fill:#fff4c6;filter:drop-shadow(0 0 10px #ffd984)}.illuminated .footlight{opacity:1}.illuminated .mini-curtain-left{transform:translateX(0) scaleX(.24);transform-origin:36px 0}.illuminated .mini-curtain-right{transform:scaleX(.24);transform-origin:219px 0}.illuminated .stage-key{animation:stage-key-rise 1.7s ease both}.mirror-controls{display:flex;justify-content:center;align-items:center;gap:10px;flex-wrap:wrap;margin:4px auto 0;max-width:990px}.mirror-controls #mirror-status{font:14px/1.4 Georgia;color:#deceac;flex:1;min-width:220px;text-align:left;margin:0 10px}.mirror-controls .brass-button,.mirror-controls .parchment-button{min-height:46px;padding:10px 18px;white-space:nowrap}.mirror-controls .hint-button{padding:9px 11px}.mirror-controls button:disabled{opacity:.4;cursor:default}.mirror-controls #mirror-claim{animation:unroll .8s ease both;background:#dbc28c;box-shadow:0 0 20px #dfc08b20}@keyframes beam-travel{to{stroke-dashoffset:-80}}@keyframes stage-key-rise{from{transform:translateY(15px);opacity:0}to{transform:translateY(0);opacity:1}}@media(max-width:650px){#castle-task.mirror-scene{padding:12px}.mirror-scene .task-frame{padding-top:42px}.mirror-instruction{font-size:14px}.mirror-board{width:100%;margin:8px 0}.mirror-controls #mirror-status{flex-basis:100%;order:-1;text-align:center;font-size:13px}.mirror-controls{gap:2px}.mirror-disc b{font-size:8px}}@media(prefers-reduced-motion:reduce){.beam-flow,.illuminated .stage-key{animation:none}.stage-curtain,.stage-spill,.stage-beam,.stage-key,.mirror-disc i{transition:none}}

/* A larger, unguided painting puzzle. */
.mosaic-scene .seal-workbench{display:block;max-width:520px;margin:auto}.mosaic-scene .mosaic-grid{width:min(470px,100%,calc(100dvh - 295px));margin:auto;gap:4px}.mosaic-scene .tile-instruction{max-width:470px;margin:16px auto 0}.mosaic-scene .task-frame{padding-top:35px}.mosaic-scene .task-frame h2{margin:5px 0 18px}.mosaic-scene .prop-actions{gap:12px;margin-top:12px}.mosaic-scene #task-feedback{margin-top:8px;min-height:24px}@media(max-width:650px){.mosaic-scene .mosaic-grid{width:min(100%,380px)}.mosaic-scene .task-frame{padding-top:42px}}
/* A physical cipher desk, with a visual code key. */
.cipher-desk{display:grid;grid-template-columns:1fr 1fr;gap:38px;align-items:center;max-width:940px;margin:auto}.cipher-note{font:25px/1.2 Hand,cursive;color:#ecd8ae;margin:0 0 15px}.symbol-key{background:linear-gradient(110deg,#e3cea0,#f1dfb9,#d6bb87);padding:20px 24px;box-shadow:0 12px 20px #0005;transform:rotate(-2deg);color:#51402b;max-width:360px;margin:auto}.symbol-key>p{font:28px Hand,cursive;margin:0 0 20px}.symbol-key-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:10px}.symbol-key-grid>div{display:flex;align-items:center;gap:16px;border-bottom:1px solid #8f74474f;padding:8px}.symbol-key-grid svg{width:40px;height:40px}.symbol-key-grid span{font:26px Georgia}.cipher-drawer{padding:25px 24px 18px;border:10px ridge #8a693d;background:repeating-linear-gradient(0deg,#3b291e 0,#533d2a 3px,#4a3524 71px,#2b2018 73px);box-shadow:0 16px 24px #0008;transition:transform .8s,filter .8s}.cipher-drawer.unlocked{transform:translateY(15px);filter:brightness(1.5)}.coded-word{display:flex;justify-content:center;gap:10px;margin:15px 0 22px}.coded-word>span{display:grid;place-items:center;width:60px;height:60px;border:1px solid #ae9263;background:#d3bc8c;color:#3b2b1c;box-shadow:0 3px 7px #0006;font:32px Georgia}.coded-word svg{width:37px;height:37px}.cipher-drawer .cipher-answer{display:flex;justify-content:center;gap:9px;margin:0 0 20px;min-height:0;letter-spacing:normal}.cipher-answer button{width:59px;height:61px;border:2px inset #a48854;background:#201811;color:#f3d99e;font:32px Georgia;cursor:pointer}.cipher-letter-bank{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;max-width:264px;margin:0 auto 20px}.cipher-letter-bank button{height:47px;border:2px ridge #b2945e;background:linear-gradient(#c7ac76,#8b6b3e);color:#2b1e11;font:25px Georgia;box-shadow:0 4px 5px #0005;cursor:pointer}.cipher-letter-bank button:disabled{opacity:.28}.cipher-small-actions{display:flex;justify-content:center;gap:6px;margin-top:8px}.cipher-scene .task-frame{padding-top:36px}.cipher-scene .task-frame h2{margin:5px 0 20px}.cipher-scene #task-feedback{margin-top:12px;min-height:24px}@media(max-width:700px){.cipher-desk{gap:20px;grid-template-columns:1fr}.symbol-key{max-width:350px;padding:16px}.symbol-key-grid{grid-template-columns:repeat(4,1fr);gap:4px}.symbol-key-grid>div{flex-direction:column;gap:4px;padding:4px}.symbol-key-grid svg{width:28px;height:28px}.symbol-key>p{margin-bottom:10px}.cipher-drawer{max-width:390px;margin:auto;width:100%;box-sizing:border-box;padding:18px 15px}.cipher-scene .task-frame{padding-top:42px}.cipher-note{font-size:23px}.coded-word{margin:8px 0 15px}}@media(prefers-reduced-motion:reduce){.cipher-drawer{transition:none}}
/* Clear touch targets anchored directly to the task objects. */
#task-launchers{position:absolute;inset:0;z-index:7;pointer-events:none;overflow:hidden}.task-launch{position:absolute;transform:translate(-50%,-50%);pointer-events:auto;min-width:94px;min-height:52px;padding:12px 19px;border:2px solid #ffe1a1;border-radius:6px;background:linear-gradient(145deg,#e9ce94,#b28b4f);box-shadow:0 0 0 7px #dcb06224,0 0 26px #ffc56d90,0 5px 14px #000a;color:#302012;font:bold 17px Georgia;cursor:pointer;touch-action:manipulation;animation:task-glow 2.8s ease-in-out infinite}.task-launch span{font-size:14px;margin-right:7px}.task-launch:hover,.task-launch:focus-visible{background:#ffe2a0;outline:3px solid #fff1c8;outline-offset:4px;box-shadow:0 0 35px #ffde91}.task-launch:active{transform:translate(-50%,-50%) scale(.96)}@keyframes task-glow{50%{box-shadow:0 0 0 11px #dcb06212,0 0 38px #ffc56daa,0 5px 14px #000a}}@media(prefers-reduced-motion:reduce){.task-launch{animation:none}}
/* Match the visible code directly; no calibration or hidden setup. */
.cipher-instruction{font:25px/1.2 Hand,cursive;color:#ecd8ae;margin:0 0 24px}.cipher-scene .task-frame h2{margin-bottom:10px}.cipher-drawer .coded-word{margin:6px 0 0}.cipher-arrows{display:flex;justify-content:center;gap:9px;margin:2px 0 5px;font:23px/1 Georgia;color:#c9ac71}.cipher-arrows span{width:59px;text-align:center}.coded-word>span.active{outline:2px solid #ffe6a4;outline-offset:3px}.cipher-answer button.active{outline:3px solid #ffe6a4;outline-offset:2px;box-shadow:0 0 16px #ffcc6d40}.cipher-answer button:focus-visible,.cipher-letter-bank button:focus-visible{outline:3px solid #fff1c8;outline-offset:3px}.cipher-letter-bank button:active{transform:translateY(2px)}
@media(max-width:700px){.cipher-instruction{font-size:22px;margin-bottom:18px}.cipher-scene .task-frame h2{margin-bottom:10px}}

/* The pigpen code is read from the edges of these letter grids. */
.pigpen-key{max-width:385px;padding:17px 22px;transform:rotate(-1deg)}.pigpen-key>p{margin:0 0 12px}.pigpen-grids{display:grid;grid-template-columns:repeat(2,1fr);gap:19px 30px}.pigpen-grid{width:100%;display:block;overflow:visible;color:#3d3328}.pigpen-grid path{fill:none;stroke:currentColor;stroke-width:2.3;stroke-linecap:square}.pigpen-grid text{font:27px Georgia;fill:currentColor;text-anchor:middle;dominant-baseline:central}.pigpen-grid circle{fill:currentColor}.cipher-drawer .coded-word svg{width:46px;height:46px}
@media(max-width:700px){.pigpen-key{max-width:345px;width:100%;box-sizing:border-box;padding:14px 20px}.pigpen-grids{gap:16px 28px}.pigpen-key:has(.pigpen-grid:nth-child(3)){max-width:300px}.pigpen-key>p{font-size:26px}}
/* Tap the letters in the reference grid itself. */
.pigpen-grid-wrap{position:relative;aspect-ratio:1}.pigpen-grid-wrap .pigpen-grid{position:absolute;inset:0;pointer-events:none}.pigpen-letter{position:absolute;transform:translate(-50%,-50%);display:flex;align-items:center;justify-content:center;gap:3px;width:33%;height:33%;padding:0;border:0;background:none;color:#3d3328;font:27px Georgia;cursor:pointer;touch-action:manipulation;border-radius:10px}.cross-grid .pigpen-letter{width:30%;height:30%}.pigpen-letter i{width:6px;height:6px;border-radius:50%;background:currentColor;flex:none}.pigpen-letter:hover,.pigpen-letter:focus-visible{background:#a0783630;outline:2px solid #866638;outline-offset:-5px}.pigpen-letter:active{background:#8a642b4f;transform:translate(-50%,-50%) scale(.94)}.pigpen-letter:disabled{cursor:default;opacity:.7}.cipher-flying-letter{position:fixed;z-index:1000;pointer-events:none;font:bold 31px Georgia;color:#ffe4a6;text-shadow:0 2px 5px #211608}
.cipher-word+.cipher-word{margin-top:26px;padding-top:19px;border-top:1px solid #d1ae6055}.cipher-word .coded-word,.cipher-word .cipher-answer,.cipher-word .cipher-arrows{gap:7px}.cipher-word .coded-word>span,.cipher-word .cipher-answer button,.cipher-word .cipher-arrows span{width:50px;min-width:0;flex:0 1 50px}.cipher-word .coded-word>span{height:50px}.cipher-word .coded-word svg{width:40px;height:40px}.cipher-word .cipher-answer button{height:50px;font-size:28px}.cipher-word .cipher-arrows{margin:4px 0;font-size:20px}.cipher-word .cipher-answer{margin-bottom:0}.cipher-word:last-of-type{margin-bottom:25px}.cipher-drawer{padding-top:20px}.cipher-drawer #cipher-open{margin-top:22px}
@media(max-width:700px){.pigpen-key:has(.pigpen-grid-wrap:nth-child(3)){max-width:345px}.cipher-word .coded-word,.cipher-word .cipher-answer,.cipher-word .cipher-arrows{gap:5px}.cipher-word .coded-word>span,.cipher-word .cipher-answer button,.cipher-word .cipher-arrows span{flex-basis:45px;width:45px}.cipher-word .coded-word>span,.cipher-word .cipher-answer button{height:46px}.cipher-word .coded-word svg{width:35px;height:35px}}
@media(max-width:390px){.pigpen-letter{font-size:24px}.cipher-word .coded-word,.cipher-word .cipher-answer,.cipher-word .cipher-arrows{gap:3px}.cipher-word .coded-word svg{width:29px;height:29px}.cipher-word .cipher-answer button{font-size:24px}}
/* Play fills the viewport; controls live in the pause menu. */
.game-shell:not([hidden]){position:fixed;inset:0;overflow:hidden}.game-shell .game-content{position:absolute;inset:0;width:100%!important;height:100%;max-width:none;padding:0!important}.game-shell .arena{width:100%;height:100%;aspect-ratio:auto;border:0;border-radius:0;box-shadow:none}.game-shell .round-bar,.game-shell .play-footer,.game-shell .mobile-controls,.game-brand,#explore-pad,#castle-objective,#castle-map,.castle-stats,#castle-room{display:none!important}.game-shell .game-header{position:absolute;top:12px;right:14px;left:auto;z-index:12;height:44px;padding:0!important;background:none!important;border:0;pointer-events:none}.game-shell .header-controls{pointer-events:auto}.game-shell #pause{width:44px;height:44px;min-height:44px;border:0;border-radius:50%;padding:0;background:#fff9;color:#343434;font:20px Georgia;box-shadow:none}.game-shell.immersive #pause{background:#10201ab0;color:#eee0bd}.castle-status{top:18px;left:20px}.seal-row{margin:0;gap:6px}#castle-hud{background:none}.seal-icon{font-size:20px;width:auto;height:auto}#castle-seals{font-size:12px}#castle-toast{top:70px;font-size:18px}#pause-overlay{z-index:30}#pause-options{display:flex;justify-content:center;gap:12px;margin-top:24px}.game-shell #pause-options button{display:block!important;min-height:48px;padding:10px 15px;color:inherit;border:1px solid currentColor;border-radius:3px;background:none;font:15px Georgia}.task-launch{min-height:44px;min-width:85px;font:15px Georgia;padding:9px 15px;border:1px solid #cfb679;border-radius:3px;box-shadow:0 3px 10px #0007;animation:none}.task-launch:hover,.task-launch:focus-visible{box-shadow:0 0 16px #ffd89166}.castle-intro #difficulty-help,.castle-intro fieldset legend{display:none}.castle-intro .intro-panel>small{font-size:14px}.cipher-scene~#pause-overlay{z-index:30}
/* The optical task is played on the gallery floor, using the world camera. */
#mirror-room-ui{position:absolute;inset:0;z-index:9;pointer-events:none;color:#f5e5bd}#mirror-room-ui[hidden]{display:none}.room-playing #castle-hud,.room-playing #task-launchers{display:none!important}#mirror-room-ui button{pointer-events:auto;touch-action:manipulation;cursor:pointer;font:17px Georgia;color:#f3dfb0;border:1px solid #a78b59;background:#17221be8;border-radius:3px;min-height:46px;padding:11px 17px;box-shadow:0 4px 14px #0005}#mirror-room-ui button:focus-visible{outline:3px solid #fff0ad;outline-offset:3px}.room-back{position:absolute;top:18px;left:20px}.room-instruction{position:absolute;top:20px;left:50%;transform:translateX(-50%);text-align:center;width:min(65%,650px);text-shadow:0 2px 6px #000}.room-instruction h2{font:26px Georgia;margin:0 0 8px}.room-instruction p{font:16px/1.4 Georgia;margin:0}.room-mounts{position:absolute;inset:0;pointer-events:none}#mirror-room-ui .room-mounts button{position:absolute;transform:translate(-50%,-50%);width:68px;height:64px;min-height:0;padding:0;border:1px solid #e6c38c38;border-radius:50%;background:#edcc7522;box-shadow:none}#mirror-room-ui .room-mounts button.occupied{background:transparent;border-color:transparent}#mirror-room-ui .room-mounts button.selected{border:2px solid #efcf87;box-shadow:0 0 18px #ffc96b44}#mirror-room-ui .room-mounts button:hover{border-color:#ffe7ad;background:#e5c87922}#mirror-room-ui .room-mounts button:disabled{pointer-events:none;border-color:transparent;background:none}#mirror-room-ui .room-test,#mirror-room-ui .room-claim{position:absolute;transform:translate(-50%,-50%);white-space:nowrap;background:#cfaf72;color:#2d2417}.room-result{position:absolute;bottom:91px;left:50%;transform:translateX(-50%);text-align:center;font:19px Georgia;width:85%;text-shadow:0 2px 5px #000}.room-retry{position:absolute;bottom:28px;left:50%;transform:translateX(-50%)}.room-hint{position:absolute;bottom:25px;right:25px}.room-mounts button[hidden],#mirror-room-ui button[hidden]{display:none!important}.seal-icon:nth-child(3){display:grid}@media(max-width:650px){.room-instruction{top:82px;width:90%}.room-instruction h2{font-size:22px}.room-instruction p{font-size:15px}#mirror-room-ui .room-mounts button{width:56px;height:56px}.room-result{font-size:17px}.room-hint{bottom:18px;right:18px}}
