Why are there waves in seas towards shore - even in night?
Ocean waves (and also in mediterranean type seas and larger lakes, but on a smaller scale) are generated by two processes:


locally generated waves ("wind waves"), which follow the direction of the wind;
waves generated further out in the sea (i.e. "swell waves"), which do not necessarily follow the direction of the wind.


During the night, you are probably seeing swell waves. Of course, some wave energy is generated also in the opposite direction by the wind blowing offshore, but one can only "see" these waves further out in the sea if the wind is strong enough (see the definition of fetch). 

Also check the Figure [1] below for clarification on how swell is generated (the longer period wave energy travels faster than the energy of the shorter period waves, so the initial "random" wave field disintegrates into regular swell). 



Shallow water wave processes like diffraction and refraction will curve the paths of the waves that start reaching the coast and "feeling the bottom". The waves appear to be heading almost perpendicular when they reach the coast, even if 1 km out to sea they're moving almost parallel to the long distance coast.

How the waves appear at the coast to the observer depends on the direction of the local wind. Generally, if the local wind blows in the same direction as the waves (i.e. onshore wind), the waves appear "mushy" as the wind helps to break the waves (see example image). If the local wind blows in the opposite direction of the incoming waves (i.e. offshore wind), the waves maintain their shape due to opposing wind and they break later (see example image). These conditions are favourable to surfers.

[1] Holthuijsen, L. H. Waves in oceanic and coastal waters. Cambridge University press, 2010.