# Write the fully merged HTML (with real per-card avatars/sprites) to a new file
html = r"""
Flash Royale
0
Idle
Online: 0
02:00
2× ELIXIR
What’s new in Flash Royale
- Scripted and brought to you by Chace, enjoy!
- Real per-card avatars on the battlefield (sprite render + soft shadow & subtle bob).
- Deck builder: limit to 8 cards; add/remove cards in the Deck view.
- Battle rotation: only 4 cards visible; when used, a card cycles to the back.
- Emotes: both players see emote bubbles above king towers.
- Pocketing: after you destroy an enemy lane tower, you can place units on that lane of their side.
- Match timer: 2:00 regulation. If one player has taken a lane tower and still has both of theirs at the horn, they win.
- Overtime: if no winner at 2:00, display banner and enable 2× elixir.
- Skeleton Army: spread-out swarm with separation so they don’t stack unrealistically.
- Bugfix: coins (+100) and trophies (+5) reliably grant on win.
- Bugfix: rooms clean up correctly when both players leave or a match ends.
- UI polish: battle-only timer/controls stay hidden in the menu.
Click × to close
"""
# Quick fix: a typo slipped in drawArena (I used 'x='). Replace that token.
html = html.replace("const bridges=[ {x=BRIDGE_CENTERS[0]-BRIDGE_W/2, y:RIVER_Y-6}, {x:BRIDGE_CENTERS[1]-BRIDGE_W/2, y:RIVER_Y-6} ];",
"const bridges=[ {x:BRIDGE_CENTERS[0]-BRIDGE_W/2, y:RIVER_Y-6}, {x:BRIDGE_CENTERS[1]-BRIDGE_W/2, y:RIVER_Y-6} ];")
out_path = "/mnt/data/flash-royale-avatars.html"
with open(out_path, "w", encoding="utf-8") as f:
f.write(html)
out_path