Designated ports are simply ports that are attached to something, be it another switch or a host. If the port is empty, ie no cable attached, it's simply down and not participating in Spanning Tree. Only the Root Bridge has all it's ports as Designated/Forwarding.
The MAC address is used to elect the Root Bridge if the switches all have the same priority. Default priority is 32768. The priority can be changed, with the lowest number being Zero. The increments are in multiples of 4096 and end at 61440 (so 0, then 4096, then 8192 etc...). with 32768 being the mid point. So, if two or more switches have the same priority, then they must have a tie breaker, which is MAC address. Lowest number wins, IE the switch with the lowest priority will be the Root Bridge. If two switches have the same priority, then MAC address is used and again, lowest number wins.
Spanning tree works by choosing a port to block, thereby preventing switching loops by effectively shutting down an interface. The interface(s) chosen are usually on the switch with the highest priority or the highest MAC address.
Path costs also play a part at the interface level in deciding which interfaces Spanning Tree should block as Spanning Tree PDU's contain the Bridge Priority, MAC address and path cost information.