:root{--bg:#091221;--panel:rgba(10,19,38,.92);--border:rgba(174,203,237,.18);--ink:#f4f7ff;--muted:#a6b9d3;--gold:#ffcb78;--mint:#72e0bb;--accent:#479bfb;font-family:Inter,system-ui,-apple-system,'Segoe UI',Arial,sans-serif;color:var(--ink)}*{box-sizing:border-box}html,body{margin:0;width:100%;height:100%;background:var(--bg);overflow:hidden}button,input,select{font:inherit}button{cursor:pointer;border:1px solid rgba(194,220,255,.25);border-radius:10px;background:rgba(33,52,80,.92);color:#f4f7ff;padding:9px 12px;transition:background .14s,transform .14s}button:hover{background:#38587c}button:active{transform:scale(.96)}button:disabled{cursor:not-allowed;opacity:.45}.primary{background:linear-gradient(120deg,#e1a453,#f3d38a);color:#1d2630;border-color:#fff1be;font-weight:900;box-shadow:0 5px 21px #dfae5e50}.primary:hover{background:#f1cf80}.glass{background:var(--panel);border:1px solid var(--border);backdrop-filter:blur(12px);box-shadow:0 8px 36px rgba(0,0,0,.22)}#app,#gameShell{position:absolute;inset:0}#worldCanvas{width:100%;height:100%;display:block;touch-action:none;background:linear-gradient(145deg,#1b5068,#14233a)}#cloudLayer{pointer-events:none;position:absolute;inset:0;background:radial-gradient(ellipse 16% 7% at 38% 12%,#fff1,transparent),radial-gradient(ellipse 13% 7% at 78% 21%,#fff1,transparent);opacity:.4;animation:cloud 38s linear infinite}@keyframes cloud{50%{transform:translateX(3%)}100%{transform:translateX(0)}}#hud{position:absolute;left:12px;right:12px;top:10px;display:flex;align-items:center;gap:22px;min-height:55px;padding:6px 12px;border-radius:14px;z-index:4}.hud-title{display:flex;gap:10px;align-items:center;min-width:200px}.hud-title b{font-size:14px;letter-spacing:2.5px}.hud-title small{display:block;color:var(--muted);font-size:11px;max-width:190px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.logo{color:var(--gold);font-size:32px;text-shadow:0 0 16px #ffd089}.hud-stat{min-width:70px;white-space:nowrap}.hud-stat span{display:block;color:var(--muted);font-size:10px}.hud-stat strong{font-weight:850;font-size:17px}.hud-stat.energy strong{color:var(--gold)}.hud-controls{display:flex;gap:6px;margin-left:auto}.hud-controls button{white-space:nowrap;font-size:13px;padding:9px 11px}#leftBar{position:absolute;top:78px;left:12px;width:92px;border-radius:14px;display:flex;flex-direction:column;gap:4px;padding:7px;z-index:4}#leftBar button{border:0;background:transparent;display:flex;flex-direction:column;align-items:center;gap:1px;font-size:21px;padding:9px 1px}#leftBar button span{font-size:10px}#leftBar button.active{background:linear-gradient(130deg,#245b79,#29685c);outline:1px solid #64d1b999}#rightPanel{position:absolute;right:12px;top:78px;width:246px;max-height:calc(100% - 240px);overflow:auto;border-radius:14px;padding:12px;z-index:4;color:#e5efff;font-size:12px;line-height:1.45}.sectionhead{display:flex;gap:8px;justify-content:space-between;align-items:center;margin-bottom:10px}.sectionhead strong{font-size:14px}.xbtn,.modal-close{padding:2px 7px;font-size:21px;line-height:1}.statrow{display:flex;justify-content:space-between;gap:6px;border-bottom:1px solid #ffffff16;padding:6px 0}.statrow b{color:#d2e8ff}#infoBody p{margin:7px 0}#infoBody button{padding:6px 9px;font-size:11px;margin:3px 2px 3px 0}#notify{position:absolute;top:79px;left:119px;max-width:min(48vw,490px);padding:9px 13px;border-radius:11px;font-size:11px;color:#e0e9e8;pointer-events:none;z-index:3}#bottomBar{position:absolute;bottom:10px;left:114px;right:12px;min-height:120px;padding:9px 12px;border-radius:14px;z-index:5}#toolHeading{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:6px}#categoryTitle{font-size:11px;letter-spacing:1.3px;color:var(--gold);font-weight:800}.tool-hint{color:var(--muted);font-size:10px;text-align:right}#tools{display:flex;align-items:stretch;gap:6px;overflow-x:auto;scrollbar-width:thin;padding-bottom:5px}#tools .tool{flex:0 0 auto;min-width:82px;max-width:116px;display:flex;align-items:center;justify-content:center;flex-direction:column;padding:6px 6px;font-size:20px;gap:2px;border-color:#64738b44}#tools .tool small{font-size:10px;white-space:nowrap}#tools .tool em{font-style:normal;font-size:9px;color:#ffda86}#tools .tool.active{border-color:#ffe49b;background:linear-gradient(120deg,#735d36,#355460)}.bottom-actions{display:flex;gap:6px;margin-top:5px;align-items:center;justify-content:flex-end}.bottom-actions button{font-size:11px;padding:6px 9px}#toast{position:absolute;bottom:158px;left:50%;transform:translateX(-50%);background:#162c3fe9;border:1px solid #7dcaba77;color:#fff;padding:9px 18px;border-radius:12px;font-size:12px;box-shadow:0 4px 24px #0008;opacity:0;pointer-events:none;transition:opacity .2s;z-index:12;max-width:86%;text-align:center}#toast.visible{opacity:1}#modal{position:absolute;inset:0;z-index:30;display:flex;align-items:center;justify-content:center;background:#071124ba;padding:12px}#modal.hidden{display:none}#modalCard{position:relative;width:min(680px,96vw);max-height:min(88vh,760px);overflow:auto;border-radius:20px;padding:22px 24px;background:#101e34f7;border:1px solid #7795b055}#modalCard h2{margin:0 0 10px;font-size:24px;color:#f3d99a}#modalCard h3{margin:15px 0 8px;color:#c7e6ff}#modalCard p{color:#becde1;line-height:1.5;font-size:13px}#modalCard label{display:block;color:#bdcde0;font-size:12px;margin:9px 0}#modalCard input,#modalCard select{background:#182b48;color:#fff;border:1px solid #6480a8;border-radius:9px;padding:9px 10px;width:100%;font-size:13px}#modalCard .grid2{display:grid;grid-template-columns:1fr 1fr;gap:12px}#modalCard .grid3{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}#modalCard .actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:14px}#modalCard .actions button{flex:1;min-width:120px}.modal-close{position:absolute;right:14px;top:12px;border:none;background:#223551}#modalContent{padding-right:12px}.list-card{background:#182d49;border:1px solid #6286aa55;border-radius:12px;padding:12px;margin:7px 0}.list-card strong{color:#ffe1a4}.list-card small{display:block;color:#a9c0dd;line-height:1.5;margin-top:5px}.list-card .actions{margin-top:8px}.badge-note{display:inline-flex;border:1px solid #6ba99b;color:#85dfc4;border-radius:18px;padding:2px 9px;font-size:10px;margin-left:6px}.start-screen{position:absolute;inset:0;background:#071124 url('cover_bg.jpg') center center/cover no-repeat;z-index:25;display:flex;align-items:center;justify-content:center;text-align:center;padding:22px;overflow:auto}.start-screen.hidden{display:none}.start-shade{position:absolute;inset:0;background:linear-gradient(90deg,#071021df 0%,#051124a3 50%,#040c2094 100%),linear-gradient(0deg,#061121da,transparent 48%)}.start-content{position:relative;z-index:1;max-width:830px;margin:auto;text-shadow:0 2px 13px #000a}.eyebrow{font-size:12px;color:#ffcf85;letter-spacing:4px;font-weight:800}.start-content h1{font-size:clamp(28px,5vw,60px);font-weight:1000;line-height:1.12;margin:18px 0 18px;letter-spacing:1px}.start-content h1 em{font-style:normal;color:#ffcc81;text-shadow:0 4px 30px #a6532980}.start-content p{font-size:clamp(13px,1.6vw,19px);line-height:1.55;color:#e3edf9}.start-actions{display:flex;justify-content:center;gap:9px;flex-wrap:wrap;margin:18px 0 0}.start-actions .large{min-width:170px;padding:13px 19px;font-size:14px;font-weight:850}.start-actions.secondary{margin-top:9px}.start-actions.secondary button{font-size:12px;padding:10px 13px}.start-footer{color:#bbcad9;font-size:11px;margin-top:32px}.map-legend{display:flex;gap:10px;flex-wrap:wrap;font-size:11px;color:#b7c9db;margin-top:8px}.small-btn{padding:4px 7px!important}.scroll-history{max-height:45vh;overflow:auto}.history-item{border-left:3px solid #c8a46d;padding:6px 10px;margin:8px 0;background:#ffffff07;font-size:12px;color:#c6dbf3}.history-item b{color:#ffe29a}.focus-ring{position:absolute;border:2px solid #fff;pointer-events:none}
@media(max-width:900px){#hud{gap:10px}.hud-title{min-width:130px}.hud-title b{font-size:11px}.hud-stat{min-width:50px}.hud-stat strong{font-size:14px}#rightPanel{width:210px}#notify{max-width:48vw}.tool-hint{display:none}}
@media(max-width:620px){#hud{left:4px;right:4px;top:3px;padding:5px 6px;gap:5px;min-height:45px;border-radius:9px}.hud-title{min-width:0;flex:1;gap:2px}.hud-title b{font-size:10px;letter-spacing:.6px}.hud-title small{font-size:9px;max-width:105px}.logo{font-size:20px}.hud-stat{min-width:0}.hud-stat span{font-size:8px}.hud-stat strong{font-size:11px}.hud-stat.energy{display:none}.hud-controls{gap:3px}.hud-controls button{padding:7px 6px;font-size:11px;border-radius:7px}#leftBar{top:52px;left:4px;width:49px;padding:4px;gap:2px;border-radius:9px}#leftBar button{font-size:16px;padding:5px 1px}#leftBar button span{font-size:8px}#rightPanel{top:53px;right:4px;width:min(214px,61vw);max-height:calc(100% - 196px);padding:9px;font-size:11px}#rightPanel:not(.open){display:none}#notify{top:54px;left:57px;max-width:calc(100vw - 64px);font-size:10px;padding:6px 9px}#bottomBar{left:4px;right:4px;bottom:3px;min-height:124px;padding:6px 7px;border-radius:10px}#toolHeading{margin-bottom:3px}#tools{gap:4px}#tools .tool{min-width:61px;font-size:18px;padding:4px 4px}#tools .tool small{font-size:8px}#tools .tool em{font-size:8px}.bottom-actions{gap:4px;justify-content:space-between}.bottom-actions button{flex:1;padding:6px 2px;font-size:9px;white-space:nowrap}#toast{bottom:146px;font-size:11px;padding:8px 12px}.start-screen{padding:10px}.eyebrow{font-size:9px;letter-spacing:2px}.start-content h1{font-size:clamp(23px,7.5vw,38px);margin:12px 0}.start-content p{font-size:12px}.start-actions{gap:6px;margin-top:12px}.start-actions .large{min-width:125px;padding:10px;font-size:11px}.start-actions.secondary button{padding:7px 8px;font-size:10px}.start-footer{margin-top:18px;font-size:9px}#modal{padding:5px}#modalCard{max-height:92vh;padding:18px 13px;border-radius:12px}#modalCard h2{font-size:20px}#modalCard .grid2,#modalCard .grid3{grid-template-columns:1fr 1fr;gap:6px}#modalContent{padding-right:4px}}
@media(max-height:510px){#hud{top:2px;min-height:39px}.hud-title small{display:none}#leftBar{top:46px;gap:0;padding:2px;width:53px}#leftBar button{padding:3px 1px;font-size:14px}#notify{top:46px}#rightPanel{top:45px;max-height:calc(100% - 143px)}#bottomBar{bottom:2px;min-height:90px;padding:5px 7px}#tools .tool{font-size:15px;padding:2px 3px}#tools .tool small{font-size:9px}#tools .tool em{display:none}.bottom-actions{margin-top:2px}.bottom-actions button{padding:4px 5px}#toast{bottom:110px}.start-content h1{font-size:clamp(22px,4.2vw,37px);margin:10px 0}.start-content p{font-size:12px;margin:6px 0}.start-actions{margin-top:7px}.start-actions .large{padding:8px 12px}.start-actions.secondary button{padding:6px}.start-footer{margin-top:9px}}

#rightPanel:not(.open){display:none}
