.game .bottom{flex-wrap:wrap}
#weaponHud{position:static;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:5px;width:340px;max-width:100%;margin-left:auto;color:#edf4f8;font:11px/1.3 system-ui;direction:ltr}
#weaponHud[hidden]{display:none}
#weaponHud .weapon-title{display:none}
#weaponHud button{display:grid;grid-template-columns:1fr auto;gap:3px;min-width:0;width:100%;margin:0;padding:5px 7px;text-align:left;color:#bdccd7;background:#182633;border:1px solid #435564;border-radius:4px;font:11px system-ui}
#weaponHud button[aria-pressed=true]{border-color:#ffc65b;color:#ffe0a0;background:#3b3020}
#weaponHud button.overheated{border-color:#ff745c;color:#ff947c}
#weaponHud button b{font-size:10px;font-variant-numeric:tabular-nums}
#weaponHud meter{grid-column:1/-1;width:100%;height:7px}
#weaponHud small{display:block;grid-column:1/-1;text-align:right;font-size:9px;letter-spacing:0;color:#a9b9c6;margin:0}
@media(max-width:650px){#weaponHud{width:100%;flex-basis:100%}#weaponHud button{font-size:11px}.game .bottom{gap:6px}}
#weaponHud{width:420px}
#weaponHud button .weapon-name{grid-column:1/-1;font-size:13px;font-weight:800;white-space:nowrap}
#weaponHud .weapon-ammo{font-size:12px;color:#edf4f8}
#weaponHud button b{align-self:center;text-align:right}
#weaponHud small{font-size:10px}
@media(max-width:650px){#weaponHud{width:100%}#weaponHud button .weapon-name{font-size:12px}}

#weaponHud .weapon-upgrade-icon{width:22px;height:22px;vertical-align:middle;margin-left:4px}
#weaponHud .weapon-upgrade-icon[hidden]{display:none}

/* Compact in-field equipment; long instructions belong to the pause overlay. */
.game .field #weaponHud{position:absolute;right:12px;bottom:12px;width:360px;max-width:48%;margin:0;z-index:3;gap:4px}
#weaponHud button{background:#132231ed;padding:5px 6px}
#weaponHud button .weapon-name{font-size:11px;white-space:normal;overflow-wrap:anywhere;line-height:1.2}
#weaponHud .weapon-upgrade-icon{width:18px;height:18px}
#pauseWeaponHelp{max-width:600px;margin:14px 0 0;padding:10px 14px;color:#bed4e6;font-size:12px;line-height:1.6;background:#101e30e8;border-radius:6px}
#pauseWeaponHelp[hidden],.field:has(#overlay:not([hidden])) #weaponHud{display:none}
@media(max-width:700px){.game .field #weaponHud{right:6px;bottom:10px;max-width:46%;grid-template-columns:1fr;width:190px}#weaponHud button .weapon-name{font-size:10px}#weaponHud button b{font-size:9px}}

/* Keep each upgrade canvas in its own weapon row, not at the playfield origin. */
#weaponHud button .weapon-name{display:flex;align-items:center;gap:4px;min-width:0}
#weaponHud .weapon-name-text{flex:1;min-width:0}
#weaponHud canvas.weapon-upgrade-icon{position:static;inset:auto;display:block;flex:0 0 18px;width:18px;height:18px;margin:0;align-self:center;pointer-events:none}
#weaponHud canvas.weapon-upgrade-icon[hidden]{display:none}

/* Match custom emoji badges to expansion badges at the right of the name. */
#weaponHud .weapon-custom-icon{display:inline-flex;flex:0 0 18px;width:18px;height:18px;align-items:center;justify-content:center;align-self:center;font-size:16px;line-height:1;margin:0;overflow:hidden}
#weaponHud .weapon-custom-icon[hidden]{display:none}
