html,
body {
	margin: 0;
	padding: 0;
	min-height: 100vh;
}

body {
	font-family: sans-serif;
	display: grid;
	grid-template-rows: auto 1fr;
	background: #eeeeee;
	user-select: none;
	-webkit-touch-callout: none;

	--resize-width: 3px;
	--resize-length-corner: 18px;
	--resize-length-edge: 22px;
	--resize-pad: 8px;
}

.menu {
	display: flex;
	flex-flow: row wrap;
	gap: 4px 12px;
	background: #dddddd;
	padding: 4px;
	position: sticky;
	top: 0;
	z-index: 1;
}

.menu > div {
	display: flex;
	gap: 4px;
}

button {
	width: 2em;
	height: 2em;
	font: 1em sans-serif;
	line-height: 1;
	background: linear-gradient(to bottom, #f8f8f8, #e8e8e8);
	border: 1px solid #888888;
	border-top-color: #999999;
	border-bottom-color: #777777;
	border-radius: 4px;
	padding: 0;
}

button:hover {
	background: linear-gradient(to bottom, #ffffff, #eeeeee);
}

button:active {
	background: linear-gradient(to bottom, #dddddd, #e0e0e0);
	border-color: #666666;
}

button:active:hover {
	background: linear-gradient(to bottom, #cccccc, #d0d0d0);
}

.sample {
	display: inline-block;
	vertical-align: middle;
	width: 1.2em;
	height: 1.2em;
	border: 1px solid #000000;
	border-radius: 100%;
	background: var(--col);
	box-sizing: border-box;
}

button[data-active] {
	background: linear-gradient(to bottom, #cccccc, #d0d0d0);
	border-color: #666666;
	box-shadow: inset 0 1px 2px #00000033;
}

button[data-active] .sample {
	box-shadow: 0 0 1px 2px #66aadd;
}

.display {
	padding: 8px;
	display: flex;
	flex-flow: row wrap;
	justify-content: center;
	gap: 16px;
}

.centre {
	flex: 1000000;
	display: grid;
	align-content: center;
	justify-content: center;
}

.preview {
	width: max(45vw, 45vh);
	height: max(45vw, 45vh);
	align-self: center;
	border: 1px solid #666666;
	box-sizing: border-box;
}

.preview canvas {
	width: 100%;
	height: 100%;
	touch-action: none;
	user-select: none;
	-webkit-touch-callout: none;
}
