:root {
  --background: #111111;
  --foreground: #eeeeee;
  --primary: #7498fc;
  --warning: #fcf774;
  --error: #fc7f74;
}

.c-warning {
	color: var(--warning);
}

.c-error {
	color: var(--error);
}

body {
	font: sans-serif;
	position: relative;
}

/* TODO: is there a better way to exclude last children */
.message-container h2:not(:nth-last-child(2)), 
.message-container ol:not(:nth-last-child(2)), 
.message-container p:not(:nth-last-child(2)) {
	margin-bottom: 1rem;
}

.message-container h3:not(:nth-last-child(2)) {
	margin-bottom: 0.25rem;
}

.header {
	display: flex;
	flex-direction: column;
	justify-content: center;
	row-gap: 1rem;
	position: absolute;
	align-items: start;
	left: 2rem;
	top: 2rem;
}

.header-modes-menu-info {
	display: flex;
	flex-direction: column;
	align-items: end;
}

.menu {
	display: flex;
	flex-direction: row;
	border-bottom: 1px solid var(--foreground);
	border-left: 1px solid var(--foreground);
	border-right: 1px solid var(--foreground);
	align-self: start;
	background-color: var(--foreground);
}

button {
	font-size: 0.7rem;
	background-color: var(--background);
	color: var(--foreground);
	padding: 0.5rem 1rem; 
	transition: all 0.5s;
}

a {
	color: var(--primary);
}

button:hover {
	background-color: var(--foreground);
	color: var(--background);
	cursor: pointer;
}

.header-modes {
	display: grid;
	grid-template-columns: repeat(2, auto);
	grid-template-rows: repeat(2,1fr);
	border-top: 1px solid var(--foreground);
	border-right: 1px solid var(--foreground);
	/* border-radius: 4px; */
	/* padding: 0.25rem; */
}

.header-mode-indicator, .operation-btn {
	padding: 0.5rem 1rem; 
	font-size: 0.7rem;
	transition: all 0.5s;
	text-align: center;
}

.border-hack {
	background-color: transparent;
	border-top: 1px solid var(--foreground);
	border-right: 1px solid var(--foreground);
}

.header-modes > .header-mode-indicator:first-child {
	border-left: 1px solid var(--foreground);
}

.header-mode-group {
	display: grid;
	grid-template-columns: repeat(2,1fr);
	grid-row: 1 / span 2;
	grid-column: 2;
}

.header-mode-group .header-mode-indicator:last-child {
	grid-column: 1 / span 2;
}

.header-info {
	display: flex;
	justify-content: center;
	column-gap: 0.5rem;
	color: var(--foreground);
	font-size: 0.75rem;
	padding: 0.5rem;
	align-self: stretch;
	border: 1px solid var(--foreground);
	background-color: var(--background);
}

.input-cont {
	display: none;
	column-gap: 0.5rem;
	align-items: center;
}

input, .input-text {
	color: var(--foreground);
	background-color: var(--background);
	font-size: 0.7rem;
	border: 1px solid var(--foreground);
	padding: 0.25rem;
}

input:focus, .input-text:focus {
	outline: none;
}

.input-text-label {
	color: var(--foreground);
	font-size: 0.7rem;
}

.dialog {
	background-color: var(--background);
	color: var(--foreground);
	border: 1px solid var(--foreground);
	padding: 2rem;
	margin: auto;
}

.message-container {
	display: none;
	background-color: var(--background);
	color: var(--foreground);
	border: 1px solid var(--foreground);
	position: absolute;
	font-size: 0.7rem;
	padding: 1rem;
	bottom: 0rem;
	left: 75%;
	max-width: calc(80ch);
	margin-right: 2rem; 
	margin-bottom: 2rem;
	max-height: 20rem;
	overflow: scroll;
}

.close-dialog {
	border: 1px solid var(--foreground);
	font-weight: bold;
	margin-top: 1rem;
}

.close-message {
	display: none;
	border: 1px solid var(--foreground);
	font-weight: bold;
	margin-top: 1rem;
}

.settings-controls {
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

.setting {
	display: flex;
	gap: 1rem;
	align-items: center;
	justify-content: space-between;
}

.mode-operations {
	display: none;
	position: absolute;
	border: 1px solid var(--foreground);
	right: 2rem;
	top: 2rem;
}

.help-cont {
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

input[type="checkbox"] {
	border: 1px solid var(--foreground);
	cursor: pointer;
	appearance: none;
	outline: 0;
	background: var(--background);
	height: 1rem;
	width: 1rem;
}

input[type="number"] {
    appearance: textfield;
    margin: 0;
}

input[type="checkbox"]:checked {
	background: var(--foreground);
}

.help-button-container {
	border: 1px solid var(--foreground);
	position: absolute;
	right: 2rem;
	bottom: 2rem;
}

.help-button {
}

canvas {
	background-color: var(--background);
}

@media (max-width: 900px) {
    html {
        font-size: 85%; /* Fixed size for larger screens */
    }

	.mode-operations {
		flex-direction: column;
	}
}
