@font-face{font-family:'Chakra Petch';font-style:normal;font-weight:400;font-display:swap;src:url(assets/fonts/8e128f6f4e4be277.woff2) format('woff2')}
@font-face{font-family:'Chakra Petch';font-style:normal;font-weight:600;font-display:swap;src:url(assets/fonts/0fe8a7eb7177aed6.woff2) format('woff2')}
@font-face{font-family:'Chakra Petch';font-style:normal;font-weight:700;font-display:swap;src:url(assets/fonts/0f64b4015ce9869c.woff2) format('woff2')}
@font-face{font-family:'Barlow Semi Condensed';font-style:normal;font-weight:400;font-display:swap;src:url(assets/fonts/044146ee54ce6982.woff2) format('woff2')}
@font-face{font-family:'Barlow Semi Condensed';font-style:normal;font-weight:500;font-display:swap;src:url(assets/fonts/77182ec76d867335.woff2) format('woff2')}
@font-face{font-family:'Barlow Semi Condensed';font-style:normal;font-weight:600;font-display:swap;src:url(assets/fonts/fa86672088f4b988.woff2) format('woff2')}
@font-face{font-family:'Barlow Semi Condensed';font-style:normal;font-weight:700;font-display:swap;src:url(assets/fonts/8c76b5ca46901d8c.woff2) format('woff2')}
@font-face{font-family:'Martian Mono';font-style:normal;font-weight:100 800;font-display:swap;src:url(assets/fonts/c2f442b7b6044fdb.woff2) format('woff2')}

