/* 星海边缘 Edge of Cosmic — 移动端竖屏优先 UI */

:root {
  --bg: #04070f;
  --bg2: #0a1220;
  --panel: rgba(8, 16, 30, 0.94);
  --line: rgba(90, 190, 255, 0.22);
  --cyan: #2fd8ff;
  --cyan-dim: #1a7f9e;
  --pink: #ff2d78;
  --amber: #ffd24a;
  --green: #7dffb0;
  --purple: #c46bff;
  --txt: #dbe9ff;
  --txt-dim: #7f95b5;
  --r: 14px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --hud-left: var(--safe-l);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0; height: 100%; overflow: hidden;
  background: var(--bg); color: var(--txt);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", system-ui, sans-serif;
  user-select: none; -webkit-user-select: none;
  overscroll-behavior: none; touch-action: none;
}

#app { position: fixed; inset: 0; overflow: hidden; }

#stage { position: absolute; inset: 0; background: #01030a; }
#combat-field { position: absolute; inset: 0; }
#game { display: block; width: 100%; height: 100%; touch-action: none; }

.hidden { display: none !important; }
.muted { color: var(--txt-dim); }
.small { font-size: 12px; }
.center { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }

/* ---------------------------------------------------------------- HUD */

#hud { position: absolute; inset: 0; pointer-events: none; }

.hud-top {
  position: absolute; top: calc(8px + var(--safe-t)); left: calc(var(--hud-left) + 10px); right: 10px;
}
.hud-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

