I am looking for a way to create this type of boxes (like "uncommon", "evocation", "magical" in the image below) around text.
Mostly this text would be on a separate line, but it should be practical to use, so it should be in-line text: The box size should change with the length of the text inside, and any number of these boxes; Usually between 2 and 5 would appear on these lines.
I experimented with Character Styles (underline options, but doesn't allow me to do the frame) as well as tables (I don't know how to make each cell flexible width), but I'm probably missing the optimal solution here, and would be grateful for some assistance.