:root {
	--connected: #26f476;
	--lost-connection: #fd2828;
	--success: #26f476;
	--danger: #ff4e4e;
	--warn: #ffe720;
	--highlight: #ffe720;
	--navbar: #111618;
	--info-bar: #1a2124;
	--info-color: #b0bdc1;
	--self-msg-bg: #26f4bc;
	--self-msg-fg: #000000;
	--others-msg-bg: #1f282b;
	--others-msg-fg: #b0bdc1;
	--msg-input-bg: #20272b;
	--self-msg-link-fg: #004ea2;
	--others-msg-link-fg: #009fff;
}

*, :before, :after {
	-webkit-tap-highlight-color: transparent;
	outline: none;
	box-sizing: border-box;
}

html {
	font-size: 1px;
}

body {
	font-family: sans-serif, "Courier New", Courier, monospace;
	background-color: black;
	color: white;
	margin: 0;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	position: fixed;
	width: 100%;
	height: 100%;
	max-height: 100%;
	font-size: 16rem;
}

a {
	color: var(--self-msg-fg);
	text-decoration: underline;
}

#partial-data-viewer :not(.btn) > a {
	color: var(--others-msg-link-fg);
	background: var(--others-msg-bg);
}

.center, .screen-box .container {
	transform: translate(-50%, -50%);
	top: 50%;
	left: 50%;
}

.screen-box {
	position: fixed;
	z-index: 500;
	width: 100%;
	height: 100%;
	background-color: rgba(0, 0, 0, 0.8);
	top: 0;
	left: 0;
}

#partial-data-viewer.screen-box {
	z-index: 515;
}

.screen-box .container {
	position: relative;
	background: var(--others-msg-bg);
	color: var(--self-msg-bg);
	padding: 20px;
	max-width: 80%;
	max-height: 90%;
	overflow: auto;
}

.screen-box .container input {
	background: transparent;
	border: 1px solid var(--self-msg-bg);
	color: var(--self-msg-bg);
	padding: 8px;
	font-size: 1.2em;
	border-radius: 8px;
	width: 100%;
}

.screen-box .container li {
	margin-bottom: 5rem;
}

#navbar {
	position: relative;
	width: 100%;
	z-index: 510;
	background-color: var(--navbar);
	color: var(--self-msg-bg);
	height: 55px;
	display: flex;
	justify-content: space-between;
	padding: 5rem;
	align-items: center;
}

#navbar img {
	height: 32px;
}

#main-menu-icon {
	padding: 1rem 8rem;
	font-size: 1.5em;
}

#main-menu {
	position: fixed;
	display: none;
	top: 46px;
	background: #111618;
	background-color: var(--navbar);
	left: 0;
	width: 100%;
	height: 100%;
	height: calc(100% - 46px);
	z-index: 505;
	padding: 10rem;
	color: var(--info-color);
	overflow: auto;
}

#main-menu.active { display: block }

.setting-section .user-profile {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
}

.setting-section .user-profile .profile-picture-label {
	cursor: pointer;
	border-radius: 50%;
	overflow: hidden;
	display: flex;
}

.setting-section .user-profile .profile-picture {
	width: 60px;
	height: 60px;
}

.menu-icon {
	min-width: 25rem;
}

.setting-section > * {
	margin-bottom: 7rem;
}

.setting-input {
	display: flex;
	justify-content: space-between;
}

label.setting-input { cursor: pointer }

.setting-input > * {
	padding: 7rem;
}

.setting-operation > * {
	cursor: pointer;
	display: inline-block;
	padding: 7rem;
}

.setting-input select {
	background-color: var(--navbar);
	padding-bottom: 4rem;
	border: none;
	border-bottom: 2px solid var(--self-msg-bg);
	color: var(--self-msg-bg);
}

.room-info-box {
	cursor: pointer;
	color: var(--success);
	padding: 10rem;
	padding-top: 13rem;
	margin-top: 20rem;
	border-radius: 5px;
	border: 2px solid currentColor;
	position: relative;
}

.room-info-box.cant-join {
	cursor: no-drop;
}

.room-info-box .has-bg {
	background: var(--success);
	color: var(--self-msg-fg);
}

.room-info-box .access {
	position: absolute;
	left: -12rem;
	border-radius: 50%;
	font-size: 0.8em;
	text-align: center;
	padding: 3rem;
	width: 22rem;
	height: 22rem;
	transform: translateY(-50%);
	top: 50%;
}

.room-info-box .title {
	flex-grow: 1;
	padding: 0 10rem;
}

