Risk buffering and resource access shape valuation of out-group and in-group strangers.