Visualize a Recursive Acronym Background

Famously, the acronym GNU stands for GNU's Not Unix. 1

It's recursive because, after expanding it once, it still contains the acronym GNU, and so must be exanded again:

(GNU's Not Unix)'s Not Unix


And so on, ad infinitum.  Visualizing this, we get a kind of Droste effect: 

┌────────────────────────────────────────────┬───────────┐
│┌──────────────────────────────┬───────────┐│'s Not Unix│
││┌────────────────┬───────────┐│'s Not Unix││           │
│││┌──────────────┐│'s Not Unix││           ││           │
││││GNU's Not Unix││           ││           ││           │
│││└──────────────┘│           ││           ││           │
││└────────────────┴───────────┘│           ││           │
│└──────────────────────────────┴───────────┘│           │
└────────────────────────────────────────────┴───────────┘ 


Recursive acronyms need not recurse on the first word, or only once.  For example:


YOPY: Your Own Personal YOPY
PIPER: PIPER Is PIPER Expanded Recursively


Visualized:



Challenge

Input

You will be given two inputs:


A string whose space-delimited words form a recursive acronym.  That is, if you form a string from the first letter of each word, that string is guaranteed to be either:


One of the words of the input string (it may occur more than once).
A prefix of one or more of those words (e.g. GNU is a prefix of GNU's)
The casing will match exactly

A non-negative integer -- the number of times to recursively expand.  Given 0, you'll return the input unaltered (or "framed" once, in its entirety).  Given 1, you'll expand once.  Etc.  


Output

The output is the input string with all instances of the acronym visually expanded, recursively, the specified number of times.

You must use some visual effect to "frame" the nesting -- at minimum, distinct start and end delimiters like parentheses.  Ascii boxing of some sort, as in the examples above, is also fine.  As would be outputting an actual image that showed the nesting. 

I'm flexible as long as the nesting is in fact visualized.

For clarity, parenthesized output would like this:

(((GNU's Not Unix)'s Not Unix)'s Not Unix)'s Not Unix


You are guaranteed that parentheses will never be part of acronym.  Other than alphanumeric characters, the acronym will only contain apostrophes, commas, quotes, question marks and exclamation points, and those will only occur as valid punctuation (e.g., a question mark will not appear at the beginning of a word).  

This is code golf, fewest bytes wins, no loopholes.

Test Cases

This assumes you're using a parentheses visualization.  

Format for test cases:


Input string (the acronym)
Input integer (recursion)
Expected Output





GNU's Not Unix
0
GNU's Not Unix





GNU's Not Unix
2
((GNU's Not Unix)'s Not Unix)'s Not Unix





YOPY Own Personal YOPY
1
(YOPY Own Personal YOPY) Own Personal (YOPY Own Personal YOPY)





YOPY Own Personal YOPY
2
((YOPY Own Personal YOPY) Own Personal (YOPY Own Personal YOPY)) Own Personal ((YOPY Own Personal YOPY) Own Personal (YOPY Own Personal YOPY))






YourYOPY Own Personal YOPY
2
YourYOPY Own Personal (YourYOPY Own Personal (YourYOPY Own Personal YOPY))
APL (Dyalog Extended), 33 32 bytes

-1 byte thanks to Bubbler.



Anonymous infix lambda. Takes count as left argument and string as right argument.

{('\b',⊃¨⍵⊆⍨≠⍵)⎕R(1⌽')(',⍵)⍣⍺⊢⍵}


Try it online!

{…} "dfn"; number is ⍺ and text is ⍵:

 ⊢⍵ on the text:

 ⍣⍺ repeat given number of times

 (…)⎕R(…) PCRE Replace:

  ')(',⍵ the text prefixed by ")("

  1⌽ cyclically rotated one step left (puts ")" at end)

  … with:

  ≠⍵ The mask of non-spaces in the text

  ⍵⊆⍨ characters runs in the text corresponding to runs of 1s in that

  ⊃¨ first character of each

 '\b', prepend PCRE for word boundary