What did I do wrong?

I wasn’t home all day and came back to my pink toe in the death curl:( I’m not really sure what happened, not enough ventilation? needed more space?? this is also my first tarantula and where I got it from they told me he/she could stay in the enclosure for a couple molts untill it needed a upgrade. It didn’t want to eat at all and I gave it water the last couple days.(literally a whole mealworm did its lifecycle in the enclosure) (enclosure pic when it was alive)