/* CANVAS */

#canvas-container {
	width: 70%;
	min-width: var(--min-content-width);
	height: auto;
	left: 0;
	right: 0;
	margin: 0 auto;
}

/* CONTROL GROUPS */

.control-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 10px;
}

.control-group {
	display: grid;
	gap: 10px;
}

/* KNOBS */

.knob {
	box-sizing: border-box;
}

.knob > .wheel.disabled {
	opacity: 0.5;
}

.knob > * {
	display: inline-block;
	vertical-align: middle;
}

.knob > label {
	flex: 1;
	white-space: nowrap;
	position: relative;
	vertical-align: top;
	padding-left: var(--edge-padding);
}

.knob > label > p {
	padding: 0;
	margin: 0;
	line-height: 1.2em;
}

.knob > label .name {
	color: var(--color-text);
}

.knob > label output {
	font-weight: bold;
}

.knob > .wheel {
	border-radius: 50%;
	border: 2px solid var(--color-text);
	box-sizing: border-box;
	outline: 0px solid var(--color3);
	/* This fixes a tiny gap between rounded borders and outlines */
	outline-offset: -1px;
	width: var(--finger-size);
	aspect-ratio: 1;
	position: relative;
	transition:
		border 60ms linear,
		outline 60ms linear;
	margin: 3px;
}

.knob > .wheel:not(.disabled) {
	cursor: ns-resize;
}

.knob > .wheel:hover:not(.disabled),
.knob > .wheel.changing:not(.disabled) {
	border-width: 4px;
}

.knob > .wheel.changing:not(.disabled) {
	outline-width: 4px;
}

.knob > .wheel > .marker {
	position: absolute;
	display: block;
	left: 50%;
	top: 0%;
	transform: translateY(50%) rotate(var(--angle)) translateY(-50%);
	transition: transform 40ms ease-out;
	width: 0;
	height: 50%;
	outline: 1px solid var(--color-text);
}

/* GAUGES */

.gauge > label > .name {
	display: block;
	/*width: 100%;*/
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
	margin-right: 10px;
}

.gauge > label > output {
	font-weight: bold;
}

.gauge > label {
	font-family: var(--font-family);
}

.gauge > meter {
	width: 100%;
	height: 0.75em;
	border-radius: 0.75em;
	border: 1px solid var(--color2);
	background: var(--color2);
	box-shadow: 0 0 2px 0 var(--color5) inset;
}

.gauge > meter::-webkit-meter-bar,
.gauge > meter::-moz-meter-bar {
	background:
		linear-gradient(-90deg, transparent 0px, var(--color4) 30vw),
		url("/static/img/moire-dark.png") repeat,
		var(--color5);
	background-position: top left;
}

/* COMBO BOX */

.combobox > label {
	color: var(--text-color-dim);
}

.combobox > select {
	min-width: 100px;
	padding: 4px 8px;
	height: var(--finger-size);
	box-sizing: border-box;
}

.combobox > * {
	display: block;
}

/* CHECKBOX */

.checkbox,
.checkbox > input[type="checkbox"],
.checkbox > label {
	color: var(--text-color);
	margin: 0;
}

.checkbox > label {
	line-height: var(--finger-size);
}

.checkbox > input[type="checkbox"] {
	accent-color: var(--color3);
}

@keyframes pop-rotate {
	0% {
		transform: scale(1) rotate(0deg);
	}
	70% {
		transform: scale(1.4) rotate(8deg);
	}
	100% {
		transform: scale(1.2) rotate(5deg);
	}
}

.checkbox > input[type="checkbox"]:checked {
	animation: pop-rotate 80ms ease-out;
	animation-fill-mode: forwards;
}

.checkbox > label {
	padding-left: 6px;
}

.checkbox input[type="checkbox"]:disabled + label {
	opacity: 0.6;
}
