html,
body {
	font-family: Helvetica, sans-serif;
	padding: 0;
	margin: 0;
	background: #1B1B1B;
	color: white;
	width: 100%;
	height: 100%;
	margin: 0;
	overflow: hidden;
}

.buttons-overlay {
	position: absolute;
	top: 0;
	display: flex;
	gap: 6px;
	margin: 6px;
}
#buttons-overlay-left {
	left: 0;
}
#buttons-overlay-right {
	right: 0;
}
.buttons-overlay .button-visual {
	transition: width 0.5s;
}
.buttons-overlay .button-visual .text-label {
	transition: opacity 0.5s, max-width 0.5s;
	overflow: hidden;
	max-width: 300px;
}
@media (max-width: 720px) {
	.buttons-overlay .button-visual .text-label {
		opacity: 0;
		max-width: 0;
	}
	.buttons-overlay .button-visual {
		width: 32px;
	}
}

.outer-container {
	display: flex;
	height: 100%;
}

.centering-container {
	display: flex;
	align-items: center;
	justify-content: center;
	flex: 1;
	/*overflow-y: scroll;*/ /* always visible so page doesn't shift horizontally when scrollbar appears or disappears */
	overflow-y: auto; /* scrollbar only visible when needed */

	/* reserve space for the top buttons */
	margin-top: 3em;
}

.app-main {
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	margin: auto;
	z-index: 1;
}

#fullscreen-target {
	position: fixed;
	top: 0;
	left: 0;
	pointer-events: none;
}

#fullscreen-target,
#midi-viz-canvas {
	pointer-events: none;
}

.error-message {
	background: maroon;
	color: white;
	padding: 1em;
}
.error-message pre {
	margin: 0;
	margin-top: 1em;
}

fieldset.labeled-radio-buttons {
	margin: 0;
	padding: 0;
	border: 0;
}
fieldset.labeled-radio-buttons > legend {
	margin: 0;
	padding: 0;
	float: left;
	font: inherit;
}
.labeled-radio-buttons label {
	display: inline-block;
}

fieldset.ui-section {
	border: 2px solid gray;
	border-radius: 8px;
	background: rgba(30, 30, 30, 0.5);
	padding: 1em;
	/* padding-bottom: calc(1em + 1.3em / 2); - to balance with the top which has the <legend>, mathematically */
	padding-bottom: 1.5em; /* to balance with the top which has the <legend> */
}
fieldset.ui-section > legend {
	background-color: #1a1a1a;
	color: #aaa;
	padding: 3px 6px;
	border-radius: 2px;
	font-size: 1.3em;
}
fieldset.ui-section:not(:first-of-type) {
	margin-top: 1.3em;
}
.control-row {
	line-height: 2em;
}
.control-row:not(:first-of-type) {
	margin-top: 0.5em;
}

#midi-exporting-clearing-controls {
	display: flex;
	flex-direction: row;
	align-items: center;
}
@media (max-width: 600px) {
	/* allow the controls to wrap, so that the whole UI can shrink */
	#midi-exporting-clearing-controls {
		flex-wrap: wrap;
	}
}
#clear-button,
#undo-clear-button {
	margin-left: auto;
}

ul.bullets-in-items {
	list-style-type: none;
	padding: 0;
}
li {
	padding: 2px 0;
}
.supported {
	color: lime;
}
.bulleted-list {
	color: #dedede;
	padding-left: 1.1em;
}

.button-functional {
	border: none;
	background: none;
	padding: 0;
}
/* Note: don't make a [hidden] { display: none !important; } rule as it will break the aria.modal library */
.button-functional,
.button-visual,
#demo-button-stop-text:not([hidden]),
#demo-button-start-text:not([hidden]) {
	vertical-align: middle;
	display: inline-flex; /* NOTE: overrides display: none implicit style from "hidden" attribute*/
	justify-content: center;
	align-items: center;
}
.button-functional[hidden] {
	visibility: hidden;
}
#clear-button[hidden],
#undo-clear-button[hidden] {
	display: none;
}

