/* HUD overlays the bottom of the canvas and wraps on small screens */
#hud {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 12px;		/* slightly above bottom */
	z-index: 10;

	display: flex;
	flex-wrap: wrap;		/* <-- enables wrapping */
	justify-content: center;
	align-items: center;
	gap: 0.5rem;			/* space between items, also between rows */

	pointer-events: none;	/* parent ignores clicks */
	padding: 4px 8px;
	box-sizing: border-box;
}

/* All HUD items get a controlled box size */
#hud .hud-item,
#hud input,
#hud select,
#hud button {
	min-height: 28px;
	height: 28px;
	line-height: 28px;
	padding: 0 8px;
	font-size: 14px;

	display: inline-flex;
	align-items: center;
	justify-content: center;

	box-sizing: border-box;
	pointer-events: auto;	/* items are clickable */
}

/* Any <img> used inside a HUD button now scales properly */
#hud .hud-item img,
#hud button img,
#hud input img {
	height: 20px;
	width: auto;
	display: block;
	pointer-events: none;	/* click goes to the button, not the img */
}