:root{
  --ink:#070B12;
  --steel:#16202E;
  --steel-2:#0d151f;
  --powder:#2E7DFF;
  --cyan:#33E0FF;
  --violet:#7B3BFF;
  --violet-hot:#b56bff;
  --amber:#FFB020;
  --gold:#FFC94A;
  --white:#E8F1FF;
  --muted:#8ea5bd;
  --line:#2a3b4f;
  --line-hot:#3f5b76;
  --display:'Chakra Petch',sans-serif;
  --body:'Barlow Semi Condensed',sans-serif;
  --mono:'Martian Mono',monospace;
}
*{box-sizing:border-box}
html,body{height:100%;margin:0;background:var(--ink);color:var(--white);font-family:var(--body);overflow:hidden}
body{-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;user-select:none;-webkit-user-select:none;touch-action:none}
canvas{display:block;width:100%;height:100%}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.hidden{display:none!important}
.mono{font-family:var(--mono);font-variant-numeric:tabular-nums;letter-spacing:-.04em}
.micro{font-family:var(--body);font-weight:600;font-size:10px;line-height:1;letter-spacing:.2em;text-transform:uppercase;color:var(--muted);white-space:nowrap}
kbd{font-family:var(--body);font-weight:700;font-size:11px;line-height:1;color:var(--white);background:linear-gradient(#1b2839,#0d141d);border:1px solid #3b5069;border-bottom-color:#060a10;border-radius:3px;padding:4px 6px;box-shadow:0 1px 0 #000;display:inline-block;min-width:18px;text-align:center}
.sep{color:#4d6580;padding:0 6px}

/* ================= WORLD LAYERS ================= */
#stage{position:fixed;inset:0;background:#04070c}
#grade{position:absolute;inset:0;pointer-events:none;background:
  radial-gradient(120% 80% at 50% 44%, rgba(46,125,255,.05), transparent 60%),
  linear-gradient(180deg, rgba(3,6,11,.18), transparent 22%, transparent 72%, rgba(3,6,11,.55));mix-blend-mode:normal}
#vignette{position:absolute;inset:0;pointer-events:none;box-shadow:inset 0 0 180px 40px rgba(0,0,0,.82), inset 0 0 40px rgba(0,0,0,.6)}
#flash{position:absolute;inset:0;pointer-events:none;background:radial-gradient(circle at 50% 56%,rgba(165,110,255,.55),rgba(123,59,255,.18) 45%,transparent 70%);opacity:0;transition:opacity .22s ease}
#flash.on{opacity:1;transition:opacity .03s ease}
#hurt{position:absolute;inset:0;pointer-events:none;background:radial-gradient(circle at 50% 50%,transparent 48%,rgba(255,58,40,.45) 100%);opacity:0;transition:opacity .4s ease}
#hurt.on{opacity:1;transition:opacity .05s ease}

/* ================= START SCREEN ================= */
.screen{position:fixed;inset:0;display:flex;flex-direction:column;justify-content:space-between;padding:22px 34px 20px;z-index:20;pointer-events:none;background:
  linear-gradient(180deg,rgba(4,7,12,.88) 0%,rgba(4,7,12,.5) 26%,rgba(4,7,12,.06) 48%,rgba(4,7,12,.52) 78%,rgba(4,7,12,.92) 100%),
  radial-gradient(90% 70% at 50% 60%,transparent 40%,rgba(4,7,12,.55) 100%)}
.screen.fade-out{opacity:0;transition:opacity .55s ease}
.start-top{display:flex;justify-content:center}
.station-tag{font-family:var(--body);font-weight:600;font-size:11px;letter-spacing:.24em;color:#adc0d4;display:flex;align-items:center;gap:6px;padding:8px 16px;border:1px solid rgba(63,91,118,.6);background:linear-gradient(180deg,rgba(13,21,31,.82),rgba(7,11,18,.82));clip-path:polygon(10px 0,calc(100% - 10px) 0,100% 10px,100% 100%,0 100%,0 10px)}
.station-tag .dot{width:6px;height:6px;background:var(--amber);box-shadow:0 0 10px var(--amber);transform:rotate(45deg);margin-right:3px}
.start-mid{display:flex;flex-direction:column;align-items:center;text-align:center;margin-top:-3vh}
#title-art{width:min(780px,86vw);max-height:31vh;object-fit:contain;filter:drop-shadow(0 0 26px rgba(51,224,255,.18)) drop-shadow(0 18px 40px rgba(0,0,0,.8));image-rendering:auto}
.start-sub{font-family:var(--body);font-weight:500;font-size:clamp(11px,1.4vw,15px);letter-spacing:.16em;text-transform:uppercase;color:#a9bed3;margin:14px 0 24px}
.deploy{pointer-events:auto;cursor:pointer;position:relative;font-family:var(--display);text-align:left;color:var(--white);background:linear-gradient(180deg,#16263a 0%,#0b1420 56%,#091019 100%);border:1px solid #3a5672;border-top-color:#5d82a6;padding:12px 72px 14px 24px;min-width:min(430px,84vw);clip-path:polygon(0 0,calc(100% - 18px) 0,100% 18px,100% 100%,18px 100%,0 calc(100% - 18px));box-shadow:0 0 0 1px rgba(0,0,0,.6),0 18px 44px rgba(0,0,0,.55),inset 0 0 30px rgba(46,125,255,.12);transition:transform .12s ease,box-shadow .18s ease,background .18s ease}
.deploy::before{content:"";position:absolute;left:0;right:0;bottom:0;height:3px;background:repeating-linear-gradient(115deg,var(--amber) 0 12px,#1a1204 12px 24px);opacity:.9}
.deploy:disabled{opacity:.72;cursor:wait;transform:none;box-shadow:0 0 0 1px rgba(0,0,0,.6),0 18px 44px rgba(0,0,0,.55)}
.deploy:hover:not(:disabled),.deploy:focus-visible{outline:none;transform:translateY(-1px);background:linear-gradient(180deg,#1d3450 0%,#0e1a28 56%,#0b131d 100%);box-shadow:0 0 0 1px rgba(51,224,255,.3),0 0 38px rgba(51,224,255,.22),0 20px 50px rgba(0,0,0,.6),inset 0 0 40px rgba(51,224,255,.14)}
.deploy-kicker{display:block;font-family:var(--body);font-weight:600;font-size:10px;letter-spacing:.26em;color:var(--cyan);margin-bottom:3px}
.deploy-main{display:block;font-size:clamp(18px,2.6vw,26px);font-weight:700;letter-spacing:.06em}
.deploy-arrow{position:absolute;right:24px;top:50%;transform:translateY(-50%);font-size:26px;color:var(--cyan);text-shadow:0 0 12px rgba(51,224,255,.7)}
.start-hint{margin:10px 0 0;font-size:12px;letter-spacing:.14em;color:#6f879e;text-transform:uppercase}
.start-bottom{display:flex;flex-direction:column;align-items:center;gap:10px}
.controls-strip{display:flex;flex-wrap:wrap;justify-content:center;gap:8px 22px;padding:10px 20px;border-top:1px solid rgba(63,91,118,.55);border-bottom:1px solid rgba(63,91,118,.35);background:linear-gradient(180deg,rgba(7,11,18,.5),rgba(7,11,18,.75));pointer-events:auto}
.ctrl{display:flex;align-items:center;gap:5px;font-family:var(--body);font-size:11px;letter-spacing:.12em;text-transform:uppercase;color:#93a9bf}
.ctrl span{margin-left:5px;color:#b7c8d9}
.start-legal{font-family:var(--body);font-size:9px;letter-spacing:.24em;color:#53708d;text-align:center}
.touch-hint{display:none;font-family:var(--body);font-size:10px;letter-spacing:.16em;color:#9fb6cb;text-align:center;padding:6px 10px;border:1px solid rgba(63,91,118,.45);background:rgba(7,11,18,.55)}
body.touch .touch-hint{display:block}
.icon-btn{pointer-events:auto;cursor:pointer;font-family:var(--mono);font-size:11px;font-weight:600;color:#b9cde1;background:linear-gradient(180deg,#142131,#0a111a);border:1px solid #344a61;padding:8px 10px;min-width:38px;line-height:1;clip-path:polygon(6px 0,100% 0,100% calc(100% - 6px),calc(100% - 6px) 100%,0 100%,0 6px);transition:all .15s ease}
.icon-btn:hover{border-color:var(--cyan);color:var(--white);box-shadow:0 0 16px rgba(51,224,255,.18)}
.sound-btn{position:absolute;right:26px;top:20px;z-index:3;pointer-events:auto}
.sound-btn .snd-on{display:inline}
.sound-btn .snd-off{display:none}
body.muted .sound-btn .snd-on{display:none}
body.muted .sound-btn .snd-off{display:inline}
#btn-sound-help .snd-off{display:none}
body.muted #btn-sound-help .snd-on{display:none}
body.muted #btn-sound-help .snd-off{display:inline}

/* ================= HUD ================= */
#hud{position:fixed;inset:0;z-index:10;pointer-events:none;font-family:var(--body);opacity:0;transition:opacity .5s ease}
#hud.on{opacity:1}
.hud-col{position:absolute;display:flex;flex-direction:column;gap:7px}
.hud-tl{left:18px;top:16px;width:clamp(226px,23vw,330px)}
.hud-tr{position:absolute;right:18px;top:16px;align-items:flex-end}
.hud-bl{position:absolute;left:18px;bottom:18px}
.hud-bc{position:absolute;left:50%;bottom:16px;transform:translateX(-50%)}
.hud-br{position:absolute;right:18px;bottom:18px;align-items:flex-end}
.plate{position:relative;background:linear-gradient(180deg,rgba(20,32,47,.96),rgba(8,13,20,.97));border:1px solid #2c4056;border-left-color:#3d5873;box-shadow:0 10px 26px rgba(0,0,0,.5),inset 0 1px 0 rgba(255,255,255,.05),inset 0 0 24px rgba(40,90,150,.06);clip-path:polygon(0 0,calc(100% - 9px) 0,100% 9px,100% 100%,9px 100%,0 calc(100% - 9px))}
.plate::before{content:"";position:absolute;left:8px;top:6px;width:26px;height:2px;background:var(--amber);opacity:.9;box-shadow:0 0 8px rgba(255,176,32,.35)}
.plate-rule{position:absolute;right:7px;bottom:6px;width:34px;height:2px;background:repeating-linear-gradient(90deg,#405a73 0 3px,transparent 3px 6px)}
.level-craft{display:flex;align-items:center;gap:5px;margin-left:auto;padding-left:8px;border-left:1px solid #2c4056}
.level-craft img{width:19px;height:19px;object-fit:contain;filter:drop-shadow(0 0 6px rgba(51,224,255,.28))}
.level-craft>div{display:flex;flex-direction:column;align-items:flex-start;gap:2px}
.level-craft .micro{font-size:8px;letter-spacing:.14em}
.level-craft b{font-size:15px;color:var(--cyan);line-height:1}
.level-plate{display:flex;align-items:center;gap:9px;padding:7px 10px 7px 8px}
.hud-icon{width:30px;height:30px;object-fit:contain;flex:none;filter:drop-shadow(0 0 8px rgba(51,224,255,.22))}
.hud-icon.small{width:26px;height:26px}
.hud-icon.tiny{width:20px;height:20px}
.plate-body{flex:1;min-width:0}
.level-line{display:flex;align-items:baseline;gap:9px;margin-top:2px}
.level-line b{font-size:20px;font-weight:600;color:var(--white);text-shadow:0 0 14px rgba(51,224,255,.24)}
.level-line span{font-family:var(--display);font-weight:600;font-size:10px;letter-spacing:.18em;color:#a9bed2;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.objective-plate,.reactor-plate{display:flex;align-items:center;gap:8px;padding:6px 9px 7px 8px}
.objective-line{display:flex;align-items:baseline;justify-content:space-between;gap:8px;margin-top:3px}
.objective-line span{font-family:var(--display);font-size:11px;font-weight:600;letter-spacing:.05em;color:#d3e2f1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.objective-line b{font-size:10px;color:var(--cyan);white-space:nowrap}
.thin-bar{height:4px;background:#0a121b;border:1px solid #253849;margin-top:4px;overflow:hidden}
.thin-bar i{display:block;height:100%;width:0%;background:linear-gradient(90deg,#1f7fe6,var(--cyan));box-shadow:0 0 10px rgba(51,224,255,.6);transition:width .25s ease}
.thin-bar.violet i{background:linear-gradient(90deg,#5a20d8,var(--violet-hot));box-shadow:0 0 10px rgba(123,59,255,.7)}
.mini-row{display:flex;gap:8px}
.mini-plate{display:flex;align-items:center;gap:7px;padding:6px 10px;flex:1}
.mini-plate b{font-size:15px;color:var(--white);margin-left:auto}
.coin-plate{display:flex;align-items:center;gap:5px;padding:3px 12px 4px 3px;min-width:138px;border-right:2px solid rgba(255,201,74,.55)}
#hud-coin-token{width:46px;height:46px;object-fit:contain;margin-right:2px;filter:drop-shadow(0 0 14px rgba(255,201,74,.4));animation:coinspin 6s linear infinite}
@keyframes coinspin{0%,100%{transform:rotate(-7deg) scale(1)}50%{transform:rotate(7deg) scale(1.04)}}
.coin-body{display:flex;flex-direction:column;align-items:flex-start}
.coin-body b{font-size:23px;font-weight:600;color:var(--gold);text-shadow:0 0 18px rgba(255,201,74,.35);line-height:1.1}
.hud-tr-buttons{display:flex;gap:6px}
.hud-tr-buttons .sound-btn{position:static;right:auto;top:auto}
.bay-nav{margin-top:6px;width:186px;padding:6px 8px 7px;background:linear-gradient(180deg,rgba(17,28,41,.94),rgba(6,11,18,.95));border:1px solid #2c4056;border-top-color:#3f5b76;clip-path:polygon(0 0,calc(100% - 8px) 0,100% 8px,100% 100%,8px 100%,0 calc(100% - 8px));box-shadow:0 8px 22px rgba(0,0,0,.45);display:flex;flex-direction:column;gap:2px}
.bay-nav-title{font-family:var(--mono);font-size:8px;letter-spacing:.2em;color:#7f97ae;padding:0 0 4px;margin-bottom:2px;border-bottom:1px solid #213447}
.bay-row{display:flex;align-items:center;gap:6px;padding:2px 0;font-family:var(--display);font-weight:600;font-size:10px;letter-spacing:.14em;color:#c3d6e8}
.bay-name{flex:1;white-space:nowrap}
.bay-dist{font-family:var(--mono);font-size:9px;font-weight:500;color:#8ea8bf;min-width:26px;text-align:right}
.bay-arrow{display:inline-block;width:0;height:0;border-left:5px solid transparent;border-right:5px solid transparent;border-bottom:9px solid currentColor;transform-origin:50% 65%;transition:transform .1s linear;opacity:.95}
.bay-row[data-bay="forge"]{color:#7fe9ff}.bay-row[data-bay="forge"] .bay-arrow{color:var(--cyan)}
.bay-row[data-bay="arena"]{color:#ffd27a}.bay-row[data-bay="arena"] .bay-arrow{color:var(--amber)}
.bay-row[data-bay="reactor"]{color:#c9a4ff}.bay-row[data-bay="reactor"] .bay-arrow{color:#b56bff}
.health-plate{display:flex;align-items:center;gap:8px;padding:7px 10px 7px 8px;min-width:226px}
.health-body{flex:1}
.health-cells{display:flex;gap:3px;margin-top:5px}
.hcell{width:31px;height:14px;background:linear-gradient(180deg,#10202c,#0a1118);border:1px solid #31485e;transform:skewX(-12deg);transition:background .2s ease,box-shadow .2s ease}
.hcell.on{background:linear-gradient(180deg,#8ef4ff,#25c8ee 56%,#0b85b8);border-color:#8beeff;box-shadow:0 0 11px rgba(51,224,255,.5),inset 0 0 6px rgba(255,255,255,.4)}
.hcell.low.on{background:linear-gradient(180deg,#ffd478,#ff9d1a 56%,#9c4a00);border-color:#ffc357;box-shadow:0 0 11px rgba(255,176,32,.5)}
.weapon-slots{display:flex;gap:7px;pointer-events:auto}
.wslot{position:relative;width:150px;height:50px;background:linear-gradient(180deg,rgba(18,29,42,.94),rgba(8,13,20,.96));border:1px solid #2b3f55;clip-path:polygon(0 0,calc(100% - 10px) 0,100% 10px,100% 100%,0 100%);display:flex;align-items:center;padding:5px 8px;overflow:hidden}
.wslot-art{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;opacity:.16;filter:saturate(.55)}
.wslot-key{position:absolute;left:6px;top:6px;font-size:9px;color:#8ca4bb;z-index:2}
.wslot-text{display:flex;flex-direction:column;gap:2px;margin-left:13px;padding-right:40px;z-index:1}
.wslot-gun{position:absolute;right:8px;top:50%;transform:translateY(-50%);width:38px;height:13px;fill:#cfe6f7;opacity:.9;filter:drop-shadow(0 0 6px rgba(51,224,255,.5));z-index:1}
.wslot-lock{position:absolute;right:11px;top:50%;transform:translateY(-50%);width:12px;height:15px;fill:#728ba1;opacity:.75;z-index:1}
.wslot-label{font-size:7px;letter-spacing:.16em;color:#7f97ae}
.wslot-name{font-family:var(--display);font-weight:600;font-size:13px;letter-spacing:.04em;color:#cfdeec;white-space:nowrap}
.wslot.active .wslot-art{opacity:.26}
.wslot.active{border-color:rgba(51,224,255,.7);box-shadow:0 0 24px rgba(51,224,255,.14),inset 0 0 24px rgba(51,224,255,.09)}
.wslot.active::after{content:"";position:absolute;left:0;bottom:0;width:100%;height:2px;background:linear-gradient(90deg,transparent,var(--cyan),transparent)}
.wslot.active .wslot-name{color:var(--white)}
.wslot.locked{opacity:.46}
.dash-btn{pointer-events:auto;cursor:pointer;position:relative;width:78px;height:64px;background:linear-gradient(180deg,#142131,#0a1119);border:1px solid #344b62;clip-path:polygon(10px 0,100% 0,100% calc(100% - 10px),calc(100% - 10px) 100%,0 100%,0 10px);color:#c3d6e7;font-family:var(--body);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;overflow:hidden}
.dash-btn:hover{border-color:var(--violet-hot);box-shadow:0 0 20px rgba(123,59,255,.2)}
.dash-glyph{position:relative;display:block;width:20px;height:9px;margin-bottom:1px;color:var(--amber)}
.dash-glyph::before,.dash-glyph::after{content:'';position:absolute;top:0;width:7px;height:7px;border-top:2px solid var(--amber);border-right:2px solid var(--amber);transform:rotate(45deg);opacity:.9}
.dash-glyph::before{left:1px}
.dash-glyph::after{left:9px}
.dash-key{font-size:8px;letter-spacing:.16em;color:#6f879e}
.dash-label{font-family:var(--display);font-size:13px;font-weight:700;letter-spacing:.12em}
#dash-fill{position:absolute;left:0;bottom:0;height:3px;width:100%;background:linear-gradient(90deg,var(--violet),#c69bff);transform-origin:left;transform:scaleX(1)}
.weapon-slots+.interact{margin-top:8px}
#interact{position:absolute;left:50%;bottom:86px;transform:translateX(-50%);display:flex;align-items:center;gap:10px;padding:7px 12px 7px 7px;background:linear-gradient(180deg,rgba(16,26,39,.97),rgba(7,11,18,.97));border:1px solid #3f5872;clip-path:polygon(8px 0,100% 0,100% calc(100% - 8px),calc(100% - 8px) 100%,0 100%,0 8px);pointer-events:none;box-shadow:0 10px 26px rgba(0,0,0,.55);animation:promptIn .18s ease}
@keyframes promptIn{from{opacity:0;transform:translate(-50%,6px)}to{opacity:1;transform:translate(-50%,0)}}
#interact img{width:28px;height:28px;object-fit:contain}
#interact>div{display:flex;flex-direction:column;gap:3px}
#interact span:last-child{font-family:var(--display);font-weight:600;font-size:12px;letter-spacing:.05em;color:#e3eef9;white-space:nowrap}
#interact kbd{background:linear-gradient(#26384c,#111c28);border-color:#5d7d9c;color:var(--cyan);font-size:12px;padding:6px 8px}
#interact .micro{color:var(--amber)}
.banner{position:absolute;left:50%;top:4%;transform:translate(-50%,-8px);display:flex;max-width:92vw;flex-direction:column;align-items:center;gap:5px;opacity:0;pointer-events:none;text-align:center;transition:opacity .35s ease,transform .35s ease}
.banner.show{opacity:1;transform:translate(-50%,0)}
.banner span#banner-kicker{font-family:var(--mono);font-size:9px;letter-spacing:.22em;color:var(--amber);padding:4px 12px;border-top:1px solid rgba(255,176,32,.5);border-bottom:1px solid rgba(255,176,32,.5);background:rgba(8,13,20,.6)}
.banner strong{font-family:var(--display);font-weight:700;font-size:clamp(15px,2.1vw,26px);letter-spacing:.08em;color:var(--white);text-shadow:0 0 24px rgba(51,224,255,.3),0 4px 18px rgba(0,0,0,.8)}
.banner span#banner-sub{font-size:10px;letter-spacing:.15em;text-transform:uppercase;color:#a7bdd2}
.toast{position:absolute;left:50%;bottom:160px;transform:translateX(-50%);padding:8px 16px;background:rgba(8,13,20,.94);border:1px solid #3a526a;border-left:3px solid var(--amber);font-family:var(--display);font-size:12px;letter-spacing:.08em;color:#dbe8f4;opacity:0;pointer-events:none;transition:opacity .25s ease;white-space:nowrap;max-width:90vw;overflow:hidden;text-overflow:ellipsis}
.toast.show{opacity:1}

/* ================= TOUCH ================= */
#touch{position:fixed;inset:0;z-index:9;pointer-events:none}
body.touch .hud-br{display:none!important}
.stick{position:absolute;left:22px;bottom:96px;width:118px;height:118px;border-radius:50%;border:1px solid rgba(80,120,160,.45);background:radial-gradient(circle,rgba(20,34,50,.5),rgba(7,11,18,.18) 70%);pointer-events:auto;touch-action:none}
.stick-ring{position:absolute;inset:28px;border-radius:50%;border:1px dashed rgba(90,135,175,.4)}
.stick-nub{position:absolute;left:50%;top:50%;width:46px;height:46px;margin:-23px 0 0 -23px;border-radius:50%;background:radial-gradient(circle at 38% 32%,#3d6688,#152536 68%,#0a121a);border:1px solid #5d87a9;box-shadow:0 0 16px rgba(51,224,255,.18),inset 0 1px 3px rgba(255,255,255,.2)}
.touch-btn{position:absolute;pointer-events:auto;font-family:var(--display);font-weight:700;letter-spacing:.1em;color:#dcebf7;background:linear-gradient(180deg,rgba(24,40,58,.9),rgba(8,14,22,.9));border:1px solid #3e5a74;clip-path:polygon(10px 0,100% 0,100% calc(100% - 10px),calc(100% - 10px) 100%,0 100%,0 10px);touch-action:none}
.touch-dash{right:22px;bottom:96px;width:86px;height:70px;font-size:14px}
.touch-interact{right:118px;bottom:168px;width:50px;height:44px;font-size:15px;color:var(--cyan);border-color:#4c7b93}
.touch-btn:active{background:linear-gradient(180deg,#2c4d6f,#12202e);border-color:var(--cyan)}

/* ================= PANELS ================= */
.panel-wrap{position:fixed;inset:0;z-index:40;display:flex;align-items:center;justify-content:center;padding:24px}
.panel-back{position:absolute;inset:0;background:rgba(2,5,9,.72);backdrop-filter:blur(2px)}
.panel{position:relative;width:min(760px,94vw);max-height:88vh;overflow:auto;background:
  linear-gradient(180deg,rgba(19,30,44,.99),rgba(7,11,18,.99));border:1px solid #334a61;box-shadow:0 30px 90px rgba(0,0,0,.75),inset 0 0 70px rgba(46,125,255,.05);clip-path:polygon(0 0,calc(100% - 20px) 0,100% 20px,100% 100%,20px 100%,0 calc(100% - 20px));padding:18px 20px 16px;animation:panelIn .22s ease}
@keyframes panelIn{from{opacity:0;transform:translateY(10px) scale(.985)}to{opacity:1;transform:none}}
.panel::before{content:"";position:absolute;left:0;top:0;width:100%;height:3px;background:repeating-linear-gradient(115deg,var(--amber) 0 14px,#191204 14px 28px);opacity:.9}
.panel-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;padding-bottom:12px;border-bottom:1px solid #283c50}
.panel-head h2{font-family:var(--display);font-weight:700;font-size:clamp(20px,2.5vw,28px);letter-spacing:.06em;margin:3px 0 0;color:var(--white)}
.panel-body{padding:14px 0 4px}
.panel-foot{display:flex;align-items:center;justify-content:space-between;gap:12px;padding-top:12px;margin-top:12px;border-top:1px solid #283c50;font-size:10px;letter-spacing:.18em;text-transform:uppercase;color:#7089a1}
.small-btn{cursor:pointer;font-family:var(--display);font-weight:600;letter-spacing:.08em;font-size:11px;color:#d8e8f6;background:linear-gradient(180deg,#1b2c40,#0c141e);border:1px solid #3c566f;padding:8px 12px;clip-path:polygon(6px 0,100% 0,100% calc(100% - 6px),calc(100% - 6px) 100%,0 100%,0 6px)}
.small-btn:hover{border-color:var(--cyan);color:#fff}
.sys-note{border-left:3px solid var(--amber);padding:8px 12px;background:rgba(255,176,32,.06);font-size:12px;line-height:1.45;color:#c8d7e6;margin:0 0 14px}
.sys-note b{color:var(--amber);font-weight:600;letter-spacing:.06em}
.holo-img{width:100%;display:block;margin:0 auto 14px;max-height:190px;object-fit:contain;filter:drop-shadow(0 0 22px rgba(51,224,255,.25));opacity:.94}
.stat-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:12px 0}
.stat{border:1px solid #2a4056;background:rgba(10,17,26,.7);padding:8px 10px}
.stat span{display:block;font-size:9px;letter-spacing:.18em;text-transform:uppercase;color:#7e98af;margin-bottom:3px}
.stat b{font-family:var(--mono);font-size:12px;color:#dceaf7;font-weight:500}
.rarity-list{display:flex;flex-direction:column;gap:3px;margin-top:6px}
.rarity-row{display:flex;align-items:center;gap:8px;font-family:var(--body);font-size:11px;letter-spacing:.06em;padding:4px 6px;background:rgba(8,13,20,.55);border-left:3px solid var(--rc,#8090a0)}
.rarity-row .swatch{width:8px;height:8px;background:var(--rc);box-shadow:0 0 8px var(--rc)}
.rarity-row .pct{margin-left:auto;font-family:var(--mono);font-size:10px;color:#a9bfd3}
.slot-grid{display:grid;grid-template-columns:repeat(6,1fr);gap:6px;margin:12px 0}
.slot-cell{aspect-ratio:1;border:1px solid #2a4056;background:linear-gradient(180deg,rgba(13,22,33,.8),rgba(6,10,16,.9));position:relative}
.slot-cell::after{content:"";position:absolute;left:50%;top:50%;width:12px;height:12px;margin:-6px 0 0 -6px;border:1px solid #2f4a61;transform:rotate(45deg)}
.slot-cell.hot{border-color:rgba(255,176,32,.5);box-shadow:inset 0 0 12px rgba(255,176,32,.08)}
/* console readouts dock to the bottom so the station stays visible */
#panel{align-items:flex-end;justify-content:flex-end;padding:10px 12px 12px;pointer-events:auto}
#panel .panel-back{display:none}
#panel .panel{pointer-events:auto;width:min(540px,30vw);max-height:min(calc(100vh - 24px),640px);padding:10px 14px 8px;overflow-x:hidden;border:2px solid #4b6680;background:
  repeating-linear-gradient(92deg,rgba(255,255,255,.018) 0 2px,transparent 2px 5px),
  radial-gradient(ellipse at 22% -10%,rgba(80,145,205,.16),transparent 55%),
  radial-gradient(ellipse at 82% 0%,rgba(123,59,255,.12),transparent 50%),
  linear-gradient(180deg,rgba(27,42,58,.995),rgba(8,13,20,.995));
  box-shadow:0 24px 70px rgba(0,0,0,.72),inset 0 0 0 1px #0a1017,inset 0 0 44px rgba(51,224,255,.05);
  clip-path:polygon(0 0,calc(100% - 20px) 0,100% 20px,100% 100%,20px 100%,0 calc(100% - 20px));animation:consoleIn .2s ease}
@keyframes consoleIn{from{opacity:0;transform:translateY(16px)}to{opacity:1;transform:none}}
#panel .panel::before{content:"";position:absolute;left:0;top:0;width:100%;height:4px;background:repeating-linear-gradient(115deg,var(--amber) 0 14px,#191204 14px 28px);opacity:.95;z-index:2}
#panel .panel::after{content:"";position:absolute;inset:6px;pointer-events:none;border:1px solid rgba(140,175,205,.14);background:
  radial-gradient(circle at 0 0,#a7bccd 0 2px,#2a3d50 2.2px 3.4px,transparent 3.6px) top left/12px 12px no-repeat,
  radial-gradient(circle at 100% 0,#a7bccd 0 2px,#2a3d50 2.2px 3.4px,transparent 3.6px) top right/12px 12px no-repeat,
  radial-gradient(circle at 0 100%,#a7bccd 0 2px,#2a3d50 2.2px 3.4px,transparent 3.6px) bottom left/12px 12px no-repeat,
  radial-gradient(circle at 100% 100%,#a7bccd 0 2px,#2a3d50 2.2px 3.4px,transparent 3.6px) bottom right/12px 12px no-repeat;opacity:.85}
#panel .panel-head{position:sticky;top:0;z-index:3;padding-bottom:5px;border-bottom-color:#2a3f52;background:linear-gradient(180deg,#1a2a3b,rgba(20,32,45,.96));overflow:hidden}
#panel .panel-head>div{min-width:0;flex:1}
#panel .panel-head .micro{display:block;max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#panel .panel-head h2{font-size:clamp(18px,2.1vw,24px);margin:1px 0 0;letter-spacing:.05em}
#panel .panel-head .micro{font-size:8px}
#panel .panel-body{padding:8px 2px 2px;overflow-x:hidden;overflow-y:visible}
#panel .panel-foot{padding-top:6px;margin-top:6px;font-size:9px}
.console-grid{display:grid;grid-template-columns:minmax(128px,238px) 1fr;gap:14px;align-items:start}
@media (max-width:980px){
  .console-grid{grid-template-columns:1fr;gap:10px}
  .console-art{max-height:110px}
  .console-art img{max-height:110px}
  .sacrifice-values,.forge-rarities{display:none}
  #panel .panel-foot{display:none}
}
.reactor-meter{display:flex;flex-wrap:wrap;align-items:baseline;gap:6px;margin:0 0 8px}
.reactor-meter .micro{flex:1}
.reactor-meter b{font-family:var(--mono);font-size:11px;color:var(--cyan)}
.reactor-bar{flex-basis:100%;height:8px;background:#0a121b;border:1px solid #2a4258;overflow:hidden}
.reactor-bar i{display:block;height:100%;background:linear-gradient(90deg,#5a20d8,#b56bff,#ff3bd0);box-shadow:0 0 12px rgba(181,107,255,.6);transition:width .3s ease}
.reactor-actions{display:flex;flex-direction:column;gap:6px;margin:0 0 8px}
.reactor-actions .small-btn{width:100%;text-align:left;cursor:pointer;font-family:var(--display);font-weight:600;font-size:10px;letter-spacing:.05em;color:#eaf6ff;background:linear-gradient(180deg,#23405b,#0c1825);border:1px solid #4f7ca3;padding:8px 10px;box-shadow:0 0 0 1px rgba(51,224,255,.08),inset 0 0 14px rgba(51,224,255,.06);clip-path:polygon(6px 0,100% 0,100% calc(100% - 6px),calc(100% - 6px) 100%,0 100%,0 6px)}
.reactor-actions .small-btn::before{content:"\25B8  ";color:var(--cyan)}
.reactor-actions .small-btn:hover{border-color:var(--cyan);background:linear-gradient(180deg,#2c5273,#102131);box-shadow:0 0 18px rgba(51,224,255,.18),inset 0 0 18px rgba(51,224,255,.1)}
.reactor-actions .small-btn:active{transform:translateY(1px)}
.reactor-stable{font-family:var(--mono);font-size:10px;letter-spacing:.14em;color:#8ef4ff;padding:3px 0}
.console-art{position:relative;margin:0;min-height:104px;max-height:150px;border:1px solid #35506a;background:
  radial-gradient(circle at 50% 42%,rgba(123,59,255,.24),rgba(4,9,15,.96) 70%),
  repeating-linear-gradient(90deg,rgba(255,255,255,.02) 0 2px,transparent 2px 6px);
  overflow:hidden;box-shadow:inset 0 0 26px rgba(0,0,0,.85),0 0 18px rgba(51,224,255,.06)}
.console-art img{display:block;width:100%;height:100%;max-height:150px;object-fit:contain;filter:drop-shadow(0 6px 16px rgba(0,0,0,.6));-webkit-mask-image:radial-gradient(ellipse at 50% 52%,#000 54%,transparent 82%);mask-image:radial-gradient(ellipse at 50% 52%,#000 54%,transparent 82%)}
.console-art figcaption{position:absolute;left:6px;bottom:5px;max-width:calc(100% - 12px);font-family:var(--mono);font-size:7px;letter-spacing:.1em;color:#a6c4da;background:rgba(4,9,15,.72);border-left:2px solid var(--violet-hot);padding:2px 5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.console-readout .sys-note{margin:0 0 8px;font-size:11px;padding:6px 9px}
.console-readout .stat-grid{grid-template-columns:1fr 1fr;gap:6px;margin:0 0 8px}
.console-readout .stat{padding:5px 8px;min-width:0;overflow:hidden}
.console-readout .stat b{white-space:normal;overflow-wrap:anywhere}
.console-readout .stat span{font-size:8px;margin-bottom:2px}
.console-readout .stat b{font-size:10px}
.console-readout .rarity-list{max-height:84px;overflow:auto;margin-top:4px;padding-right:4px}
.console-readout .rarity-row{padding:3px 5px;font-size:10px}
#panel .panel-foot .small-btn{font-size:9px;padding:6px 10px}
@media (max-height:560px) and (orientation:landscape){
  #panel .panel{padding:8px 11px 6px;max-height:calc(100vh - 18px)}
  #panel .panel-head h2{font-size:17px}
  .console-grid{grid-template-columns:minmax(104px,168px) 1fr;gap:10px}
  .console-art{max-height:112px}
  .console-art img{max-height:112px}
  .console-readout .sys-note{font-size:10px;padding:5px 7px;margin-bottom:6px}
  .console-readout .stat-grid{gap:4px;margin-bottom:6px}
  .console-readout .stat{padding:4px 6px}
  .console-readout .rarity-list{max-height:60px}
}
.help-panel{width:min(720px,94vw)}
.help-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px 20px;padding:16px 0}
.help-grid p{font-size:12px;line-height:1.5;color:#b6c9da;margin:4px 0 0}
.help-row{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:10px 0;border-top:1px solid #223548}
.seg{display:flex;gap:0}
.seg button{cursor:pointer;font-family:var(--display);font-weight:600;font-size:10px;letter-spacing:.12em;color:#8fa6bb;background:#0a121b;border:1px solid #2e445a;padding:7px 13px}
.seg button.on{color:var(--ink);background:var(--cyan);border-color:var(--cyan);box-shadow:0 0 16px rgba(51,224,255,.25)}
.boot{position:fixed;inset:0;z-index:60;display:flex;align-items:flex-end;justify-content:center;gap:14px;padding-bottom:8px;background:transparent;color:#7f9ab3;font-family:var(--mono);font-size:9px;letter-spacing:.18em;transition:opacity .5s ease;pointer-events:none}
.boot.gone{opacity:0;pointer-events:none}
.boot i{width:30px;height:2px;background:linear-gradient(90deg,transparent,var(--cyan),transparent);animation:bootbar 1s linear infinite}
@keyframes bootbar{0%{transform:translateX(-12px)}100%{transform:translateX(12px)}}
.sys-error{color:#ffb4a8;border-color:#7a2d25;background:rgba(120,30,20,.12)}

/* ================= RESPONSIVE ================= */
@media (max-width:980px){
  .hud-tl{width:clamp(220px,36vw,320px)}
  .wslot{width:140px}
  .hcell{width:28px}
  .level-line span{display:none}
}
@media (max-width:760px){
  .hud-tl{left:10px;top:10px;width:min(56vw,300px);gap:6px}
  .hud-tr{right:10px;top:10px}
  .bay-nav{width:152px;padding:5px 7px 6px}
  .bay-row{font-size:9px}
  .bay-dist{font-size:8px;min-width:22px}
  .hud-bl{left:10px;bottom:10px}
  .hud-bc{bottom:10px}
  .hud-br{right:10px;bottom:10px}
  .plate::before{width:20px}
  .level-plate{padding:7px 9px}
  .hud-icon{width:26px;height:26px}
  .level-line b{font-size:17px}
  .objective-line span{font-size:10px}
  .coin-plate{min-width:126px;padding-right:10px}
  #hud-coin-token{width:42px;height:42px}
  .coin-body b{font-size:20px}
  .health-plate{min-width:190px;padding:7px 9px}
  .health-cells{gap:2px}
  .hcell{width:22px;height:12px}
  .weapon-slots{gap:4px}
  .wslot{width:106px;height:46px;padding:5px 6px}
  .wslot-text{margin-left:10px}
  .wslot-label{display:none}
  .wslot-name{font-size:9px}
  .dash-btn{width:62px;height:56px}
  .stick{width:104px;height:104px;bottom:82px;left:14px}
  .touch-dash{right:14px;bottom:82px;width:74px;height:60px}
  .touch-interact{right:96px;bottom:148px}
  #interact{bottom:68px}
  .toast{bottom:132px}
  .start-mid{margin-top:2vh}
  .start-sub{letter-spacing:.1em;margin-bottom:16px}
  .controls-strip{gap:6px 10px;padding:8px 10px}
  .ctrl{font-size:9px}
  .ctrl span{margin-left:2px}
  .sound-btn{right:14px;top:14px}
  .station-tag{font-size:8px;letter-spacing:.16em;padding:6px 10px}
  .screen{padding:14px 14px 14px}
}
@media (max-width:680px){
  .hud-bl{top:206px;bottom:auto}
}
@media (max-width:430px){
  .hud-tl{width:52vw}
  .bay-nav{width:118px;padding:5px 6px}
  .bay-row{font-size:8px;letter-spacing:.08em;gap:4px}
  .bay-dist{font-size:8px;min-width:18px}
}
@media (max-width:560px){
  .hud-tl{width:58vw}
  .bay-nav{width:132px}
  .bay-nav-title{display:none}
  .objective-plate,.reactor-plate{padding:6px 8px}
  .level-line span{display:none}
  .mini-row{display:none}
  .wslot{width:78px;height:42px}
  .wslot-name{font-size:8px;max-width:64px;overflow:hidden;text-overflow:ellipsis}
  .wslot-key{top:4px;left:4px}
  .hcell{width:18px}
  .health-plate{min-width:160px}
  .dash-btn{display:none}
  .start-legal{display:none}
}
@media (max-height:560px) and (orientation:landscape){
  .hud-bl{top:auto;bottom:8px}
  .mini-row{display:none}
  .hud-tl{width:min(224px,34vw);gap:5px}
  .level-plate{padding:5px 7px}
  .objective-plate,.reactor-plate{padding:5px 7px 6px 6px}
  .hud-tl .hud-icon{width:22px;height:22px}
  .hud-tl .hud-icon.small{width:20px;height:20px}
  .level-line b{font-size:16px}
  .objective-line span{font-size:9.5px}
  .objective-line b{font-size:9px}
  .thin-bar{margin-top:3px}
  .plate::before{width:16px;top:4px}
  .level-craft{padding-left:5px}
  .level-craft b{font-size:12px}
  .wslot{width:124px;height:44px;padding:4px 6px}
  .wslot-label{display:none}
  .wslot-name{font-size:10.5px}
  .wslot-gun{width:30px;height:11px;right:6px}
  .wslot-text{margin-left:11px;padding-right:30px}
  .wslot-key{top:3px;left:4px;font-size:8px}
  .wslot-lock{width:10px;height:13px;right:9px}
  .coin-plate{min-width:118px;padding:2px 9px 3px 3px}
  #hud-coin-token{width:38px;height:38px}
  .coin-body b{font-size:19px}
  .bay-nav{width:156px;padding:4px 7px 5px}
  .bay-row{font-size:9px;letter-spacing:.1em}
  .bay-dist{font-size:8px;min-width:20px}
  .hcell{width:23px;height:12px}
  body.touch .hud-bl{left:auto;right:10px;top:196px;bottom:auto}
  body.touch .hud-bl .health-plate{min-width:162px;padding:6px 8px}
  #title-art{max-height:26vh}
  .start-sub{margin:8px 0 12px}
  .start-mid{margin-top:0}
  .controls-strip{padding:6px 12px}
  .start-bottom{gap:4px}
  .hud-tl{top:8px}
  .hud-bl{bottom:8px}
  .hud-bc{bottom:8px}
  .hud-br{bottom:8px}
  #interact{bottom:66px}
  .toast{bottom:128px}
}
@media (orientation:portrait){
  #title-art{width:94vw;max-height:24vh}
  .start-sub{font-size:10px;padding:0 8px}
  .deploy{min-width:min(340px,92vw)}
  .controls-strip{max-width:94vw}
}