.button-visual {
	pointer-events: none; /* needed for ARIAModal library to show dialog */
	line-height: 0.8;
	height: 1.5em;
	width: 10em;
	font-size: 14px;
	font-weight: bold;
	background-color: #434343;
	background-image: linear-gradient(100% 100% 90deg, #515151, #7A7A7A);
	border: none;
	border-radius: 4px;
	box-shadow: inset 0 1px 2px rgba(255,255,255,0.2), 0 1px 0 #2D2D2D, 0 2px 0 #2D2D2D, 0 3px 0 #2C2C2C, 0 4px 0 #2A2A2A, 0 0 0 2px black, 0 4px 0 2px black, 0 0 0 3px #222, 0 4px 0 3px #222;
	padding: 9px 16px;
	margin-bottom: 3px;
	color: #ddd;
}

.button-functional:disabled .button-visual {
	color: #555;
	background: #222;
	box-shadow: inset 0 1px 2px rgba(255,255,255,0.05), 0 4px 0 #111, 0 0 0 2px black, 0 4px 0 2px black, 0 0 0 3px #222, 0 4px 0 3px #222;
}

.button-functional:enabled:hover .button-visual { color: white }

.button-functional:enabled:active .button-visual {
	margin-top: 3px;
	margin-bottom: 0px;
	box-shadow: inset 0 1px 2px rgba(255,255,255,0.2), 0 1px 0 #2A2A2A, 0 1px 0 2px black, 0 1px 0 3px #222;
} 

.button-functional {
	outline: none;
}
.button-functional:focus .button-visual {
	outline: 2px auto #2b8ce2;
	outline: 2px auto -webkit-focus-ring-color;
}

.button-visual span[aria-hidden],
.button-visual:not(.popover-button) svg {
	margin-right: 5px;
}
.button-visual svg {
	height: 1.5em;
	width: 1.5em;
	flex: 0 0 auto;
}
#setup-3d-button svg {
	height: 1.5em;
	width: calc(1.5em * 1.5);
}
#learn-range-or-apply-button svg {
	height: 1.5em;
	width: 3em;
}
#fullscreen-button svg,
#demo-button svg {
	height: 1em;
	width: 1em;
}
#github-button svg {
	height: 1.3em;
	width: 1.3em;
}
#undo-clear-button svg {
	height: 1.3em;
	width: 1.3em;
}
.fill-cc {
	fill: currentColor;
}
button:disabled .fill-cc-if-disabled {
	fill: currentColor;
}

#song-name-input {
	margin-left: 7px;
	width: auto;
}

input[type="text"],
input[type="number"] {
	background: #111;
	color: white;
	padding: 4px;
	width: calc(4ch + 20px);
	border: 1px solid #5f5f5f;
	border-radius: 2px;
}
input[type="text"]:disabled,
input[type="number"]:disabled {
	color: #555;
	background: #111;
	border-color: #333;
}
input[type="text"]:invalid,
input[type="number"]:invalid {
	background: #e83636;
	color: white;
}

input[type="checkbox"]:disabled,
input[type="radio"]:disabled {
	opacity: 0.3;
}

.disabled {
	color: rgba(128, 128, 128, 0.7);
}
.disabled svg,
:disabled svg {
	opacity: 0.5;
}
.disabled select {
	opacity: 0.3;
}

a {
	color: #00ceff;
}

.visually-hidden {
	position: absolute;
	left: -10000px;
	top: auto;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.a11y-modal {
	background: #111;
	color: white;
	/* Ensures modal's close button is accessible when viewport is narrow */
	box-sizing: border-box;
}

.is-icon-btn:hover [data-modal-x],
.is-icon-btn:focus [data-modal-x] {
	color: white;
}

/* Settings modal should be allowed to be a little bigger than a11y-modal's default,
so that the Learn Range and (usually invisible) Cancel button can fit on one row with the label and inputs. */
#settings-modal-content {
	max-width: 700px;
}

/* Align info dialog's heading with logo icon */
@media (min-width: 520px) {
	/* App name and tagline both beside icon */
	#info-modal-content h1,
	#info-modal-content h2 {
		margin: 0;
	}
}
@media (max-width: 519px) {
	/* Tagline on a separate row */
	#info-modal-content h2 {
		clear: both;
	}
}
@media (max-width: 519px) and (min-width: 360px) {
	/* App name not wrapped; center it vertically with the icon */
	/* This is an inexact approach, using media queries, as it depends on the font, so there's an edge case or two where it won't look as nice. */
	#info-modal-content h1 {
		/* using rem to match img size style defined in HTML, given that the h1 has a different em scale */
		line-height: 4rem;
	}
}
@media (max-width: 270px) {
	/* App name on a separate row */
	#info-modal-content h1 {
		clear: both;
	}
}

#element-to-transform {
	position: absolute;
	left: 0;
	top: 0;
	width: 150px;
	height: 120px;
	border: 4px solid red;
	transform-origin: 0 0;
	pointer-events: none;
	color: white;
	background: rgba(0, 0, 0, 0.2);
}

