@font-face{font-family:BlockWalk;src:url('assets/blockwalk.woff') format('woff');font-style:normal;font-weight:100 900;font-display:swap}
:root{--paper:#f0e7ca;--muted:#b0b9a9;--gold:#eac477;--line:#5c7164;--ink:#15272a;--panel:#203334;color-scheme:dark}
*{box-sizing:border-box}body{margin:0;background:#172729;color:var(--paper);font-family:BlockWalk,monospace;font-size:14px;line-height:1.7}button{font:inherit;color:inherit;cursor:pointer;background:#243a39;border:2px solid #617563;border-radius:0;padding:9px 12px;line-height:1.4;box-shadow:0 3px 0 #0d1a1d}button:hover{background:#344d42;border-color:var(--gold)}button:focus-visible,canvas:focus-visible{outline:3px solid var(--gold);outline-offset:3px}button:disabled{cursor:default;color:#a0ab9f;background:#23302f;border-color:#3e5047;box-shadow:none}button.primary{background:var(--gold);color:#1a2a2c;border-color:#f8d894}button.primary:hover{background:#ffdc91}[hidden]{display:none!important}
main{width:min(1280px,calc(100% - 32px));margin:auto}header{height:94px;display:flex;align-items:center;justify-content:space-between;gap:20px}.eyebrow{font-size:10px;color:var(--gold);margin:0 0 5px;letter-spacing:1px}h1{font-size:28px;line-height:1.25;margin:0;font-weight:400}h1 span{color:var(--gold)}h2{font-size:18px;font-weight:400;line-height:1.6;margin:0}.header-actions{display:flex;gap:15px;align-items:center}.header-actions button{font-size:11px}.version{font-size:10px;color:var(--muted)}
.game-shell{border:2px solid var(--line);background:#132326}.scene-bar{display:flex;align-items:center;justify-content:space-between;height:35px;padding:0 14px;font-size:12px}.scene-bar>div{display:flex;align-items:center;gap:12px}.scene-bar button{border:0;box-shadow:none;background:none;font-size:10px;padding:3px}.scene-bar #fullscreen,.scene-bar #pause{font-family:monospace;font-size:20px}.stage{position:relative;overflow:hidden;background:#454157}#game{width:100%;display:block;aspect-ratio:12/5;image-rendering:pixelated;outline-offset:-3px}.toast{position:absolute;top:12px;right:12px;max-width:min(430px,calc(100% - 24px));background:#142629f2;border:2px solid var(--gold);padding:12px 15px;font-size:12px;pointer-events:none;box-shadow:4px 4px #14202288;z-index:2}.overlay{position:absolute;inset:0;display:flex;flex-direction:column;gap:16px;align-items:center;justify-content:center;background:#142629e8;text-align:center;padding:20px;z-index:5}.overlay p{margin:0}#loading-overlay{background:#203334}
.hub-panel{position:absolute;left:16px;top:16px;bottom:16px;width:300px;padding:14px;background:#162c2bee;border:3px solid var(--gold);box-shadow:5px 5px #101c23a8;display:flex;flex-direction:column}.hub-heading{display:flex;align-items:start;justify-content:space-between;gap:10px}.hub-heading h2{font-size:22px}.hub-heading .eyebrow{font-size:8px}.hub-heading button{border:0;box-shadow:none;background:none;padding:0 3px;font:22px monospace}.hub-panel nav{display:flex;flex-direction:column;gap:7px;margin:12px 0 0}.sector{width:100%;text-align:left;display:flex;justify-content:space-between;align-items:center;gap:6px;font-size:12px;min-height:40px;padding:8px 9px}.sector span{display:block}.sector small{display:block;font-size:8px;color:var(--muted);margin-top:4px}.sector:disabled{min-height:34px;font-size:10px;padding:6px 9px}.sector:disabled small{font-size:7px;margin-top:0}.sector.ready{border-color:var(--gold)}#home-note{font-size:9px;color:var(--gold);line-height:1.7;margin:11px 0}.character-options{display:flex;gap:8px;margin-top:auto}.character-options button{flex:1;display:flex;align-items:center;justify-content:center;gap:5px;padding:2px 4px;font-size:9px;min-height:45px}.character-options canvas{width:32px;height:36px;image-rendering:pixelated}.character-options [aria-pressed=true]{color:var(--gold);border-color:var(--gold);background:#3c4937}
.dashboard{display:flex;gap:16px;align-items:end;padding:13px 0 12px}.pockets{flex:1;max-width:650px;min-width:0}.label-row{display:flex;justify-content:space-between;align-items:center;margin-bottom:6px}.label-row h2,.label-row span{font-size:10px;line-height:1.2}.label-row span{color:var(--muted)}.inventory{display:grid;grid-template-columns:repeat(5,1fr);gap:6px}.slot{height:58px;padding:3px;position:relative;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:1px}.slot .number{position:absolute;left:5px;top:3px;font-size:7px;color:var(--muted)}.slot canvas{width:27px;height:27px;image-rendering:pixelated}.slot-name{font-size:7px;line-height:1.4}.slot .empty{width:9px;height:9px;border:1px dashed #6b7b6b;transform:rotate(45deg)}.slot.selected{border-color:var(--gold)}.mission-bag{display:flex;align-items:center;gap:12px;min-height:58px;min-width:170px;text-align:left;font-size:10px}.mission-bag>span:first-child{font-family:monospace;font-size:30px;color:var(--gold)}.mission-bag strong{display:block;font-size:18px;color:var(--gold);font-weight:400;margin-top:3px}.utility{display:flex;gap:8px;align-items:center;margin-left:auto}.utility button{font-size:10px;min-height:42px}.controls-strip{display:flex;align-items:center;gap:16px;flex-wrap:wrap;padding:10px 0;border-top:1px solid #4c6057;font-size:9px;color:var(--muted)}.controls-strip>span{display:flex;gap:4px;align-items:center}kbd{font:inherit;color:var(--paper);border:1px solid #677b6a;padding:3px 5px;background:#263c38}#save-status{margin-left:auto;font-size:8px}footer{display:flex;justify-content:space-between;font-size:8px;color:#9aa99d;padding:4px 0 12px}
.touch-controls{display:none;justify-content:space-between;gap:10px;margin-bottom:10px}.touch-controls>div{display:flex;gap:6px}.touch-controls button{touch-action:none;user-select:none;min-height:44px;min-width:42px;font-size:11px}
dialog{width:min(520px,calc(100% - 24px));max-height:calc(100dvh - 40px);overflow:auto;background:#1b3130;color:var(--paper);border:3px solid var(--gold);padding:25px;box-shadow:7px 7px #0b161ddd;font:14px/1.9 BlockWalk,monospace}dialog::backdrop{background:#081519bd}.dialog-heading{display:flex;justify-content:space-between;gap:12px;align-items:start}.dialog-heading>button{font:23px monospace;background:none;border:0;box-shadow:none;padding:0 2px}dialog p{margin:18px 0}dialog>button{display:block;width:100%;margin-top:12px;font-size:12px}dialog ul{list-style:none;padding:0;margin:16px 0}dialog li{padding:10px 0;border-bottom:1px solid #526856;display:flex;justify-content:space-between;gap:15px;font-size:12px}dialog li small{font-size:9px;color:var(--gold)}.quiet{color:var(--muted);font-size:11px}.gold{color:var(--gold)}
main:fullscreen,main.expanded{width:100vw;height:100dvh;background:#172729;overflow:auto;padding:0 16px}main.expanded{position:fixed;inset:0;z-index:20}main:fullscreen header,main.expanded header{height:60px}main:fullscreen .game-shell,main.expanded .game-shell{max-width:calc((100dvh - 235px)*2.4);margin:auto}main:fullscreen .dashboard,main.expanded .dashboard{max-width:1400px;margin:auto}
@media(max-width:1100px){.hub-panel{width:270px;padding:10px;top:10px;bottom:10px;left:10px}.hub-panel nav{margin-top:7px;gap:5px}.sector{font-size:10px;min-height:34px;padding:6px}.sector:disabled{font-size:9px;min-height:28px;padding:4px 6px}#home-note{font-size:8px;margin:6px 0}.hub-heading h2{font-size:18px}.character-options button{min-height:36px}.character-options canvas{height:30px;width:27px}.dashboard{gap:10px}.mission-bag{min-width:145px;padding:7px}.utility{flex-wrap:wrap;max-width:210px}.utility button{min-height:34px;font-size:8px;padding:7px}.controls-strip{gap:10px}}
@media(max-width:760px){main{width:calc(100% - 20px)}header{height:80px;gap:6px}h1{font-size:20px}.eyebrow{font-size:7px}.header-actions{gap:5px}.header-actions button{font-size:8px;padding:7px}.version{font-size:8px}.scene-bar{font-size:10px}.stage:has(.hub-panel:not([hidden])){min-height:360px}.stage:has(.hub-panel:not([hidden])) #game{height:360px;object-fit:cover;width:864px;max-width:none}.hub-panel{width:255px;left:10px}.hub-panel nav{gap:7px}.sector{min-height:39px}.sector:disabled{min-height:31px}.dashboard{flex-wrap:wrap;gap:10px}.pockets{flex-basis:calc(100% - 140px);max-width:none}.mission-bag{min-width:125px;font-size:9px}.mission-bag strong{font-size:16px}.mission-bag>span:first-child{display:none}.utility{max-width:none;width:100%;justify-content:flex-end}.utility button{font-size:10px}.slot-name{font-size:6px}.controls-strip{font-size:8px;gap:8px}#save-status{width:100%;margin:0}.touch-controls{display:flex}footer{font-size:6px;gap:15px}.toast{font-size:10px;padding:8px}.overlay h2{font-size:16px}}
@media(pointer:coarse){.touch-controls{display:flex}}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important}}

/* Keep the compact pixel interface legible at a normal desktop zoom. */
@media(min-width:761px){main{max-width:calc((100dvh - 300px)*2.4)}.sector{font-size:14px}.sector small{font-size:10px}.sector:disabled{font-size:12px}.sector:disabled small{font-size:9px}.character-options button{font-size:11px}.label-row h2,.label-row span{font-size:12px}.slot-name{font-size:9px}.utility button{font-size:12px}.controls-strip{font-size:11px}.header-actions button{font-size:12px}.scene-bar button{font-size:11px}}

.utility{flex-wrap:wrap;max-width:440px}.utility #drop-loot{border-color:var(--gold);color:var(--gold)}
#accomplished-dialog{text-align:center}.mission-star{display:block;color:var(--gold);font:48px/1.3 monospace;margin:10px 0}
@media(min-width:761px) and (max-width:1100px){.utility{max-width:210px}}
@media(max-width:760px){.utility{max-width:none}}

/* One permanent star per community mission, in the existing frame. */
#community-stars{display:flex;gap:4px;align-items:center;flex-shrink:0;padding-right:12px;border-right:1px solid var(--line)}
.community-star{display:block;width:18px;height:22px;color:#9ba998;position:relative}
.community-star svg{display:block;width:100%;height:100%;overflow:visible;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linejoin:miter}
.community-star.earned{color:var(--gold)}.community-star.earned svg{fill:currentColor;stroke:#ffe0a0}
.star-reward{color:var(--gold)}.community-star.just-earned,.star-earned .mission-star{animation:star-glow 1.6s ease-out}
.star-earned .mission-star::after{content:'✦';display:inline-block;font-size:18px;position:absolute;margin-left:8px;animation:star-spark 1.6s ease-out both}
@keyframes star-glow{0%{transform:scale(.7);filter:brightness(1)}35%{transform:scale(1.2);filter:brightness(1.6);text-shadow:0 0 16px #eac477}100%{transform:scale(1);filter:brightness(1)}}
@keyframes star-spark{0%{opacity:0;transform:translate(-8px,12px) scale(.4)}40%{opacity:1}100%{opacity:0;transform:translate(8px,-10px) scale(1)}}
@media(max-width:760px){.scene-bar{padding:0 7px}.scene-bar>div{gap:6px}.scene-location #area-name{font-size:8px}#community-stars{gap:3px;padding-right:6px}.community-star{width:14px;height:18px}.scene-bar #sound{font-size:8px}}
@media(prefers-reduced-motion:reduce){.community-star.just-earned,.star-earned .mission-star{animation:none}.star-earned .mission-star::after{display:none}}
dialog .dialog-keys{font-size:10px;text-align:center;margin:18px 0 0}
dialog>button,dialog>button.primary{background:#243a39;color:var(--paper);border-color:#617563}
dialog button:focus,#hub-panel button:focus,.overlay button:focus{background:var(--gold);color:var(--ink);border-color:#ffe0a0;outline:2px solid var(--gold);outline-offset:3px}

/* Keep the chosen outing readable on the gold keyboard focus, and let compact hubs scroll. */
#hub-panel .sector:focus small{color:var(--ink)}
.hub-panel{overflow-y:auto;scrollbar-width:thin;scrollbar-color:var(--line) transparent}
.hub-panel nav{gap:5px;margin-top:8px}
.hub-panel #home-note{margin:7px 0}

/* Four characters live in one small chooser, keeping the outing panel compact. */
#choose-character{display:flex;align-items:center;gap:8px;text-align:left;flex-shrink:0;margin-top:auto;padding:3px 7px;font-size:11px}
#choose-character canvas{width:32px;height:36px;image-rendering:pixelated;flex-shrink:0}
#choose-character small{display:block;font-size:8px;color:var(--muted)}
#choose-character .change-character{margin-left:auto;font-size:9px;color:var(--gold)}
#choose-character:focus small,#choose-character:focus .change-character{color:var(--ink)}
#character-dialog .character-options{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:22px 0 18px}
#character-dialog .character-options button{flex-direction:column;gap:8px;padding:10px 4px;font-size:12px;min-height:126px}
#character-dialog .character-options canvas{width:64px;height:72px}
@media(max-width:420px){#character-dialog{padding:18px}#character-dialog h2{font-size:15px}#character-dialog .character-options button{font-size:10px}}

/* Defence chooser and small, opt-in-sound celebration. */
#choose-gear{font-size:9px;padding:7px;margin:4px 0 6px;text-align:left;color:var(--gold);flex-shrink:0}
#choose-character{margin-top:0}
.gear-options{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin:16px 0}
.gear-options button{display:flex;flex-direction:column;align-items:center;gap:10px;padding:10px 3px;font-size:10px}
.gear-options canvas{width:70px;height:90px;image-rendering:pixelated}
.gear-options [aria-pressed=true]{border-color:var(--gold)}
#celebration{display:block;width:100%;height:auto;max-height:120px;image-rendering:pixelated;margin-bottom:-25px;pointer-events:none}
.touch-controls{flex-wrap:wrap}.touch-controls>div{flex-wrap:wrap}.touch-controls button{font-size:10px}
@media(max-width:420px){.gear-options{gap:6px}.gear-options button{font-size:8px}.gear-options canvas{width:54px;height:76px}}


/* Keep on-screen movement available on smaller displays and touch tablets. */
@media(max-width:900px){.touch-controls{display:flex}}