.room-info-box .join {
	cursor: inherit;
	position: absolute;
	border: none;
	border-radius: 6rem;
	padding: 3rem 10rem;
	top: -14rem;
	transform: translateX(-50%);
	left: 50%;
	transition: 0.2s;
}

.room-info-box .join:hover {
	transform: translateX(-50%) scale(1.2);
}

.room-info-box .users {
	font-size: 0.8em;
	line-height: 18rem;
	position: absolute;
	right: 10rem;
	top: 0;
}

.is-rtl .room-info-box .users{
	right: unset;
	left: 10rem;
}

.room-info-box .lock {
	position: absolute;
	right: -12rem;
	border-radius: 50%;
	font-size: 0.8em;
	padding: 3rem;
	width: 22rem;
	height: 22rem;
	text-align: center;
	transform: translateY(-50%);
	top: 50%;
}

.room-info-box.cant-join {
	border-color: var(--danger);
}

.room-info-box.cant-join .title {
	color: var(--danger);
}

.room-info-box.cant-join .has-bg {
	background-color: var(--danger);
}

.room-info-box.cant-join .has-bg.reason {
	background-color: var(--highlight);
}

.room-info-box.cant-join .users.reason {
	color: var(--danger);
}

#info {
	background: var(--info-bar);
	color: var(--info-color);
	height: 30px;
	padding: 5px;
	line-height: 1.5em;
	display: flex;
	justify-content: space-between;
	align-items: center;
}

#info > * {
	min-width: 70px;
	text-align: center;
}

#info .connected {
	color: var(--connected);
}

#info .connected .connection-icon {
	animation-name: fade-blink;
	animation-duration: 3s;
	animation-iteration-count: infinite;
}

#info .lost-connection {
	color: var(--lost-connection);
}

#info #room-info button {
	background: transparent;
	color: var(--self-msg-bg);
	border: 1px solid currentColor;
	padding: 4rem;
	border-radius: 5rem;
	cursor: pointer;
}

#connection-ping {
	min-width: 30px;
	display: inline-block;
}

#messages-wrapper {
	position: relative;
	flex-grow: 1;
	height: 100%;
	overflow: hidden;
	z-index: 5;
}

#messages {
	position: relative;
	overflow: auto;
	height: 100%;
	scroll-behavior: smooth;
	padding-bottom: 10rem;
}

#messages > div {
	overflow: auto;
}

.message.text-msg p {
	white-space: pre-wrap;
	margin-top: 0;
	margin-bottom: 10rem;
	overflow: hidden;
	word-wrap: break-word;
	word-break: break-word;
}

.message.self.text-msg a {
	color: var(--self-msg-link-fg);
}

.message.others.text-msg a {
	color: var(--others-msg-link-fg);
}

.message.file-msg {
	min-width: 70%;
	display: flex;
	align-items: center;
}

.message.file-msg .info {
	display: flex;
	flex-direction: column;
	overflow: hidden;
	padding: 5rem;
	padding-left: 12rem;
	line-height: 1.5;
	max-width: calc(100% - 40px);
}

.message.file-msg .download {
	border: 2rem solid currentColor;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
}

