@font-face {
	font-family: CascadiaMono;
	src: url("/CascadiaMono.ttf") format("truetype");
}

*,
*::before,
*::after {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

:root {
	text-rendering: optimizeLegibility;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;

	color-scheme: dark;
	--text-color: #ecf6ff;
	--background-color: #14161d;
}

html {
	font-size: 62.5%;
}

body {
	font-family: CascadiaMono, sans-serif;
	font-size: 1.6rem;
	line-height: 1.5;
	font-weight: 400;
	color: var(--text-color);
	background-color: var(--background-color);
	height: 100vh;
	padding: 2rem;
}

a {
	color: var(--text-color);
	text-decoration: none;
}

a:hover {
	color: var(--text-color);
	text-decoration: underline;
}

.container {
	display: flex;
	border: 1px solid var(--text-color);
	height: 100%;
	width: 100%;
}

.container > div {
	display: flex;
	flex-direction: column;
	width: 100%;
}

ul#chat {
	width: 100%;
	list-style: none;
	margin: 0;
	overflow-y: auto;
	flex-grow: 1;
	padding: 2rem;
}

ul#chat li.message {
	margin: 0.4rem 0;
	user-select: none;
}

ul#chat li.message:first-child {
	margin-top: 0;
}

ul#chat li.message:last-child {
	margin-bottom: 0;
}

ul#chat li.message .timestamp::before,
ul#chat li.message .timestamp::after {
	font-size: 1.6rem;
}

ul#chat li.message .timestamp::before {
	content: "[";
}

ul#chat li.message .timestamp {
	color: #7f8c8d;
	font-size: 1.4rem;
	vertical-align: middle;
	margin-right: 1ch;
}

ul#chat li.message .timestamp::after {
	content: "]";
}

ul#chat li.message .timestamp,
ul#chat li.message .username {
	white-space: nowrap;
}

ul#chat li.message .username {
	font-weight: 600;
	margin-right: 0.7ch;
	user-select: text;
}

.red {
	color: #e74c3c !important;
}

.green {
	color: #2ecc71 !important;
}

.yellow {
	color: #f1c40f !important;
}

.blue {
	color: #3498db !important;
}
.magenta {
	color: #9b59b6 !important;
}

.cyan {
	color: #1abc9c !important;
}

.white {
	color: #ecf0f1 !important;
}

ul#chat li.message .username::after {
	content: ":";
	color: var(--text-color);
}

ul#chat li.message .text {
	flex-grow: 1;
	min-width: 0;
	white-space: pre-wrap;
	word-wrap: break-word;
	overflow-wrap: break-word;
	user-select: text;
}

.input-container {
	border-top: 1px solid var(--text-color);
	display: flex;
}

.input-container input {
	width: 100%;
	padding: 1.4rem 1.2rem;
	border: none;
	background-color: transparent;
	color: var(--text-color);
	font-family: CascadiaMono, sans-serif;
	font-size: 1.6rem;
}

.input-container input:focus {
	outline: none;
	background-color: #111214;
}

.users {
	border-left: 1px solid var(--text-color);
	max-width: 40rem;
	width: 100%;
	padding: 2rem;
}

.users h2 {
	font-size: 1.8rem;
	margin-bottom: 0.4rem;
}

.users ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

@media screen and (max-width: 500px) {
	body {
		padding: 1rem;
	}

	.container {
		padding-top: 1rem;
	}

	ul#chat {
		padding: 0 1rem;
		padding-bottom: 1rem;
	}
}
