You need blank lines above and below the details block. Looks like you need blank lines above and below the code block too. Let me see…
details go here
This text will not be visible until you expand the spoiler.
it also works with blurred text
this is code
Like so?
[details=details go here]
This text will not be visible until you expand the spoiler.
[spoiler]it also works with blurred text[/spoiler]
```
this is code
```
[/details]