/* 0.11: persistent resources, level-gated tech map and stellar projects. */
:root{--resource-hud-height:100px}
.resource-bar{position:sticky;top:0;z-index:20;isolation:isolate;background:#0c1722;box-shadow:0 8px 24px #0006}
.resource-tile{min-width:0;background:#0c1722}
.resource-tile>div{min-width:0}
.resource-value{font-variant-numeric:tabular-nums;white-space:nowrap}
.resource-bar .resource-value{font-size:clamp(12px,1.65vw,22px)}
.resource-bar .resource-rate{overflow-wrap:anywhere}
html{scroll-padding-top:calc(var(--resource-hud-height) + 16px)}
#fleet-panel,.tech-map-panel,.stellar-panel{scroll-margin-top:calc(var(--resource-hud-height) + 16px)}
.tech-header{display:flex;justify-content:space-between;align-items:flex-start;gap:18px;margin-bottom:22px}
.tech-header h2{font-size:21px;margin:0 0 8px}
.tech-header .section-intro{margin:0;max-width:610px}
.tech-goals{display:flex;gap:8px;flex-wrap:wrap;margin:0 0 22px}
.tech-goal{flex:1;min-width:130px;border:1px solid #344838;border-radius:11px;background:linear-gradient(135deg,#142920,#111923);color:var(--text);padding:12px 14px;text-align:left;cursor:pointer}
.tech-goal strong{display:block;font-size:12px;margin:0 0 5px}
.tech-goal span{font-size:10px;color:var(--muted)}
.tech-goal.endgame{border-color:#665538;background:linear-gradient(135deg,#302519,#151b28)}
.tech-legend{display:flex;gap:16px;flex-wrap:wrap;font-size:10px;color:var(--muted);margin:0 0 16px}
.tech-legend span:before{content:'';display:inline-block;width:7px;height:7px;border-radius:50%;background:#42546a;margin-right:6px}
.tech-legend .ready:before{background:#79cdae}.tech-legend .active:before{background:#e9bf73}.tech-legend .learned:before{background:#698fcc}
.tech-map-panel{background:radial-gradient(ellipse at 50% 8%,#11263a 0,transparent 45%),#090f19;border:1px solid var(--line);border-radius:16px;padding:22px 12px 16px;overflow:hidden;margin-bottom:24px}
.tech-map-heading{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:0 10px;margin-bottom:16px}
.tech-map-heading h2{font-size:16px;margin:0}.tech-map-heading .muted{font-size:10px}
.tech-tree-scroll{position:relative;overflow:auto;scrollbar-width:thin;scrollbar-color:#304658 #0b121b}
.tech-tree{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));grid-auto-rows:154px;column-gap:30px;row-gap:66px;position:relative;padding:14px 22px 24px;isolation:isolate}
.tech-links{position:absolute;top:0;left:0;z-index:0;overflow:visible;pointer-events:none}
.tech-edge path{fill:none;stroke:#465168;stroke-width:1.4;stroke-linecap:round;stroke-linejoin:round;opacity:.52}
.tech-edge.met path{stroke:#69b79f;opacity:.75;stroke-width:1.8}
.tech-edge.highlighted path{stroke:#edc67e;stroke-width:2.5;opacity:1}
.tech-node{position:relative;z-index:1;display:flex;flex-direction:column;align-items:stretch;justify-content:flex-start;width:100%;min-width:0;border:1px solid #2c3a4b;border-radius:11px;padding:12px;color:#acbace;text-align:left;background:linear-gradient(150deg,#172333,#0e1622);cursor:pointer;box-shadow:0 5px 18px #0005;transition:border-color .15s,box-shadow .15s}
.tech-node:hover,.tech-node:focus-visible{outline:2px solid #d8b675;outline-offset:3px;border-color:#d8b675}
.tech-node.ready{border-color:#4b9e85;background:linear-gradient(145deg,#1b342b,#0f1b24);color:#e5eee8}
.tech-node.learned,.tech-node.complete{border-color:#597cac;color:#dce7f5}
.tech-node.active{border-color:#bca164;box-shadow:0 0 18px #d4b16922;color:#ffe0a1}
.tech-node.endgame{border-color:#68513a;background:linear-gradient(145deg,#2b2430,#151a29)}
.tech-node-head{display:flex;align-items:center;justify-content:space-between;gap:6px;min-height:30px;margin-bottom:9px}
.tech-node-art{width:32px;height:30px;object-fit:cover;border-radius:6px;opacity:.8}
.tech-node-level{color:#bdd0d9;background:#0a101aaa;border:1px solid #354358;border-radius:6px;padding:3px 6px;font-size:10px;white-space:nowrap}
.tech-node-title{display:block;font-size:13px;line-height:1.35;overflow-wrap:anywhere;font-weight:600}
.tech-node-status{font-size:9px;color:#8aa9a2;display:block;margin-top:7px}.tech-node.active .tech-node-status{color:#e7bf75}.tech-node.locked .tech-node-status{color:#919cab}
.tech-node-unlock{font-size:9px;color:#dfc083;margin-top:auto;padding-top:6px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.tech-map-note{margin:14px 10px 0;font-size:10px;line-height:1.7;color:var(--muted)}
.research-dialog{width:calc(100% - 30px);max-width:700px;max-height:calc(100dvh - 40px);padding:28px;overflow:auto;scroll-padding-top:12px}
.research-dialog h2{padding-right:34px;margin-bottom:12px}
.research-dialog .project-description{font-size:13px;line-height:1.8;min-height:0}
.research-dialog .dialog-close{position:absolute;right:14px;top:14px}
.research-levels{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin:20px 0}
.research-levels>div{background:#0b1420;border:1px solid #2c3c4e;border-radius:10px;padding:14px}
.research-levels span{font-size:10px;display:block;color:var(--muted);margin-bottom:6px}
.research-levels strong{font-size:13px;font-weight:500;line-height:1.6}
.research-levels .next{border-color:#426052;background:#12241f}
.requirements-list{display:flex;flex-wrap:wrap;gap:6px;margin:12px 0}
.requirement{display:inline-flex;align-items:center;gap:5px;border:1px solid #534043;border-radius:7px;padding:6px 8px;font:inherit;font-size:10px;line-height:1.5;color:#d0a3a3;background:#241a2066;text-align:left}
.requirement.met{color:#a5cebb;border-color:#344f45;background:#18312566}
button.requirement{cursor:pointer}button.requirement:hover,button.requirement:focus-visible{border-color:#d7b77e;outline:1px solid #d7b77e}
.requirement .req-level{white-space:nowrap;opacity:.8}
.research-dialog h3,.ship-requirements h3{font-size:13px;margin:22px 0 9px}
.tech-unlocks{display:flex;flex-direction:column;gap:7px}
.tech-unlock{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 12px;background:#0a1420;border:1px solid #253748;border-radius:8px;color:#cbdbe7;text-align:left;font:inherit;font-size:12px}
button.tech-unlock{cursor:pointer}.tech-unlock small{display:block;font-size:9px;color:var(--muted);margin-top:4px}.tech-unlock>.level{white-space:nowrap;font-size:10px}
.research-dialog .dialog-project-action{display:flex;gap:12px;align-items:center;flex-wrap:wrap;margin-top:20px}
.research-dialog .cost-list{margin-top:20px}.research-dialog .project-reason{font-size:12px;line-height:1.6;margin-top:14px}
.ship-tier{display:inline-block;font-size:9px;letter-spacing:.06em;text-transform:uppercase;padding:5px 8px;margin-bottom:10px;border-radius:6px;border:1px solid #405e69;color:#b1d1df;background:#16344566}
.ship-tier.signature{color:#dcc4f3;border-color:#795c9d;background:#36214888}.ship-tier.endgame{color:#efcb81;border-color:#8d713f;background:#3a2a1588}
.ship-stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px 8px;padding:14px 0;margin:0 0 6px;border-top:1px solid var(--line);border-bottom:1px solid var(--line)}
.ship-stats div{min-width:0}.ship-stats dt{font-size:9px;color:var(--muted);margin-bottom:5px}.ship-stats dd{margin:0;color:#dbe6ed;font-size:13px;overflow-wrap:anywhere;font-variant-numeric:tabular-nums}
.ship-requirements h3{margin-top:14px;font-size:10px;text-transform:uppercase;color:var(--muted)}
.ship-requirements .requirements-list{margin-bottom:0}.ship-requirements .requirement{font-size:9px;padding:4px 6px}
.ship-special{font-size:11px;line-height:1.7;color:#cfb4ef;margin:12px 0}
.stellar-hero{border:1px solid #705a33;border-radius:16px;background:radial-gradient(ellipse at 85% 40%,#8f642833,transparent 60%),linear-gradient(120deg,#171a29,#292016);padding:28px;margin-bottom:23px}
.stellar-hero h2{font-size:27px;margin:10px 0}.stellar-hero p{font-size:12px;color:#bdc6d1;line-height:1.8;max-width:720px}
.stellar-path{display:flex;gap:9px;flex-wrap:wrap;margin-top:22px}.stellar-step{border:1px solid #4b4542;border-radius:9px;color:#a89b88;padding:9px 12px;font-size:11px}.stellar-step.done{color:#9cd4b8;border-color:#417b59;background:#23413455}
.stellar-metrics{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:13px;margin:21px 0 0}.stellar-metrics>div{min-width:0;padding:12px;background:#090d16aa;border:1px solid #413b35;border-radius:9px}.stellar-metrics dt{font-size:9px;color:var(--muted);margin-bottom:8px}.stellar-metrics dd{font-size:16px;color:#e8d4a8;margin:0;overflow-wrap:anywhere}
.stellar-grid{display:grid;grid-template-columns:1fr 1fr;gap:20px}.stellar-grid>.panel{min-width:0}.stellar-grid h2{font-size:20px;margin:0 0 10px}.stellar-grid .section-intro{font-size:12px}
.stellar-status{font-size:11px;color:#d1bc84;margin:12px 0}.stellar-panel .cost-list{flex-wrap:wrap}.stellar-panel .button{margin-top:12px}.stellar-panel .project-reason{font-size:11px}
.tunnel-controls{margin-top:20px}.tunnel-controls label{font-size:11px}.tunnel-controls .form-actions{margin-top:12px}.tunnel-window{border:1px solid #476a75;background:#132631;border-radius:11px;padding:18px;margin-top:18px}.tunnel-window h3{font-size:16px}.tunnel-window p{font-size:11px;line-height:1.8;color:var(--muted)}
@media(max-width:1150px){.tech-tree{column-gap:25px;padding-left:17px;padding-right:17px}.tech-node{padding:10px}.tech-node-title{font-size:12px}.stellar-metrics{grid-template-columns:1fr 1fr}}
@media(max-width:700px){.tech-header{flex-direction:column;gap:12px}.tech-header h2{font-size:19px}.stellar-grid{grid-template-columns:1fr}.stellar-hero{padding:20px}.stellar-hero h2{font-size:22px}}
@media(max-width:620px){.resource-tile{padding:10px 6px}.resource-bar .resource-value{font-size:12px;letter-spacing:-.03em}.resource-rate{font-size:7px;line-height:1.5}.resource-label{font-size:7px}.tech-goals{gap:6px}.tech-goal{min-width:calc(50% - 6px);padding:10px}.tech-goal strong{font-size:11px}.tech-goal span{font-size:9px}.tech-legend{gap:10px;font-size:9px}.tech-map-panel{padding:16px 3px 12px;margin-left:-7px;margin-right:-7px;border-radius:12px}.tech-map-heading{padding:0 8px}.tech-map-heading h2{font-size:14px}.tech-map-heading .muted{font-size:8px}.tech-tree{grid-auto-rows:155px;column-gap:15px;row-gap:61px;padding:10px 9px 22px}.tech-node{padding:9px 6px;border-radius:8px}.tech-node-title{font-size:10px;line-height:1.4}.tech-node-head{flex-direction:column;align-items:flex-start;gap:5px;margin-bottom:7px}.tech-node-art{width:25px;height:23px}.tech-node-level{font-size:8px;padding:2px 4px}.tech-node-status{font-size:8px;margin-top:5px}.tech-node-unlock{font-size:8px}.tech-map-note{font-size:9px}.research-dialog{padding:23px 18px;max-height:calc(100dvh - 24px)}.research-dialog h2{font-size:20px}.research-levels{gap:8px}.research-levels>div{padding:10px}.research-levels strong{font-size:11px}.research-dialog .requirement{font-size:10px}.research-dialog .dialog-project-action .button{width:100%}.stellar-metrics dd{font-size:14px}.stellar-path{gap:6px}.stellar-step{font-size:10px;padding:8px}.ship-stats dd{font-size:13px}}
