/* Logical game coordinates: the complete canvas scales, child layouts never reflow. */
.game-viewport{position:fixed;inset:0;overflow:hidden;background:#080e0b;isolation:isolate;touch-action:manipulation}
.game-shell{position:absolute;left:50%;top:50%;width:1280px;height:720px;transform:translate(-50%,-50%) scale(var(--game-scale,1));transform-origin:center center;overflow:hidden;isolation:isolate;background:#17281b url('assets/forge.webp') center/cover no-repeat}
.game-shell:after{content:'';position:absolute;inset:0;z-index:1;pointer-events:none;background:linear-gradient(#0a1714c9,transparent 29%,transparent 60%,#091a13df);box-shadow:inset 100px 0 130px -75px #07140cdd,inset -100px 0 130px -75px #07140cdd}
.topbar{position:absolute;top:0;left:0;width:1280px;height:91px;z-index:8;background:linear-gradient(#15251fdf,#13241a88 75%,transparent);pointer-events:none}.topbar>*{pointer-events:auto}.brand{position:absolute;left:26px;top:8px;width:220px;height:74px}.navigation{position:absolute;left:285px;top:22px;width:558px;height:48px;display:grid;grid-template-columns:repeat(6,88px);gap:6px}.top-resources{position:absolute;left:949px;top:20px;width:248px;height:51px;display:grid;grid-template-columns:1fr 1fr;gap:16px;align-items:center;padding:5px 12px;border:1px solid #8b8d5c66;background:linear-gradient(130deg,#29392be0,#13261deb);box-shadow:inset 0 1px #bfc58c22,0 3px 10px #0005}#settings-button{position:absolute;left:1217px;top:27px}
.expedition-bar{position:absolute;left:26px;top:95px;width:1228px;height:50px;z-index:7;pointer-events:none}.stage-location{position:absolute;left:0;top:0;width:243px}.route-progress{position:absolute;left:270px;top:23px;width:250px;height:7px}.boss-note{position:absolute;right:0;top:10px;width:290px;height:26px}
.main-layout{position:absolute;inset:0;z-index:auto;overflow:hidden}.workshop{position:absolute;inset:0;z-index:auto}.scene{position:absolute;inset:0;width:1280px;height:720px;z-index:0;isolation:isolate;overflow:hidden;touch-action:none;background:#1d2a20 url('assets/forge.webp') center/cover no-repeat}.scene.battle-scene{background-image:url('assets/journey.webp')}.scene.work-active:before{content:'';position:absolute;inset:0;z-index:0;background:#11221c66}.scene:after{content:'';position:absolute;inset:0;z-index:-1;pointer-events:none;box-shadow:inset 0 0 140px #09170d88}.scene canvas{position:absolute;inset:0;width:1280px;height:720px;display:block;z-index:1}
.orders-panel{position:absolute;left:26px;top:171px;width:196px;height:438px;z-index:5;display:flex;flex-direction:column;gap:10px;overflow:hidden}.orders-panel .panel-title{flex-shrink:0}.order-card{flex-shrink:0}.orders-panel .side-link{flex-shrink:0}
.journey-panel{position:absolute;left:1034px;top:171px;width:220px;height:397px;z-index:5;padding:13px 14px;overflow:hidden;background:linear-gradient(145deg,#1b2e20df,#11251cbb);border:1px solid #92a06466;box-shadow:inset 0 1px #b5c08122,0 5px 16px #0005;clip-path:polygon(8px 0,calc(100% - 8px) 0,100% 8px,100% 100%,0 100%,0 8px)}.journey-panel>.panel-title{border-bottom:1px solid #889c5e55}.journey-card+.journey-card{border-top:1px solid #8c9e5e44}.journey-panel .material-description{height:34px;line-height:17px;font-size:9px;overflow:hidden}.journey-panel .relic-row{height:84px;align-content:start}
.scene-top{position:absolute;left:266px;top:153px;width:744px;height:29px;z-index:3;display:flex;align-items:center;justify-content:space-between;pointer-events:none}.scene-overlay{position:absolute;inset:0;z-index:2;pointer-events:none}.work-hint{position:absolute;left:520px;top:410px;width:430px;height:48px;z-index:3;pointer-events:none}.forge-preview-label{position:absolute;left:815px;top:195px;width:170px;height:90px}.station-tabs{position:absolute;left:286px;top:460px;width:708px;height:34px;z-index:6;display:flex;align-items:center;padding:0 18px;background:linear-gradient(#14291ee9,#12251ee6);border:1px solid #a5936366}
.work-controls{position:absolute;left:286px;top:502px;width:708px;height:174px;z-index:6;padding:14px 20px;display:grid;grid-template-rows:25px 56px 44px;row-gap:9px;background:linear-gradient(135deg,#2b3b2bf7,#182d22f5);border:1px solid #b29c68aa;box-shadow:inset 0 1px #decd952b,inset 0 -3px #0a1d1166,0 9px 30px #0008;clip-path:polygon(9px 0,calc(100% - 9px) 0,100% 9px,100% 100%,0 100%,0 9px)}
.is-crafting .orders-panel,.is-crafting .journey-panel,.is-battling .orders-panel,.is-battling .journey-panel{display:none!important}.is-crafting .scene-top{left:26px;top:153px;width:1228px}.is-crafting .work-hint{display:none}.is-crafting .work-controls{left:280px;top:524px;width:720px;height:156px;padding:12px 20px;display:flex;flex-direction:column;justify-content:space-between;gap:7px}.is-crafting .station-tabs{left:280px;top:482px;width:720px;height:34px}.step-heading{position:absolute;left:330px;top:175px;width:820px;height:76px;text-align:center}.step-eyebrow{display:block;height:15px;line-height:15px;font-size:9px;letter-spacing:1px;color:#cfb67d}.step-heading h2{height:39px;font:31px/39px var(--heading);font-weight:400;color:#eddbab;text-shadow:0 3px #2d3522,0 4px 12px #0009}.step-heading p{height:18px;line-height:18px;font-size:11px;color:#becdae}
.weapon-result{position:absolute;left:349px;top:195px;width:582px;height:252px}.weapon-result .result-close{pointer-events:auto}
.is-battling .scene-top,.is-battling .work-hint{display:none}.is-battling .work-controls{left:280px;top:551px;width:720px;height:129px;padding:10px 17px;display:grid;grid-template-rows:23px 53px 16px;gap:7px;background:linear-gradient(#223c29f2,#132b1ff2)}.is-battling .work-controls>.material-description{font-size:9px;line-height:16px}.battle-hud{position:absolute;left:35px;top:159px;width:1210px;height:65px;display:flex;justify-content:space-between;align-items:flex-start}
.is-menu:after{background:#0d2118ba;backdrop-filter:blur(4px)}.collection-view{position:absolute;left:52px;top:144px;width:1176px;height:536px;z-index:5;background:linear-gradient(135deg,#293b29f0,#142b1ff5);border:1px solid #a0a36888;box-shadow:inset 0 1px #cad29b22,0 12px 40px #0008;clip-path:polygon(10px 0,calc(100% - 10px) 0,100% 10px,100% 100%,0 100%,0 10px);overflow:hidden}
.collection-header{position:absolute;left:25px;top:17px;width:1124px;height:80px;border-bottom:1px solid #879b5c55}.collection-header>div:first-child{position:absolute;left:0;top:0;width:867px;height:79px}.collection-header .eyebrow{position:absolute;left:0;top:0;width:850px;height:14px;white-space:nowrap;overflow:hidden}.collection-header h1{position:absolute;left:0;top:16px;width:850px;height:38px}.collection-header p{position:absolute;left:0;top:57px;width:850px;height:18px}.collection-header>.balance{position:absolute;right:0;top:3px}.collection-header>.secondary-button{position:absolute;right:0;top:14px;width:145px;height:39px}
.collection-scroll{position:absolute;left:25px;top:108px;width:1124px;height:407px;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;scrollbar-gutter:stable;touch-action:pan-y;padding:0 11px 16px 0;scrollbar-width:thin;scrollbar-color:#a5aa6d88 #0f251a88}.collection-scroll::-webkit-scrollbar,.modal-content::-webkit-scrollbar{width:9px}.collection-scroll::-webkit-scrollbar-track,.modal-content::-webkit-scrollbar-track{background:#10261b88;border-left:1px solid #a4ad6c22}.collection-scroll::-webkit-scrollbar-thumb,.modal-content::-webkit-scrollbar-thumb{background:linear-gradient(90deg,#62744b,#9d9f67);border:2px solid #19321e;border-radius:0}
.modal-backdrop{position:absolute;inset:0;width:1280px;height:720px;z-index:30;overflow:hidden;background:#091a12df;backdrop-filter:blur(6px)}
/* All dialogs share one frame. Content, titles and actions have separate fixed viewports. */
.modal,.modal.wide{position:absolute;left:140px;top:60px;width:1000px;height:600px;min-width:1000px;max-width:1000px;min-height:600px;max-height:600px;overflow:hidden;background:linear-gradient(135deg,#3d4c31,#172e20);border:1px solid #b49f68bb;box-shadow:inset 0 1px #ebdba333,inset 0 0 0 5px #c0b5780a,0 18px 80px #000b;animation:fade-in .13s ease}
.modal-header{position:absolute;left:0;top:0;width:998px;height:88px;padding:13px 36px 10px;border-bottom:1px solid #91a06266;background:linear-gradient(#7d815111,transparent)}.modal-header .modal-eyebrow{position:absolute;left:40px;top:13px;width:918px;height:16px;text-align:center;overflow:hidden;white-space:nowrap}.modal-header h2{position:absolute;left:58px;top:34px;width:882px;height:40px;text-align:center;overflow:hidden;text-overflow:ellipsis}.modal-close{position:absolute;right:16px;top:15px;z-index:2}.modal-header .close-placeholder{position:absolute;right:16px;top:15px;width:30px;height:30px}
.modal-content{position:absolute;left:30px;top:106px;width:938px;height:367px;padding:0 13px 12px 0;overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;scrollbar-gutter:stable;scrollbar-width:thin;scrollbar-color:#a5aa6d88 #0f251a88;touch-action:pan-y}.modal-footer{position:absolute;left:0;top:486px;width:998px;height:112px;display:grid;grid-template-rows:54px 42px;align-content:center;row-gap:3px;padding:4px 25px 6px;border-top:1px solid #91a06266;background:#142c1d55}.modal-footer>.base-reward{width:946px}.modal[data-kind=salvage] .modal-content,.modal[data-kind=retire] .modal-content,.modal[data-kind=import] .modal-content,.modal[data-kind=sync] .modal-content{display:flex;flex-direction:column;justify-content:center}.modal[data-kind=settings] .modal-content{padding-left:9px;padding-right:22px}.modal[data-kind=gameover] .modal-content .modal-intro{margin:4px 0 0}.modal[data-kind=gameover] .gameover-stats{margin-top:14px}.modal[data-kind=reward] .modal-intro{height:44px;margin-bottom:15px}.modal[data-kind=help] .modal-intro{height:26px;line-height:26px;margin-bottom:12px}
.base-reward{height:42px}.collection-scroll:focus-visible,.modal-content:focus-visible{outline:1px solid #c4b27a;outline-offset:3px}
.is-gameover .work-controls{height:156px;top:524px;display:flex;flex-direction:column;justify-content:center}.is-gameover .work-controls .hold-control{height:100px;flex-shrink:0}.is-gameover .work-controls .hold-copy p{max-width:400px}
.statusbar{position:absolute;left:26px;top:689px;width:1228px;height:24px;z-index:8;display:flex;align-items:center;justify-content:space-between;gap:15px;background:transparent;pointer-events:none}.statusbar>*{pointer-events:auto}.toast-stack{position:absolute;right:25px;bottom:38px;width:365px;height:220px;z-index:45;display:flex;flex-direction:column;justify-content:flex-end;gap:8px;pointer-events:none}
.title-screen{position:absolute;inset:0;z-index:20;isolation:isolate;overflow:hidden;background:#132419 url('assets/forge.webp') center/cover no-repeat}.title-screen:before{content:'';position:absolute;inset:0;z-index:0;background:linear-gradient(90deg,#10241bef,#12251a99 44%,#12241a11 77%),linear-gradient(transparent 43%,#091b12dc)}.title-screen:after{content:'';position:absolute;inset:16px;z-index:0;border:1px solid #c6b68155;pointer-events:none;box-shadow:inset 0 0 100px #08171033}.title-light{position:absolute;inset:0;background:radial-gradient(ellipse at 68% 54%,#e5a13818,transparent 60%);animation:fire-light 5s ease-in-out infinite}.title-character{position:absolute;left:663px;top:65px;width:500px;height:590px;object-fit:contain;filter:drop-shadow(0 12px 15px #07180d99);transform:rotate(-2deg);animation:smith-breathe 5s ease-in-out infinite}.title-menu{position:absolute;left:156px;top:151px;width:355px;height:440px;z-index:1}.title-kicker{position:absolute;left:3px;top:0;height:20px;font-size:13px;line-height:20px;letter-spacing:3px;color:#c2c8a7;text-shadow:0 2px 5px #0009}.title-menu h1{position:absolute;left:0;top:35px;width:370px;height:110px;font:98px/110px var(--heading);font-weight:400;color:#eed39a;letter-spacing:-5px;white-space:nowrap;text-shadow:0 4px #8b683e,0 7px #3a4529,0 12px 20px #0009}.title-rule{position:absolute;left:0;top:165px;width:270px;height:1px;background:linear-gradient(90deg,#c4aa70aa,transparent)}.title-buttons{position:absolute;left:0;top:190px;width:280px;height:160px;display:grid;grid-template-rows:48px 48px 48px;gap:6px}.title-buttons button{position:relative;width:280px;height:48px;font:27px/48px var(--heading);font-weight:400;padding:0 22px 0 27px;text-align:left;border:1px solid transparent;border-left:0;color:#c2cdb0;text-shadow:0 2px 5px #0008;background:none}.title-buttons button:hover,.title-buttons button.title-primary{border-image:linear-gradient(90deg,#b5a16b66,transparent) 1;background:linear-gradient(90deg,#b5a36133,transparent);color:#efd39a}.title-record{position:absolute;left:3px;top:378px;width:330px;height:36px;font-size:10px;line-height:18px;letter-spacing:.3px;color:#9ab491}.title-footer{position:absolute;left:156px;top:672px;width:1000px;height:19px;display:flex;align-items:center;justify-content:space-between;font-size:9px;letter-spacing:1px;color:#9caf92}.title-footer span:first-child{color:#c3c5a3}
.viewport-helper{position:absolute;z-index:80;right:16px;bottom:12px;height:40px;display:none;align-items:center;gap:13px;padding:0 12px;background:#13271fe8;border:1px solid #a7986966;color:#c4d0b0;font:12px 'Malgun Gothic',sans-serif}.viewport-helper button{height:30px;padding:0 12px;border:1px solid #ac9c6b99;background:#4e5231aa;font-size:12px}.orientation-advice{display:none}.game-viewport[data-orientation=portrait] .viewport-helper{display:flex}.game-viewport[data-orientation=portrait] .viewport-helper{right:auto;left:50%;transform:translateX(-50%);top:calc(50% + var(--frame-height)/2 + 24px);bottom:auto;white-space:nowrap}.game-viewport[data-orientation=portrait] .orientation-advice{display:inline}.game-viewport[data-fullscreen=true][data-orientation=landscape] .viewport-helper{display:none}
@media(prefers-reduced-motion:reduce){.title-character,.title-light{animation:none}*{scroll-behavior:auto!important}}

/* The traveling shop shares the fixed game coordinates and never reflows the HUD. */
.scene.caravan-scene{background-image:linear-gradient(#14251b33,#0e1c1244),url('assets/journey.webp')}
.is-front .orders-panel,.is-front .journey-panel,.is-front .work-controls,.is-front .station-tabs,.is-front .scene-top,.is-front .work-hint{display:none!important}
.storefront-overlay{position:absolute;inset:0;width:1280px;height:720px;pointer-events:none}
.caravan-queue{position:absolute;left:35px;top:173px;width:190px;height:95px;color:#c6c9a4}
.caravan-queue>span{display:block;height:23px;font:12px/23px var(--heading);letter-spacing:1px;text-shadow:0 2px 4px #07130b}
.caravan-queue>div{display:flex;gap:9px;height:61px}.customer-token{position:relative;width:52px;height:60px;border-bottom:2px solid #8d98634d;background:linear-gradient(transparent,#1b3321a8);opacity:.62}.customer-token.current{border-color:#ead19b;opacity:1}.customer-token.served{border-color:#b1c18d;opacity:.85}.customer-token>img{width:52px;height:55px;object-fit:contain;filter:drop-shadow(0 3px 3px #0007)}.customer-token>i{position:absolute;right:0;bottom:-3px;width:16px;height:16px;border:1px solid #a29c63aa;background:#253c26;font:10px/14px var(--body);text-align:center;font-style:normal;color:#e7cd8f}.customer-token.served>i{background:#40572b;color:#d5e2ba}
.caravan-status{position:absolute;left:35px;top:280px;width:270px;height:30px;font:17px/30px var(--heading);color:#d3c393;text-shadow:0 2px 5px #07150b}
.caravan-skip{position:absolute;left:1030px;top:649px;width:213px;height:30px;display:flex;align-items:center;justify-content:flex-end;gap:8px;font-size:11px;color:#c5c8a8;pointer-events:auto;text-shadow:0 2px 4px #06120a}.caravan-skip svg{width:16px;height:16px}
.customer-bubble{position:absolute;left:875px;top:202px;width:365px;height:252px;padding:15px 17px;border:2px solid #d4b27a;border-radius:13px;background:linear-gradient(135deg,#f2e8c7,#e4d3a7);box-shadow:inset 0 0 0 3px #fff4,0 9px 25px #07140d88;color:#4a492e;pointer-events:auto;animation:customer-speech .18s ease-out}
.customer-bubble:after{content:'';position:absolute;right:125px;bottom:-13px;width:22px;height:22px;transform:skew(-20deg) rotate(45deg);border-right:2px solid #d4b27a;border-bottom:2px solid #d4b27a;background:#e6d6ad;box-shadow:4px 4px 5px #07140b22}
.customer-bubble-heading{position:relative;height:27px;display:flex;align-items:center;justify-content:space-between}.customer-bubble-heading>span{order:2;font-size:9px;letter-spacing:1px;color:#847448}.customer-bubble-heading h2{height:27px;font:26px/27px var(--heading);font-weight:400;color:#4a492d}
.customer-line{height:40px;margin-top:7px;font:12px/20px var(--body);color:#6b6242;overflow:hidden}
.customer-request{height:48px;margin-top:3px;display:flex;align-items:center;gap:10px}.customer-request>.item-icon{height:45px;width:45px;filter:drop-shadow(0 3px 3px #60462344)}.customer-request>span{min-width:0;flex:1}.customer-request small{display:block;height:14px;font:9px/14px var(--body);color:#88794d;white-space:nowrap}.customer-request strong{display:block;height:29px;font:23px/29px var(--heading);font-weight:400;color:#4e482a;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.customer-actions{position:relative;z-index:1;height:76px;margin-top:9px;display:flex;flex-direction:column;gap:7px;align-items:stretch}.customer-actions>.primary-button{height:36px;min-height:36px;width:100%;min-width:0;font-size:19px;box-shadow:inset 0 1px #fff6,inset 0 -2px #80602f55,0 2px #92703c,0 3px 6px #84632e33}.customer-actions>.secondary-button{height:28px;min-height:28px;width:100%;font-size:10px;border-color:#b59d64aa;background:#a7945740;color:#6a603d;box-shadow:inset 0 1px #fff4}.customer-actions>small{height:28px;font:9px/28px var(--body);text-align:center;color:#9b8859}
.delivery-score{height:42px;display:flex;align-items:center;justify-content:space-between;font-size:10px;border-top:1px solid #c7b37b99;margin-top:15px}.delivery-score b{font:22px var(--heading);font-weight:400;margin-left:5px;color:#65532e}
.customer-arrival{position:absolute;left:892px;top:226px;width:340px;height:36px;font:17px/36px var(--heading);text-align:center;color:#ddcf9f;text-shadow:0 2px 6px #04130b}
.caravan-ready{position:absolute;left:875px;top:208px;width:365px;height:250px;padding:20px 23px;border:1px solid #b7a26f99;background:linear-gradient(135deg,#354a2cec,#152f21ed);box-shadow:inset 0 1px #d3cb8d33,0 8px 25px #06130b66;pointer-events:auto}.caravan-ready>.eyebrow{display:block;height:18px;font-size:10px;color:#c3b37f;letter-spacing:1px}.caravan-ready h2{height:37px;font:30px/37px var(--heading);font-weight:400;color:#e8d39e}.caravan-ready p{height:60px;font-size:11px;line-height:24px;color:#b4c29c;margin-top:5px}.caravan-ready p strong{font:24px var(--heading);font-weight:400;color:#e6cf98;margin-left:7px}.caravan-ready>.primary-button{width:100%;height:42px;min-height:42px;margin-top:10px}.caravan-ready>div{height:30px;display:flex;align-items:center;justify-content:space-between;margin-top:7px}.caravan-ready .subtle-button{height:25px;font-size:10px;color:#b8c49d}
.order-return{height:24px;font-size:10px;color:#c6c69f;padding:0 7px;border:1px solid #a8a17044;white-space:nowrap}
@keyframes customer-speech{from{opacity:0;transform:translateY(4px)}to{opacity:1;transform:translateY(0)}}
@media(prefers-reduced-motion:reduce){.customer-bubble{animation:none}}
