Over a weekend about a decade ago, I toyed with making a Final Fantasy Tactics-like game in the browser using CSS for the renderer. I could not get it to work in the time I gave it. I realized too late I needed to make some abstractions and stop trying to manipulate CSS directly.
Which is a long way of saying I appreciate how challenging this probably was to figure out. I love stuff like this.