I'm having a bit of trouble understanding the Second Law of Thermodynamics, which seems to be far less intuitive than the First. From what I've read on it, the best way to describe it is that energy tends to disperse from being more "concentrated" to spread out/diluted. This makes sense from the perspective of a gas expanding into a vacuum or energy distributing from hot to cold, but feels more difficult in applying to the theoretical perpetual motion machine.
1) The Second Law tells us that we can't have any mechanism where all heat is completely converted into work, there is always some "waste heat". Heat and Work are both quantities which tell us the change in internal energy/kinetic energy of a system. When a system does work on its surroundings, while there is a reduction in heat, shouldn't an increase in the volume of the container increase the entropy, since you're increasing the number of positions which the gas can now occupy? Also, with expansion work, couldn't this result in a temperature increase of the surroundings, thereby increasing the overall entropy? I think my problem is that I'm not clear on the role which work plays in determining entropy, beyond representing ordered motion.
2) Also, because Entropy is considered a state function, how does this relate to the fact that the entropy of the universe is always increasing? Shouldn't it be possible to restore the state of the original system if it's considered an inherent property?