Easiest way to do it for a non-sloped top (still possible, but more difficult for a sloped top) is to size your pieces so that the plastic sheet and top piece of wood fit just inside the side walls (when the side walls are assembled to form a rectangle). Then lay the top face-down (the imaginary top, mind you, since it’s just 4 pieces of wood forming a rectangle) on a smooth flat surface. Put the plastic sheet in first so it’s lying flat against the surface - don’t be an idiot and remove the protective sheets before the stick is complete, btw - and then fit the top piece on top of that. Install the corner pieces which will hold up the top piece and plastic, and bingo - everything at the top is flush.
EDIT: Here’s an example
Front/back side pieces are 12"x3"x3/4"
Left/right side pieces are 10"x3"x3/4"
Ends are 45-deg mitered
The internal dimensions of the rectangle that the four pieces form when assembled will be 10.5"x8.5", so make your plastic sheet and top piece 10.5"x8.5"