Pasarselo bien and derivatives
Just wondering about how this phrase and its derivatives work grammatically. I understand that "pasarselo bien" means "to have a good time" and that its literal is "to spend it well". However I don't quite understand what the "lo"/"it" is supposed to refer to. Originally I thought that "lo" was supposed to refer to whatever the person was doing to have a good time, however aside from that not making much sense I then saw this example on Memrise: "me lo paso bien jugando al futbol". Now I don't think "jugando al futbol" is clarification of the direct object in the sentence because aside from anything, it's not a noun phrase. So I can only imagine that "lo" or "it" is referring to time itself. Or in other words "I pass [the time] well playing football"? Would I be right?
5 Answers
There is a phrase "pasar un buen rato" Which gets shortened down to "pasarlo (the buen rato )bien".
Fui a una fiesta anoche y lo pasé muy bien. I went to a party last night and had a good time.
Some folks would make it reflexive and say "Me lo pasé muy bien."

Lo in this case is an abstract thing, so you can think of it as representing el día, el tiempo, las vacaciones, la experiencia, etc, if you want, but it´s really what ever is discussed. In these cases it is neuter gender, so gender agreement is not necessary.
This is similar to other usages of the neuter lo, ie: Vamos a hablar sobre lo de ayer .... let´s talk about the thing that occured yesterday.
The "thing" doesn´t necessarily have to be mentioned.
Thanks for the answers, I've read through all of them and they've all helped me improve my understanding.
Levelled:
After reviewing reviewing Julian's answer I'd say you are close.
The lo could refer to time, vacation or other things. The important thing to note is that with the "to spend time" meaning, pasar is transitive, meaning that in a sentence with this meaning there needs to be a direct object or direct object pronoun. If a direct object is specifically mentioned el día, cinco años, las vacaciones, etc. then the "lo" is not needed. If no direct object is stated, the lo has to be there for this meaning. You probably understand that many things can follow the verb and not be direct objects. In this case, none of the rest of your sentence could qualify as a direct object. bien is an adverb and jugando..... is an adverbial clause.
Anyway, read the rest for some examples that show when lo can and cannot be omitted.
Here are some example sentences from the SD dictionary:
Se pasaron el día hablando. They spent all day talking.
Here a time period is mentioned and there is no "lo".
Same here:
Fuimos a pasar el día en la playa. We went to the seaside for the day.
In the next one no time period (or direct object) was mentioned so the lo appears.
Lo pasaremos tan ricamente. We'll have such a good time.
¿Comó te pasaste el día?
How did you spend the day?
Me lo pasé bien, jugando al fútbol.
I spent it well, by playing footall....or I had a good time playing football.
Lo = el día
¿Cómo te pasaste tus vacaciones?
Me las pasé en grande, viajando por España.
Las = las vacaciones
¿Cómo te pasaste el día festivo?
How did you spend the holiday.
Me lo pasé bien, descansando todo el día.
I had a great time resting all day.
Lo = el día festivo
Note that there is a time period mentioned above (todo el día) but it is not a direct object, it is part of an adverbial clause so the "lo" is needed here.
¿Cómo te has pasado esta tarde?
How did you spend the afternoon?
Me ha pasado dos o tres horas leyendo.
I spent two or three hours reading.
Why no "lo"? A specific time period was mentioned, which becomes the direct object so so no direct object pronoun is needed.
¿Lo te pasaste bien?
Did you have a good time?
Sí, lo pasé muy bien.
Yes, I had a good time. (Literal: yes I passed "it" well.
Lo = it could represent the day, your vacation, your time at a party, your visit to your grandmother....whatever the two of you were talking about before. This is what Julian meant by it being an abstract, neuter pronoun
The reason the "lo" has to be there, is because pasar and pasarse are always used transitively (there must be a direct object or direct object pronoun) with this meaning of spending time doing something.
There are also intransitive uses of pasar and pasarse. These uses include something passing by (like a bus) or something happening / ocurring. e.g. ¿Qué pasa? What's happening?
By requiring that the "lo" be present if no time period is stated (in hours, days, months or years OR el fin de semana, las vacaciones, el viernes pasado, etc) this helps the listener to know that the verb is be used with the "spending time" meaning and not one of the other meanings that go with intransitive usage.