.message.file-msg .info > * {
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.message {
	transition: 0.3s;
	clear: both;
	position: relative;
	min-width: 100px;
	max-width: 100%;
	max-width: calc(100% - 40px);
	margin: 3rem;
	padding: 10px 8px;
	box-sizing: border-box;
	direction: ltr;
	border-radius: 4px;
	border-top-left-radius: 16px;
	border-top-right-radius: 16px;
}

.message.is-last::before {
	position: absolute;
	bottom: 0;
	display: block;
	width: 10px;
	height: 20px;
	pointer-events: none;
	content: " ";
	background-color: inherit;
	z-index: -1;
}

.message.self {
	float: right;
	border-bottom-right-radius: 4px;
	color: var(--self-msg-fg);
	background-color: var(--self-msg-bg);
	margin-right: 10rem;
}

.message.self::before {
	right: -6px;
	clip-path: polygon(0 50%, 0 100%, 100% 100%);
}

.message.others {
	float: left;
	border-bottom-left-radius: 4px;
	color: var(--others-msg-fg);
	background-color: var(--others-msg-bg);
	margin-left: 35rem;
	margin-top: 15rem;
}

.message.others::before {
	left: -6px;
	clip-path: polygon(0px 100%, 100.00% 50%, 100% 100%);
}

.message.continued {
	margin-top: 0;
}

.message.self.is-last {
	border-bottom-left-radius: 16px;
}

.message.others.is-last {
	border-bottom-right-radius: 16px;
}

.message.continued {
	border-top-left-radius: 4px;
	border-top-right-radius: 4px;
}

.message .from {
	font-size: 0.6em;
	color: white;
	border-radius: 4px;
	direction: ltr;
	position: absolute;
	top: -13rem;
	padding: 0 5rem;
}

.message .user-pp {
	position: absolute;
	width: 25rem;
	border-radius: 50%;
	bottom: 0;
	left: -30rem;
}

.message .time {
	position: absolute;
	bottom: 0;
	right: 0;
	display: block;
	font-size: 0.7em;
	padding: 3px;
	direction: ltr;
}

.message.others .time {
	right: 6px;
	opacity: 0.6;
}

.event {
	text-align: center;
	padding: 5px;
	position: relative;
	clear: both;
	margin: 3px 0;
}

.event .time {
	position: absolute;
	bottom: 0;
	font-size: 0.6em;
	color: var(--others-msg-fg);
	right: 0;
	padding: 3px;
	direction: ltr;
}

.event::before, .event::after {
	display: block;
	content: '';
	background: linear-gradient(to left, transparent 20%, var(--self-msg-bg) 50%, transparent 80%);
	height: 1px;
	position: absolute;
	width: 100%;
	left: 0;
}

.event.success-event::before, .event.success-event::after {
	background: linear-gradient(to left, transparent 20%, var(--success) 50%, transparent 80%);
}

.event.warn-event::before, .event.warn-event::after {
	background: linear-gradient(to left, transparent 20%, var(--warn) 50%, transparent 80%);
}

.event.danger-event::before, .event.danger-event::after {
	background: linear-gradient(to left, transparent 20%, var(--danger) 50%, transparent 80%);
}

.event::before { top: 0 }
.event::after { bottom: 0 }

#TapToScroll {
	position: absolute;
	top: -30px;
	z-index: 150;
	transform: translateX(-50%);
	left: 50%;
	animation-name: up-and-down;
	animation-duration: 2s;
	animation-iteration-count: infinite;
	cursor: pointer;
}

#TapToScroll > div {
	padding: 20px;
	background: #444;
	border-radius: 50%;
	height: 15px;
	width: 15px;
	display: flex;
	justify-content: center;
	align-items: center;
	background-color: var(--self-msg-bg);
	color: var(--self-msg-fg);
	box-shadow: 0 0 10px black;
}

#messageInput {
	width: 100%;
	text-align: center;
	padding: 5px 0;
	background: var(--msg-input-bg);
	position: relative;
}

#messageInput form {
	display: flex;
}

.progress-bar-container {
	position: absolute;
	top: -18rem;
	width: 100%;
	left: 0;
	padding: 7rem;
	z-index: 5;
}

.progress-bar-container .line {
	position: relative;
	background: var(--info-bar);
	width: 100%;
	height: 4rem;
	border-radius: 8px;
}

.progress-bar-container .line .progress {
	content: '';
	display: block;
	background: var(--success);
	width: 0;
	max-width: 100% !important;
	height: 100%;
	box-shadow: -2px 0 6px var(--success);
	transition: 0.2s;
	border-radius: inherit;
}

.progress-bar-container .abort {
	position: absolute;
	top: -15rem;
	right: 8rem;
	cursor: pointer;
}

.progress-bar-container .percent {
	position: absolute;
	top: -12rem;
	left: 8rem;
	color: var(--info-color);
}

#textInput {
	background: transparent;
	color: var(--self-msg-bg);
	border: 1px solid var(--self-msg-bg);
	border-radius: 15px;
	padding: 10px;
	flex-grow: 1;
	margin: 4px;
	resize: none;
	height: 38rem;
}

#submitButton {
	display: none;
	opacity: 0;
	visibility: hidden;
}

#send-message, #select-file-input {
	overflow: hidden;
	transition: 0.3s;
	width: 0;
}

#send-message.show, #select-file-input.show {
	width: 65px;
}

#messageInput label {
	background: var(--self-msg-bg);
	width: 45px;
	height: 45px;
	display: flex;
	align-items: center;
	align-content: center;
	text-align: center;
	color: var(--self-msg-fg);
	border-radius: 50%;
	margin-left: 10px;
	cursor: pointer;
	justify-content: center;
	overflow: hidden;
}

.user-info-box {
	position: relative;
	border: 1px solid var(--self-msg-bg);
	border-radius: 5px;
	padding: 5rem 6rem;
	margin: 8rem 0;
	direction: ltr;
	display: flex;
	justify-content: space-between;
	flex-wrap: wrap;
	align-items: center;
}

