@font-face{font-family:PixelFallback;src:local("Courier New");font-display:swap}
/* Disable double-tap zoom, with native panning confined to menu scrollers. */
html,body{touch-action:manipulation;-webkit-tap-highlight-color:transparent}
button,a,summary{touch-action:manipulation}
/* Lock both scroll roots, including the initial load before mobile JS runs. */
@media(any-pointer:coarse),(max-width:600px){
 html{width:100%;height:100%;overflow:hidden;overscroll-behavior:none;scrollbar-width:none}
 body{position:fixed;inset:0;width:100%;height:100%;min-height:0;overflow:hidden;overscroll-behavior:none}
 html::-webkit-scrollbar,body::-webkit-scrollbar{display:none}
}
/* A finger leaving the stick must not select the surrounding mobile game. */
body.mobile-game{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
body.mobile-game input,body.mobile-game textarea,body.mobile-game [contenteditable="true"]{-webkit-user-select:text;user-select:text;-webkit-touch-callout:default}
:root{color-scheme:dark;--ink:#15111e;--paper:#ffefd1;--muted:#bfb2c5;--accent:#ffcc79;--edge:#655064;--panel:#211a2d;font-family:Arial,Helvetica,sans-serif;font-size:16px}
*{box-sizing:border-box}body{margin:0;background:radial-gradient(ellipse at 50% 12%,#33243e 0,transparent 64%),#15111e;color:var(--paper);min-height:100svh}button{font:inherit;color:inherit;cursor:pointer}button:focus-visible,canvas:focus-visible{outline:3px solid #ffe6a4;outline-offset:4px}button:disabled{opacity:.5;cursor:default}[hidden]{display:none!important}main{max-width:1392px;margin:auto;padding:26px 40px 20px}.masthead{display:flex;align-items:center;justify-content:space-between;gap:20px;margin:0 0 20px}.artist,.eyebrow,.episode,.location,.game-footer,.speaker-row,.reward,.caption,.touch-action span{font-family:PixelFallback,monospace}.artist{font-size:.8rem;letter-spacing:.23em;color:var(--accent)}h1{font-size:clamp(1.6rem,3vw,2.4rem);line-height:1;margin:10px 0 0;letter-spacing:-.02em;font-weight:900}.title-star{display:inline-block;color:var(--accent);margin-left:18px;font-size:1.65rem;vertical-align:middle}.header-actions{display:flex;align-items:center;gap:24px}.episode{font-size:.75rem;letter-spacing:.1em;color:var(--muted)}#pause{background:#271e33;border:1px solid #5f4e68;padding:10px 14px;font-size:.875rem;border-radius:4px}#pause:hover{background:#44334f}.game-shell{border:1px solid #765967;box-shadow:0 18px 80px #09060d99,0 0 0 5px #1e1726;overflow:hidden;border-radius:5px}.stage{position:relative;aspect-ratio:3/2;max-height:calc(100svh - 210px);min-height:360px;overflow:hidden;background:#423550}canvas{display:block;width:100%;height:100%;image-rendering:pixelated;outline:none!important;touch-action:none}.quest{position:absolute;top:20px;left:20px;width:280px;padding:15px 18px;background:#1c172ceb;border:1px solid #77616c;box-shadow:4px 4px 0 #21172966;pointer-events:none}.eyebrow{display:block;color:var(--accent);font-size:.75rem;letter-spacing:.11em}h2{font-size:1.1rem;margin:8px 0 7px}.quest p{font-size:.875rem;line-height:1.5;margin:0;color:#e0d1dc}.inventory{margin-top:12px;border-top:1px solid #59445c;padding-top:10px;font-size:.875rem;color:var(--accent)}.location{position:absolute;top:25px;right:22px;font-size:.75rem;letter-spacing:.06em;color:#ffe9cf;text-shadow:1px 2px 1px #292036;pointer-events:none}.location span{color:#ffc472;margin-right:7px}.game-footer{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:12px;background:#211a29;padding:16px 20px;font-size:.75rem;color:#cdbbcf;border-top:1px solid #695063;min-height:56px}.footer-star{color:#ffc472;font-size:1rem;margin-right:7px}kbd{font-size:.75rem;font-family:inherit;display:inline-block;border:1px solid #7a687f;border-bottom-width:2px;border-radius:3px;padding:3px 5px;color:#ffefd5;background:#382c44}i{display:inline-block;width:10px}.caption{display:flex;justify-content:space-between;gap:15px;font-size:.75rem;color:#a58fa8;margin:18px 0 0}.caption span{color:#897a94}.interact{position:absolute;left:50%;bottom:26px;transform:translateX(-50%);white-space:nowrap;background:#191523ed;border:1px solid #ebc47e;border-bottom-width:3px;padding:10px 18px;box-shadow:3px 4px 0 #160f2266;font-size:.875rem;display:flex;align-items:center;gap:12px}.interact kbd{color:#1a1422;background:var(--accent);border-color:var(--accent);font-weight:bold}.dialogue{position:absolute;bottom:20px;left:20px;right:20px;max-width:720px;margin:auto;background:#20192cf5;border:2px solid #e5c68b;box-shadow:5px 5px 0 #21162a9c;padding:18px 22px}.speaker-row{display:flex;justify-content:space-between;gap:15px;color:var(--accent);font-size:.8rem;letter-spacing:.06em;text-transform:uppercase}#dialogue-progress{color:#a99bb5;font-size:.75rem}.dialogue p{font-size:1rem;line-height:1.6;margin:12px 0 14px;max-width:64ch}.dialogue button{display:block;margin-left:auto;border:0;background:transparent;color:var(--accent);font-size:.875rem;padding:8px 0 0 16px}.dialogue button span{margin-left:8px}.overlay{position:absolute;inset:0;display:grid;place-items:center;background:#0e0d20b8;backdrop-filter:blur(3px);padding:24px}.overlay-card{text-align:center;max-width:450px;background:#241b31;border:1px solid #ba977a;padding:35px 38px;box-shadow:7px 7px 0 #100b1766}.overlay-card h2{font-size:clamp(1.5rem,3vw,2rem);letter-spacing:-.03em;margin:14px 0}.overlay-card p{font-size:1rem;line-height:1.6;color:#d0c1d6;margin-bottom:25px}.primary{background:var(--accent);color:#25182e;border:1px solid #ffe6b8;border-bottom:4px solid #b97651;padding:13px 20px;font-weight:700;width:100%;border-radius:2px}.primary:hover{background:#ffe1aa}.text-button{background:none;border:0;padding:16px 10px 0;color:#c9b5cc;font-size:.875rem}.complete-star{display:block;font-size:2.8rem;color:var(--accent);margin-bottom:16px}.reward{border-block:1px solid #55415f;padding:15px 0;margin:0 0 24px;color:#bfa9ca;font-size:.75rem;line-height:1.6}.reward strong{display:block;font-size:.95rem;color:#ffdda6}.toast{position:absolute;top:170px;left:50%;transform:translateX(-50%);padding:12px 18px;background:#20172bea;border:1px solid #d3ac79;color:#ffe2a2;font-size:.875rem;max-width:90%;text-align:center;pointer-events:none}.touch-controls,.mobile-help{display:none}
@media(min-width:1000px) and (max-height:800px){main{padding-top:18px}.masthead{margin-bottom:16px}.stage{max-height:calc(100svh - 186px)}.caption{margin-top:14px}}
@media(max-width:900px){main{padding:20px}.episode{display:none}.game-footer>span:first-child{display:none}.game-footer{justify-content:center}.caption{font-size:.7rem}.quest{width:240px;top:16px;left:16px}.location{font-size:.65rem;right:14px;top:20px}.stage{max-height:none;min-height:400px}}
@media(max-width:600px){main{padding:16px 12px 20px}.masthead{margin-bottom:18px;gap:12px}.artist{font-size:.7rem}h1{font-size:1.65rem}.title-star{margin-left:12px;font-size:1.3rem}#pause{padding:10px}#pause span{display:none}.stage{aspect-ratio:4/5;min-height:360px;max-height:65svh}.quest{top:12px;left:12px;width:220px;padding:12px 14px}.quest h2{font-size:1rem}.quest p{font-size:.875rem}.eyebrow{font-size:.7rem}.location{display:none}.desktop-help{display:none}.mobile-help{display:block;font-size:.75rem}.game-footer{padding:12px 6px;min-height:42px}.caption{display:none}.touch-controls{display:flex;justify-content:space-between;align-items:center;padding:18px 0 0;gap:12px;max-width:440px;margin:auto;touch-action:none;user-select:none}.touch-actions{display:flex;gap:8px}.touch-action{height:72px;width:72px;border-radius:50%;border:2px solid #cd9d77;border-bottom-width:5px;background:#57364d;color:var(--accent);font-size:1.5rem;touch-action:none}.touch-action span{display:block;font-size:.6rem;margin-top:5px}.dialogue{bottom:12px;left:10px;right:10px;padding:14px}.dialogue p{line-height:1.45;margin:10px 0;font-size:.95rem}.overlay{padding:15px}.overlay-card{padding:24px 20px}.overlay-card p{font-size:.9rem}.interact{bottom:16px}.toast{top:150px}}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important}.overlay{backdrop-filter:none}}

@media(max-width:380px){.touch-action{height:64px;width:64px}.touch-action span{font-size:.55rem}}

/* The title is a full scene; the approved cast stands on the foreground ledge. */
.on-title main{max-width:1536px;padding-top:24px}.on-title .masthead,.on-title .game-footer,.on-title .touch-controls{display:none}.on-title .stage{aspect-ratio:3/2;max-height:calc(100svh - 50px);min-height:620px}.on-title #game,.on-title .quest,.on-title .vitals,.on-title .location,.on-title #toast,.on-title #interact,.on-title #dialogue,.on-title #death-banner{visibility:hidden}
.title-screen{position:absolute;inset:0;overflow:hidden;background:#17172e url('../../art/3b45a4f41f27e899d7a0edbc7ab08d178efcf90b0803ffcf1f35240291f13648-title-desert-v2.webp') center/cover no-repeat}.title-vignette{position:absolute;inset:0;background:linear-gradient(90deg,#0e1124c9 0%,#0e11243b 51%,transparent 76%),linear-gradient(0deg,#100d21bb,transparent 25%)}.title-cast-wrap{position:absolute;width:46%;height:auto;right:1%;bottom:12%;pointer-events:none}.title-copy{position:relative;padding:5.5% 6%;width:62%;max-width:780px}.title-kicker,.title-foot,.chapter-label,.menu-note,.controls-menu{font-family:PixelFallback,monospace}.title-kicker{font-size:clamp(.6rem,.9vw,.8rem);color:#e5bdbb;letter-spacing:.17em}.game-logo{position:relative;display:inline-block;font-size:clamp(4.8rem,8.6vw,8.5rem);font-weight:950;line-height:.82;letter-spacing:-.06em;margin:30px 0 23px;color:#ffefd2;text-shadow:3px 3px 0 #bc785f,7px 7px 0 #452741,10px 10px 0 #11142699}.game-logo span{color:#ffd18f}.game-logo b{position:absolute;right:-.7em;bottom:.05em;font-size:.42em;font-weight:normal;color:#fca877;text-shadow:3px 3px #503052}.title-rule{width:55px;height:3px;background:#e6a477;box-shadow:62px 0 #ae799577}.title-tagline{color:#dfcbdc;font-size:clamp(.9rem,1.3vw,1.15rem);margin:18px 0 28px}.main-menu{max-width:340px}.chapter-label{display:flex;gap:12px;align-items:center;font-size:.83rem;letter-spacing:.06em;margin-bottom:15px;color:#ffe0ac}.chapter-label>span{border:1px solid #b88789;padding:8px;color:#dbae9b}.chapter-label small{display:block;font-size:.57rem;letter-spacing:.03em;color:#bfa6bf;margin-top:6px;line-height:1.5}.menu-start{display:flex;justify-content:space-between;align-items:center;gap:20px;width:100%;background:#ffd494;color:#2b2034;border:1px solid #ffe8c5;border-bottom:4px solid #b87758;padding:15px 18px;font-weight:800;text-align:left;box-shadow:4px 5px 0 #100d2270}.menu-start:hover{background:#ffe5b6;transform:translateY(-1px)}.menu-secondary{display:flex;justify-content:space-between;gap:16px;text-align:left;width:100%;padding:13px 18px;background:#1615298c;border:1px solid #a1819166;margin-top:9px;font-size:.875rem}.menu-secondary:hover{background:#4b314de0;border-color:#cd9da3}.menu-note{font-size:.62rem;color:#b8a0b8;line-height:1.5;margin-top:14px}.title-foot{position:absolute;bottom:22px;left:6%;right:4%;display:flex;justify-content:space-between;gap:20px;color:#d2acc0;font-size:.63rem;letter-spacing:.14em}.controls-menu{max-width:360px}.controls-menu h3{font-size:.75rem;letter-spacing:.13em;color:#ffdaad;margin:0 0 15px}.controls-menu dl{margin:0}.controls-menu dl>div{display:flex;align-items:center;justify-content:space-between;gap:12px;border-bottom:1px solid #b18a9945;padding:7px 0}.controls-menu dd{font-size:.78rem;margin:0;color:#ead4db}.controls-menu p{font-size:.7rem;color:#c3a8c1;line-height:1.5}.controls-menu kbd{font-size:.65rem}.vitals{position:absolute;top:20px;right:20px;width:185px;background:#1c172ceb;padding:12px 14px;border:1px solid #77616c;pointer-events:none}.health-label{display:flex;justify-content:space-between;gap:8px;font-family:PixelFallback,monospace;font-size:.65rem;color:#ffdbb8}.health-label>span:first-child{color:#ffb4af}.health-track{height:12px;background:#48334a;border:1px solid #8e636e;margin:8px 0 7px;padding:2px}.health-track>div{height:100%;width:100%;background:#f9a481;transition:width .16s linear}.vitals.low .health-track>div{background:#f27a88}#health-status{font-family:PixelFallback,monospace;font-size:.54rem;letter-spacing:.06em;color:#c7aec4}.location{top:118px}#combat-hint{margin-top:10px;padding-top:9px;border-top:1px solid #655063;color:#ffcf96;font-size:.75rem}#combat-hint kbd{font-size:.65rem}.death-banner{position:absolute;left:50%;bottom:15%;transform:translateX(-50%);background:#21182eeb;border:1px solid #d9a3a2;text-align:center;min-width:250px;padding:15px 24px;pointer-events:none}.death-banner strong,.death-banner span{display:block}.death-banner span{font-size:.8rem;margin-top:7px;color:#c8b0c8}.overlay{z-index:5}#title-screen{z-index:6}#loading{z-index:7}
@media(max-width:1000px){.on-title .stage{min-height:650px}.title-copy{width:68%;padding-top:8%}.game-logo{font-size:clamp(4.8rem,10vw,7.5rem)}.title-tagline{max-width:270px}.title-cast-wrap{right:-4%;width:52%;bottom:13%}.title-foot>span:last-child{display:none}}
@media(max-width:600px){.on-title main{padding:10px}.on-title .stage{min-height:730px;max-height:none;aspect-ratio:auto}.title-screen{background-position:65% center}.title-vignette{background:linear-gradient(90deg,#101128b8,#10112832),linear-gradient(0deg,#100d21c9,transparent 35%)}.title-copy{padding:30px 24px;width:100%}.title-kicker{font-size:.57rem;letter-spacing:.09em}.game-logo{font-size:clamp(4.35rem,16vw,6rem);margin:28px 0 22px}.title-tagline{font-size:.86rem;margin:14px 0 24px;max-width:none}.main-menu{max-width:300px}.chapter-label{font-size:.75rem}.chapter-label small{font-size:.52rem}.menu-start{font-size:.9rem;padding:14px}.menu-secondary{font-size:.8rem;padding:11px 14px}.menu-note{font-size:.56rem;max-width:220px}.title-foot{bottom:17px;left:24px;font-size:.55rem}.title-cast-wrap{width:58%;right:2%;bottom:5%}.controls-menu{max-width:300px;background:#11112680;padding:12px;border:1px solid #9a71834a}.vitals{width:118px;right:10px;top:12px;padding:8px}.health-label{font-size:.53rem;gap:4px}#health-status{font-size:.45rem;letter-spacing:0}.health-track{margin:7px 0 5px;height:10px}.quest{width:calc(100% - 146px);max-width:240px;padding:10px}.quest h2{font-size:.82rem}.quest p{font-size:.76rem;line-height:1.35}.quest .eyebrow{font-size:.55rem}.inventory{font-size:.72rem}#combat-hint{font-size:.62rem;line-height:1.7}#combat-hint kbd{font-size:.6rem}.touch-actions{display:grid;grid-template-columns:64px 64px;gap:6px}.touch-action{width:64px;height:60px;border-radius:12px;font-size:1.2rem;border-bottom-width:4px}.touch-action span{font-size:.52rem;margin-top:3px}#touch-punch{grid-column:1/-1;width:100%;height:48px;display:flex;align-items:center;justify-content:center;gap:9px;background:#815145}#touch-punch span{font-size:.68rem}.toast{top:175px}.death-banner{min-width:230px}.on-title #pause-screen,.on-title #complete{display:none}}
@media(prefers-reduced-motion:reduce){.health-track>div{transition:none}.menu-start:hover{transform:none}}
@media(min-width:601px) and (max-height:850px){.title-copy{padding-top:4%}.game-logo{font-size:clamp(4.4rem,8.1vw,6.8rem);margin:22px 0 20px}.title-tagline{margin:14px 0 20px}.chapter-label{margin-bottom:12px}.menu-secondary{padding-block:10px}.title-foot{bottom:18px}}
/* Speaker portraits remain attached to every conversation and radio line. */
.dialogue{display:flex;gap:18px;align-items:flex-start;max-width:810px}.dialogue-copy{flex:1;min-width:0}#dialogue-portrait{width:96px;height:96px;flex:0 0 96px;border:1px solid #aa7c89;background:#2c2134;box-shadow:3px 3px #100e2066}.dialogue p{margin-top:10px}.dialogue.cinematic{bottom:42px;border-color:#a6dad9;max-width:810px;min-height:142px}.dialogue.cinematic .speaker-row{color:#9de5df}.on-voyage .quest,.on-voyage .vitals,.on-voyage .location,.on-voyage #toast,.on-voyage #interact,.on-voyage .touch-controls{display:none}.skip-cutscene{position:absolute;top:14px;right:15px;background:#151829dd;border:1px solid #668994;color:#d8eee9;font-size:.8rem;padding:9px 12px;z-index:2}.chapter-unlock{background:linear-gradient(90deg,#101727e8 0%,#1017279e 44%,#1017270a 82%),url('../../art/09c7c57d531b48196fa8482f10ba3517e42bdc143ecdae7eebaf27e46a8fd690-saturn-space-v2.webp') center/cover;backdrop-filter:none;display:flex;align-items:center;padding:5% 7%;overflow-y:auto;overflow-x:hidden}.chapter-card{position:relative;z-index:1;max-width:370px;width:58%;text-align:left}.unlock-symbol{display:block;font-size:2rem;color:#80ddd9;margin-bottom:16px}.chapter-card .eyebrow{color:#91e8df;letter-spacing:.16em}.chapter-card h2{font-size:clamp(3.8rem,7.5vw,7rem);line-height:.87;letter-spacing:-.045em;color:#fff1ce;text-shadow:4px 4px #406572;margin:24px 0}.arrival-line{color:#cce8e6;font-size:1rem;line-height:1.5}.chapter-soon{color:#a7bec8;font-size:.85rem;line-height:1.5;margin:20px 0 26px}.chapter-card .primary{background:#a5e5dd;border-color:#ccffed;border-bottom-color:#548c91}.chapter-card .text-button{display:block;padding:14px 0 0}.chapter-menu{border-color:#729d9b;color:#a8e4dc}.chapter-menu>span:last-child{font-family:PixelFallback,monospace;font-size:.58rem;align-self:center}#chapter-cast{position:absolute;width:53%;height:auto;right:-2%;top:30%;pointer-events:none}.on-title.on-voyage .touch-controls{display:none}
@media(max-width:600px){.dialogue{gap:10px;align-items:flex-start}#dialogue-portrait{width:62px;height:62px;flex-basis:62px}.dialogue p{font-size:.94rem;line-height:1.4}.speaker-row{font-size:.72rem;letter-spacing:0;gap:8px}#dialogue-progress{font-size:.6rem;white-space:nowrap}.dialogue.cinematic{bottom:30px;min-height:160px;padding:12px}.skip-cutscene{top:40px;right:10px;font-size:.73rem;padding:8px}.chapter-unlock{padding:24px;align-items:flex-start;background-position:40% center}.chapter-card{width:100%;max-width:100%}.unlock-symbol{display:none}.chapter-card h2{font-size:3.6rem;margin:16px 0}.arrival-line{font-size:.87rem;line-height:1.4;margin-bottom:14px}.chapter-soon{font-size:.76rem;margin:16px 0}.chapter-card .primary{max-width:230px;font-size:.84rem;padding:10px 14px}.chapter-card .text-button{font-size:.75rem;padding-top:11px}#chapter-cast{width:52%;top:9%;right:-8%;opacity:.94}.chapter-card .eyebrow{font-size:.65rem}.chapter-menu{font-size:.75rem}.chapter-menu>span:last-child{font-size:.54rem}.on-voyage .stage{max-height:78svh}}
@media(min-width:601px) and (max-height:850px){.on-title .title-copy{padding-top:3%}.on-title .game-logo{font-size:clamp(4.2rem,7.4vw,6.3rem);margin:20px 0 18px}.on-title .title-tagline{margin:12px 0 16px}.on-title .menu-secondary{padding-block:8px}.chapter-card h2{font-size:5.2rem;margin:16px 0}.chapter-soon{margin:14px 0 18px}}
@media(max-width:600px){.on-voyage:not(.on-title) .stage{height:78svh;min-height:480px;max-height:none;aspect-ratio:auto}.chapter-unlock{flex-direction:column;gap:10px}.chapter-unlock #chapter-cast{position:relative;top:auto;right:auto;order:2;width:85%;max-width:300px;align-self:center;flex-shrink:0;opacity:1}.chapter-card{flex-shrink:0}}
.boss-health{position:absolute;top:20px;left:50%;transform:translateX(-50%);width:330px;max-width:42%;background:#281a31ef;border:1px solid #bc8d9a;padding:10px 13px;font-family:PixelFallback,monospace;font-size:.65rem;letter-spacing:.04em;color:#f5d0b5;pointer-events:none}.boss-track{height:12px;padding:2px;background:#463247;margin:7px 0;border:1px solid #825566}#boss-fill{height:100%;width:100%;background:linear-gradient(90deg,#b179b8,#fda885)}#boss-caption{font-size:.58rem;color:#c9e8e3;margin:0;line-height:1.4}#saturn-map{position:absolute;right:20px;top:125px;width:150px;height:100px;border:1px solid #6c8e8d;pointer-events:none}.dialogue.radio{bottom:16px;max-width:680px;padding:12px 16px;gap:12px;border-color:#7fa9b1;pointer-events:none;background:#172231ef}.dialogue.radio #dialogue-portrait{width:58px;height:58px;flex-basis:58px}.dialogue.radio p{font-size:.9rem;line-height:1.4;margin:8px 0 0}.on-saturn .location{display:none}#touch-roll{grid-column:1/-1;width:100%;height:42px;border-radius:10px;display:flex;justify-content:center;align-items:center;gap:8px;background:#31555c;border-color:#8cd6ce}#touch-roll span{font-size:.68rem}#begin-saturn{margin-bottom:10px}.on-saturn .chapter-unlock{background-image:linear-gradient(90deg,#101727e8 0%,#1017279e 44%,#1017270a 82%),url('../../art/b32c305c9389f251100b32d71f7345588e2dad2ed9a8840e8558d295c65932bb-saturn-ground-v2.webp')}.on-saturn .chapter-card h2{font-size:clamp(3.8rem,7vw,6rem)}
@media(max-width:900px){.boss-health{top:135px;max-width:none;width:calc(100% - 32px)}#saturn-map{width:120px;height:80px;right:14px}.on-saturn .quest{max-width:250px}}
@media(max-width:600px){.on-saturn:not(.on-title) .stage{height:70svh;min-height:460px;max-height:none;aspect-ratio:auto}.dialogue.radio{left:10px;right:10px;bottom:10px;padding:10px;gap:9px}.dialogue.radio #dialogue-portrait{width:42px;height:42px;flex-basis:42px}.dialogue.radio p{font-size:.78rem;line-height:1.35}#saturn-map{display:none}.boss-health{top:126px;width:calc(100% - 24px);padding:7px 10px;font-size:.58rem}#boss-caption{font-size:.53rem}.on-saturn .chapter-card h2{font-size:3.6rem}}

/* Small, optional discoveries on the title scene. */
.title-cast-wrap{z-index:2;pointer-events:none}.title-cast-wrap #title-cast{position:static;width:100%;height:auto;pointer-events:none}
.title-secret-target{position:absolute;min-width:44px;min-height:44px;background:none;border:0;padding:0;border-radius:35%;pointer-events:auto;touch-action:manipulation}
.title-secret-target:hover{box-shadow:0 0 20px #ffdaa322}.title-secret-target:focus-visible{outline:2px dashed #ffdfaa;outline-offset:3px}
.game-logo .secret-star{position:absolute;right:-.8em;bottom:0;min-width:44px;min-height:44px;padding:0;border:0;background:none;font:inherit;font-size:.42em;font-weight:normal;color:#fca877;text-shadow:3px 3px #503052;line-height:1.2}
.secret-star:hover{color:#a5e5dd;text-shadow:0 0 15px #80e5e488}
.title-joke{position:absolute;right:3%;top:6%;z-index:4;display:flex;align-items:flex-start;gap:12px;width:35%;max-width:440px;max-height:45%;overflow:auto;padding:16px 36px 16px 14px;background:#211a2df5;border:2px solid #d4af84;box-shadow:5px 5px #0d10287a}
#title-joke-portrait{width:56px;height:56px;flex:0 0 56px;border:1px solid #967991}.title-joke-copy{min-width:0}.title-joke strong{font-family:PixelFallback,monospace;font-size:.875rem;color:#ffcc79;letter-spacing:.03em}.title-joke p{font-size:1rem;line-height:1.45;margin:8px 0 0;overflow-wrap:break-word}
#title-joke-close{position:absolute;right:0;top:0;width:36px;height:40px;padding:0;background:none;border:0;font-size:1.5rem;color:#d9b9c6}
@media(max-width:1000px){.title-joke{width:39%;right:2%;gap:9px;padding-left:10px}#title-joke-portrait{width:44px;height:44px;flex-basis:44px}}
@media(max-width:600px){.title-joke{left:14px;right:14px;top:14px;width:auto;max-width:none;max-height:220px}.title-joke p{font-size:.9375rem}.title-joke strong{font-size:.875rem}#title-joke-close{width:40px;height:44px}}

/* A spring-centred thumbstick with the hero's actual silhouette. */
.touch-controls,.touch-controls *{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none;-webkit-tap-highlight-color:transparent;touch-action:none}
.stick-control{display:flex;flex-direction:column;align-items:center;gap:10px;flex:0 0 auto}
.move-stick{position:relative;width:148px;height:148px;border-radius:50%;border:2px solid #b98766;background:radial-gradient(circle,#302638 0 31%,#463048 32% 34%,#201a2d 35% 62%,#795166 63% 65%,#302337 66%);box-shadow:0 6px 0 #100e1c,inset 0 2px 3px #fbd39133,0 0 0 5px #2b2037;cursor:grab;isolation:isolate;outline-offset:7px}
.stick-ring{position:absolute;inset:21px;border:1px dashed #f3c28844;border-radius:50%;pointer-events:none}
.stick-knob{position:absolute;left:calc(50% - 32px);top:calc(50% - 38px);width:64px;height:76px;display:grid;place-items:center;background:radial-gradient(ellipse at 50% 72%,#73465a 0 31%,transparent 65%);filter:drop-shadow(2px 3px 0 #0b0d1c) drop-shadow(0 0 7px #f3b27738);pointer-events:none;transition:transform .14s ease-out}
#stick-silhouette{width:64px;height:76px;pointer-events:none}.move-stick.dragging{cursor:grabbing;border-color:#ffe0a1;box-shadow:0 6px 0 #100e1c,inset 0 0 26px #d78e5933,0 0 0 5px #5b3846}.move-stick.dragging .stick-knob{transition:none}.move-stick[aria-disabled="true"]{opacity:.45}
.stick-caption{font: .6875rem PixelFallback,monospace;letter-spacing:.14em;color:#d6ae94;pointer-events:none}
@media(max-width:600px){.touch-controls{padding:20px 10px max(20px,env(safe-area-inset-bottom));align-items:center;gap:22px}.touch-actions{flex-shrink:0}.mobile-help{font-size:.75rem}}
@media(max-width:360px){.move-stick{width:132px;height:132px}.touch-controls{padding-inline:5px;gap:14px}}
@media(pointer:coarse) and (min-width:601px){.touch-controls{display:flex;justify-content:space-between;align-items:center;max-width:600px;margin:auto;padding:20px 12px max(20px,env(safe-area-inset-bottom));gap:24px}.desktop-help{display:none}.mobile-help{display:block}.touch-actions{display:flex;flex-wrap:wrap;max-width:320px;gap:10px}.touch-action{width:70px;height:70px;border:2px solid #cd9d77;border-bottom-width:4px;border-radius:16px;background:#57364d;color:var(--accent);font-size:1.35rem}.touch-action span{display:block;font-size:.625rem;margin-top:4px}.on-title .touch-controls,.on-voyage .touch-controls{display:none}}
@media(prefers-reduced-motion:reduce){.stick-knob{transition:none}}

/* The mobile game is one visible screen, with a dedicated thumb dock. */
body.mobile-game{min-height:0;height:100%;overflow:hidden;overscroll-behavior:none}
body.mobile-game main{position:fixed;inset:0 auto auto 0;width:var(--mobile-width,100%);height:var(--mobile-height,100svh);max-width:none;margin:0;padding:max(6px,env(safe-area-inset-top)) max(8px,env(safe-area-inset-right)) max(26px,env(safe-area-inset-bottom)) max(8px,env(safe-area-inset-left));transform:var(--mobile-transform,none);transform-origin:0 0;overflow:hidden}
body.mobile-game.on-title main{overflow-y:auto;overscroll-behavior:none;-webkit-overflow-scrolling:touch;scrollbar-width:none}
body.mobile-game.on-title main::-webkit-scrollbar{display:none}
body.mobile-game:not(.on-title) main{display:grid;grid-template-rows:30px minmax(0,1fr) auto;gap:6px;touch-action:pan-y}
body.mobile-game:not(.on-title) .masthead{margin:0;gap:8px;min-width:0;align-items:center}
body.mobile-game:not(.on-title) .artist,body.mobile-game:not(.on-title) .episode,body.mobile-game:not(.on-title) .title-star{display:none}
body.mobile-game:not(.on-title) h1{font-size:1rem;letter-spacing:.05em;margin:0}
body.mobile-game:not(.on-title) #pause{padding:5px 10px;min-height:30px;font-size:.8rem}
body.mobile-game:not(.on-title) #pause span{display:inline}
body.mobile-game:not(.on-title) .game-shell{min-width:0;min-height:0;display:flex;flex-direction:column;border-radius:8px;box-shadow:0 0 0 2px #1e1726}
body.mobile-game:not(.on-title) .stage{width:100%;height:100%;flex:1;min-height:0;max-height:none;aspect-ratio:auto}
body.mobile-game:not(.on-title) .game-footer,body.mobile-game:not(.on-title) .caption{display:none}
body.mobile-game:not(.on-title) .touch-controls{display:flex;width:100%;max-width:500px;min-height:128px;justify-content:space-between;align-items:center;gap:20px;padding:8px 10px 4px;margin:0 auto}
body.mobile-game .stick-caption{display:none}
body.mobile-game .move-stick{width:116px;height:116px}
body.mobile-game .stick-ring{inset:16px}
body.mobile-game .touch-actions{display:grid;grid-template-columns:68px 68px;gap:6px;max-width:none;flex-shrink:0}
body.mobile-game .touch-action,body.mobile-game #touch-punch,body.mobile-game #touch-roll{width:100%;height:54px;min-height:44px;grid-column:auto;border:2px solid #cd9d77;border-bottom-width:4px;border-radius:13px;background:#57364d;color:var(--accent);font-size:1.2rem;display:flex;flex-direction:column;justify-content:center;align-items:center;gap:2px;padding:3px}
body.mobile-game .touch-action span,body.mobile-game #touch-punch span,body.mobile-game #touch-roll span{font-size:.625rem;margin:0}
body.mobile-game #touch-punch{background:#815145}
body.mobile-game #touch-roll{background:#31555c;border-color:#8cd6ce}
body.mobile-game:not(.on-flight) .touch-actions:not(:has(#touch-roll:not([hidden]))) #touch-punch{grid-column:1/-1;flex-direction:row;gap:9px}
body.mobile-game.on-voyage:not(.on-title) main{grid-template-rows:30px minmax(0,1fr)}
body.mobile-game.on-voyage .touch-controls,body.mobile-game.on-title .touch-controls{display:none}
body.mobile-game:not(.on-title) .quest{left:10px;top:10px;width:calc(100% - 146px);max-width:230px;padding:9px}
body.mobile-game:not(.on-title) .quest h2{font-size:.82rem;margin:4px 0}
body.mobile-game:not(.on-title) .quest p{font-size:.75rem;line-height:1.3}
body.mobile-game:not(.on-title) .quest .eyebrow{font-size:.55rem}
body.mobile-game:not(.on-title) .vitals{right:10px;top:10px;width:118px;padding:8px}
body.mobile-game:not(.on-title) .health-label{font-size:.53rem;gap:4px}
body.mobile-game:not(.on-title) #health-status{font-size:.5rem;letter-spacing:0}
body.mobile-game:not(.on-title) .location,body.mobile-game:not(.on-title) #combat-hint{display:none}
body.mobile-game:not(.on-title) .dialogue{max-height:calc(100% - 24px);overflow-y:auto;overscroll-behavior:contain;touch-action:pan-y;z-index:3}
body.mobile-game:not(.on-title) .dialogue button{min-height:44px;padding-top:8px}
body.mobile-game:not(.on-title) .overlay{overflow-y:auto;overscroll-behavior:contain;touch-action:pan-y}
@media(max-width:360px){body.mobile-game .touch-controls{padding-inline:5px;gap:12px}body.mobile-game .touch-actions{grid-template-columns:62px 62px}body.mobile-game .move-stick{width:108px;height:108px}}
/* Landscape uses the corners for thumbs and keeps the centre open for play. */
@media(orientation:landscape) and (max-height:600px){
  body.mobile-game:not(.on-title) main{grid-template-rows:26px minmax(0,1fr)}
  body.mobile-game:not(.on-title) .touch-controls{position:absolute;left:max(18px,env(safe-area-inset-left));right:max(18px,env(safe-area-inset-right));bottom:max(32px,env(safe-area-inset-bottom));width:auto;max-width:none;padding:0;min-height:0;pointer-events:none;z-index:2}
  body.mobile-game .stick-control,body.mobile-game .touch-actions{pointer-events:auto}
  body.mobile-game .move-stick{width:104px;height:104px}
  body.mobile-game .touch-actions{grid-template-columns:60px 60px}
  body.mobile-game .touch-action,body.mobile-game #touch-punch,body.mobile-game #touch-roll{height:48px}
  body.mobile-game:not(.on-title) .dialogue{left:130px;right:145px;bottom:10px;padding:10px;gap:8px}
  body.mobile-game:not(.on-title) #dialogue-portrait{width:44px;height:44px;flex-basis:44px}
  body.mobile-game:not(.on-title) .dialogue p{font-size:.875rem;line-height:1.35;margin:6px 0}
  body.mobile-game:not(.on-title) .dialogue.cinematic{left:20px;right:20px;max-width:600px;min-height:0}
}

.next-chapter-note{color:#a5e5dd;font: .75rem PixelFallback,monospace;line-height:1.5;padding:10px 0;border-top:1px solid #729d9b}.next-chapter-reward{color:#a5e5dd;font-size:.875rem;line-height:1.5}
/* Match the menu's gold trim; keep the code field comfortable for phone keyboards. */
.level-code-form{margin-top:16px;padding-top:14px;border-top:1px solid #a1819166}
.level-code-form label{display:block;font-size:.875rem;color:#ffdaad;margin-bottom:8px}
.level-code-row{display:flex;gap:8px}
.level-code-row input{min-width:0;width:100%;min-height:44px;padding:10px 12px;font:400 16px PixelFallback,monospace;letter-spacing:.04em;color:#ffefd2;background:#161529d9;border:1px solid #a18191;border-radius:2px;touch-action:manipulation;-webkit-user-select:text;user-select:text}
.level-code-row input::placeholder{color:#baa6bf;letter-spacing:0}
.level-code-row input[aria-invalid="true"]{border-color:#ff9c9c}
.level-code-row input:focus-visible{outline:2px solid #ffe6a4;outline-offset:2px}
.level-code-row button{flex:0 0 auto;min-height:44px;padding:10px 15px;border:1px solid #ffe8c5;border-bottom:3px solid #b87758;background:#ffd494;color:#2b2034;font-size:1rem;font-weight:700}
.level-code-row button:hover{background:#ffe5b6}
#level-code-status{margin:8px 0 0;min-height:1.4em;font-size:.8125rem;line-height:1.4;color:#d5bdce}
@media(min-width:601px){.title-copy{max-height:calc(100% - 52px);overflow-y:auto;scrollbar-width:thin;scrollbar-color:#a18191 #161529}}

/* Leave the arena visible: one boss objective alongside the hero's health. */
:is(.on-city-fight,.on-saturn-fight) .quest{display:none}
:is(.on-city-fight,.on-saturn-fight) .boss-health{left:12px;top:12px;transform:none;width:calc(100% - 174px);max-width:480px}
.on-city .chapter-unlock{background-image:linear-gradient(110deg,#181529f5,#181529aa),url('../../art/733973fa9ac0de95fc3c21ea264547b3fb26fe242808151ea9466a99fa803938-city-panorama-v3.webp')}
#begin-city{margin-bottom:10px}
@media(max-width:600px){:is(.on-city-fight,.on-saturn-fight) .boss-health{left:10px;top:10px;width:calc(100% - 148px);font-size:.59rem;padding:8px}:is(.on-city-fight,.on-saturn-fight) #boss-caption{font-size:.57rem}:is(.on-city-fight,.on-saturn-fight) .boss-track{margin:5px 0}.on-city .inventory{font-size:.65rem;margin-top:6px;padding-top:6px}}

@media(min-width:601px){.on-title .title-screen{overflow-y:auto}}

/* Shared dialogue typography; the fixed frame below keeps line changes steady. */
.dialogue,.dialogue.cinematic,.dialogue.radio{height:auto;min-height:0;bottom:12px;padding:12px 15px;gap:12px;max-width:760px}
.dialogue-copy{align-self:flex-start}
.dialogue p{margin:7px 0 8px;line-height:1.4}
.dialogue.radio p{margin:5px 0 0}
.dialogue.radio #dialogue-portrait{width:48px;height:48px;flex-basis:48px}
@media(max-width:600px){.dialogue,.dialogue.cinematic,.dialogue.radio{min-height:0;left:10px;right:10px;bottom:10px;padding:10px;gap:9px}.dialogue #dialogue-portrait{width:48px;height:48px;flex-basis:48px}.dialogue p,.dialogue.radio p{font-size:.875rem;line-height:1.4}.dialogue .speaker-row{font-size:.65rem}.dialogue.radio #dialogue-portrait{width:40px;height:40px;flex-basis:40px}}

/* The optional shop is a quiet conversation scene; give its cast the room. */
.on-shop .quest,.on-shop .vitals,.on-shop .location{display:none}


/* A small, separately preloaded atlas makes the greeting visible before game art. */
#loading{position:fixed;inset:0;z-index:100;overflow-y:auto;padding:24px}
#loading .overlay-card{width:min(100%,540px)}
.loading-actor{display:none}
.loading-meter{display:flex;align-items:center;gap:12px;max-width:300px;margin:24px auto;color:#ffe1a3;font:14px PixelFallback,monospace}
.loading-track{height:7px;flex:1;overflow:hidden;border:1px solid #ad8858;background:#28222b}
#loading-fill{display:block;height:100%;width:0;background:#ffe1a3;transition:width .18s ease-out}
#loading-percent{min-width:4ch;text-align:right}
#loading.boot-loading{background:#000;align-items:center;padding:max(20px,env(safe-area-inset-top)) 16px max(24px,env(safe-area-inset-bottom));isolation:isolate}
.boot-loading .overlay-card{max-width:560px;background:none;border:0;box-shadow:none;padding:0;text-align:center}
.boot-loading .loading-actor{display:block;position:relative;width:min(100%,58svh,520px);aspect-ratio:1;margin:0 auto 6px;overflow:hidden;animation:loading-arrive .85s cubic-bezier(.17,.85,.3,1.06) both}
.loading-actor span{position:absolute;inset:0;background-image:url('../../art/8791b5fc125bd473013a695f3b6ac0635088af1636f534f03c37d0ca2e3d359c-loading-hero-eyes-v2.webp');background-size:200% 200%;background-repeat:no-repeat;mix-blend-mode:screen;opacity:0;animation-duration:5.2s;animation-timing-function:steps(1,end);animation-iteration-count:infinite}
.loading-actor .load-neutral{background-position:0 0;animation-name:loading-neutral}
.loading-actor .load-blink{background-position:100% 0;transform:translateX(2.07%);animation-name:loading-blink}
.loading-actor .load-thumb{background-position:0 100%;transform:translateY(2.39%);animation-name:loading-thumb}
.loading-actor .load-thumb-blink{background-position:100% 100%;transform:translate(2.07%,2.39%);animation-name:loading-thumb-blink}
.boot-loading .eyebrow{font-size:clamp(1.1rem,3vw,1.5rem);letter-spacing:.26em;color:#ffe1a3}
.boot-loading h2{font-size:1rem;font-weight:500;margin:14px 0 6px;color:#efe7e0}
.boot-loading p{font-size:.875rem;color:#a79fae;margin:0;line-height:1.4}
.boot-loading .loading-meter{margin:20px auto 10px}
body.booting main{visibility:hidden}
.load-failed .loading-actor,.load-failed .loading-actor span{animation-play-state:paused}
@keyframes loading-arrive{0%{transform:translateX(95vw) rotate(9deg) scale(.78)}75%{transform:translateX(-2%) rotate(-2deg) scale(1.02)}100%{transform:none}}
@keyframes loading-neutral{0%,16%,21%{opacity:1}17%,20%,34%,100%{opacity:0}}
@keyframes loading-blink{0%,20%,100%{opacity:0}17%{opacity:1}}
@keyframes loading-thumb{0%,79%,100%{opacity:0}34%,82%{opacity:1}}
@keyframes loading-thumb-blink{0%,82%,100%{opacity:0}79%{opacity:1}}
body.mobile-game.on-flight .touch-actions{display:block;width:118px}
body.mobile-game.on-flight #touch-jump,body.mobile-game.on-flight #touch-action,body.mobile-game.on-flight #touch-roll{display:none}
body.mobile-game.on-flight #touch-punch{width:112px;height:100px;border-radius:30px;background:#2b555c;border-color:#9ee2df;font-size:2.1rem;flex-direction:column;gap:7px}
body.mobile-game.on-flight #touch-punch span{font-size:.75rem;letter-spacing:.05em}
body.mobile-game.on-flight .stick-caption{display:block;font-size:.65rem;letter-spacing:.1em}
body.mobile-game.on-flight .stick-control{gap:6px}
@media(max-height:450px){.boot-loading .loading-actor{width:min(46vw,61svh)}.boot-loading .eyebrow{font-size:1rem}.boot-loading h2{margin:6px 0}.boot-loading p{display:none}.boot-loading .loading-meter{margin:12px auto 0}body.mobile-game.on-flight #touch-punch{width:84px;height:78px}body.mobile-game.on-flight .touch-actions{width:84px}}
@media(prefers-reduced-motion:reduce){.boot-loading .loading-actor,.loading-actor span{animation:none}.loading-actor .load-thumb{opacity:1}#loading-fill{transition:none}}

.homie-reward{border-color:#f4d27f;color:#fff0b4;padding:14px 0}.homie-reward strong{display:block;font-size:1.05rem;margin-bottom:7px}.homie-reward span{display:block;color:#c4e8e4;font-family:Arial,sans-serif;font-size:.88rem;line-height:1.4;letter-spacing:0}

.sr-only{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}

/* Wallet, food pockets and the two neighborhood counters. */
.wallet{display:flex;align-items:center;gap:6px;margin-top:7px;font-weight:700;color:#ffdf8d}.wallet canvas{width:23px;height:23px;image-rendering:pixelated}.inventory-card,.shop-card{width:min(630px,100%);max-height:calc(100% - 12px);overflow:auto;overscroll-behavior:contain;text-align:left}.inventory-card h2,.shop-card h2{margin:9px 0 16px}.bag-summary,.bag-heading{display:flex;align-items:center;justify-content:space-between;gap:12px}.bag-summary{border-block:1px solid #806372;padding:10px 0;font-size:.875rem}.bag-summary>span:first-child{display:flex;align-items:center;gap:7px}.bag-summary canvas{width:28px;height:28px;image-rendering:pixelated}.bag-heading{margin:16px 0 10px}.bag-heading h3{margin:0}.bag-heading>span{font-size:.8rem;color:#bdb4c9}.pockets{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}.pocket{border:1px solid #715b78;border-radius:10px;background:#171727;padding:12px 8px;text-align:center;display:flex;flex-direction:column;align-items:stretch}.pocket.selected{border-color:#9de0ce;box-shadow:inset 0 0 0 1px #9de0ce}.pocket canvas{width:70px;height:70px;align-self:center;image-rendering:pixelated}.pocket h3{font-size:.88rem;line-height:1.3;min-height:2.6em;margin:7px 0}.pocket p{font-size:.75rem!important;min-height:2.6em;margin:0 0 10px}.pocket button{width:100%;padding:9px 4px;font-size:.8rem}.pocket .text-button{font-size:.72rem;margin-top:5px}.bag-hint{font-size:.8rem!important;color:#c2c3cd;line-height:1.45}.bag-message{color:#ffda92;font-size:.8rem!important;min-height:1em}.quest-pocket{margin:12px 0;padding:10px 0;border-top:1px solid #715b7855}.quest-pocket summary{cursor:pointer;font-size:.85rem}.quest-pocket p,#bag-homie{font-size:.8rem!important}.inventory-card>#resume{width:100%;margin-top:10px}.shop-overlay{z-index:40;background:#100f1ca6}.shop-item{display:grid;grid-template-columns:80px 1fr;gap:14px;border-bottom:1px solid #715b7855;padding:15px 0}.shop-item canvas{width:80px;height:80px;image-rendering:pixelated}.shop-item h3{font-size:1rem;margin:0 0 4px}.shop-item p{font-size:.85rem;margin:4px 0}.shop-copy{color:#bfb5c8}.shop-item button{width:auto;min-width:150px;padding:9px 13px;font-size:.85rem;margin-top:6px}.shop-reason{color:#ffc29c;font-size:.75rem!important;min-height:1em}.heal-action{display:flex!important;align-items:center;justify-content:center;gap:7px;grid-column:1/-1;width:100%!important;height:50px!important;border-radius:12px!important;background:#234541!important;border-color:#83cdbf!important}.heal-action[hidden]{display:none!important}.heal-action canvas{width:32px;height:32px;image-rendering:pixelated}.heal-action span{margin:0!important;display:flex!important;flex-direction:column;gap:2px}.heal-action b{font-size:.75rem}.heal-action small{font-size:.64rem;max-width:130px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}button:disabled{cursor:default;opacity:.48}
@media(max-width:600px){.inventory-card,.shop-card{padding:16px 12px!important}.inventory-card h2,.shop-card h2{font-size:1.7rem;margin:5px 0 12px}.pockets{gap:6px}.pocket{padding:8px 5px}.pocket canvas{width:52px;height:52px}.pocket h3{font-size:.78rem}.pocket p{font-size:.69rem!important}.pocket button{font-size:.75rem}.pocket .text-button{font-size:.65rem}.bag-summary{font-size:.73rem;gap:6px}.shop-item{grid-template-columns:60px 1fr;gap:10px;padding:11px 0}.shop-item canvas{width:60px;height:60px}.shop-item h3{font-size:.9rem}.shop-item p{font-size:.76rem}.wallet{font-size:.75rem;margin-top:5px}.wallet canvas{width:18px;height:18px}}

.pocket button,.shop-item button,.shop-card>#shop-close,.quest-pocket summary{min-height:44px}.quest-pocket summary{align-content:center}.pocket .text-button{font-size:.8rem}.bag-hint,.bag-message,.quest-pocket p,#bag-homie{font-size:.875rem!important}
@media(max-width:600px){.pocket h3{font-size:.85rem}.pocket p{font-size:.8rem!important}.pocket button,.pocket .text-button{font-size:.8rem}.bag-summary{font-size:.8rem}.shop-item p{font-size:.875rem}.shop-reason{font-size:.8rem!important}}

/* Tap either HUD panel to reveal its details without leaving the scene. */
.quest,.vitals{pointer-events:auto;min-height:44px}
.hud-toggle{position:absolute;inset:0;z-index:1;width:100%;height:100%;min-height:44px;margin:0;padding:0;border:0;border-radius:0;background:transparent;color:#ffd99d;box-shadow:none;cursor:pointer;touch-action:manipulation}
.hud-toggle:hover{background:#ffe1a309}.hud-toggle:focus-visible{outline:2px solid #ffe1a3;outline-offset:2px}
.quest-toggle::after{content:'⌃';position:absolute;right:8px;top:7px;font:16px Arial,sans-serif}
.hud-collapsed .quest-toggle::after{content:'⌄';top:50%;transform:translateY(-60%)}
.quest h2{padding-right:14px}
.quest.hud-collapsed{align-content:center}
.quest.hud-collapsed h2,body.mobile-game:not(.on-title) .quest.hud-collapsed h2{margin:0}
.vitals.hud-collapsed{align-content:center}
.vitals.hud-collapsed .health-track{margin:0 18px 0 0}
#health-toggle::after{content:'⌃';position:absolute;right:8px;bottom:5px;font:16px Arial,sans-serif}
.hud-collapsed #health-toggle::after{content:'⌄';top:50%;bottom:auto;transform:translateY(-60%)}

/* Food occupies the gap beside the movement stick, keeping actions two rows tall. */
body.mobile-game:not(.on-title) .touch-controls{gap:8px;padding-inline:8px}
body.mobile-game .heal-action{flex:0 0 52px;width:52px!important;height:66px!important;min-width:44px;align-self:center;pointer-events:auto;gap:2px;padding:4px}
body.mobile-game .heal-action canvas{flex:0 0 32px;width:32px;height:32px}
body.mobile-game .heal-action span{font-size:.625rem;line-height:1.1}
@media(max-width:360px){body.mobile-game:not(.on-title) .touch-controls{padding-inline:0;gap:4px}body.mobile-game .heal-action{flex-basis:46px;width:46px!important}body.mobile-game .move-stick{width:100px;height:100px}body.mobile-game .touch-actions{grid-template-columns:60px 60px}}
@media(orientation:landscape) and (max-height:600px){body.mobile-game .heal-action{margin-right:auto;margin-left:12px;align-self:flex-end}}

.save-summary{font-size:.8rem;line-height:1.45;color:#b5e0d8;margin:8px 0 14px}.save-tools{border-top:1px solid #77616c66;margin-top:14px;padding-top:12px;font-size:.875rem}.save-tools summary{cursor:pointer;min-height:32px}.save-tools p{font-size:.8rem;line-height:1.4;color:#c9b5cc}.save-tools>div,.save-file-actions{display:flex;gap:10px;flex-wrap:wrap}.save-tools button{background:#263737;border:1px solid #83cdbf;border-radius:5px;padding:10px 12px;min-height:44px;font-size:.875rem}.save-message{font-size:.8rem!important;line-height:1.45;color:#b5e0d8;margin:10px 0}.save-message:empty{display:none}.save-dialog{z-index:70;touch-action:pan-y}.save-dialog .overlay-card{max-height:100%;overflow:auto}.save-dialog button{min-height:44px}.save-file-actions{margin-bottom:12px}.save-file-actions button{padding:8px 4px;min-height:44px}

/* Adventure journal: the same ink, brass and mint as the game menus. */
.progress-overlay{z-index:48;background:#100e1beF;overflow:auto;touch-action:pan-y;overscroll-behavior:contain}
.progress-card{width:min(740px,100%);max-height:100%;overflow:auto;text-align:left;padding:24px!important}.progress-heading{display:flex;align-items:center;justify-content:space-between;gap:12px}.progress-heading h2{font-size:2rem;margin:8px 0 18px}.progress-heading button{min-width:70px;min-height:44px;align-self:flex-start}.progress-totals{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;padding:16px 0;border-block:1px solid #8a6d7955}.progress-totals div{display:flex;flex-direction:column;gap:6px}.progress-totals strong{font-size:1.5rem;color:#ffda92}.progress-totals span{font-size:.875rem;color:#d7c9dc}.progress-hint{font-size:.875rem!important;line-height:1.5;color:#c7bbd0}.progress-chapter{padding:14px 0;border-bottom:1px solid #8a6d7955}.progress-chapter-heading{display:flex;justify-content:space-between;align-items:baseline;gap:10px}.progress-chapter h3{font-size:1rem;margin:0}.progress-chapter h3>span:first-child{color:#d6ae73;margin-right:8px}.progress-chapter-heading>span{color:#a5e5dd;font-size:.875rem;white-space:nowrap}.progress-chapter>p{font-size:.875rem!important;color:#c7bbd0;margin:8px 0}.secret-collection{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin:18px 0 4px}.secret-card{background:#1b1728;border:1px dashed #856d90;border-radius:10px;padding:12px 9px;text-align:center}.secret-card.found{background:#19312f;border:1px solid #90c4ad}.secret-card canvas{display:block;width:76px;height:76px;max-width:100%;object-fit:contain;margin:0 auto 8px;image-rendering:pixelated}.secret-state{font-size:.75rem;color:#ceb8d2}.found .secret-state{color:#a5e5dd}.secret-card h4{font-size:.875rem;line-height:1.4;margin:7px 0}.secret-card p{font-size:.875rem!important;line-height:1.4;color:#c7bbd0}.secret-card small{font-size:.75rem;color:#ffda92}.progress-homie{padding-top:18px;color:#ffda92}.progress-homie p{font-size:.875rem!important;line-height:1.4;color:#c7bbd0}#pause-progress{margin-top:12px;width:100%}.chapter-discoveries{border-block:1px solid #b9936d88;padding:12px 0;margin:14px 0 0}.chapter-discoveries>strong{font-size:1rem;color:#ffda92}.chapter-secret-strip{display:flex;gap:12px;margin:8px 0}.chapter-secret-strip>div{border:1px solid #90728d;background:#211a30bb;border-radius:8px;padding:3px}.chapter-secret-strip canvas{display:block;width:48px;height:48px;image-rendering:pixelated}.chapter-discoveries p{font-size:.875rem;line-height:1.4;color:#c7d9de;margin:6px 0}.on-city .chapter-card h2{font-size:clamp(2.6rem,5vw,4.6rem)}.on-city .chapter-card{max-width:430px}.on-city #chapter-soon{display:none}.on-city #explore{margin-top:18px;display:block;width:100%;max-width:300px}.on-city #chapter-progress{padding-top:12px}.on-city #chapter-title{margin-top:6px}
@media(max-width:600px){.progress-card{padding:18px 14px!important}.progress-heading h2{font-size:1.75rem}.progress-totals{gap:6px}.progress-totals span{font-size:.75rem}.secret-collection{grid-template-columns:1fr}.secret-card{display:grid;grid-template-columns:76px 1fr;text-align:left;column-gap:12px;padding:12px}.secret-card canvas{grid-column:1;grid-row:1/5;align-self:center;margin:0}.secret-card>*:not(canvas){grid-column:2}.secret-card p{margin:4px 0}.secret-card h4{margin:4px 0}.on-city .chapter-card{width:100%;max-width:100%}}

.progress-overlay{align-items:flex-start}.progress-card{max-height:min(780px,calc(100svh - 140px))}@media(max-height:500px){.progress-card{max-height:calc(100svh - 70px)}}

/* Level 3 conversations occupy their own measured band below the action. */
body.on-city:not(.on-title) .dialogue{max-height:42%;overflow-y:auto;overscroll-behavior:contain;touch-action:pan-y}
body.on-city:not(.on-title) .dialogue.radio{pointer-events:auto}

body.on-detour:not(.on-title) .dialogue{max-height:42%;overflow-y:auto;overscroll-behavior:contain;touch-action:pan-y}
body.on-detour .quest{display:block;max-width:calc(100% - 24px)}
body.on-detour .quest .eyebrow,body.on-detour .quest .inventory,body.on-detour #combat-hint{display:none}
body.on-detour .masthead h1{font-size:clamp(.85rem,2.4vw,1.4rem)}

/* Compact speech is independent of scene geometry. Text is paged, not scrolled. */
#dialogue{height:112px;min-height:0;max-height:none;left:12px;right:12px;bottom:12px;max-width:760px;padding:10px;gap:10px;overflow:hidden;pointer-events:auto}
#dialogue.radio{height:90px;max-width:640px}
#dialogue .dialogue-copy{align-self:stretch;height:100%;display:grid;grid-template-rows:16px minmax(0,1fr);gap:4px;min-height:0;padding-right:34px}
#dialogue.radio .dialogue-copy,#dialogue.cinematic .dialogue-copy{padding-right:0}
#dialogue .speaker-row{align-items:center;min-width:0;white-space:nowrap;font-size:12px;letter-spacing:.02em}
#dialogue #speaker{overflow:hidden;text-overflow:ellipsis}
#dialogue #dialogue-progress{flex-shrink:0;font-size:11px}
#dialogue #dialogue-text{min-height:0;max-width:none;overflow:hidden;margin:0;font-size:16px;line-height:22px;overflow-wrap:anywhere;-webkit-text-size-adjust:100%;text-size-adjust:100%}
#dialogue #continue{position:absolute;right:4px;bottom:4px;width:44px;height:44px;min-height:44px;margin:0;padding:0;display:grid;place-items:center;font-size:22px}
#dialogue #continue span{margin:0}
#dialogue #dialogue-portrait{width:52px;height:52px;flex:0 0 52px}
#dialogue.radio #dialogue-portrait{width:40px;height:40px;flex-basis:40px}
#dialogue.interactive{cursor:pointer;touch-action:manipulation}
#dialogue-dock{display:none;position:absolute;inset:4px 0;pointer-events:none}
body.mobile-game:not(.on-title) .touch-controls{position:relative}
body.mobile-game.on-voyage:not(.on-title) main{grid-template-rows:30px minmax(0,1fr) auto}
body.mobile-game.on-voyage:not(.on-title) .touch-controls{display:flex}
body.mobile-game.on-voyage .touch-controls>.stick-control,body.mobile-game.on-voyage .touch-controls>.touch-actions,body.mobile-game.on-voyage .touch-controls>.heal-action,
body.dialogue-docked .touch-controls>.stick-control,body.dialogue-docked .touch-controls>.touch-actions,body.dialogue-docked .touch-controls>.heal-action{visibility:hidden;pointer-events:none}
body.dialogue-docked #dialogue-dock{display:block}
#dialogue-dock #dialogue{inset:0;width:100%;height:112px;max-height:100%;margin:auto;box-shadow:none}
@media(max-width:600px){#dialogue{left:8px;right:8px;bottom:8px;gap:8px}#dialogue #dialogue-portrait{width:44px;height:44px;flex-basis:44px}}
@media(orientation:landscape) and (max-height:600px){
 body.mobile-game:not(.on-title) .touch-controls{position:absolute}
 body.mobile-game.on-voyage:not(.on-title) main{grid-template-rows:26px minmax(0,1fr)}
 body.mobile-game #dialogue{left:130px;right:145px;bottom:10px}
 body.mobile-game #dialogue-dock{left:115px;right:140px}
 body.mobile-game #dialogue-dock #dialogue{left:0;right:0;width:100%;height:100%}
}
/* Chapter-complete menus still get the full screen; only speech uses the dock. */
body.mobile-game:not(.on-title):has(#complete:not([hidden])) main{grid-template-rows:30px minmax(0,1fr)}
body.mobile-game:not(.on-title):has(#complete:not([hidden])) .touch-controls{display:none}

/* The longer chapter title stays alongside Pause on narrow phones. */
body.mobile-game.on-city:not(.on-title) .masthead h1{font-size:clamp(.75rem,3.2vw,1rem);line-height:1.1;min-width:0}

/* Keep the same stage and control footprint while the paired ladder ride plays. */
.on-ladder .quest,.on-ladder .vitals,.on-ladder .touch-controls>.stick-control,.on-ladder .touch-controls>.touch-actions,.on-ladder .touch-controls>.heal-action{visibility:hidden;pointer-events:none}

/* Loading is a viewport overlay, independent of the scrolling title/game frame. */
#loading{position:fixed;inset:0;z-index:100;padding:max(12px,env(safe-area-inset-top)) max(12px,env(safe-area-inset-right)) max(12px,env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left));display:flex;flex-direction:column;align-items:center;justify-content:flex-start;overflow:auto;overscroll-behavior:contain;max-width:100%;box-sizing:border-box}
#loading[hidden]{display:none}
#loading .overlay-card{flex:none;margin-block:auto;max-width:100%;box-sizing:border-box;overflow-wrap:anywhere}
body.mobile-game #loading{inset:auto;left:0;top:0;width:var(--mobile-width,100vw);height:var(--mobile-height,100svh);transform:var(--mobile-transform,none);transform-origin:top left}
#loading.boot-loading .loading-actor{width:min(100%,520px,max(72px,calc(var(--mobile-height,100svh) - 245px)))}
#loading:not(.boot-loading) .overlay-card{padding:clamp(18px,4vw,35px)}
#loading .primary,#loading .text-button{max-width:100%}

/* Keep the game and dialogue dock identical when the input device changes. */
body.controller-active .touch-controls>.stick-control,body.controller-active .touch-controls>.touch-actions,body.controller-active .touch-controls>.heal-action{visibility:hidden;pointer-events:none}
body.controller-active button:focus,body.controller-active summary:focus,body.controller-active input:focus{outline:3px solid #a5e4df;outline-offset:4px}
#controller-hint{position:fixed;bottom:max(8px,env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);z-index:110;max-width:calc(100vw - 24px);width:max-content;padding:7px 12px;border:1px solid #bda579;border-radius:8px;background:#191526ed;color:#f7e4bb;font:12px/1.45 system-ui,sans-serif;text-align:center;pointer-events:none;box-sizing:border-box}
#controller-hint[hidden]{display:none}

/* Chapter 4 controls sit over the arena, leaving the canvas footprint fixed. */
.worm-controls{position:absolute;z-index:13;left:50%;bottom:10px;transform:translateX(-50%);display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:5px;width:min(680px,calc(100% - 24px));padding:7px;border:1px solid #bb9d72;border-radius:10px;background:#171b2ded;box-shadow:0 4px 0 #080d1980;box-sizing:border-box;touch-action:manipulation}
.worm-controls[hidden],.worm-laser[hidden]{display:none}
.worm-controls button{display:flex;align-items:center;justify-content:center;gap:7px;min-width:0;min-height:44px;padding:5px 6px;border:1px solid #8a858c;border-radius:6px;background:#2b3347;color:#f6e4c1;font:600 12px/1.12 system-ui,sans-serif;cursor:pointer;touch-action:manipulation;-webkit-tap-highlight-color:transparent;user-select:none}
.worm-controls button b{font-size:20px;line-height:1;font-weight:500;color:#eed096}.worm-controls button span{text-align:center}.worm-controls .worm-fire{background:#265556;border-color:#a5e3d4;color:#dcffeb}.worm-controls button:disabled{opacity:.43;cursor:default}.worm-controls button:not(:disabled):active{background:#4a5d6a;transform:translateY(1px)}.worm-controls button:focus-visible{outline:3px solid #ffdd95;outline-offset:1px}
.worm-laser{position:absolute;z-index:13;right:12px;bottom:12px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;min-width:102px;min-height:52px;padding:8px 13px;border:2px solid #a4eced;border-radius:12px;background:#214f60ed;color:#e0ffff;box-shadow:0 3px 0 #101b31;font:700 15px/1.1 system-ui,sans-serif;touch-action:manipulation;cursor:pointer}.worm-laser small{font:600 10px/1.1 system-ui,sans-serif;letter-spacing:.12em;color:#d9d2ea}.worm-laser:disabled{opacity:.55;cursor:default}.worm-laser:not(:disabled):active{background:#427387;transform:translateY(1px)}
.worm-secret-collection{grid-template-columns:repeat(2,minmax(0,1fr))}.chapter-secret-strip>div:has(canvas[hidden]){display:none}
body:has(#worm-controls:not([hidden])) .touch-actions,body:has(#worm-controls:not([hidden])) .touch-controls>.heal-action{visibility:hidden;pointer-events:none}
body.dialogue-docked .worm-laser,body.on-title .worm-laser,body:has(#pause-screen:not([hidden])) .worm-controls,body:has(#pause-screen:not([hidden])) .worm-laser{visibility:hidden;pointer-events:none}
@media(max-width:600px){.worm-controls{gap:4px;padding:5px;width:calc(100% - 12px);bottom:6px}.worm-controls button{gap:3px;font-size:10px;padding:4px 2px}.worm-controls button b{font-size:17px}.worm-laser{right:8px;bottom:8px;min-width:94px;min-height:48px;font-size:14px}.worm-secret-collection{grid-template-columns:1fr}}
@media(orientation:landscape) and (max-height:600px){.worm-controls{left:130px;right:140px;bottom:8px;transform:none;width:auto;max-width:none;gap:3px;padding:4px}.worm-controls button{min-height:34px;font-size:9px;padding:3px 2px}.worm-controls button b{font-size:15px}.worm-laser{right:145px;bottom:10px;min-height:44px;padding:5px 9px}}

/* The crew's touch dock reserves one footprint through every Chapter 4 scene. */
@media(orientation:portrait){body.mobile-game.on-worm:not(.on-title) main{grid-template-rows:30px minmax(0,1fr) 146px}body.mobile-game.on-worm:not(.on-title) .touch-controls{display:flex;height:146px;min-height:146px;max-height:146px;padding-top:8px;padding-bottom:4px}body.mobile-game.on-worm .stick-control{max-height:134px}body.mobile-game.on-worm .touch-actions{max-height:134px}}
.worm-controls{grid-template-rows:24px 44px 44px;gap:3px;padding:4px}.worm-turn-status{grid-column:1/-1;height:24px;min-height:24px;max-height:24px;margin:0;padding:0 4px;overflow:hidden;color:#c1ecdf;text-align:center;font:500 11px/12px system-ui,sans-serif;overflow-wrap:anywhere}.worm-controls button{min-height:44px}
@media(orientation:landscape) and (max-height:600px){.worm-controls{left:124px;right:12px;width:auto;grid-template-rows:24px 44px 44px}.worm-controls button{min-height:44px}.worm-turn-status{font-size:10px}}

/* Keep tactical commands in their own tray below the battlefield. The stage
   remains fully visible, including the ground line and the aiming arc. */
.game-shell>.worm-controls{position:relative;left:auto;right:auto;bottom:auto;z-index:1;transform:none;width:min(100%,720px);margin:0 auto;border-radius:0 0 10px 10px;box-shadow:none;flex:none}
body.mobile-game .game-shell>.worm-controls{width:100%;max-width:none}
@media(orientation:landscape) and (max-height:600px){body.mobile-game .game-shell>.worm-controls{width:calc(100% - 145px);margin-left:145px;grid-template-rows:20px 38px 38px}body.mobile-game .game-shell>.worm-controls button{min-height:38px}}

.worm-tray-heading{grid-column:1/-1;display:flex;align-items:center;gap:6px;min-width:0}.worm-tray-heading .worm-turn-status{flex:1;display:flex;align-items:center;justify-content:center}.worm-controls .worm-tray-heading button{min-height:22px;height:22px;padding:1px 10px;font-size:11px;flex:none}

/* Frame fit. On short desktop screens the 3:2 stage is limited by its
   max-height and narrows to keep its shape. The frame, header and caption
   follow that width and stay centered, so no empty strip sits beside the scene. */
:root{--stage-max-h:calc(100svh - 210px);--title-max-h:calc(100svh - 50px)}
@media(min-width:1000px) and (max-height:800px){:root{--stage-max-h:calc(100svh - 186px)}}
body:not(.mobile-game) .game-shell,body:not(.mobile-game) .masthead,body:not(.mobile-game) .caption{max-width:max(542px,calc(var(--stage-max-h) * 1.5 + 2px));margin-inline:auto}
body.on-title:not(.mobile-game) .game-shell{max-width:max(932px,calc(var(--title-max-h) * 1.5 + 2px))}
@media(max-width:1000px){body.on-title:not(.mobile-game) .game-shell{max-width:max(977px,calc(var(--title-max-h) * 1.5 + 2px))}}
@media(max-width:900px){body:not(.mobile-game) .game-shell,body:not(.mobile-game) .masthead,body:not(.mobile-game) .caption{max-width:none}}
/* Long chapter and room names stay on one line with their star; the header
   scales with its own width rather than the window's. */
body:not(.mobile-game) .masthead{container-type:inline-size}
body:not(.mobile-game) .identity{min-width:0}
body:not(.mobile-game) .masthead h1{white-space:nowrap;font-size:clamp(1.25rem,3.3cqi,2.4rem)}
body:not(.mobile-game) .masthead .title-star{margin-left:.45em}
.header-actions{flex:none}#pause{white-space:nowrap}
body:not(.mobile-game) .episode{max-width:32ch;text-align:right;line-height:1.5}
@container (max-width:760px){body:not(.mobile-game) .episode{display:none}}
/* The Worm Odyssey command tray sits below the battlefield; reserve its height
   so the tray and footer stay on screen without page scrolling. */
body.worm-tactical{--stage-max-h:calc(100svh - 338px)}
@media(min-width:1000px) and (max-height:800px){body.worm-tactical{--stage-max-h:calc(100svh - 314px)}}
body:not(.mobile-game):not(.on-title) .stage{max-height:var(--stage-max-h)}
@media(max-width:900px){body:not(.mobile-game):not(.on-title) .stage{max-height:none}}
body.worm-tactical:not(.mobile-game) .game-footer>span:first-child{display:none}
body.worm-tactical:not(.mobile-game) .game-footer{justify-content:center;text-align:center;text-wrap:balance}
/* How to play: on wide title screens the key list and the phone/controller
   notes sit side by side, so Back stays visible without scrolling. */
@media(min-width:1180px){
 .controls-menu{display:grid;grid-template-columns:minmax(0,340px) minmax(0,300px);column-gap:40px;max-width:680px;align-items:start}
 .controls-menu>h3{grid-column:1/-1}
 .controls-menu>dl{grid-column:1;grid-row:2/span 4}
 .controls-menu>p,.controls-menu>button{grid-column:2}
 .controls-menu>p:first-of-type{margin-top:4px}
}
@media(min-width:1000px){.controls-menu{background:#10102bb3;border:1px solid #9a718355;padding:16px 20px 18px;backdrop-filter:blur(2px);box-shadow:4px 4px 0 #0b0a1a55}.controls-menu>p{color:#d9c3d6}}
@media(min-width:1000px) and (max-height:820px){.title-copy:has(>#controls-menu:not([hidden])) .game-logo{font-size:clamp(3.4rem,6.4vw,5.4rem);margin-bottom:10px}.title-copy:has(>#controls-menu:not([hidden])) .title-tagline{margin:10px 0 16px}}
/* Chapter cards: center when they fit, start at the top and scroll when they
   do not, so the eyebrow and title are never clipped above the stage. */
.chapter-unlock{align-items:flex-start}
.chapter-card{margin-block:auto}
.chapter-card .text-button{text-align:left;width:auto}
@media(min-width:601px) and (max-height:950px){
 .chapter-unlock{padding-block:3.5%}
 .on-city .chapter-card h2,.on-worm .chapter-card h2{font-size:clamp(2.2rem,3.6vw,3.4rem);margin:12px 0}
 .chapter-card .text-button{display:inline-block;margin-right:22px}
 .on-city .unlock-symbol,.on-worm .unlock-symbol{display:none}
 .chapter-discoveries{padding:8px 0;margin-top:10px}
 .chapter-card .text-button{padding-top:9px}
 .chapter-soon{margin:12px 0 16px}
}

@media(min-width:601px){.on-city .chapter-card h2,.on-worm .chapter-card h2{font-size:clamp(2.2rem,3.6vw,3.6rem)}.on-city .chapter-card .text-button,.on-worm .chapter-card .text-button{display:inline-block;margin-right:22px}}

/* Camera tools stay in the action tray, clear of the battlefield. */
.worm-camera-controls{display:flex;gap:2px;flex:none}
.worm-controls .worm-camera-controls button{min-width:30px;padding-inline:5px}
.worm-controls #worm-follow{font-size:10px;min-width:46px}
.worm-controls #worm-follow[aria-pressed="true"]{border-color:#92ecdf;color:#c1ecdf;background:#265556}
body.worm-tactical #game{cursor:grab;touch-action:none}
body.worm-tactical #game.camera-dragging{cursor:grabbing}
@media(pointer:coarse){.worm-controls{grid-template-rows:36px 44px 44px}.worm-controls .worm-tray-heading button{height:36px;min-height:36px;min-width:36px}.worm-tray-heading{gap:3px}.worm-tray-heading .worm-turn-status{font-size:10px;line-height:11px;padding:0 1px}}

@media(orientation:landscape) and (max-height:600px){
 body.mobile-game .game-shell>.worm-controls{grid-template-rows:38px 38px 38px}
 body.worm-tactical:not(.mobile-game) main{height:100svh;display:flex;flex-direction:column;padding:8px 12px;gap:6px}
 body.worm-tactical:not(.mobile-game) .masthead{flex:none;height:30px;margin:0;max-width:none}
 body.worm-tactical:not(.mobile-game) .artist,body.worm-tactical:not(.mobile-game) .game-footer{display:none}
 body.worm-tactical:not(.mobile-game) .masthead h1{font-size:16px;margin:0}
 body.worm-tactical:not(.mobile-game) #pause{padding:5px 10px}
 body.worm-tactical:not(.mobile-game) .game-shell{flex:1;min-height:0;width:100%;max-width:none;display:flex;flex-direction:column}
 body.worm-tactical:not(.mobile-game) .stage{flex:1;min-height:0;max-height:none;aspect-ratio:auto}
}

/* Chapter 4: quiet command hierarchy; the tray stays outside the canvas. */
.worm-controls{grid-template-rows:32px 44px 44px;gap:3px;padding:4px}
.worm-tray-heading .worm-turn-status{height:30px;max-height:30px;font-size:11px;line-height:14px}
.worm-controls .worm-fire{box-shadow:inset 0 -3px #163c42;border-color:#b6edcf;font-weight:750}
.worm-controls #worm-pass,.worm-controls #worm-retreat{background:#232b3a;color:#d0c9b7}
.worm-controls button[aria-pressed="true"]{outline:1px solid #edcf8f}
@media(pointer:coarse){.worm-controls{grid-template-rows:44px 44px 44px}.worm-controls .worm-tray-heading button{min-height:44px;height:44px}.worm-controls .worm-camera-controls button{min-width:44px}.worm-tray-heading .worm-turn-status{font-size:10px;line-height:13px}}
@media(orientation:landscape) and (max-height:600px){body.mobile-game .game-shell>.worm-controls{grid-template-rows:44px 44px 44px}.worm-controls .worm-tray-heading button{min-height:44px}}

@media(orientation:portrait){
 body.mobile-game.worm-tactical .game-shell{position:relative;overflow:visible}
 body.mobile-game.worm-tactical .game-shell>.worm-controls{position:absolute;left:100px;right:0;bottom:-146px;width:calc(100% - 100px);height:146px;max-width:none;margin:0;grid-template-rows:44px 44px 44px;z-index:20;background:#1c2032;border-radius:10px}
 body.mobile-game.worm-tactical .stick-control{width:90px;max-width:90px}
 body.mobile-game.worm-tactical .move-stick{width:90px;height:90px}
 body.mobile-game.worm-tactical .worm-tray-heading button{height:44px;min-height:44px;min-width:44px}
 body.mobile-game.worm-tactical #worm-pan-left,body.mobile-game.worm-tactical #worm-pan-right{display:none}
 body.mobile-game.worm-tactical .worm-controls button{font-size:9px;padding:2px;gap:1px}
 body.mobile-game.worm-tactical .worm-controls button b{display:none}
 body.mobile-game.worm-tactical .worm-tray-heading .worm-turn-status{font-size:9px;line-height:11px}
}

@media(orientation:portrait) and (max-width:360px){body.mobile-game.worm-tactical .game-shell>.worm-controls{left:59px;width:calc(100% - 59px)}body.mobile-game.worm-tactical .stick-control{width:54px;max-width:54px}body.mobile-game.worm-tactical .move-stick{width:54px;height:54px}body.mobile-game.worm-tactical .touch-controls{padding-left:0}}

/* Campaign route stays inside the phone's scrollable Progress app. */
.progress-worm-route{margin:16px 0;padding:14px;border:1px solid #639c98;border-radius:12px;background:#172e32;color:#e5efdc;overflow-wrap:break-word}
.progress-worm-route[hidden]{display:none}.progress-worm-route h3{font-size:1rem;margin:0 0 10px;color:#a9ece0}
.progress-route-location,.progress-route-next,.progress-route-checkpoint{font-size:.875rem!important;line-height:1.5;margin:7px 0}
.progress-route-location{color:#b8d0d0}.progress-route-next{color:#ffdfa3}.progress-route-checkpoint{color:#c0d3cf}
.progress-route-list{padding-left:1.2rem;margin:12px 0 0;font-size:.875rem;line-height:1.5}.progress-route-list li{padding:3px 0}
.progress-route-list li[data-status="complete"]{color:#a5e5d5}.progress-route-list li[data-status="current"]{color:#ffe0a2;font-weight:700}.progress-route-list li[data-status="upcoming"]{color:#b2bdc7}
.worm-retreat-note{grid-column:1/-1;margin:0;padding:3px 4px 1px;color:#bac9c7;text-align:center;font:10px/1.3 system-ui,sans-serif;overflow-wrap:break-word}.worm-retreat-note[hidden]{display:none}
/* Reserve space for the retreat contract; never overflow below the touch tray. */
@media(orientation:portrait){
 body.mobile-game.worm-tactical .worm-tray-heading .worm-turn-status{height:44px;max-height:44px}
 body.mobile-game.worm-tactical:has(#worm-retreat-note:not([hidden])) main{grid-template-rows:30px minmax(0,1fr) 184px}
 body.mobile-game.worm-tactical:has(#worm-retreat-note:not([hidden])) .touch-controls{height:184px;min-height:184px;max-height:184px}
 body.mobile-game.worm-tactical:has(#worm-retreat-note:not([hidden])) .game-shell>.worm-controls{height:184px;bottom:-184px;grid-template-rows:44px 44px 44px 32px}
}
@media(orientation:landscape) and (max-height:600px){
 body.worm-tactical .quest.hud-collapsed{top:4px;left:4px;width:210px;padding:6px 10px}
 body.worm-tactical .quest.hud-collapsed h2{font-size:12px;line-height:1.2}
 body.worm-tactical .vitals.hud-collapsed{top:4px;right:4px;width:160px;padding:8px}
}

/* Practice uses the repair cell for the onward route, without enlarging the tray. */
.worm-controls button[hidden]{display:none}

/* Illustrated scenery keeps smooth contours through fractional screen scaling.
   Character sheets and inventory canvases keep their authored sprite sampling. */
#game{image-rendering:auto}
