/* Framed wood and brass UI. Layout, controls and world artwork stay in their existing layers. */
:root{--ui-gold:#9d9d9d;--ui-gold-light:#d7d7d7;--ui-dark:#121212;--ui-wood:#232323;--ui-muted:#afafaf;--ui-red:#3b3b3b}
body{color:#e4e4e4}
button,#download-apk{color:#e7e7e7;border:2px solid var(--ui-gold);border-radius:3px;background:#373737;box-shadow:inset 0 1px #bebebe,inset 0 -2px #0d0d0d,0 2px 2px #00000088;text-shadow:1px 1px #0d0d0d}
button:hover,#download-apk:hover{background:#373737;border-color:#d4d4d4}
button:focus-visible,a:focus-visible{outline:2px solid #e7e7e7;outline-offset:3px}
button:disabled{opacity:.45}button.active,button.selected,button[aria-pressed="true"]{border-color:#e4e4e4;box-shadow:inset 0 0 0 1px #3d3d3d,0 0 0 1px #bfbfbf;background:#373737}
#game>header{background:#373737,#373737;border-bottom:3px double var(--ui-gold);box-shadow:0 3px 12px #00000099}
#screw-counter,#shop-balance{color:#e1e1e1;background:#0e0e0e;border:2px solid var(--ui-gold);border-radius:14px;box-shadow:inset 0 1px 4px #000000;padding-inline:10px}
#inventory,#tool-panel,#launch-checklist,dialog,.server-card,.server-form,.guide-card,.guide-block-list>button,#craft-selected,#crafting-resources,#crafting-recipes{background-color:var(--ui-wood);background-image:none;border-color:var(--ui-gold);color:#e4e4e4}
dialog{border:4px double var(--ui-gold);border-radius:4px;padding:18px;box-shadow:inset 0 0 0 2px #0d0d0d,inset 0 0 0 4px #585858,0 16px 60px #000000bb}
dialog::backdrop{background:#060606c7}
.dialog-head{border-bottom:2px solid #7b7b7b;padding-bottom:12px;gap:12px;color:#e4e4e4}
.dialog-head h2{letter-spacing:1px;text-shadow:2px 2px #070707}
.dialog-head button[id^="close-"],#close-password{min-width:28px;min-height:28px;padding:3px 7px;border-radius:50%;background:#373737;border-color:#c0c0c0;box-shadow:inset 0 1px #9b9b9b,0 1px #000000}
#tool-panel,#launch-checklist{border:3px double var(--ui-gold);box-shadow:inset 0 0 0 1px #0d0d0d,0 4px 10px #00000077}
#toggle-tools{background:#373737;border-color:var(--ui-gold)}
#inventory{border-top:3px double var(--ui-gold)}#inventory h2{color:#d7d7d7;letter-spacing:1px}
.slot,#shop-items .shop-tile,.craft-selector,.area-choice{background:#111111;border:2px solid #858585;border-radius:3px;box-shadow:inset 0 0 0 1px #c0c0c0,inset 0 3px 8px #00000088,0 2px #060606}
.slot:hover,#shop-items .shop-tile:hover,.craft-selector:hover{background:#2b2b2b;border-color:#d9d9d9}
.slot.selected,#shop-items .shop-tile.selected,.craft-selector.selected{outline:1px solid #e3e3e3;outline-offset:2px;background:#3c3c3c;border-color:#e3e3e3}
.amount{background:#111111d9;color:#e8e8e8}.ship-note,#craft-selected-owned{color:var(--ui-muted)}
input,select,textarea{font:inherit;color:#e4e4e4;background:#0f0f0f;border:2px solid #787878;border-radius:2px;box-shadow:inset 0 2px 5px #00000088}input:focus,select:focus,textarea:focus{outline:2px solid #c3c3c3;outline-offset:1px}
#shop-dialog .shop-head{background:#373737;border-bottom:3px double var(--ui-gold)}
#shop-items,#shop-detail{background:#1d1d1d;border-color:#858585}#shop-items .shop-category h2{color:#c5c5c5;border-color:#6b6b6b}
.shop-preview,.shop-description{border:3px double #959595;background:#121212;box-shadow:inset 0 0 0 1px #060606}
#shop-block-name{color:#e2e2e2}.shop-description h3{color:#c9c9c9}#shop-description-text{color:#cccccc;scrollbar-color:#898989 #131313}
#shop-buy,#craft-selected-button,#launch{background:#373737;border-color:#a5a5a5;color:#f0f0f0;box-shadow:inset 0 2px #a0a0a0,inset 0 -2px #1f1f1f,0 2px 4px #00000088}
#shop-buy:hover,#craft-selected-button:hover,#launch:hover{background:#373737}
#guide-dialog .dialog-head,#crafting-resources,#crafting-dialog .dialog-head{background:#232323}
#guide-content{color:#d0d0d0}#guide-content section+section{border-color:#747474}.guide-card,.server-card{border:2px solid #7d7d7d}
#give-up{background:#373737;border-color:#acacac}
#fuel-meter,#electricity-meter,.resource-meter{border-color:#9d9d9d;background:#131313}
#crafting-dialog{width:min(820px,calc(100vw - 24px));height:min(780px,92dvh);max-height:92dvh;overflow:hidden;display:flex;flex-direction:column;gap:12px}
#crafting-dialog:not([open]){display:none}#crafting-dialog>.dialog-head{margin:0;flex:none}#crafting-resources{position:static;flex:none;margin:0;padding:9px 12px;border:2px solid #757575;gap:10px;font-size:12px}
#craft-selected{flex:none;display:grid;grid-template-columns:140px minmax(0,1fr);gap:16px;padding:16px;border:3px double var(--ui-gold)}
.craft-selected-portrait{display:flex;align-items:center;justify-content:center;aspect-ratio:1;background:#101010;border:3px double #aeaeae;box-shadow:inset 0 0 0 3px #232323;padding:12px}
#craft-selected-image{width:100%;height:100%;object-fit:contain;image-rendering:pixelated}.craft-selected-info{min-width:0}#craft-selected-name{margin:3px 0 12px;color:#e3e3e3;font-size:19px}
#craft-selected-description{font-size:11px;line-height:1.8;max-height:130px;overflow-y:auto;padding-right:6px;scrollbar-color:#8e8e8e #131313}#craft-selected-description p{margin:0 0 8px}
.craft-selected-materials{grid-column:1/-1;border-top:1px solid #686868;padding-top:12px}.craft-selected-materials h4{font-size:11px;color:#c3c3c3;margin:0 0 9px;text-transform:uppercase}
#craft-selected-cost{gap:10px}.craft-ingredient{background:#121212;border:1px solid #545454;padding:4px 8px;border-radius:2px;font-size:12px}.craft-ingredient.missing{color:#b6b6b6;border-color:#505050}.craft-ingredient img{width:26px;height:26px}
.craft-selected-actions{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:12px}#craft-selected-owned{font-size:11px}#craft-selected-button{min-width:120px;padding:9px 24px}
.craft-picker-title{margin:0;font-size:12px;color:#cecece;flex:none}#crafting-recipes{display:grid;grid-template-columns:repeat(auto-fill,minmax(65px,1fr));gap:12px;align-content:start;overflow-y:auto;min-height:86px;flex:1;padding:12px;border:2px solid #747474;scrollbar-color:#8f8f8f #131313;overscroll-behavior:contain}
.craft-selector{width:100%;aspect-ratio:1;padding:7px;min-width:0}.craft-selector img{width:100%;height:100%;object-fit:contain;image-rendering:pixelated;pointer-events:none}#crafting-status{margin:0;min-height:16px;font-size:11px;color:#dcdcdc;flex:none}
@media(max-width:600px){
 dialog{padding:12px}.dialog-head{padding-bottom:9px}#crafting-dialog{width:calc(100vw - 12px);height:calc(100dvh - 20px);max-height:calc(100dvh - 20px);gap:9px}
 #crafting-resources{gap:5px;padding:6px}.craft-ingredient{padding:3px 5px;font-size:10px}.craft-ingredient img{width:22px;height:22px}
 #craft-selected{grid-template-columns:88px minmax(0,1fr);gap:10px;padding:10px}.craft-selected-portrait{padding:7px}#craft-selected-name{font-size:14px;margin:0 0 8px}#craft-selected-description{font-size:10px;max-height:100px;line-height:1.6}.craft-selected-materials{padding-top:9px}.craft-selected-actions{margin-top:9px}#craft-selected-button{padding:8px 18px;min-width:96px;font-size:12px}#crafting-recipes{grid-template-columns:repeat(auto-fill,minmax(52px,1fr));gap:9px;padding:10px}
}
@media(max-height:500px) and (orientation:landscape){#crafting-dialog{overflow-y:auto;height:auto;max-height:96dvh}#craft-selected{grid-template-columns:88px minmax(0,1fr)}#craft-selected-description{max-height:75px}#crafting-recipes{flex:none;max-height:180px}}

dialog::after{display:none} .shop-preview{border:0;outline:none;box-shadow:none;background:transparent}#shop-preview-art{border:0;outline:none;box-shadow:none}
.craft-ingredient.missing{color:#f3a09a;border-color:#96514c}

#game #grid{background:rgba(0,0,0,.48)}
/* Crafting workbench: a blueprint preview above a two-row parts rack. */
#crafting-dialog{width:min(860px,calc(100vw - 24px));height:min(720px,92dvh);border:2px solid #878c93;box-shadow:0 18px 60px #000b;padding:20px;background:#202226;gap:16px}
#crafting-dialog>.dialog-head{background:transparent;border-bottom:1px solid #555b63;padding-bottom:16px}
#crafting-title{font-size:20px;letter-spacing:3px;color:#ebedf0}
#craft-selected{background:#2a2d32;border:1px solid #626972;grid-template-columns:180px minmax(0,1fr);padding:0;gap:0;overflow:hidden}
.craft-selected-portrait{border:0;border-right:1px solid #515760;box-shadow:none;border-radius:0;padding:24px;aspect-ratio:auto;min-height:180px;background-color:#22262b;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24'%3E%3Cpath d='M24 0H0V24' fill='none' stroke='%23373d45' stroke-width='.7'/%3E%3C/svg%3E");background-size:24px 24px}
#craft-selected-image{max-height:150px;filter:drop-shadow(0 4px 0 #0005)}
.craft-selected-info{padding:20px 22px}#craft-selected-name{font-size:20px;margin:0 0 14px;color:#f2f3f4;line-height:1.35}
#craft-selected-description{max-height:136px;color:#bec3ca;line-height:1.8;font-size:11px}
.craft-selected-materials{background:#191c20;border-top:1px solid #515760;padding:16px 20px}.craft-selected-materials h4{color:#a9b0ba;letter-spacing:2px;margin-bottom:12px}
#craft-selected-cost{display:flex;gap:8px;flex-wrap:wrap}#craft-selected-cost .craft-ingredient{border:1px solid #515965;border-left:3px solid #8e98a6;border-radius:0;background:#282d34;padding:8px 12px;gap:10px}#craft-selected-cost .craft-ingredient img{width:28px;height:28px}#craft-selected-cost .craft-ingredient.missing{border-left-color:#be726c;color:#f0aaa4}
.craft-selected-actions{margin-top:16px;padding-top:12px;border-top:1px solid #353b43}#craft-selected-owned{color:#b4bbc5;font-size:11px}
#craft-selected-button{background:#737f8e;border:1px solid #aab5c4;box-shadow:none;border-radius:0;min-width:150px;text-shadow:none;color:#fff}#craft-selected-button:hover{background:#8897aa}#craft-selected-button:disabled{background:#3a414b}
.craft-picker-title{font-size:11px;letter-spacing:2px;text-transform:uppercase;color:#bfc6d0;margin:0;padding-left:1px}
#crafting-recipes{grid-template-columns:none;grid-template-rows:repeat(2,66px);grid-auto-flow:column;grid-auto-columns:66px;align-content:start;justify-content:start;overflow-x:auto;overflow-y:hidden;flex:1;min-height:168px;border:1px solid #4b535f;background:#16191d;padding:12px;gap:10px;scrollbar-color:#748090 #20252b;scroll-snap-type:x proximity}
.craft-selector{border:1px solid #555e6b;background:#282e36;box-shadow:none;border-radius:0;padding:9px;scroll-snap-align:start}.craft-selector:hover{background:#394450;border-color:#8998aa}.craft-selector.selected{background:#475669;border-color:#b6c8df;box-shadow:inset 0 -3px #a8bad2;outline:none}
#crafting-status{font-size:11px;color:#c0d2b6}
@media(max-width:600px){#crafting-dialog{padding:12px;gap:12px;width:calc(100vw - 12px);height:calc(100dvh - 20px);max-height:calc(100dvh - 20px)}#crafting-title{font-size:16px;letter-spacing:2px}#craft-selected{grid-template-columns:100px minmax(0,1fr)}.craft-selected-portrait{padding:12px;min-height:140px}.craft-selected-info{padding:12px}#craft-selected-name{font-size:14px;margin-bottom:9px}#craft-selected-description{font-size:10px;max-height:120px}.craft-selected-materials{padding:12px}#craft-selected-cost .craft-ingredient{padding:6px 8px;gap:6px;font-size:10px}#craft-selected-cost .craft-ingredient img{width:23px;height:23px}#craft-selected-button{min-width:104px;padding:8px 14px}#crafting-recipes{grid-template-rows:repeat(2,58px);grid-auto-columns:58px;min-height:150px;gap:9px;padding:10px}}
@media(max-height:500px) and (orientation:landscape){#crafting-dialog{height:auto;overflow-y:auto;max-height:96dvh}.craft-selected-portrait{min-height:120px}#craft-selected-description{max-height:80px}#crafting-recipes{flex:none;height:168px}}
@media(max-width:600px) and (max-height:700px) and (orientation:portrait){#crafting-dialog{gap:9px;padding:10px}#crafting-dialog>.dialog-head{padding-bottom:9px}.craft-selected-portrait{min-height:100px;padding:10px}.craft-selected-info{padding:10px}#craft-selected-name{font-size:13px;margin-bottom:7px}#craft-selected-description{max-height:70px;font-size:9px}.craft-selected-materials{padding:10px}.craft-selected-materials h4{margin-bottom:7px;font-size:10px}#craft-selected-cost .craft-ingredient{padding:4px 6px;font-size:9px}#craft-selected-cost .craft-ingredient img{width:20px;height:20px}.craft-selected-actions{margin-top:9px;padding-top:9px}#crafting-recipes{grid-template-rows:repeat(2,48px);grid-auto-columns:48px;min-height:125px;padding:9px;gap:8px}.craft-selector{padding:6px}}

#crafting-dialog>.dialog-head{border:0;box-shadow:none}#crafting-resources{display:none;border:0;box-shadow:none}

#drone-toggle{position:fixed;bottom:calc(108px + env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);z-index:5;min-width:112px;padding:8px 20px;background:#343b45;border:2px solid #a0aab9;color:#fff;font-size:14px}#radar-placement-note{color:#bfcada;font-size:11px;margin:7px 0 0}#mobile-shoot{display:none!important}
@media(any-pointer:coarse){#drone-toggle{bottom:calc(140px + env(safe-area-inset-bottom))}}
/* Builder gestures affect the grid and its holograms together. */
#grid-wrap{aspect-ratio:1;overflow:hidden;touch-action:none}#builder-stage{position:relative;width:100%;height:100%;transform-origin:center;will-change:transform}#builder-stage #grid{width:100%;height:100%;margin:0}
/* Compact, flat game cards with a full-height vertical parts grid. */
#crafting-dialog{border-radius:16px;border:2px solid #727a85;background:#22272e;padding:16px;gap:12px;box-shadow:0 8px 0 #101318,0 18px 40px #0008}
#crafting-dialog>.dialog-head{padding:2px 0 10px}#crafting-title{letter-spacing:1px}#close-crafting{border-radius:8px;min-width:40px;min-height:40px;background:#454d58;border:1px solid #87909c}
#craft-selected{border:1px solid #626c79;border-radius:12px;overflow:hidden;background:#303740;gap:0;grid-template-columns:116px minmax(0,1fr)}
.craft-selected-portrait{border:0;border-radius:0;background:#252c35;background-image:none;min-height:116px;padding:14px;box-shadow:none}
.craft-selected-info{padding:14px}#craft-selected-name{font-size:17px;margin-bottom:8px}#craft-selected-description{max-height:102px;font-size:10px;line-height:1.6}
.craft-selected-materials{background:#262d36;border-top:1px solid #485360;padding:12px}.craft-selected-materials h4{letter-spacing:1px;margin-bottom:8px}
#craft-selected-cost .craft-ingredient{border-radius:7px;border:1px solid #596573;background:#343e4a;padding:6px 8px;gap:6px}#craft-selected-cost .craft-ingredient.missing{border-color:#ae7474}
.craft-selected-actions{padding-top:10px;margin-top:10px;border-color:#485360}#craft-selected-button{border-radius:9px;background:#687b8f;border:2px solid #9aafc3;box-shadow:0 3px 0 #17202b;min-height:42px}#craft-selected-button:disabled{box-shadow:none}
#crafting-recipes{display:grid;grid-template-columns:repeat(auto-fill,minmax(70px,1fr));grid-template-rows:none;grid-auto-flow:row;grid-auto-columns:auto;grid-auto-rows:max-content;align-content:start;justify-content:stretch;flex:1 1 0;min-height:0;overflow-y:auto;overflow-x:hidden;padding:12px;gap:10px;border-radius:12px;border:1px solid #4e5c6c;background:#171d25;scroll-snap-type:none;touch-action:pan-y}
.craft-selector{width:100%;aspect-ratio:1;border-radius:10px;border:2px solid #4e5b6a;background:#303a47;padding:9px;box-shadow:0 3px 0 #0d131b;scroll-snap-align:none;transition:background .12s,border-color .12s}.craft-selector.selected{background:#526981;border-color:#b5cee6;box-shadow:inset 0 0 0 1px #89a8c7,0 3px 0 #0d131b}.craft-selector:hover{background:#425266}#crafting-status:empty{display:none}
@media(max-width:600px){#crafting-dialog{padding:10px;gap:10px;height:calc(100dvh - 20px);max-height:calc(100dvh - 20px)}#craft-selected{grid-template-columns:88px minmax(0,1fr)}.craft-selected-portrait{min-height:96px;padding:10px}.craft-selected-info{padding:10px}#craft-selected-name{font-size:13px}#craft-selected-description{max-height:82px;font-size:9px}.craft-selected-materials{padding:10px}#crafting-recipes{grid-template-columns:repeat(auto-fill,minmax(62px,1fr));grid-template-rows:none;grid-auto-rows:max-content;min-height:0;gap:8px;padding:9px}.craft-selector{padding:7px}#craft-selected-cost .craft-ingredient img{width:21px;height:21px}}
@media(max-height:500px) and (orientation:landscape){#crafting-dialog{height:calc(100dvh - 16px);max-height:calc(100dvh - 16px);overflow:hidden;display:grid;grid-template-columns:minmax(220px,1fr) minmax(220px,1fr);grid-template-rows:auto minmax(0,1fr) auto;gap:10px}#crafting-dialog>.dialog-head{grid-column:1/-1}#craft-selected{min-height:0;overflow-y:auto;align-self:stretch}#crafting-recipes{height:100%;min-height:0;grid-template-columns:repeat(auto-fill,minmax(54px,1fr))}#crafting-status{grid-column:1/-1}}
