Right side gives the sound:
元 yuán shifts to
玩 wán — initial drop with the rime preserved, a typical phonetic pattern. The first/primary meaning of
元 is irrelevant here; pure sound borrowing. Same phonetic in
完 wán (complete),
院 yuàn (courtyard),
远 yuǎn (far).