.user-info-box .user-username {
	margin: 10rem 0;
}

.user-info-actions {
	height: 100%;
}

.user-actions-box > * {
	margin: 0 5rem !important;
	padding: 1rem 2rem;
	cursor: pointer;
}

.custom-placeholder {
	position: relative;
	display: inline-block;
}

.custom-placeholder .placeholder {
	position: absolute;
	top: 10rem;
	margin: 0 8px;
	transition: 0.1s;
	pointer-events: none;
	line-height: 22rem;
	color: var(--self-msg-bg);
}

.custom-placeholder input.d-none + .placeholder {
	display: none;
}

input:focus + .placeholder, textarea:focus + .placeholder, .hasValue + .placeholder {
	transform: scale(0.8) translateY(-27rem);
	background: var(--others-msg-bg);
	padding: 0 10rem;
	margin: 0;
	height: 22rem;
	color: var(--others-msg-fg);
}

.btn {
	cursor: pointer;
	padding: 6rem 10rem;
	background: var(--self-msg-bg);
	border: none;
	border-radius: 5px;
	font-size: 1em;
	margin-top: 5rem;
}

.disabled {
	opacity: 0.5;
	pointer-events: none;
}

.d-none { display: none !important }
.d-flex { display: flex; flex-wrap: wrap; }
.justify-between { justify-content: space-between }
.c-pointer { cursor: pointer }
.dir-rtl { direction: rtl }
.color-danger { color: var(--danger) }
.color-hightlight { color: var(--highlight) }
.p-0 { padding: 0 }
.p-5 { padding: 5rem }
.mx-5 { margin-left: 5rem !important; margin-right: 5rem !important; }
img { max-width: 100% }

.input-group {
	display: inline-block;
	vertical-align: middle;
	margin: 7rem 0;
}

.check-container {
	display: block;
	position: relative;
	padding-left: 25rem;
	cursor: pointer;
	-webkit-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
	user-select: none;
}

.check-container > * {
	vertical-align: middle;
}

.check-container input {
	display: none;
}

.check-container .checkmark {
	position: absolute;
	top: 0;
	left: 0;
	height: 20rem;
	width: 20rem;
	background-color: transparent;
	border: 2rem solid var(--self-msg-bg);
	border-radius: 6rem;
}

.check-container .checkmark::after {
	content: "";
	position: absolute;
	display: none;
	left: 5rem;
	top: 1rem;
	width: 7rem;
	height: 13rem;
	border: solid var(--self-msg-fg);
	border-width: 0 3rem 3rem 0;
	-webkit-transform: rotate(45deg);
	-ms-transform: rotate(45deg);
	transform: rotate(45deg);
}

.check-container input:checked ~ .checkmark {
	background-color: var(--self-msg-bg);
}

.check-container input:checked ~ .checkmark::after {
	display: block;
}

footer {
	background-color: var(--others-msg-bg);
	color: var(--others-msg-fg);
	padding: 3rem 20rem;
	min-height: 18px;
	text-align: left;
	direction: ltr;
	font-size: 0.6em;
	display: flex;
	flex-direction: row;
	justify-content: space-between;
}

footer a {
	color: white;
	text-decoration: none;
}

@keyframes fade-blink {
	25% { opacity: 1 }
	50% { opacity: 0 }
	75% { opacity: 1 }
}

@keyframes up-and-down {
	0% { margin-top: 0 }
	50% { margin-top: -10px }
	100% { margin-top: 0 }
}

/* Right-to-Left override */
.is-rtl .screen-box .container {
	transform: translate(50%, -50%);
	left: unset;
	right: 50%;
}

.is-rtl .check-container {
	padding-left: unset;
	padding-right: 25rem;
}

.is-rtl .check-container .checkmark {
	left: unset;
	right: 0;
}

.is-rtl .check-container .checkmark::after {
	left: unset;
	right: 5rem;
}

.dropzone-container {
	display: none;
	background: rgba(0, 0, 0, 0.8);
	position: absolute;
	top: 0;
	width: 100%;
	height: 100%;
	justify-content: center;
	align-items: center;
	padding: 5px;
}

.dropzone-container.dropzone-dragging {
	display: flex;
}

.dropzone {
	width: 100%;
	height: 100%;
	text-align: center;
	border: 4px dashed currentColor;
}

.dropzone i {
	font-size: 4em;
	position: absolute;
}