.icon-btn {
  pointer-events: auto;
  width: 38px; height: 38px; flex: 0 0 38px;
  border-radius: 10px; border: 1px solid var(--line);
  background: rgba(10, 24, 42, 0.82); color: var(--txt);
  font-size: 16px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.icon-btn:active { background: rgba(30, 70, 110, 0.9); }

/* Small ruby globe overlays one corner; the canvas keeps its full width. */
.hud-left { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; padding-bottom: 70px; }
.vital-orb {
  position: absolute; left: calc(8px + var(--safe-l)); bottom: calc(8px + var(--safe-b));
  width: 64px; height: 64px; pointer-events: none;
  filter: drop-shadow(0 2px 5px #0009);
}
.vital-orb svg { width: 100%; height: 100%; display: block; }
.vital-shield-track { fill: none; stroke: #3b8ecb30; stroke-width: 3; }
.vital-shield-fill {
  fill: none; stroke: #59beff; stroke-width: 3; stroke-linecap: round;
  stroke-dasharray: 194.779; stroke-dashoffset: 194.779;
  transition: stroke-dashoffset .16s linear; filter: drop-shadow(0 0 2px #37aaff);
}
.vital-number { fill: #fff1f4; font: 700 13px system-ui; text-anchor: middle; paint-order: stroke; stroke: #3c071b99; stroke-width: 2px; }
#vital-liquid { transition: transform .2s ease-out; }
.vital-orb.partial .vital-wave { animation: ruby-slosh 2.6s ease-in-out infinite; transform-origin: 36px 0; }
@keyframes ruby-slosh {
  0%, 100% { transform: translateX(-10px) rotate(-2deg); }
  50% { transform: translateX(10px) rotate(2deg); }
}
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (prefers-reduced-motion: reduce) {
  .vital-orb.partial .vital-wave { animation: none; }
}

.bar {
  position: relative; height: 13px; border-radius: 7px;
  background: rgba(4, 12, 24, 0.85); border: 1px solid var(--line); overflow: hidden;
}
.bar .fill { position: absolute; inset: 0; width: 100%; transform-origin: left center; transition: width .12s linear; }
.bar-hp .fill { background: linear-gradient(90deg, #2fd8ff, #7dffb0); }
.bar-shield { height: 7px; }
.bar-shield .fill { background: linear-gradient(90deg, #4dd2ff, #a0f0ff); }
.bar span {
  position: absolute; inset: 0; font-size: 10px; line-height: 13px; text-align: center;
  color: #041018; font-weight: 700; letter-spacing: .5px;
}

.flight-readout {
  flex: 0 0 auto; min-width: 56px; text-align: right;
  font-variant-numeric: tabular-nums; font-size: 14px; font-weight: 700;
  color: var(--cyan); text-shadow: 0 0 10px rgba(47, 216, 255, .5);
}

.progress {
  position: absolute; right: 7px; top: 37px; width: min(52vw, 230px); height: 4px; border-radius: 3px;
  background: rgba(4, 12, 24, .8); border: 1px solid var(--line); overflow: visible;
}
#progress-fill { height: 100%; width: 0%; border-radius: 3px; background: linear-gradient(90deg, var(--cyan-dim), var(--cyan)); }
#level-tag {
  position: absolute; right: 0; top: 49px; font-size: 10px; color: var(--txt-dim);
}
#flight-milestones { position: absolute; inset: 0; }
.flight-marker {
  position: absolute; top: 50%; transform: translate(-50%, -50%);
  width: 15px; height: 15px; padding: 1px; border-radius: 4px;
  background: #0a1728; border: 1px solid #607084; color: #9ddbea;
}
.flight-marker svg, .toast .t-title svg { display: block; width: 100%; height: 100%; }
.flight-marker.elite { color:#ffd286; }
.flight-marker.boss { color:#ff94b4; }
.flight-marker.passed { opacity:.55; }
.flight-marker.current { border-color:currentColor; box-shadow:0 0 9px currentColor; }

.boss-bar {
  position: absolute; top: calc(74px + var(--safe-t)); left: calc(var(--hud-left) + 14px); right: 14px;
}
.boss-name {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 13px; font-weight: 700; color: var(--pink);
  text-shadow: 0 0 12px rgba(255, 45, 120, .6); margin-bottom: 4px; letter-spacing: 1px;
}
.boss-phase { font-size: 11px; color: var(--txt-dim); }
.bar-boss { height: 11px; }
.bar-boss .fill { background: linear-gradient(90deg, #ff2d78, #ff8a5f); transition: width .15s linear; }

.toast {
  position: absolute; top: calc(120px + var(--safe-t)); left: calc(50% + var(--hud-left) / 2); transform: translateX(-50%);
  min-width: 180px; max-width: 86%; padding: 8px 14px; border-radius: 12px;
  background: rgba(6, 18, 34, .88); border: 1px solid var(--line);
  text-align: center; opacity: 0; transition: opacity .25s, transform .25s;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(6px); }
.toast .t-title { font-size: 14px; font-weight: 700; color: var(--cyan); }
.toast .t-sub { font-size: 11px; color: var(--txt-dim); margin-top: 2px; }
.toast[data-route="fleet"] { --signal:#9deeff; }
.toast[data-route="elite"] { --signal:#ffcf79; }
.toast[data-route="boss"] { --signal:#ff8ab3; }
.toast[data-route]:not([data-route=""]) { border-color:var(--signal); }
.toast[data-route]:not([data-route=""]) .t-title {
  display:flex; align-items:center; justify-content:center; gap:6px; color:var(--signal);
}
.toast .t-title svg { width:17px; height:17px; flex:none; }

.hud-bottom {
  position: absolute; left: calc(var(--hud-left) + 12px); right: 12px; bottom: calc(14px + var(--safe-b));
  display: flex; align-items: flex-end; justify-content: space-between; gap: 10px;
}

.module-slots { display: flex; gap: 7px; align-items: flex-end; flex-wrap: wrap; max-width: 100%; }
.mod-slot {
  position: relative; width: 46px; height: 46px; border-radius: 12px;
  background: rgba(6, 18, 34, .88); border: 1.5px solid var(--line);
  display: flex; align-items: center; justify-content: center;
}
.mod-slot.expiring { animation: blink .45s infinite alternate; }
@keyframes blink { from { border-color: var(--line); } to { border-color: var(--pink); } }
.mod-slot svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.mod-slot .ring-bg { fill: none; stroke: rgba(255,255,255,.07); stroke-width: 3; }
.mod-slot .ring-fill { fill: none; stroke: var(--cyan); stroke-width: 3; stroke-linecap: round; }
.mod-slot canvas { width: 30px; height: 30px; }

.bottom-right { flex: 0 0 216px; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }

.mat-counter { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; max-width: 100%; }
.mat-chip {
  display: flex; align-items: center; gap: 3px; font-size: 11px;
  background: rgba(6, 18, 34, .8); border: 1px solid var(--line);
  border-radius: 8px; padding: 2px 6px; font-variant-numeric: tabular-nums;
}
.mat-chip i { width: 7px; height: 7px; border-radius: 2px; display: inline-block; }

.nova-btn {
  pointer-events: auto; position: relative;
  width: 78px; height: 78px; border-radius: 50%; border: none; padding: 0;
  background: radial-gradient(circle at 50% 40%, rgba(20, 60, 90, .95), rgba(6, 18, 34, .95));
  color: var(--cyan); cursor: pointer;
}
.nova-btn .nova-ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.nova-btn .ring-bg { fill: none; stroke: rgba(255,255,255,.10); stroke-width: 6; }
.nova-btn .ring-fill { fill: none; stroke: var(--cyan); stroke-width: 6; stroke-linecap: round; }
.nova-btn .nova-label { font-size: 12px; font-weight: 800; letter-spacing: 1px; }
.nova-btn.ready { animation: pulse 1.1s infinite alternate; box-shadow: 0 0 22px rgba(47, 216, 255, .55); }
@keyframes pulse { from { transform: scale(1); } to { transform: scale(1.06); } }
.nova-btn:active { transform: scale(.94); }

/* ---------------------------------------------------------------- 面板 */

#panels { position: absolute; inset: 0; pointer-events: none; }
.panel {
  position: absolute; inset: 0; display: none;
  background: linear-gradient(160deg, #050b16 0%, #0a1424 55%, #071020 100%);
  overflow: hidden;
}
.panel.active { display: block; pointer-events: auto; }
.panel.overlay { background: rgba(3, 8, 16, .88); backdrop-filter: blur(6px); }
.panel-inner {
  position: absolute; inset: 0; padding: calc(18px + var(--safe-t)) 18px calc(18px + var(--safe-b));
  display: flex; flex-direction: column; gap: 14px; overflow: hidden;
}
.panel-inner.center { justify-content: center; }
.panel-inner h2 { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: 1px; }
.scroll { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; touch-action: pan-y; padding-bottom: 20px; }

.pnl-head { display: flex; align-items: center; gap: 10px; }
.pnl-head h2 { flex: 1; white-space: nowrap; }
.pnl-head .mats { max-width: 46%; }
.mats { display: flex; gap: 5px; flex-wrap: wrap; justify-content: flex-end; }
.hangar-tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; flex: 0 0 auto; }
.hangar-tabs button { min-height: 44px; border: 1px solid var(--line); border-radius: 10px; background: rgba(10,24,42,.78); color: var(--txt-dim); font-size: 15px; font-weight: 700; touch-action: manipulation; }
.hangar-tabs button.active { color: #03131d; border-color: var(--cyan); background: linear-gradient(135deg, var(--cyan), #7dffb0); }

.logo-big {
  font-size: 40px; font-weight: 900; letter-spacing: 8px;
  background: linear-gradient(180deg, #dff6ff, var(--cyan) 55%, #1a7f9e);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 0 40px rgba(47, 216, 255, .25);
}
.logo-sub { font-size: 11px; letter-spacing: 3px; color: var(--txt-dim); margin-top: 2px; }

.loading-bar { width: 62%; max-width: 260px; height: 4px; border-radius: 2px; background: rgba(255,255,255,.08); overflow: hidden; margin: 26px 0 10px; }
#loading-fill { height: 100%; width: 8%; background: var(--cyan); transition: width .3s; }

.menu-btns { display: flex; flex-direction: column; gap: 11px; width: 78%; max-width: 300px; margin-top: 26px; }
.menu-btns.row { flex-direction: row; width: auto; max-width: none; }
.big-btn {
  padding: 14px 20px; border-radius: var(--r); font-size: 16px; font-weight: 700;
  border: 1px solid var(--line); background: rgba(12, 28, 48, .9); color: var(--txt);
  cursor: pointer; letter-spacing: 2px; flex: 1;
}
.big-btn.primary {
  background: linear-gradient(135deg, #0d5f80, #0f8fb8);
  border-color: rgba(47, 216, 255, .55);
  box-shadow: 0 6px 26px rgba(15, 143, 184, .3);
}
.big-btn.danger { border-color: rgba(255, 45, 120, .5); color: #ffb8cf; }
.big-btn:active { transform: translateY(1px); }
.big-btn:disabled { opacity: .45; }

.mini-btn {
  padding: 7px 12px; border-radius: 10px; font-size: 12px;
  border: 1px solid var(--line); background: rgba(12, 28, 48, .8); color: var(--txt); cursor: pointer;
}
.menu-foot { display: flex; align-items: center; gap: 12px; margin-top: 22px; }
.save-line { margin-top: 14px; font-size: 12px; color: var(--txt-dim); }

/* 机库 */
.up-item {
  display: flex; align-items: center; gap: 12px; padding: 12px;
  border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 10px;
  background: rgba(10, 22, 40, .75);
}
.up-info { flex: 1; min-width: 0; }
.up-name { font-size: 15px; font-weight: 700; }
.up-desc { font-size: 11.5px; color: var(--txt-dim); margin-top: 2px; }
.up-pips { display: flex; gap: 3px; margin-top: 6px; }
.pip { width: 20px; height: 5px; border-radius: 3px; background: rgba(255,255,255,.12); }
.pip.on { background: var(--cyan); box-shadow: 0 0 8px rgba(47,216,255,.6); }
.up-buy {
  flex: 0 0 auto; min-width: 84px; padding: 9px 10px; border-radius: 10px;
  border: 1px solid var(--line); background: rgba(12, 32, 54, .9);
  color: var(--txt); font-size: 12px; font-weight: 700; cursor: pointer; text-align: center;
}
.up-buy.can { border-color: rgba(125, 255, 176, .5); color: var(--green); }
.up-buy:disabled { opacity: .4; }
.section-title { padding: 14px 4px 7px; color: var(--cyan); font-size: 13px; letter-spacing: .12em; }
.gear-slots { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 8px; }
.gear-slot { min-height: 70px; padding: 8px; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; border: 1px solid rgba(95,225,255,.3); border-radius: 8px; background: rgba(10,25,45,.72); color: var(--txt); text-align: left; }
.gear-slot b { color: var(--txt-dim); font-size: 11px; }
.gear-slot small { color: var(--green); font-size: 10px; }
.gear-slot.unpowered { border-color: rgba(255,105,120,.65); background: rgba(70,20,36,.28); }
.gear-slot.unpowered small { color: #ff788b; }
.gear-slot.empty { opacity: .58; border-style: dashed; }
.gear-item { flex-wrap: wrap; gap: 5px; }
.gear-item .up-info { min-width: 130px; }
.gear-item.equipped { border-color: rgba(95,225,255,.28); }
.battery-card { position: sticky; top: 0; z-index: 1; background: rgba(7,17,31,.97); }
.stat-card .up-desc { line-height: 1.7; }
.hangar-hint, .hangar-empty { padding: 12px; border: 1px solid rgba(90,190,255,.14); border-radius: 10px; color: var(--txt-dim); font-size: 12px; line-height: 1.6; }
.gear-item .up-buy { min-height: 40px; min-width: 72px; touch-action: manipulation; }
.gear-slot { min-height: 76px; touch-action: manipulation; }

/* 星图 */
.sector {
  margin-bottom: 18px; border: 1px solid var(--line); border-radius: var(--r);
  padding: 12px; background: rgba(10, 22, 40, .6);
}
.sector-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 4px; }
.sector-name { font-size: 16px; font-weight: 800; }
.sector-en { font-size: 10px; color: var(--txt-dim); letter-spacing: 1px; }
.sector-desc { font-size: 11.5px; color: var(--txt-dim); margin-bottom: 10px; }
.node-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(74px, 1fr)); gap: 8px; }
.node {
  position: relative; aspect-ratio: 1 / 1.12; border-radius: 12px;
  border: 1.5px solid var(--line); background: rgba(8, 20, 36, .9);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 4px; cursor: pointer; overflow: hidden;
}
.node.locked { opacity: .35; }
.node .n-id { font-size: 10px; color: var(--txt-dim); }
.node .n-name { font-size: 12px; font-weight: 700; margin-top: 2px; text-align: center; line-height: 1.15; }
.node .n-stars { margin-top: 3px; font-size: 10px; color: var(--amber); letter-spacing: 1px; height: 12px; }
.node.type-boss { border-color: rgba(255, 45, 120, .55); box-shadow: inset 0 0 18px rgba(255,45,120,.14); }
.node.type-elite { border-color: rgba(255, 210, 74, .45); }
.node.type-reward { border-color: rgba(125, 255, 176, .45); }
.node .n-tag {
  position: absolute; top: 0; right: 0; font-size: 9px; padding: 1px 5px;
  border-bottom-left-radius: 8px; background: rgba(255,255,255,.1);
}
.node.type-boss .n-tag { background: rgba(255,45,120,.75); color: #fff; }
.node.type-elite .n-tag { background: rgba(255,210,74,.7); color: #241a00; }
.node.type-reward .n-tag { background: rgba(125,255,176,.7); color: #04220f; }

/* 简报 */
.brief-tag { font-size: 12px; letter-spacing: 3px; color: var(--txt-dim); }
#p-brief h2 { font-size: 26px; margin: 4px 0 8px; }
.brief-mod {
  display: inline-block; padding: 5px 12px; border-radius: 20px; font-size: 12px;
  border: 1px solid var(--line); background: rgba(12, 32, 54, .8);
}
.brief-text { font-size: 13px; color: var(--txt-dim); line-height: 1.6; max-width: 320px; margin: 12px 0; font-style: italic; }
.brief-grid { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; max-width: 340px; }
.brief-cell {
  flex: 1 1 90px; padding: 8px; border-radius: 10px; border: 1px solid var(--line);
  background: rgba(10, 22, 40, .7); font-size: 11px;
}
.brief-cell b { display: block; font-size: 15px; color: var(--cyan); margin-top: 2px; }

/* 结算 */
.stars { font-size: 34px; letter-spacing: 6px; color: var(--amber); text-align: center; margin: 6px 0; min-height: 40px; }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat-cell { padding: 10px 6px; border-radius: 10px; border: 1px solid var(--line); background: rgba(10,22,40,.7); text-align: center; }
.stat-cell span { display: block; font-size: 10.5px; color: var(--txt-dim); }
.stat-cell b { display: block; font-size: 17px; margin-top: 3px; color: var(--cyan); font-variant-numeric: tabular-nums; }
.gain-list { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.gain-chip {
  display: flex; align-items: center; gap: 4px; padding: 5px 10px; border-radius: 9px;
  border: 1px solid var(--line); background: rgba(10,22,40,.7); font-size: 12px;
}
.gain-chip i { width: 8px; height: 8px; border-radius: 2px; }

/* 图鉴 */
.codex-item {
  display: flex; gap: 10px; align-items: center; padding: 10px 12px; margin-bottom: 8px;
  border: 1px solid var(--line); border-radius: var(--r); background: rgba(10,22,40,.7);
}
.codex-icon {
  flex: 0 0 38px; width: 38px; height: 38px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(255,255,255,.15); background: rgba(4,12,24,.8);
}
.rar { font-size: 10px; padding: 1px 6px; border-radius: 6px; margin-left: 6px; }
.rar-1 { background: rgba(160,180,200,.25); color: #c8d6e6; }
.rar-2 { background: rgba(47,216,255,.22); color: #9ff0ff; }
.rar-3 { background: rgba(196,107,255,.25); color: #e2c0ff; }

/* 记录 */
.board-empty { color: var(--txt-dim); font-size: 13px; text-align: center; padding: 24px; }
.board-row {
  display: flex; justify-content: space-between; align-items: center; padding: 9px 12px;
  border-bottom: 1px solid rgba(90,190,255,.12); font-size: 13px;
}

/* 桌面端：限制内容宽度，居中 */
@media (min-width: 700px) {
  .panel-inner { max-width: 560px; margin: 0 auto; left: 0; right: 0; }
  .menu-btns { max-width: 340px; }
}

/* 登录门禁（未登录灵豚账户时显示） */
#login-gate.overlay {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  background: radial-gradient(circle at 50% 30%, rgba(47,216,255,.12), rgba(3,8,16,.92));
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
#login-gate.overlay.hidden { display: none; }
#login-gate .overlay-card {
  width: 100%; max-width: 360px; text-align: center;
  background: rgba(8,16,28,.92); border: 1px solid rgba(90,190,255,.22);
  border-radius: 22px; padding: 32px 24px;
  box-shadow: 0 30px 60px -20px rgba(0,0,0,.6);
}
#login-gate .overlay-card h2 { color: #eaf6ff; font-size: 1.3rem; margin: 16px 0 10px; }
#login-gate .overlay-card p { color: #9fb4c8; font-size: .92rem; line-height: 1.6; margin-bottom: 22px; }
#login-gate .btn-primary.block {
  display: block; width: 100%; padding: 13px; border-radius: 12px; text-decoration: none;
  background: linear-gradient(135deg, #2fd8ff, #7c5cff); color: #04121f;
  font-weight: 700; font-size: 1rem;
}
#login-gate .overlay-link {
  display: inline-block; margin-top: 16px; color: #6f8aa3; font-size: .82rem; text-decoration: none;
}
#login-gate .overlay-link:hover { color: #9fb4c8; text-decoration: underline; }

/* ImageGen equipment atlas: 3 columns × 3 rows. */
.gear-icon {
  --gear-color: #57b8ff;
  position: relative; display: inline-block; flex: 0 0 50px; width: 50px; height: 50px;
  border: 1px solid var(--gear-color); border-radius: 11px;
  background: radial-gradient(circle, rgba(80, 130, 180, .18), rgba(3, 9, 18, .8));
  overflow: hidden;
}
.gear-icon::before {
  content: ''; position: absolute; inset: 0;
  background-image: url('../assets/equipment-v1.png'); background-size: 300% 300%;
  background-position: var(--icon-x) var(--icon-y); background-repeat: no-repeat;
}
.gear-slot { display: grid; grid-template-columns: 44px minmax(0, 1fr); column-gap: 8px; align-content: center; }
.gear-slot .gear-icon { grid-column: 1; grid-row: 1 / 4; width: 44px; height: 44px; }
.gear-slot b, .gear-slot > span:not(.gear-icon), .gear-slot small { grid-column: 2; }
.gear-slot.empty { display: flex; }
.gear-item { gap: 10px; }
.gear-item .up-info { flex-basis: 120px; min-width: 100px; }
.gear-item .up-buy { margin-left: auto; }
@media (max-width: 360px) {
  .gear-slots { grid-template-columns: 1fr; }
  .gear-icon { flex-basis: 42px; width: 42px; height: 42px; }
  .battery-card { flex-wrap: wrap; gap: 8px; }
}

/* Optional objectives and short, frequent combat decisions. */
.objective-banner {
  position: absolute; top: calc(61px + var(--safe-t)); left: calc(var(--hud-left) + 12px);
  width: min(230px, calc(100% - var(--hud-left) - 26px)); padding: 7px 9px;
  border-left: 2px solid #ffd374; border-radius: 0 8px 8px 0;
  background: rgba(5, 15, 29, .64); pointer-events: none;
}
.objective-heading { display: flex; gap: 8px; justify-content: space-between; color: #ffe0a2; font-size: 12px; }
.objective-hint { margin-top: 3px; font-size: 10px; line-height: 1.45; color: #cfdef0; }
.objective-track { height: 3px; margin-top: 5px; background: #ffffff14; }
#objective-progress { height: 100%; width: 0; background: #87f5c3; }
.objective-reward { margin-top: 3px; font-size: 9px; color: #8ac9bb; }
.ability-buttons { display: flex; gap: 8px; align-items: flex-end; }
.dash-btn {
  pointer-events: auto; width: 54px; height: 54px; padding: 5px; border-radius: 16px;
  border: 1px solid #85eec963; background: rgba(8, 30, 36, .9); color: #a8ffdd;
  display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: pointer;
}
.dash-btn span { font-size: 12px; font-weight: 700; }
.dash-btn small { font-size: 10px; margin-top: 3px; }
.dash-btn:disabled { opacity: .55; }
.dash-btn.ready { box-shadow: inset 0 0 12px #6cffb91c; }
.dash-btn:active { transform: scale(.94); }
.run-builds { max-width: 340px; color: #a7bad2; font-size: 12px; line-height: 1.7; }
.choice-inner { gap: 10px; overflow-y: auto; touch-action: pan-y; }
.choice-inner h2 { font-size: 21px; }
.choice-sub { margin: 0 0 6px; font-size: 11px; line-height: 1.5; color: var(--txt-dim); }
.upgrade-choices { width: 100%; max-width: 430px; display: flex; flex-direction: column; gap: 12px; }
#choice-reroll { width: 100%; max-width: 430px; min-height: 40px; }
#choice-reroll:disabled { opacity: .55; cursor: default; }
.upgrade-choice {
  width: 100%; padding: 13px; display: flex; align-items: center; gap: 12px; text-align: left;
  border: 1px solid var(--choice-color); border-radius: 14px; color: var(--txt);
  background: linear-gradient(120deg, #10243b, #080f1e); cursor: pointer;
}
.upgrade-choice:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.upgrade-choice:active { transform: scale(.98); }
.choice-copy { display: flex; flex-direction: column; gap: 5px; }
.choice-copy strong { color: var(--choice-color); font-size: 17px; }
.choice-copy em { color: #adc1d8; font-size: 10px; font-style: normal; }
.choice-copy > span { color: #d2dfef; font-size: 12px; line-height: 1.6; }
@media (max-width: 420px) {
  .ability-buttons .nova-btn { width: 68px; height: 68px; }
  .bottom-right { flex-basis: 192px; }
  .module-slots { gap: 4px; }
  .mod-slot { width: 34px; height: 34px; border-radius: 9px; }
  .mod-slot canvas { width: 24px; height: 24px; }
}

.boss-skill-row { display: flex; align-items: center; gap: 8px; margin-top: 5px; }
#boss-skill { color: #ffbd9c; font-size: 10px; line-height: 1.4; text-shadow: 0 1px 3px #000; }
.boss-skill-track { flex: 0 0 42px; height: 3px; border-radius: 2px; background: #ff9dbe26; overflow: hidden; }
#boss-skill-fill { height: 100%; width: 0; background: #ffb67f; }
.boss-bar.recovering #boss-skill { color: #9effd0; }
.boss-bar.recovering #boss-skill-fill { background: #9effd0; }

.skill-icon { display:inline-block; flex-shrink:0; width:64px; height:64px; background:url('../assets/skill-equipment-v1.png') var(--icon-x,0%) var(--icon-y,0%)/200% 200% no-repeat; }
.skill-btn { pointer-events:auto; flex-shrink:0; width:54px; height:70px; padding:2px; border:1px solid #ffc77988; border-radius:14px; background:#101d30e8; color:#ffdc9e; display:flex; flex-direction:column; align-items:center; justify-content:center; cursor:pointer; }
.skill-btn .skill-icon { width:32px;height:32px; }
.skill-btn span:not(.skill-icon) { font-size:11px; font-weight:700; }
.skill-btn small { font-size:10px; }.skill-btn:disabled { opacity:.6; }.skill-btn.ready { box-shadow:0 0 12px #ffca6020; }
.skill-btn.casting:disabled { opacity:1; border-color:#b2f0ff; box-shadow:0 0 13px #79ddff5c; }
.skill-btn.casting small { color:#d4f8ff; }
.skill-card { flex-wrap:wrap; }.skill-card .up-info { min-width:140px; }.skill-actions { display:flex; gap:8px; margin-left:auto; }.skill-card.equipped { border-color:#7ddcff88; }

.dash-btn { touch-action:none; user-select:none; -webkit-user-select:none; -webkit-touch-callout:none; }
.dash-btn.aiming { border-color:#b5ffe6; background:#175547ed; box-shadow:0 0 18px #79ffd461; transform:none; }

.hangar-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.hud-bottom .bottom-right { flex: 0 0 auto; min-width: 66px; }
.hud-bottom .hud-left { max-width: 118px; }
#mat-counter { color: #f8cf7f; font-size: 12px; }
#mat-counter span { white-space: nowrap; }
#run-stamina { color: #9fe9d4; }
#menu-wallet, #brief-wallet { color: #f8cf7f; font-size: 13px; }
.fragment-row { display: flex; align-items: center; gap: 6px; margin: 6px 0; }
.fragment-row > span { flex: 0 0 64px; }
.fragment-row select { flex: 1; min-width: 0; padding: 5px; color: inherit; background: #14273a; border: 1px solid #7ca7cf4a; border-radius: 6px; }
#launch-notice:empty, #choice-notice:empty { display: none; }
.run-kit { padding: 6px 8px; background: #081823d9; border: 1px solid #7bc9ed44; border-radius: 8px; }
.run-kit-heading { display: flex; justify-content: space-between; gap: 6px; font-size: 11px; color: #b6eaff; }
.run-energy-track { height: 3px; margin: 5px 0; border-radius: 3px; background: #35516b; }
#run-energy-fill { height: 100%; background: #85ffd3; border-radius: inherit; }
#btn-skill { width: 66px; }
#btn-skill .gear-icon { width: 24px; height: 24px; }
.arsenal-notice { margin: 8px 0; color: #bcd2e5; font-size: 13px; line-height: 1.5; }
.arsenal-card { display: flex; align-items: flex-start; gap: 10px; margin: 8px 0; padding: 12px; border: 1px solid #719fc84d; border-radius: 13px; background: #0b192be8; }
.arsenal-card > .gear-icon { flex-shrink: 0; }
.arsenal-card-copy { flex: 1; min-width: 0; }
.arsenal-card-copy h3 { margin: 3px 0 6px; font-size: 16px; }
.arsenal-card-copy p, .arsenal-card-copy ul { margin: 4px 0; color: #c8dae9; font-size: 12px; line-height: 1.6; }
.arsenal-card-copy ul { padding-left: 1.15em; }
.arsenal-card-copy small { color: #91acc8; font-size: 10px; }
.arsenal-card-copy .arsenal-tiers { color: #97e6df; }
.arsenal-draw { display: grid; gap: 9px; padding: 10px 0; }
.arsenal-draw h3, .arsenal-draw p { margin: 0; }
.arsenal-draw > p { color: #bcd2e5; line-height: 1.5; font-size: 13px; }
.arsenal-pool { display: flex; flex-wrap: wrap; gap: 6px; }
.arsenal-pool > span { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 72px; padding: 6px; color: #daebfa; font-size: 11px; border: 1px solid #7ca7cf4a; border-radius: 10px; }
#choice-recipe:empty { display: none; }

.choice-loadout { display: flex; justify-content: center; flex-wrap: wrap; gap: 5px; }
.choice-loadout:empty { display: none; }
.choice-loadout > span { padding: 4px 7px; border: 1px solid #71aac666; border-radius: 8px; color: #bdedff; font-size: 11px; }
.arsenal-card-actions { display: flex; flex-direction: column; gap: 6px; align-self: center; flex-shrink: 0; }
.arsenal-card-actions .up-buy { min-width: 63px; }
.arsenal-odds { padding: 8px 10px; border: 1px solid #7ca7cf4a; border-radius: 10px; color: #bcd2e5; font-size: 12px; }
.arsenal-odds summary { cursor: pointer; }
.arsenal-odds p { margin: 7px 0; line-height: 1.5; }
