Two gamekeepers have been accused of the manslaughter of their 18-year-old colleague after a shotgun went off in a 4x4.
Caernarfon Crown Court heard Peter Colwell was shot after a night out on 5 February last year in the car park of the Ship Inn pub in Llanbedrog, near Pwllheli.
Prosecutor Patrick Harrington said the semi-automatic shotgun was owned by Ben Wilson, 29, and was accidentally discharged by Ben Fitzsimons, 23.
Both men deny manslaughter.
Mr Harrington said Mr Fitzsimons had been sitting in the front passenger seat of the vehicle with the gun propped up to his right with the muzzle facing backwards.
Mr Harrington said Mr Wilson was in the car park, but not in the car at the time.
"The muzzle shouldn't have been pointing at the teenager, and there had been drinking by Fitzsimons and a gun which could be a lethal mix," Mr Harrington told the jury.
"The killing was neither deliberate nor malicious.
"But a young man died as the result of the cavalier disregard of the fundamental rules of gun safety by Ben Wilson and Ben Fitzsimons.
The prosecution claimed "gross negligence" caused the death.
Mr Wilson, who now lives in Ely, Cambridgeshire, admitted unlawfully having a loaded shotgun in a public place.
Mr Fitzsimons and his brother Michael Fitzsimons, 25, both of Nanhoron, Pwllheli, and another colleague Harry Butler, 23, of Llaniestyn, Pwllheli, deny unlawfully having a loaded shotgun in a public place.
They worked together, along with Mr Colwell, as gamekeepers on the Boduan Estate near Pwllheli.
Mr Wilson had lived close to his employer, who had a state-of-the-art gun store, and the prosecution said it would have been simple for him to store the gun there.
Mr Harrington added the weapon had a safety catch which, when operational, stopped it being fired and pressure had to be applied on the trigger, too.
The trial is expected to last three weeks.