@font-face {
	font-family: "Teko";
	font-style: normal;
	font-weight: 500;
	src: url("fonts/teko-500.woff2") format("woff2");
}

* {
	box-sizing: border-box;
}

body {
	margin: 0;
	height: 100dvh;
	display: flex;
	overflow: hidden;
	color-scheme: dark;
	font-family: sans-serif;
	background: var(--bg-color);
	color: var(--text-color);
	--bg-color: black;
	--text-color: white;
	--border-color: #555;
}

#previewColumn,
#editorColumn {
	display: flex;
	flex-direction: column;
	min-width: 100px;
	overflow: auto;
}

#previewColumn {
	width: 60vw;
	resize: horizontal;
}

.layout2 #previewColumn {
	order: 1;
	width: auto;
	flex: 1 1 100px;
	resize: none;
}

.layout2 #editorColumn {
	width: 40vw;
	flex: 0 0 auto;
	resize: horizontal;
}

#previewTabs {
	justify-content: center;
	padding: 1px 0 0;
}

.tabs input {
	display: none;
}

.tabs span {
	display: block;
	position: relative;
	margin-bottom: -1px;
	padding: 3px 2ch;
	border: 1px solid transparent;
	border-radius: 3px 3px 0 0;
}

.tabs input:checked + span {
	background: #333;
	border-color: var(--border-color);
	border-bottom-color: #333;
}

.tabs input:not(:checked) + span:hover {
	background: #fff2;
}

.tabs input.empty:not(:checked) + span {
	opacity: 0.5;
}

#previewAll {
	min-height: 14.5rem;
	background: black url(images/glass-desert-env.jpg) center;
	background-size: cover;
	border: solid var(--border-color);
	border-width: 1px 0;
}

#preview {
	flex: 0 0 14.5rem;
	overflow: visible;
}

.scores {
	display: flex;
	flex-direction: column;
	flex-wrap: wrap;
	justify-content: center;
	align-content: center;
	flex: 1 1 auto;
	color: white;
	font-family: "Teko", sans-serif;
	font-weight: 500;
	font-size: 150%;
	text-align: center;
	overflow: auto;
}

.score {
	position: relative;
	margin: 0.75em;
	white-space: pre;
}

.bloom {
	position: absolute;
	inset: 0;
	margin: 0;
	mix-blend-mode: screen;
	filter: drop-shadow(0 0 1px #fffe) blur(7px);
}

#bRangeInput {
	flex-grow: 70;
	width: 70px;
}

#cRangeInput {
	flex-grow: 15;
	width: 15px;
}

#aRangeInput {
	flex-grow: 30;
	width: 30px;
}

#editorColumn {
	flex: 1 1 100px;
	display: flex;
	flex-direction: column;
	background: var(--bg-color);
	color: var(--text-color);
}

.toolbar {
	display: flex;
	flex-wrap: wrap;
	font-size: 80%;
	padding: 0.25em 0.5em;
	align-items: center;
}

#editorColumn .toolbar {
	padding: 0;
}

#previewColumn .toolbar > * {
	margin: 0 0.5em;
	color: #ccc;
}

#loadInput {
	width: 4em;
}

#loadInput option[value=""],
#fileInput {
	display: none;
}

#filenameInput {
	flex-grow: 1;
	width: 4em;
	padding: 0 0.5em;
	border: none;
}

#textInput {
	flex-grow: 1;
	width: 100%;
	min-width: 16em;
	min-height: 14.5rem;
	background: inherit;
	color: inherit;
	font-family: monospace;
	outline: none;
	resize: none;
}

#textInput.error {
	border-color: red;
	outline: thin solid red;
}

#error {
	padding: 0.25em;
	background-color: darkred;
	font-family: monospace;
}

#errorMessage {
	cursor: pointer;
}

button {
	margin: 1px 1px 1px 0;
}

input[type="text"],
input[type="number"] {
	background: var(--bg-color);
	color: var(--text-color);
	font-family: monospace;
}

input[type="range"] {
	min-width: 4em;
}

label {
	margin-left: 1em;
	user-select: none;
}

#help {
	width: 100%;
	min-height: 21.9em;
	font-size: 80%;
}

#help td:first-child {
	padding: 0 1em;
	font-family: monospace;
	font-size: 125%;
	white-space: nowrap;
}

#help td:nth-child(3) {
	width: 5em;
}

#help input {
	width: 5em;
	border: none;
}

#help code {
	font-size: 125%;
}

form {
	display: flex;
	flex-direction: column;
	flex-grow: 1;
}

textarea,
table,
td,
th {
	border: 1px solid var(--border-color);
	border-spacing: 0;
	border-collapse: collapse;
}

#colorInput {
	position: fixed;
	width: 20px;
	height: 20px;
	padding: 0;
	border: none;
}

#colorInput:hover {
	--border-color: var(--text-color);
}

#colorInput::-webkit-color-swatch-wrapper {
	padding: 0;
}

#colorInput::-webkit-color-swatch {
	border: 1px solid var(--border-color);
}

#colorInput::-moz-color-swatch {
	border: 1px solid var(--border-color);
}

#colorInput:not(.active) {
	display: none;
}

.layout2 .footer {
	flex-direction: row-reverse;
}

.spacer {
	flex: 1 1 0;
}

.hidden {
	display: none;
}
