:root {
	--purple: #321d47;
	--yellow: #ffa400;
	--yellow-tint: #ffa40012;
	--grey: #8e8a8a;
	--grey-tint: #00000054;
	--grey-light: #aeac9c;
	--white: white;
	--black: black;
	--error: #8a504a;
	--dialling: #8c782a;
	--connected: #c1ffab;
	--highlight: #8464a4;

	/* Palette of background colours chosen by the session key. */
	--palette-0: #c1ffab; /* bright green */
	--palette-1: #c3c0a7; /* brown */
	--palette-2: #b7ae5e; /* gold */
	--palette-3: #6cc3c5; /* teal */
	--palette-4: #cccccc; /* grey */
	--palette-5: #88b6fb; /* blue */
	--palette-6: #cdff33; /* lime */
	--palette-7: #e796ea; /* purple */
}

html {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

body {
	align-items: center;
	background-image: url("space.svg");
	background-color: var(--purple);
	color: var(--white);
	display: flex;
	flex-direction: column;
	font-size: 18px;
	font-family: Arial, Helvetica, sans-serif;
	justify-content: center;
	height: 100vh;
	margin: 0;
	padding: 0;
	box-shadow: inset 0 0 150px -50px var(--black);
	transition: background-color 0.3s;
}

body.disconnected,
body.error {
	background-color: var(--error);
}

body.dialling {
	background-color: var(--dialling);
}

body.connected {
	background-color: var(--connected);
}

#footer {
	font-size: small;
	text-align: left;
}

.connected #footer {
	display: none;
}

#footer ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

#footer li {
	margin: 4px 0;
}

#main {
	display: flex;
	align-items: center;
	flex-flow: column;
	justify-content: space-between;
	padding: 1em 0;
	overflow: auto;
	text-align: center;
	box-shadow: 0px 0px 75px 0px var(--grey-tint);
	background: var(--purple);
	border: 4px solid transparent;
	box-sizing: border-box;
}

.connected #main {
	justify-content: space-between;
	transition: all 1s;
}

.highlight #main {
	background-color: var(--highlight);
	border: 4px dashed var(--white);
}

#prompt {
	display: flex;
	align-items: center;
	flex-flow: column;
}

#prompt input {
	margin: 4px;
}

.connected #prompt p,
.dialling #prompt p {
	display: none;
}

#info {
	margin: 16px 8px;
	font-size: 18px;
	padding: 8px 0;
	text-align: center;
}

.connected #info {
	display: none;
}

#top {
	display: none;
}

.connected #top {
	display: unset;
}

#filepicker {
	display: none;
}

#filepicker-wrap {
	display: inline-block;
}

#transfers {
	display: none;
	list-style-type: none;
	padding-left: 0;
	margin: 0;
	width: 80%;
	max-width: 400px;
}

.connected #transfers,
.dialling #transfers {
	display: unset;
}

#transfers li {
	border-color: var(--grey);
	border-style: solid;
	border-width: 1px;
	border-radius: 4px;
	background-color: var(--grey-tint);
	margin: 5px;
	padding: 8px;
	box-shadow: 0px 0px 4px 0px var(--grey-tint);
}

#transfers li.upload {
	list-style-type: "↑ ";
}

#transfers li.download {
	list-style-type: "↓ ";
}

#transfers li.pending {
	list-style-type: "... ";
}

#qr {
	margin: 4px;
	border: 2px solid;
	width: 256px;
	height: 256px;
	display: none;
}

.dialling #qr[src] {
	display: unset;
}

#magiccode {
	color: var(--yellow);
	background: var(--yellow-tint);
	border: 2px solid var(--yellow);
	border-radius: 10px;
	font-weight: bold;
	margin: 4px;
	padding: 16px;
	text-align: center;
	text-transform: uppercase;
}

.connected #magiccode {
	opacity: 0.2;
}

.error #magiccode {
	display: none;
}

#dial {
	text-transform: uppercase;
}

.connected #dial,
.error #dial {
	display: none;
}

#autocomplete {
	height: 1em;
	opacity: 0.5;
}

.connected #autocomplete,
.dialling #autocomplete {
	display: none;
}

.button {
	-webkit-appearance: none;
	appearance: none;
	background: var(--yellow);
	border-radius: 10px;
	border: none;
	box-shadow: 0px 0px 5px 0px var(--grey-tint);
	color: var(--purple);
	font-weight: bold;
	font-size: medium;
	cursor: pointer;
	margin: 8px 0px;
	padding: 16px;
	transition: all 0.2s ease 0s;
}

.button:hover {
	box-shadow: 0px 0px 5px 0px var(--grey-tint);
	opacity: 0.75;
}

.button:disabled,
.button:disabled:hover {
	background: var(--grey);
	box-shadow: 0px 0px 5px 0px var(--grey-tint);
	color: var(--grey-light);
	cursor: unset;
	letter-spacing: unset;
	transition: all 0.2s ease 0s;
}

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

a:link,
a:visited {
	border-bottom: 1px dotted;
}

a:link:hover,
a:visited:hover {
	border-bottom: 1px solid;
}


#main {
	height: min-content;
	min-height: 200px;
	width: 100%;
}

@media only screen and (min-width: 700px) {
	#main {
		width: min-content;
		min-width: 400px;
		height: 100%;
	}
	#info {
		margin-top: 10vh;
	}
}
