:root{color-scheme:dark;--ink:#10191e;--panel:#182226;--gold:#e8be70;--cream:#f4ead6;--muted:#a6b1a9;--teal:#7cbaa5;--sprite:url('/assets/items.d6daf0fb1ab9fc09.png');--granary-sprite:url('/assets/granary-items.398becd17625d7e5.png')}
*{box-sizing:border-box}html{min-height:100%;background:var(--ink)}body{margin:0;min-height:100vh;min-height:100svh;color:var(--cream);font-family:ui-monospace,'Cascadia Code','SFMono-Regular',Consolas,monospace;background:linear-gradient(90deg,rgba(10,17,21,.56),rgba(10,17,21,.16) 50%,rgba(10,17,21,.52)),var(--scene) center/cover fixed;line-height:1.5}body::before{content:'';position:fixed;inset:0;pointer-events:none;background:linear-gradient(0deg,#0d171cd9,transparent 45%,#0d171c33);z-index:-1}button{font:inherit;cursor:pointer;color:inherit;-webkit-tap-highlight-color:transparent}button:focus-visible{outline:3px solid #b1e7d1;outline-offset:5px}button:disabled{cursor:default;opacity:.35}button,select{touch-action:manipulation}button svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:square;stroke-linejoin:miter}button svg,button span{pointer-events:none}button:hover:not(:disabled){filter:brightness(1.12)}.topbar{max-width:1240px;margin:auto;padding:27px 42px;display:flex;align-items:center;justify-content:space-between;gap:16px}.brand-mini{font-size:11px;letter-spacing:2.5px;color:#d4d9cb;display:flex;align-items:center;gap:12px}.mini-castle{width:21px;height:20px;color:var(--gold);background:currentColor;clip-path:polygon(0 0,20% 0,20% 25%,40% 25%,40% 0,60% 0,60% 25%,80% 25%,80% 0,100% 0,100% 100%,60% 100%,60% 65%,40% 65%,40% 100%,0 100%)}.top-actions{display:flex;gap:8px}.icon-button{width:39px;height:39px;display:grid;place-items:center;background:#142024c9;border:1px solid #506050}.demo-tag{font-size:10px;letter-spacing:1.5px;color:var(--muted);margin-right:13px;align-self:center}.layout{max-width:1140px;margin:13px auto 0;display:grid;grid-template-columns:290px minmax(0,650px);gap:66px;align-items:center;padding:0 32px 36px;justify-content:center}.intro{padding-bottom:42px}.eyebrow{font-size:10px;letter-spacing:2.5px;text-transform:uppercase;color:var(--teal);font-weight:600}.intro h1{font-family:Georgia,serif;font-size:57px;font-weight:normal;line-height:1.04;letter-spacing:-2px;margin:19px 0 24px;color:#f5dba0;text-shadow:3px 3px 0 #151d1f}.intro h1 em{font-style:normal;color:var(--cream)}.intro .lead{font-size:13px;line-height:1.9;color:#c0c6b9;max-width:260px}.chapter-line{height:1px;background:linear-gradient(90deg,#9e8458,transparent);margin:31px 0 25px}.howto{display:flex;gap:13px;font-size:11px;line-height:1.8;margin:13px 0;color:#b3bdb5}.howto .number{color:var(--gold);border:1px solid #675d45;width:23px;height:23px;flex-shrink:0;text-align:center;font-size:10px}.howto b{display:block;color:var(--cream);font-weight:normal}.legend{display:flex;gap:7px;margin:25px 0 11px}.legend .sprite{width:47px;height:47px;opacity:.9}.tiny{font-size:9px;letter-spacing:.5px;color:#9ca99f}.game{width:100%;min-width:0}.game-heading{text-align:center;margin-bottom:21px}.game-heading .eyebrow{color:#c6b388;font-size:9px}.game-title{font-size:30px;line-height:1.15;letter-spacing:-1.1px;color:var(--gold);font-weight:900;text-shadow:2px 2px 0 #30271c,3px 3px 0 #080f11;margin:6px 0 7px}.game-heading p{font-size:10px;color:var(--muted);margin:0;letter-spacing:1.5px}.levelbar{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:0 3px 12px}.level-info{display:flex;align-items:center;gap:12px}.level-num{width:37px;height:37px;background:#29392f;border:1px solid #718c69;display:grid;place-items:center;color:#c8e3b5;font-size:16px;box-shadow:inset 0 0 0 3px #1b2a24}.level-name{font-size:12px;letter-spacing:.3px;margin:0}.level-sub{font-size:9px;color:var(--muted);margin-top:3px}.moves{font-size:10px;color:var(--muted);text-align:right}.moves strong{font-size:17px;color:var(--cream);font-weight:normal;margin-right:5px}.cabinet{position:relative;border:8px solid #614b31;border-top-color:#927047;border-bottom-color:#3e3022;background:#31271e;box-shadow:0 0 0 2px #1a1b17,0 0 0 4px #a17d4a,0 13px 30px #080e13a6,inset 0 0 0 2px #b7955d;padding:12px;isolation:isolate}.cabinet::before,.cabinet::after{content:'◆';position:absolute;top:-13px;color:#e6bc67;font-size:20px;text-shadow:2px 2px #352818;z-index:2}.cabinet::before{left:-15px}.cabinet::after{right:-15px}.board{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:13px 14px;touch-action:none;user-select:none;-webkit-user-select:none}.shelf{position:relative;background:#171c20;border:3px solid #795e3b;border-top-color:#3c3328;border-bottom:9px solid #a07a48;box-shadow:0 3px 0 #372b20,inset 0 5px 8px #0b131b90;min-width:0;padding:17px 4px 6px}.shelf::after{content:'';position:absolute;bottom:-6px;left:3%;width:92%;height:1px;background:#d5a66460;box-shadow:5px 3px #44352680;pointer-events:none}.shelf-meta{position:absolute;left:9px;right:9px;top:3px;display:flex;justify-content:space-between;align-items:center;font-size:8px;letter-spacing:1px;color:#a29777;pointer-events:none}.layers{font-size:8px;color:#b9c2a4;letter-spacing:1px;display:flex;align-items:center;gap:4px}.layer-dot{height:4px;width:4px;background:#91a98b;box-shadow:1px 1px #0d1418}.slots{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:1px}.slot{position:relative;display:grid;place-items:center;width:100%;padding:0;aspect-ratio:1;background:none;border:1px solid transparent;min-width:0;border-radius:0}.slot.empty::before{content:'';position:absolute;inset:20%;border:1px dashed #5b665242;box-shadow:inset 0 0 12px #97b67704}.slot.empty::after{content:'+';color:#78837460;font-size:13px;position:absolute}.slot.has-item{cursor:grab}.slot.has-item:active{cursor:grabbing}.sprite{display:block;width:100%;height:100%;aspect-ratio:1;background-image:var(--sprite);background-size:200% 200%;background-repeat:no-repeat;image-rendering:pixelated;mix-blend-mode:lighten;pointer-events:none;flex-shrink:0}.sprite.helmet{background-position:0% 0%}.sprite.shield{background-position:100% 0%}.sprite.potion{background-position:0% 100%}.sprite.goblet{background-position:100% 100%}.slot .sprite{transition:transform .14s}.slot:hover .sprite{transform:translateY(-3px)}.slot.selected{background:#a5b06b18;border:1px solid var(--gold);box-shadow:0 0 0 2px #d9ba6e2b}.slot.selected .sprite{transform:translateY(-4px)}.board.selecting .slot.empty.valid{background:#87b49b0b}.board.selecting .slot.empty.valid::before{border-color:#93c3a476}.board.selecting .slot.empty.valid::after{color:#9ac7a6}.slot.hint-source{outline:2px solid var(--gold);outline-offset:-2px;animation:hintPulse 1s ease-in-out infinite}.slot.hint-target{background:#72c1a42b;outline:2px dashed var(--teal);outline-offset:-3px}.slot.drag-origin{opacity:.25}.shelf.flash{animation:clearGlow .55s ease-out}.shelf.reveal .sprite{animation:unveil .35s ease-out}.float-sprite{position:fixed;width:78px;height:78px;z-index:30;pointer-events:none;filter:drop-shadow(0 8px 4px #0008);background-color:#171c20;border:1px solid #ccb77188;box-shadow:0 0 20px #a1b97822;image-rendering:pixelated}.float-sprite .sprite{mix-blend-mode:normal}.match-label{position:absolute;left:0;right:0;top:30%;text-align:center;font-size:14px;color:#ffe2a0;text-shadow:2px 2px #13201a;pointer-events:none;z-index:4;animation:matchUp .75s ease-out forwards}.progress-row{display:flex;align-items:center;gap:12px;margin:19px 2px 12px;font-size:10px}.progress-row .track{flex:1;height:6px;background:#263029;border:1px solid #535e46}.progress-row .fill{height:100%;width:0;background:#bfc796;box-shadow:0 0 8px #aec38e22;transition:width .3s}.progress-row #matchCount{color:#d8dec6;min-width:83px;text-align:right}.status{min-height:45px;margin:0;text-align:center;font-size:11px;line-height:1.6;display:flex;align-items:center;justify-content:center;color:#d5d5bd;padding:0 13px}.status.accent{color:#e6c885}.tools{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin:12px 0 21px}.tool{display:flex;justify-content:center;align-items:center;gap:8px;background:#22322b;border:1px solid #637058;border-bottom:3px solid #121f19;min-height:45px;box-shadow:inset 0 1px #86926a32;font-size:11px}.tool.hint{background:#473c25;border-color:#9d8150;border-bottom-color:#29271b;color:#f6dba0}.tool kbd{font-size:8px;opacity:.5;border:1px solid #a4af8b55;padding:0 3px;margin-left:3px}.level-footer{border-top:1px solid #67725c4a;padding-top:15px;display:flex;justify-content:space-between;align-items:center;gap:9px}.level-footer .tiny{font-size:9px}.levels{display:flex;gap:8px}.level-dot{width:27px;height:27px;border:1px solid #59624e;background:#1a2725;color:#afbaaa;display:grid;place-items:center;font-size:10px;padding:0}.level-dot.active{border-color:#d8b772;background:#5b4d2d;color:#f2dda6;box-shadow:0 0 0 2px #d8b77218}.level-dot.complete:not(.active){border-color:#799a7a;color:#bfdbb7}.page-footer{max-width:1080px;margin:0 auto;padding:0 32px 27px;text-align:center;color:#92a197;font-size:9px;letter-spacing:1px}.page-footer span{color:#a9b5a3}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}dialog{border:1px solid #a58a54;background:#182522;color:var(--cream);padding:32px;max-width:390px;width:calc(100% - 32px);box-shadow:0 0 0 5px #25312a,0 25px 90px #0008;text-align:center}dialog::backdrop{background:#071114bf;backdrop-filter:blur(4px)}dialog h2{font-family:Georgia,serif;font-size:32px;font-weight:normal;line-height:1.2;color:#f2d590;margin:12px 0}dialog p{font-size:12px;line-height:1.9;color:#c1cdbb}dialog .primary{background:#c7ab68;color:#1f2a23;border:1px solid #f2d793;border-bottom:4px solid #8b723d;width:100%;padding:12px;margin:13px 0 0;font-weight:bold;font-size:12px}dialog .secondary{border:0;background:transparent;color:#b4c1ad;font-size:10px;text-decoration:underline;text-underline-offset:4px;padding:13px 10px 2px}dialog .trophy{width:78px;height:78px;margin:0 auto}.win-stats{display:flex;justify-content:center;gap:30px;margin:19px 0}.win-stats strong{display:block;font-size:23px;color:#e9ddbb;font-weight:normal}.win-stats span{font-size:9px;color:#a8bda8}.help-list{text-align:left;padding-left:20px;font-size:12px;line-height:1.9;color:#c6d0bb}.help-list li{margin:10px 0}.help-foot{font-size:10px!important}.close-dialog{position:absolute;right:10px;top:8px;border:0;background:none;font-size:22px;color:#a8bda8;padding:0 7px}.toast{position:fixed;bottom:20px;left:50%;transform:translate(-50%,20px);background:#26352c;border:1px solid #83976a;color:#f0e6c8;padding:12px 20px;font-size:11px;z-index:50;max-width:90vw;width:max-content;opacity:0;pointer-events:none;transition:.2s;text-align:center}.toast.visible{opacity:1;transform:translate(-50%,0)}.spark{position:fixed;width:5px;height:5px;background:#f2d28c;pointer-events:none;z-index:40;animation:spark .7s ease-out forwards;box-shadow:0 0 5px #ffdb75}.drop-hover{outline:2px solid #b8d7a1!important;background:#8ea76420!important}
@keyframes hintPulse{50%{box-shadow:0 0 15px #f2c87566}}@keyframes clearGlow{0%{background:#827043;box-shadow:0 0 25px #f0ca7377}100%{background:#171c20}}@keyframes unveil{from{opacity:0;transform:translateY(-10px)}to{opacity:1;transform:none}}@keyframes matchUp{0%{opacity:0;transform:translateY(8px)}20%{opacity:1}100%{opacity:0;transform:translateY(-30px)}}@keyframes spark{to{transform:translate(var(--x),var(--y)) rotate(135deg);opacity:0}}
@media(min-width:1200px){.layout{margin-top:27px}.game{max-width:620px}.topbar{padding-top:30px}}@media(max-width:960px){.layout{grid-template-columns:220px minmax(0,560px);gap:35px;padding:0 28px 28px}.intro h1{font-size:45px}.intro .lead{font-size:12px}.topbar{padding:20px 28px}.tool kbd{display:none}.cabinet{padding:9px}.board{gap:12px 10px}}@media(max-width:740px){body{background-position:center;background-attachment:scroll}.topbar{padding:15px 19px 7px}.brand-mini{font-size:9px;letter-spacing:1.8px}.mini-castle{width:17px;height:17px}.demo-tag{display:none}.icon-button{width:34px;height:34px}.layout{display:block;max-width:540px;margin:0 auto;padding:0 20px 22px}.intro{display:none}.game-heading{margin:6px 0 17px}.game-title{font-size:29px}.game-heading .eyebrow{font-size:8px}.game-heading p{font-size:9px}.levelbar{margin-bottom:11px}.level-name{font-size:11px}.level-sub{font-size:8px}.level-num{width:32px;height:32px;font-size:14px}.cabinet{border-width:6px;padding:9px}.board{gap:12px 10px}.shelf{padding:17px 3px 5px;border-width:2px;border-bottom-width:8px}.shelf-meta{font-size:7px;left:6px;right:6px}.progress-row{margin-top:16px;margin-bottom:7px}.status{font-size:10px;min-height:42px;padding:0 2px}.tools{margin:8px 0 16px}.tool{font-size:10px;min-height:43px;gap:7px}.level-footer{padding-top:12px}.page-footer{font-size:8px;padding-bottom:max(16px,env(safe-area-inset-bottom));letter-spacing:.3px}.level-dot{width:27px;height:27px}.float-sprite{width:65px;height:65px}}@media(max-width:370px){.layout{padding:0 14px 18px}.cabinet{padding:7px}.board{gap:10px 7px}.shelf{padding-left:1px;padding-right:1px}.slot.empty::before{inset:17%}.level-footer .tiny{font-size:8px}.levels{gap:5px}.game-title{font-size:27px}.level-sub{max-width:170px}.tools{gap:7px}}@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}}

/* Embed the larger backdrop as an image: CSS variables have browser size limits. */
body{position:relative;isolation:isolate;background:none}.scene{position:fixed;inset:0;width:100%;height:100%;object-fit:cover;z-index:-2;pointer-events:none;image-rendering:pixelated;filter:brightness(.85)}body::before{z-index:-1;background:linear-gradient(90deg,#0b141cc4,#0b141c30 60%,#0b141c77),linear-gradient(0deg,#0b151bd4,transparent 55%)}.intro h1{font-size:48px}
@media(min-width:741px) and (max-width:960px){.intro h1{font-size:37px}}
@media(min-width:741px) and (max-height:850px){.topbar{padding-top:14px;padding-bottom:9px}.layout{margin-top:0;align-items:start}.game-heading{margin-bottom:12px}.game-heading .eyebrow{font-size:8px}.game-title{font-size:25px}.slot{aspect-ratio:auto;height:66px}.slot .sprite{width:66px;height:66px}.shelf{padding-top:14px;padding-bottom:3px}.board{gap:10px 14px}.status{min-height:36px}.tools{margin:6px 0 12px}.game-heading p{font-size:9px}.intro{padding-top:35px}.progress-row{margin-top:15px}.page-footer{padding-bottom:10px}}

/* Readable reserves, generous hit areas, and an earned room. */
.restored-scene{opacity:0;transition:opacity 1.6s ease;filter:brightness(.82)}
body.restored .restored-scene{opacity:1}
body.restored::before{background:linear-gradient(90deg,#101a1cc9,#101a1c45 60%,#101a1c88),linear-gradient(0deg,#121b20bd,transparent 60%)}
body.restored .cabinet{border-color:#9a7947;border-top-color:#cea66c;border-bottom-color:#66512e;box-shadow:0 0 0 2px #343b2e,0 0 0 4px #d5b576,0 12px 35px #07101399,inset 0 0 0 2px #d6b578}
body.restored .shelf{border-right-color:#a18350;border-left-color:#a18350;border-bottom-color:#c3a465}
body.restored .game-title{color:#ffe0a2}
.shelf{padding-top:16px;padding-bottom:4px}
.shelf-meta{font-size:8px;color:#c6b38f}
.layers{font-size:7px;letter-spacing:.8px;color:#a3bbaa}
/* Front and reserve rows share a shelf stage, with real silhouette overlap. */
.sprite-filters{position:absolute;pointer-events:none}
.shelf-stage{--front-height:76px;--front-size:calc(100% + 16px);--front-max:100px;--row-lift:24px;position:relative;padding-top:var(--row-lift)}
.back-preview{position:absolute;left:0;right:0;top:0;height:var(--front-height);display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:1px;pointer-events:none;user-select:none;z-index:0}
.rear-slot{position:relative;min-width:0}
.back-preview .sprite{position:absolute;left:56%;top:50%;translate:-50% -50%;width:var(--front-size);max-width:var(--front-max);height:auto;aspect-ratio:1;transform:scale(.88);opacity:.7;filter:var(--hosted-document-fragment-0);mix-blend-mode:normal}
.back-preview.no-reserve{visibility:hidden}
.back-preview::after{content:none}
.slots{position:relative;z-index:1}
.slot{height:var(--front-height);min-height:var(--front-height);aspect-ratio:auto}
.slot .sprite{position:absolute;left:50%;top:50%;translate:-50% -50%;width:var(--front-size);max-width:var(--front-max);height:auto;aspect-ratio:1;transition:transform .12s;filter:var(--hosted-document-fragment-0);mix-blend-mode:normal}
.slot.empty::before{inset:13%;border-color:#788267aa;background:#171c20e8;box-shadow:inset 0 0 12px #a9bd7608}
.slot.empty::after{font-size:16px;color:#a4b294;z-index:1}
.slot.selected{box-shadow:0 0 0 2px #d9ba6e38,0 0 20px #d9ba6e16}
.slot.coach-source{outline:2px solid #e9c77d;outline-offset:-2px;animation:coachPulse 1.8s ease-in-out infinite}
.slot.coach-target{outline:2px dashed #a6d4b2;outline-offset:-4px;background:#81b39a15}
.slot.coach-target::after{content:'↓';font-size:23px;color:#b8d9b7;animation:coachNudge 1.8s ease-in-out infinite}
.slot.hint-target{outline:2px solid #b5d99d;outline-offset:-3px;background:#75964d35}
.shelf.matching{background:#3b3c2b;box-shadow:0 0 0 1px #f4d994,0 0 25px #c5af564d,inset 0 0 28px #dfc16435;transition:background .12s}
.shelf.matching .back-preview{visibility:visible}
.shelf.matching .slot{border-color:transparent;outline:none}
.shelf.matching .slot .sprite{filter:var(--hosted-document-fragment-0) brightness(1.35) drop-shadow(0 0 5px #f6d28166)}
.shelf.reveal .slots .sprite{animation:reserveForward .28s ease-out}
.shelf.reveal .back-preview .sprite{animation:none}
.float-sprite{border:0;box-shadow:none;background:#171c20;outline:1px solid #d8c98977;filter:drop-shadow(0 8px 6px #0008);border-radius:3px}
.float-sprite .sprite{width:100%;height:100%;transform:scale(1.17);mix-blend-mode:lighten}
.drag-cursor{position:fixed;width:11px;height:11px;border:2px solid #f1d28e;box-shadow:0 0 0 2px #1a241a;translate:-50% -50%;pointer-events:none;z-index:35}
.board[data-busy=true] .has-item{cursor:default}
.tools .tool{min-height:48px}
.icon-button{min-width:42px;min-height:42px}
.progress-row{font-size:9px}
.level-footer{display:block;padding-top:10px}
.journey-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:9px}
.journey-heading .tiny{letter-spacing:1px;font-size:8px}
.room-button{display:flex;align-items:center;gap:7px;min-height:28px;background:none;border:0;color:#b6c5a7;padding:0;font-size:9px;text-align:right}
.room-button.ready{color:#f1cd81;text-shadow:0 0 12px #e8c27a55}
.room-button span:last-child{color:#d4b572;font-size:14px}
.levels{display:flex;gap:6px;overflow-x:auto;padding:3px 2px 7px;scrollbar-width:thin;scrollbar-color:#687055 transparent;overscroll-behavior-x:contain;scroll-snap-type:x proximity}
.level-dot{min-width:44px;height:40px;flex:1 0 44px;font-size:12px;scroll-snap-align:center;position:relative}
.level-dot.complete::after{content:'';position:absolute;width:3px;height:3px;background:#d0d4a0;bottom:4px;left:calc(50% - 1px)}
.journey-track{display:flex;gap:4px;height:3px;margin-top:2px}
.journey-track i{flex:1;background:#5d655a55}
.journey-track i.done{background:#c0c995}
.room-dialog{max-width:690px;padding:0;border:2px solid #bca16b;overflow:auto;max-height:92svh}
.room-preview{width:100%;aspect-ratio:3/2;background:#233029;position:relative;overflow:hidden}
.room-preview img{display:block;width:100%;height:100%;object-fit:cover;image-rendering:pixelated}
.room-preview .room-before{position:absolute;inset:0}.room-preview .room-after{position:relative}.room-preview .revealing{animation:roomDawn 1.7s ease both}
.room-preview::after{content:'';position:absolute;inset:0;background:linear-gradient(0deg,#182522,transparent 28%);pointer-events:none}
.room-copy{padding:0 30px 28px;position:relative;margin-top:-9px}
.room-copy h2{font-size:31px}
.room-copy p{font-size:11px}
.room-copy .primary{max-width:370px}
.reset-note{font-size:8px!important;opacity:.75;margin-bottom:0}
dialog{max-height:90svh;overflow:auto}
dialog .primary{min-height:48px}
dialog .secondary{min-height:38px}
.page-footer{padding-top:3px}
@keyframes coachPulse{0%,100%{box-shadow:0 0 0 1px #d7b56822}50%{box-shadow:0 0 14px #efd59677;background:#c3b77113}}
@keyframes coachNudge{0%,100%{translate:0 -2px}50%{translate:0 3px}}
@keyframes reserveForward{from{transform:translate(6%,calc(-1 * var(--row-lift))) scale(.88)}to{transform:translate(0,0) scale(1)}}
@keyframes roomDawn{from{opacity:0}to{opacity:1}}
@media(min-width:741px) and (max-height:850px){
  .shelf-stage{--front-height:58px;--front-size:80px;--front-max:calc(100% + 10px);--row-lift:23px}
  .shelf{padding-top:13px;padding-bottom:2px}.board{gap:9px 14px}
  .tools .tool{min-height:43px}.level-dot{height:34px}.journey-heading{margin-bottom:4px}
  .level-footer{padding-top:5px}.game-heading{margin-bottom:7px}.levelbar{margin-bottom:9px}
  .status{min-height:32px}.progress-row{margin-top:12px;margin-bottom:5px}.layout{padding-bottom:14px}
}
@media(max-width:740px){
  .topbar{padding:10px 14px 2px}.top-actions{gap:5px}.icon-button{min-width:42px;min-height:42px}
  .layout{padding:0 14px 16px}.game-heading{margin:3px 0 10px}.game-title{font-size:27px;margin:5px 0}
  .game-heading p{font-size:8px}.levelbar{margin-bottom:10px}.board{gap:10px 8px}
  .cabinet{padding:7px;border-width:5px}.shelf{padding:14px 2px 3px;border-width:2px;border-bottom-width:7px}
  .shelf-stage{--front-height:61px;--front-size:calc(100% + 14px);--front-max:86px;--row-lift:22px}
  .shelf-meta{left:5px;right:5px;font-size:7px}.layers{font-size:6px;letter-spacing:.5px}
  .status{min-height:42px;line-height:1.7;font-size:10px}.tools{gap:8px;margin:7px 0 10px}
  .tools .tool{min-height:46px;font-size:11px}.level-footer{padding-top:6px}
  .journey-heading{margin-bottom:5px;gap:5px}.room-button{font-size:8px;min-height:28px}
  .journey-heading .tiny{font-size:7px;letter-spacing:.7px}.level-dot{min-width:44px;height:40px;flex-basis:44px}
  .level-sub{max-width:220px;font-size:8px}.room-copy{padding:0 19px 22px}.room-copy h2{font-size:26px}
  .progress-row{margin-top:13px;font-size:8px}.progress-row #matchCount{min-width:84px}
  .page-footer{padding-bottom:max(16px,env(safe-area-inset-bottom))}
}
@media(max-width:370px){
  .layout{padding-left:8px;padding-right:8px}.cabinet{padding:5px;border-width:4px}.board{gap:9px 6px}
  .shelf{padding-left:0;padding-right:0}.shelf-stage{--front-height:58px;--row-lift:21px}.status{font-size:9px;min-height:43px}
  .level-name{font-size:10px}.level-sub{max-width:180px}.level-info{gap:8px}.moves{font-size:9px}
  .journey-heading .tiny{font-size:7px;letter-spacing:0}.room-button{font-size:8px}
}
@media(prefers-reduced-motion:reduce){.slot.coach-source{box-shadow:0 0 0 1px #e2c485}.restored-scene{transition:none}.spark{display:none}}

/* Chapter II and the keeper's castle map. */
.chapter-scene{display:none}
body[data-chapter=granary] #oldScene,body[data-chapter=granary] #restoredScene{display:none}
body[data-chapter=granary] #granaryScene{display:block;filter:brightness(.92)}
body[data-chapter=granary] #granaryRestoredScene{display:block;opacity:0;transition:opacity 1.6s ease;filter:brightness(.88)}
body[data-chapter=granary].restored #granaryRestoredScene{opacity:1}
body[data-chapter=granary]::before{background:linear-gradient(90deg,#201a15ce,#201a1528 63%,#201a1555),linear-gradient(0deg,#171b1be6,transparent 70%)}
body[data-chapter=granary]{--teal:#c7b574;--muted:#bdb79d}
body[data-chapter=granary] .cabinet{border-color:#956937;border-top-color:#b99154;border-bottom-color:#51391e;box-shadow:0 0 0 2px #29251b,0 0 0 4px #c59a58,0 13px 30px #0c100faa,inset 0 0 0 2px #b7955d}
body[data-chapter=granary] .shelf{border-left-color:#977543;border-right-color:#977543;border-bottom-color:#b58e51}
body[data-chapter=granary] .level-num{background:#55472a;border-color:#b49a5c;box-shadow:inset 0 0 0 3px #322e20;color:#f0dba0}
body[data-chapter=granary] .game-title{color:#f3ca7f}
body[data-chapter=granary] .intro .lead{color:#d2c5a8}
body[data-chapter=granary] .legend{gap:1px}
body[data-chapter=granary] .legend .sprite{width:45px;height:45px}
.sprite.wheat,.sprite.apple,.sprite.bread,.sprite.cheese,.sprite.honey,.sprite.flour{background-image:var(--granary-sprite);background-size:300% 200%}
.sprite.wheat{background-position:0% 0%}.sprite.apple{background-position:50% 0%}.sprite.bread{background-position:100% 0%}
.sprite.cheese{background-position:0% 100%}.sprite.honey{background-position:50% 100%}.sprite.flour{background-position:100% 100%}
.map-button{min-height:42px;display:flex;align-items:center;gap:8px;padding:7px 12px;background:#192820d9;border:1px solid #6e795a;color:#d3d4b9;font-size:10px}
.map-button .mini-castle{width:16px;height:16px;flex-shrink:0}
.chapter-route{display:flex;align-items:center;justify-content:center;gap:12px;margin:-5px 0 13px;font-size:8px;color:#ac9866}
.chapter-route button{border:0;border-bottom:1px solid transparent;background:transparent;font-size:9px;padding:5px 2px;color:#bdc0a7;min-height:28px}
.chapter-route button.current{border-bottom-color:#bfa66c;color:#eed49c}
.chapter-route button:disabled{opacity:.45}.chapter-route button.current:disabled{opacity:.8}
.crate-lid{position:absolute;left:2px;right:2px;top:var(--row-lift);bottom:1px;z-index:3;display:flex;justify-content:center;align-items:center;gap:9px;background:repeating-linear-gradient(0deg,#64472a 0px,#765333 17px,#3b2c1d 18px,#a07842 20px);border:2px solid #997543;box-shadow:inset 4px 0 #b1915244,inset -4px 0 #261d1488,0 1px #231e17;pointer-events:none;overflow:hidden}
.crate-lid::before{content:'';position:absolute;inset:5px;border-left:5px solid #a28146;border-right:5px solid #a28146;box-shadow:inset 1px 0 #312417,inset -1px 0 #312417;opacity:.85}
.crate-seal{display:block;width:46px;height:46px;background:#171c20;box-shadow:0 0 0 2px #b59652,2px 4px 0 #2c2019;z-index:1}
.crate-seal .sprite{width:100%;height:100%}
.crate-lid b{font-weight:normal;color:#f2d997;font-size:9px;width:46px;text-align:left;line-height:1.6;z-index:1;letter-spacing:.6px;text-shadow:1px 1px #302317}
.crate-type{display:block;color:#ffe5ad;font-weight:bold;letter-spacing:.3px}
.crate-order{position:absolute;right:4px;top:2px;z-index:2;padding:0 3px;background:#2c271fe6;border:1px solid #c1a36666;color:#c7ba95;font-size:6px;line-height:1.4;letter-spacing:.5px}
.crate-order[hidden]{display:none}
.shelf.next-seal .crate-order{color:#efdc9d;border-color:#c7ae70}
.shelf.key-target .crate-lid{border-color:#d5d7aa;box-shadow:inset 0 0 0 2px #a8bb7944,0 0 0 1px #d5d7aa66}
.shelf.key-target .crate-seal{box-shadow:0 0 0 2px #d5d7aa,0 0 11px #c9dd8555}
.shelf.unlock-target .crate-lid{border-color:#ffe099;box-shadow:inset 0 0 0 2px #f3d58a66,0 0 0 2px #e6c77866}
.shelf.unlock-target .crate-order{background:#ecd291;color:#342a1a;border-color:#ffecb7;font-weight:bold}
.shelf.locked .slots{visibility:hidden}
.shelf.locked .layers{color:#e4c580}
.shelf.unsealed{animation:crateOpen .65s ease-out}
.unlock-label{position:absolute;left:0;right:0;top:30%;text-align:center;font-size:8px;letter-spacing:1px;background:#263122e6;color:#f1d58a;padding:7px 2px;z-index:4;pointer-events:none;animation:matchUp 1s ease-out forwards}
.map-dialog{max-width:660px;background:radial-gradient(ellipse at 50% 0,#35422e,#172722 75%);padding:32px 30px 20px}
.map-dialog h2{font-size:31px}.map-dialog>p{font-size:11px}.castle-map{display:grid;grid-template-columns:1fr 1fr;gap:35px;position:relative;margin:32px 0 24px}
.castle-map::before{content:'';position:absolute;left:25%;right:25%;top:75px;border-top:3px dashed #b3a47465;z-index:0}
.map-room{display:flex;flex-direction:column;align-items:center;position:relative;background:#1e2d27e6;border:1px solid #86906580;padding:19px 8px 16px;gap:8px;color:#d9d8bd;min-height:235px}
.map-room:disabled{opacity:.55}.map-room.map-current{outline:1px solid #c4ad70;outline-offset:4px}.map-room.map-restored{border-color:#b8a565;background:#2d3727ed}
.map-room .eyebrow{font-size:8px;letter-spacing:2px}.map-room strong{font-family:Georgia,serif;font-size:24px;font-weight:normal;color:#efd28d}.map-progress{font-size:9px;max-width:170px;line-height:1.8}
.map-tower{width:100px;height:100px;background:linear-gradient(90deg,#6b7053,#93906b 50%,#68674b);clip-path:polygon(0 0,20% 0,20% 13%,40% 13%,40% 0,60% 0,60% 13%,80% 13%,80% 0,100% 0,100% 100%,0 100%);padding:28px 21px 8px}
.map-tower .sprite{width:58px;height:58px;background-color:#171c20;mix-blend-mode:normal;border:2px solid #beb180;box-shadow:0 2px #272c23}
.map-note{color:#c2c2a5!important;font-size:10px!important}
@keyframes crateOpen{0%{box-shadow:0 0 0 2px #e5c26f,inset 0 0 50px #ddbb6877}100%{box-shadow:0 3px 0 #372b20,inset 0 5px 8px #0b131b90}}
@media(min-width:741px){body[data-chapter=granary] .shelf-stage{--front-height:66px;--front-max:88px}body[data-chapter=granary] .layout{align-items:start}body[data-chapter=granary] .intro{padding-top:55px}}
@media(min-width:741px) and (max-height:900px){body[data-chapter=granary] .shelf-stage{--front-height:53px;--row-lift:23px}body[data-chapter=granary] .shelf{padding-top:13px;padding-bottom:2px}.chapter-route{margin-bottom:8px}.game-heading{margin-bottom:9px}}
@media(max-width:740px){.map-button{padding:5px 8px;font-size:9px;gap:6px}.map-button .mini-castle{width:14px;height:14px}.chapter-route{margin:0 0 8px;gap:10px}.chapter-route button{font-size:8px;padding:2px;min-height:24px}.crate-lid{gap:7px}.crate-lid b{font-size:7px;width:39px}.crate-seal{width:38px;height:38px}.map-dialog{padding:29px 16px 20px}.map-dialog h2{font-size:26px}.castle-map{gap:15px;margin:25px 0 20px}.map-room{min-height:222px;padding:14px 4px;gap:7px}.map-room strong{font-size:22px}.map-progress{font-size:8px}.map-tower{width:85px;height:90px;padding:27px 17px 10px}.map-tower .sprite{width:51px;height:51px}.unlock-label{font-size:6px;letter-spacing:.4px}}
@media(max-width:370px){.map-button>span:last-child{display:none}.map-button{width:38px;justify-content:center}.top-actions{gap:4px}.crate-seal{width:34px;height:34px}.crate-lid{gap:5px}.crate-lid b{font-size:6px;width:33px}}
@media(prefers-reduced-motion:reduce){body[data-chapter=granary] #granaryRestoredScene{transition:none}.unlock-label{animation:none}.shelf.unsealed{animation:none}}

/* The playable board owns the viewport. Quests and restoration details live in a sheet. */
.topbar{padding:12px 30px 8px;max-width:1180px;height:66px}
.demo-tag{display:none}
.layout{grid-template-columns:240px minmax(0,600px);gap:48px;max-width:1080px;margin:0 auto;padding:0 24px 14px;align-items:center}
.intro{padding:0!important}.intro h1{font-size:43px}.intro .lead{font-size:12px}
.game{display:grid;grid-template-rows:34px 42px minmax(0,1fr) 18px 34px 48px 34px;gap:8px;height:calc(100svh - 88px);min-height:610px;max-height:900px;align-content:stretch}
.game-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0!important;text-align:left}
.game-heading .eyebrow,.chapter-route{display:none}
.game-title{font-size:23px!important;letter-spacing:.5px;margin:0!important;line-height:1.2}
.quest-button{display:flex;align-items:center;gap:9px;min-height:34px;padding:2px 8px;border:1px solid #77836577;background:#1c2b25ce;color:#dddbbb;font-size:10px;white-space:nowrap}
.quest-button #questCount{color:#b2c99f}
.levelbar{margin:0 2px!important}.level-info{min-width:0;gap:10px}.level-name{font-size:12px}.level-sub{font-size:9px;max-width:none}
.level-num{width:36px;height:36px}.moves{white-space:nowrap}
.cabinet{min-height:0;padding:9px;border-width:6px;width:100%;height:100%;max-height:calc(var(--board-rows,3) * 138px + 20px);align-self:center}
.board{position:relative;z-index:1;height:100%;grid-template-columns:repeat(6,minmax(0,1fr));grid-template-rows:repeat(var(--board-rows,3),minmax(0,1fr));gap:12px 10px;align-content:stretch}
.shelf{grid-column:span 3;display:flex;flex-direction:column;justify-content:center;min-height:0;padding:14px 3px 3px!important;border-width:2px;border-bottom-width:7px}
.board[data-shelves="5"] .shelf:last-child,.board[data-shelves="7"] .shelf:last-child{grid-column:2 / span 3}
body .shelf-stage,body[data-chapter=granary] .shelf-stage{--row-lift:22px;--front-size:calc(100% + 12px);--front-max:88px;--front-height:100%;height:100%;max-height:114px;padding-top:var(--row-lift);min-height:0}
.slots{height:100%}.slot{height:100%;min-height:0;aspect-ratio:auto}
.back-preview{height:calc(100% - var(--row-lift));max-height:100px}
.slot .sprite,.back-preview .sprite{width:var(--front-size);max-width:min(var(--front-max),var(--sprite-limit,88px));height:auto;max-height:none}
.slot.has-item:focus-visible{outline-offset:-2px}.slot.empty::before{inset:12%;border-color:#7e8c7090}
.slot.has-item:not(:disabled):active .sprite{transform:translateY(-5px) scale(1.06)}
.slot:disabled{opacity:1}.shelf.settling .slots,.shelf.settling .back-preview{visibility:hidden}
.shelf.reveal .slots .sprite{animation:none}.shelf.arriving .slots .sprite{animation:reserveForward .15s ease-out both}
.slot.placed .sprite{animation:placeBounce .13s ease-out}
.float-sprite{background:transparent;outline:0;filter:drop-shadow(0 5px 3px #0007);border-radius:0}
.float-sprite .sprite{transform:none;filter:var(--hosted-document-fragment-0);mix-blend-mode:normal}
.match-ghost{z-index:32;filter:drop-shadow(0 0 4px #edc66e99)}
.match-label{font-size:11px;animation:matchUp .5s ease-out forwards;top:22%}
.progress-row{margin:0 2px!important;font-size:9px;gap:9px;min-height:0}.progress-row .track{height:5px}.progress-row #matchCount{min-width:92px}
.status{font-size:10px;line-height:1.45;min-height:0!important;margin:0;padding:0 5px}
.tools{margin:0!important;gap:8px}.tools .tool{min-height:44px;font-size:11px}
.level-footer{padding:0!important;border:0;display:flex;flex-direction:column;justify-content:center;gap:4px}
.journey-heading{margin:0;min-height:24px}.journey-heading .tiny{font-size:8px}.room-button{font-size:9px;min-height:24px}
.journey-track{margin:0;width:100%;height:2px}.page-footer{display:none}
.quests-dialog{max-width:480px;padding:28px}.quests-dialog h2{margin-bottom:8px}.quests-dialog>p{font-size:11px}
.quests-dialog .levels{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:8px;overflow:visible;padding:7px 0 18px}
.quests-dialog .level-dot{width:100%;min-width:0;height:48px}
.room-milestones{list-style:none;text-align:left;margin:0;padding:0;display:grid;gap:12px}
.room-milestones li{display:flex;align-items:center;gap:12px;opacity:.6;font-size:11px;line-height:1.5}
.room-milestones li.earned{opacity:1}.room-milestones strong{display:block;color:#e6d8ad;font-size:11px;font-weight:normal}.room-milestones small{display:block;font-size:9px;color:#adbea9;margin-top:2px}
.milestone-mark{display:grid;place-items:center;width:29px;height:29px;flex-shrink:0;background:#253329;border:1px solid #708361;color:#d4dbb0;font-size:11px}
.earned .milestone-mark{background:#465534;border-color:#a5b482;color:#f5e5b1}
.win-reward{display:flex;gap:15px;align-items:center;text-align:left;padding:15px 12px;background:#35442c;border:1px solid #829468;box-shadow:inset 0 1px #bac99744;margin:13px 0 5px}
.win-reward[hidden]{display:none}.win-reward .eyebrow{font-size:8px;letter-spacing:1px;color:#bed5a2}.win-reward strong{display:block;font-family:Georgia,serif;font-weight:normal;font-size:20px;color:#ffe2a4;margin:4px 0}
.win-reward p{font-size:10px;margin:0;line-height:1.6;color:#d1d8b9}
.reward-art{flex-shrink:0;width:34px;height:36px;border:4px solid #b6914e;border-top-width:7px;border-bottom-width:7px;background:repeating-linear-gradient(0deg,#37432b 0 7px,#c5a668 7px 11px);box-shadow:2px 3px #172720}
[data-upgrade$=lanterns] .reward-art{width:27px;height:36px;background:#ffdf82;border:5px solid #ae8750;box-shadow:0 0 18px #edc05b66,inset 3px 0 #fff1aa;position:relative}
[data-upgrade$=banners] .reward-art{background:#6a9987;border:0;clip-path:polygon(0 0,100% 0,100% 100%,50% 75%,0 100%);box-shadow:inset 5px 0 #416450,inset -5px 0 #416450}
[data-upgrade$=harvest] .reward-art{background:repeating-linear-gradient(90deg,#dab968 0 5px,#91733e 5px 7px);border:0;border-bottom:9px solid #688348;transform:rotate(-8deg)}
/* Repairs stay visible on the cabinet; the final chapter reward still transforms the room art. */
.cabinet-upgrades{position:absolute;inset:0;pointer-events:none;z-index:2}
.room-lantern,.room-banner,.harvest-mark{display:none;position:absolute}
body[data-room-stage="1"] .cabinet,body[data-room-stage="2"] .cabinet,body[data-room-stage="3"] .cabinet{border-top-color:#c29b5b;border-bottom-color:#7b613a}
body[data-room-stage="1"] .shelf,body[data-room-stage="2"] .shelf,body[data-room-stage="3"] .shelf{border-bottom-color:#c2a269}
body[data-room-stage="2"] .room-lantern,body[data-room-stage="3"] .room-lantern{display:block;width:11px;height:20px;top:42%;border:3px solid #8b693f;background:#ffe497;box-shadow:0 0 16px 4px #fbd87955,inset 2px 0 #fff1b1}
.room-lantern::before{content:'';position:absolute;left:1px;top:-8px;width:3px;height:6px;background:#8b693f}.room-lantern.left{left:-9px}.room-lantern.right{right:-9px}
body[data-room-stage="3"][data-chapter=armory] .room-banner{display:block;top:-9px;width:18px;height:27px;background:#7cac96;box-shadow:inset 4px 0 #456c56,inset -4px 0 #456c56;clip-path:polygon(0 0,100% 0,100% 100%,50% 77%,0 100%)}
.room-banner.left{left:21%}.room-banner.right{right:21%}
body[data-room-stage="3"][data-chapter=granary] .harvest-mark{display:block;top:-15px;left:calc(50% - 15px);width:30px;height:30px;background:#3c3c22;border:2px solid #b99b54;transform:rotate(-4deg)}
.harvest-mark .sprite{filter:var(--hosted-document-fragment-0);mix-blend-mode:normal}
@keyframes placeBounce{0%{transform:scale(1.08) translateY(-3px)}65%{transform:scale(.98) translateY(1px)}100%{transform:none}}
@media(max-width:1100px){
  .topbar{max-width:620px;padding:7px 13px 5px;height:54px}.brand-mini{font-size:9px;letter-spacing:1.3px}.mini-castle{width:17px;height:17px}.top-actions{gap:5px}
  .layout{display:block;max-width:620px;padding:0 12px max(9px,env(safe-area-inset-bottom));margin:0 auto}
  .intro{display:none}.game{height:calc(100svh - 63px - env(safe-area-inset-bottom));min-height:0;max-height:none;grid-template-rows:28px 36px minmax(0,1fr) 16px 32px 46px 30px;gap:6px}
  .game-title{font-size:19px!important}.quest-button{font-size:9px;min-height:28px}.level-num{width:32px;height:32px}.level-name{font-size:11px}.level-sub{font-size:8px}.level-info{gap:9px}
  .cabinet{padding:7px;border-width:5px}.board{gap:10px 8px}.shelf{padding:13px 2px 2px!important}
  body .shelf-stage,body[data-chapter=granary] .shelf-stage{--row-lift:21px;--front-max:84px;max-height:106px}
  .map-button,.icon-button{min-height:42px;height:42px;min-width:42px}.map-button{font-size:9px;padding:5px 8px}.tools .tool{min-height:44px}.tool kbd{display:none}
  .room-button{font-size:8px}.journey-heading .tiny{font-size:7px}.status{font-size:10px}.progress-row{font-size:8px}
  .quests-dialog{padding:26px 20px}.quests-dialog .level-dot{height:46px}
}
@media(max-width:370px){
  .topbar{padding-left:9px;padding-right:9px}.layout{padding-left:8px;padding-right:8px}.brand-mini{font-size:8px;letter-spacing:.9px}
  .cabinet{border-width:4px;padding:4px}.board{gap:8px 6px}.shelf{padding-left:0!important;padding-right:0!important}
  .map-button>span:last-child{display:none}.map-button{padding:4px;justify-content:center}
  .level-name{font-size:10px}.level-sub{font-size:7px}.moves{font-size:8px}.moves strong{font-size:15px}.status{font-size:9px}
}
@media(max-width:1100px) and (max-height:700px){
  .topbar{height:44px;padding-top:1px;padding-bottom:1px}.layout{padding-bottom:max(6px,env(safe-area-inset-bottom))}
  .game{height:calc(100svh - 50px - env(safe-area-inset-bottom));grid-template-rows:32px minmax(0,1fr) 14px 28px 44px;gap:5px;min-height:518px}
  .game-heading{display:contents!important}.game-title,.level-footer{display:none!important}.level-sub{display:none}.board{gap:7px 6px}.shelf{padding-top:11px!important}
  .brand-mini{visibility:hidden}.quest-button{position:absolute;top:1px;left:max(9px,calc((100vw - 600px) / 2));height:42px;min-width:112px;z-index:3;background:#1c2b25}
  body .shelf-stage,body[data-chapter=granary] .shelf-stage{--row-lift:18px;--front-max:72px}
  .shelf-meta{top:1px;font-size:6px}.layers{font-size:6px}.cabinet{padding:5px}
}
@media(prefers-reduced-motion:reduce){.shelf.arriving .sprite,.slot.placed .sprite{animation:none}.room-lantern{box-shadow:0 0 10px #fbd87944!important}}

/* Cached alpha textures preserve the layered artwork without live SVG filters. */
html.armory-sprites-ready .sprite:is(.helmet,.shield,.potion,.goblet),html.granary-sprites-ready .sprite:is(.wheat,.apple,.bread,.cheese,.honey,.flour){filter:none!important;mix-blend-mode:normal}
.float-sprite,.match-ghost{filter:none!important;will-change:transform;contain:layout style}
.dragging-ghost{left:0!important;top:0!important;transform:translate3d(-200px,-200px,0)}
.drag-cursor{will-change:transform}
.slot.pressed .sprite{transform:translateY(-3px) scale(1.04);transition:none}
.slot:hover{filter:none!important}.slot .sprite{transition:none}
.slot.placed .sprite{animation:placeBounce .08s ease-out}
.shelf.arriving .slots .sprite{animation-duration:.1s}

/* Bare shelves at rest; lightweight landing cues appear only while choosing a move. */
.slots{background:linear-gradient(0deg,#171c20 0%,#171c20d9 26%,#171c2044 70%,transparent 100%)}
.slot.empty::before{content:none!important}
.slot.empty::after{content:''!important;position:absolute;inset:auto;left:22%;bottom:7%;width:56%;height:3px;border:0;box-shadow:none;background:linear-gradient(90deg,transparent,#a8c5a3,transparent);opacity:0;font-size:0;animation:none;pointer-events:none}
.board.selecting .slot.empty.valid{background:none}
.board.selecting .slot.empty.valid::after{opacity:.38}
.slot.empty.hint-target,.slot.empty.coach-target,.slot.empty.drop-hover{outline:none!important;background:none!important;box-shadow:none}
.slot.empty.hint-target::after,.slot.empty.coach-target::after{opacity:1;background:linear-gradient(90deg,transparent,#efd08f,transparent);height:4px;animation:landingPulse 1.3s ease-in-out infinite}
.slot.empty.drop-hover::after{opacity:1;height:4px;background:linear-gradient(90deg,transparent,#c0dab6,transparent);animation:none}
.shelf.drop-ready{border-bottom-color:#f1ce80!important}
.shelf.drop-ready .slot.empty.drop-hover::after{background:linear-gradient(90deg,transparent,#f6dc9c,transparent)}
.slot.selected{border-color:transparent;background:none;box-shadow:none}
.slot.selected::after{content:'';position:absolute;left:28%;bottom:5%;width:44%;height:3px;background:linear-gradient(90deg,transparent,#e4c887,transparent);pointer-events:none}
.slot.drag-origin{opacity:.16}.slot.return-origin .sprite{opacity:.2}
.drop-preview{z-index:8;opacity:.32;pointer-events:none}
.drop-preview.makes-match{opacity:.5}
.dragging-ghost{opacity:.82}.dragging-ghost.can-drop{opacity:1}
.returning-ghost{pointer-events:none;will-change:transform}
.drag-cursor{border:0;width:7px;height:7px;border-radius:50%;background:#e9d6a6;box-shadow:0 0 0 2px #1a241a88}
@keyframes landingPulse{50%{opacity:.45}}
.board.selecting .slot.empty.valid:is(.hint-target,.coach-target,.drop-hover)::after{opacity:1}
.board .slot.empty:focus-visible{outline:2px solid #d4e9bd!important;outline-offset:-3px}

/* A destination map, rendered only when opened. */
.map-dialog{width:calc(100% - 24px);max-width:980px;max-height:94svh;padding:0;border:2px solid #9d895b;background:#172721;overflow:auto;text-align:left;box-shadow:0 0 0 4px #27372d,0 24px 90px #000b}
.map-header{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:23px 27px 8px;background:#172721;position:sticky;top:0;z-index:5}
.map-header .eyebrow{font-size:8px;color:#b6bd92;letter-spacing:2px}.map-header h2{font-size:31px;margin:6px 0 0;color:#efdb9e}
.map-close{flex-shrink:0;border-color:#748061;background:#26392e;color:#d6ddc2}
.map-overview{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:5px 28px 19px;color:#a8b79d;font-size:10px}
.map-overview>span{display:flex;align-items:center;gap:7px}.map-overview strong{font-weight:normal;color:#e5d5a6}.map-overview .mini-castle{display:inline-block;width:14px;height:14px;color:#ccaf67}
.map-content{display:grid;grid-template-columns:minmax(0,1.8fr) minmax(245px,1fr);gap:0;align-items:start;border-top:1px solid #86936538;border-bottom:1px solid #86936538;background:#12231f}
.map-landscape{min-width:0;padding:16px 0 0 16px;align-self:center}
.map-illustration{position:relative;aspect-ratio:3/2;overflow:hidden;border:1px solid #7a806144;background:#0e1e29;isolation:isolate}
#castleMapArt{display:block;width:100%;height:100%;object-fit:contain;image-rendering:pixelated}
.map-illustration::after{content:'';position:absolute;inset:0;pointer-events:none;background:linear-gradient(0deg,#0a2027bd,transparent 21%,transparent 87%,#0a202766);z-index:1}
.map-lock-veil{position:absolute;left:55%;right:0;top:27%;bottom:16%;background:radial-gradient(ellipse,#081522d9,#08152266 50%,transparent 74%);pointer-events:none;z-index:1}
.map-lock-veil[hidden]{display:none}
.map-compass{position:absolute;left:12px;top:9px;display:flex;flex-direction:column;align-items:center;font-size:8px;color:#e4d5a0;line-height:1.1;z-index:2;opacity:.75}.map-compass span{font-size:22px}
.map-art-caption{position:absolute;left:0;right:0;bottom:9px;text-align:center;font-size:6px;letter-spacing:1.4px;color:#c3cdb0;z-index:2;pointer-events:none}
.castle-map{display:block;position:absolute;inset:0;margin:0!important;z-index:3}.castle-map::before{content:none}
.map-node{position:absolute;transform:translate(-50%,-50%);width:133px;min-height:50px;display:flex;align-items:center;gap:8px;padding:7px 9px;border:1px solid #92996e;background:#152b27ef;color:#e4d8b2;box-shadow:0 3px 0 #061c1cb3;text-align:left}
.map-node[data-map-room=armory]{left:29%;top:69%}.map-node[data-map-room=granary]{left:73%;top:65%}
.map-node::before{content:'';position:absolute;left:calc(50% - 3px);top:-6px;width:7px;height:7px;transform:rotate(45deg);background:#152b27;border-left:1px solid #92996e;border-top:1px solid #92996e}
.map-node.selected{border-color:#f0cf84;background:#36452def;box-shadow:0 0 0 2px #ecd08433,0 3px 0 #12261e}.map-node.selected::before{border-color:#f0cf84;background:#36452d}
.map-node.restored{border-color:#c6af6d}.map-node.locked{border-color:#67777b;background:#18282fed;color:#abb8b2}.map-node.locked::before{border-color:#67777b;background:#18282f}
.map-node .node-symbol{width:23px;height:27px;flex-shrink:0;border:1px solid #9da98070;display:grid;place-items:center;font-size:13px;color:#e6d393;background:#2a3f30}
.map-node.locked .node-symbol{background:#27363c;color:#b5c5c0}.map-node .node-symbol svg{width:15px;height:17px}
.map-node strong{font-family:Georgia,serif;font-size:16px;font-weight:normal;display:block;line-height:1.15}.map-node small{display:block;font-size:7px;margin-top:4px;color:#b4c5ab;letter-spacing:.3px}
.map-node .node-current{position:absolute;right:4px;top:3px;width:4px;height:4px;background:#b1dab1;border-radius:50%}
.map-note{font-size:9px!important;line-height:1.7;margin:11px 10px 12px;text-align:center;color:#9faf9b!important}
.map-detail{padding:22px 21px 18px;min-width:0;background:linear-gradient(180deg,#24372a55,transparent)}
.map-detail-heading{display:flex;align-items:center;gap:13px}.map-detail-icon{width:52px;height:52px}
.map-detail .eyebrow{font-size:8px;letter-spacing:1.8px;color:#b7be93}.map-detail h3{font-family:Georgia,serif;font-weight:normal;font-size:26px;line-height:1.15;margin:5px 0;color:#efdaa0}
.map-room-status{display:inline-block;font-size:8px;color:#b9cbb0}.map-detail>p{font-size:10px;line-height:1.8;margin:14px 0;color:#b4c5b1}
.map-room-progress{font-size:9px;color:#d3d5b6;margin:17px 0 19px}.map-track{height:5px;background:#091e1c;border:1px solid #73805b66;margin-top:8px}.map-track>span{display:block;height:100%;background:#c2c990;width:0}
.map-steps{display:flex;justify-content:space-between;position:relative;gap:6px;isolation:isolate}.map-steps::before{content:'';position:absolute;left:12%;right:12%;top:12px;height:1px;background:#62765777;z-index:-1}
.map-step{flex:1;display:flex;align-items:center;flex-direction:column;gap:7px;text-align:center;color:#7f9684;font-size:7px}
.map-step i{width:25px;height:25px;display:grid;place-items:center;background:#26392b;border:1px solid #6f8161;font-style:normal;font-size:9px;color:#a9b49a;border-radius:50%}
.map-step.earned{color:#c5d1ac}.map-step.earned i{background:#687342;border-color:#c0c788;color:#f2e4b6}
.map-next-step{min-height:34px;font-size:9px!important;color:#d5c58f!important;line-height:1.6!important;margin:18px 0 5px!important}
.map-detail .primary{margin-top:8px;font-size:11px;min-height:46px}.map-detail .primary:disabled{opacity:.5;cursor:default}
.map-detail .secondary{width:100%;text-align:center;min-height:36px;font-size:9px}.map-detail .secondary[hidden]{display:none}
.map-footer{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:4px 27px 8px;font-size:8px;color:#95ac96}.map-footer .secondary{padding:10px 0;min-height:40px;font-size:9px;white-space:nowrap}
@media(max-width:700px){
  .map-dialog{width:calc(100% - 16px);max-width:470px}.map-header{padding:17px 17px 7px}.map-header h2{font-size:27px}.map-header .eyebrow{font-size:7px}
  .map-overview{padding:5px 18px 14px;font-size:8px;gap:7px}.map-overview>span{gap:5px}.map-overview .mini-castle{width:12px;height:12px}
  .map-content{display:block}.map-landscape{padding:0}.map-illustration{border-width:0 0 1px}.map-detail{padding:17px 20px 10px}
  .map-node{width:118px;min-height:46px;padding:6px 7px;gap:6px}.map-node strong{font-size:15px}.map-node small{font-size:6px}.map-node .node-symbol{width:20px;height:25px;font-size:12px}
  .map-note{font-size:8px!important;margin:10px 18px 0}.map-art-caption{font-size:5px;letter-spacing:1px;bottom:6px}
  .map-detail h3{font-size:25px}.map-detail-heading{gap:12px}.map-detail-icon{width:45px;height:45px}.map-detail>p{margin:10px 0;font-size:10px}.map-room-progress{margin:12px 0 14px}
  .map-step{font-size:8px}.map-next-step{min-height:0;margin:14px 0 3px!important}.map-detail .primary{min-height:46px}
  .map-footer{padding:3px 20px 7px;font-size:7px}.map-footer .secondary{font-size:8px}
}
@media(max-width:370px){.map-node{width:105px;padding:6px;gap:5px}.map-node strong{font-size:13px}.map-node small{font-size:6px}.map-header h2{font-size:25px}.map-detail{padding-left:16px;padding-right:16px}.map-overview{font-size:7px}.map-art-caption{letter-spacing:.5px}}
