:root {
	/* --posterWidth: 190px;
	--posterHeight: 281px;
	--containerSizeMultiplicator: .6; */
	--posterWidth: 114px;
	--posterHeight: 171px;
	--horisontalPadding: 5px;
	--glowColor: #fff1c9;
	--headerMargin: 2vw;
	--scrollBarWidth: 16px;
}

html {
	color-scheme: dark;
	scroll-snap-type: mandatory;
}

/* html {
	box-sizing: border-box;
}

*,
*:before,
*:after {
	box-sizing: inherit;
} */

body,
a {
	color: #eee;
}

body,
h1,
h2 {
	margin: 0;
}

body {
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	background: #191922 url(images/metal-30.jpg) fixed no-repeat center;
	background-size: cover;
	font-family: "Fira Sans Condensed", sans-serif;
}

header,
.genres {
	cursor: default;
}



/*******************
		HEADER
*******************/

header {
	height: 35px;
	width: 100vw;
	/* padding-top: 50px; */
	position: fixed;
	top: 0;
	left: 0;
	/* display: flex; */
	/* flex-wrap: wrap; */
	/* justify-content: center; */
	/* text-align: center; */
	user-select: none;
	z-index: 3;
}


header>h1,
header>div#sort {
	display: block;
	width: fit-content;
	transform: translateX(calc(50vw - 50%)) translateY(50px);
	transition: all .5s ease-out,
		box-shadow .2s ease-in-out;
}

header.sticky {
	/* padding: 0; */
	/* margin-bottom: 40px; */
	/* align-items: center; */
	/* vertically align text in the middle of container */
	/* justify-content: space-between; */
	/* divide elements to left and right side, respectively */
	background-color: rgba(0, 0, 0, .3);
	backdrop-filter: blur(5px);
	box-shadow: 0 2px 5px #000;
}

header>h1 {
	font-size: 300%;
	/* width: 100%; */
	text-transform: uppercase;
	color: #eee;
	/* margin: 40px 0 0 0; */
	/* position: relative;
	left: 50%;
	transform: translate(-16%); */
	text-shadow:
		-1px -1px 0px var(--header3Dcolor),
		-2px -2px 0px var(--header3Dcolor),
		-3px -3px 0px var(--header3Dcolor),
		-4px -4px 0px var(--header3Dcolor),
		-5px -5px 0px var(--header3Dcolor),
		-6px -6px 0px var(--header3Dcolor);
}

header.sticky>h1 {
	font-size: 150%;
	/* width: auto; */
	/* position: fixed;
	top: 5px;
	left: 5px; */
	/* margin: 0;
	margin-left: 20px; */
	text-shadow: none;
	color: var(--header3Dcolor);
	/* transform: none; */
	transform: translateX(var(--headerMargin)) translateY(4px);
	cursor: pointer;
}

header>div#sort {
	font-size: 80%;
	word-spacing: 4px;
	padding: 5px 10px;
	/* position: relative;
	right: -50%;
	transform: translate(-9%); */
	/* text-shadow: 0px 1px 0px rgba(255, 255, 255, .5); */
	background-color: rgba(0, 0, 0, .5);
	border-radius: 7px;
}

header.sticky>div#sort {
	/* position: fixed;
	top: 6px;
	right: 0; */
	/* float: right; */
	/* transform: none; */
	transform: translateX(calc(100vw - var(--headerMargin) - 100% - var(--scrollBarWidth))) translateY(-22px);
	/* text-shadow: none; */
	background: none;
}

/* header > div#sort > #arrow {
	font-size: 70%;
	padding-bottom: 2px;
} */

header>div#sort>a {
	cursor: pointer;
	text-decoration: none;
	color: var(--header3Dcolor);
}

header>div#sort>a:hover {
	text-decoration: underline;
	/* filter: invert(100%); */
	filter: hue-rotate(90deg);
}

header>div#sort>a#asc::before,
header>div#sort>a#desc::before {
	font-size: 80%;
	display: inline-block;
	margin-right: 1px;
}

header>div#sort>a#asc::before {
	content: "▲";
	position: relative;
	top: -1px;
}

header>div#sort>a#desc::before {
	content: "▼";
}

header>div#login {
	position: absolute;
	top: 7px;
	right: 24px;
}

header>div#login>a {
	text-decoration: none;
	opacity: .3;
}

header>div#login>a:hover {
	opacity: 1;
}



/*******************
		MAIN
*******************/

main {
	width: 80%;
	margin: 200px auto 0 auto;
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
}

main>div.container {
	/* width: calc(var(--posterWidth) * var(--containerSizeMultiplicator)); */
	width: var(--posterWidth);
	margin: 10px 20px;
	position: relative;
	scroll-snap-align: start;
}

main>div.container a {
	display: block;
	width: 100%;
	text-decoration: none;
}

main>div.container>a:hover>div.poster {
	box-shadow: 0 0 50px -20px var(--glowColor),
		0 5px 5px 0 #000;
}

main>div.container>a:hover>div.poster>div.overlay {
	filter: grayscale(70%) brightness(50%);
}

main>div.container>div.rating,
main>div.container>a>div.seasons {
	position: relative;
	float: right;
	line-height: 1;
	z-index: 1;
}

main>div.container>div.rating {
	top: -8px;
	right: 4px;
}

main>div.container>div.rating>a {
	mix-blend-mode: difference;
	color: #fa0;
	text-shadow:
		-1px -1px 0 #000,
		1px -1px 0 #000,
		-1px 1px 0 #000,
		1px 1px 0 #000;
}

main>div.container>div.rating>a:hover {
	color: #fe7;
	cursor: help;
}

main>div.container>a>div.poster {
	/* width: calc(var(--posterWidth) * var(--containerSizeMultiplicator));
	height: calc(var(--posterHeight) * var(--containerSizeMultiplicator)); */
	width: var(--posterWidth);
	height: var(--posterHeight);
	/* background-size: contain; */
	background-size: cover;
	background-repeat: no-repeat;
	background-position: center;
	position: relative;
	box-shadow: 0 5px 5px 0 #000;
}

main>div.container>a>div.poster>div.overlay {
	position: absolute;
	right: 0;
	height: 100%;
	background-image: inherit;
	background-size: cover;
	background-position: top right;
	filter: grayscale(100%) brightness(40%);
}

main>div.container>a>div.poster>div.overlay.todo {
	filter: grayscale(50%) brightness(50%);
}

main>div.container>a>div.seasons {
	--size: 20px;
	--bottomPadding: 4px;
	bottom: calc(var(--size) + 18px + var(--bottomPadding));
	margin-bottom: calc(var(--size) * -2);
	background: linear-gradient(315deg, rgba(0, 0, 0, 1) 10%, rgba(0, 0, 0, 0) 70%);
	padding: var(--size) 5px var(--bottomPadding) var(--size);
	border-top-left-radius: 100%;
}

main>div.container>a>div.progress {
	--barHeight: 2px;
	position: relative;
	bottom: var(--barHeight);
	height: var(--barHeight);
	width: 100%;
	z-index: 2;
}

main>div.container>a>div.progress.finished {
	background-color: #6d6;
}

main>div.container>a>div.progress.watching {
	background-color: #fc9;
}

main>div.container>a>div.progress.todo {
	background-color: #d66;
	background-color: #69c;
}

main>div.container>a>div.bar {
	height: 100%;
	z-index: -1;
	position: absolute;
	border-top-right-radius: 2px;
	border-bottom-right-radius: 2px;
}

main>div.container>a>div.bar.finished {
	background-color: #373;
}

main>div.container>a>div.bar.active {
	background-color: #963;
}

main>div.container>a>div.title,
main>div.container>div.genres {
	padding-left: var(--horisontalPadding);
	padding-right: var(--horisontalPadding);
}

main>div.container>a>div.title {
	padding-top: 10px;
	padding-bottom: 2px;
	text-shadow: 0px 1px 0px #000;
	/* width: calc(var(--posterWidth) * var(--containerSizeMultiplicator) - 2 * var(--horisontalPadding)); */
	width: var(--posterWidth) - 2 * var(--horisontalPadding);
}

main>div.container>div.genres {
	font-size: 70%;
	color: #fff;
	mix-blend-mode: difference;
}



/*******************
		FOOTER
*******************/

footer {
	/* margin-top: auto; */
	margin-top: 20px;
	padding: 10px 20px;
	color: #479;
	display: flex;
	flex-wrap: wrap;
	justify-content: left;
	gap: 50px;
	overflow: hidden;
}

footer>div#stats,
canvas#genreChart {
	background-color: rgba(0, 0, 0, .5);
	border: 2px solid rgba(0, 0, 0, .5);
	border-radius: 7px;
}

footer>div#stats {
	height: fit-content;
	padding: 20px;
}

footer>div#stats>h2,
footer>div#stats>table {
	width: max-content;
}

footer>div#stats>h2 {
	margin-bottom: 10px;
}

footer>div#stats>table {
	border-collapse: collapse;
}

footer>div#stats>table>tbody>tr>td {
	padding: 2px 0;
}

footer>div#stats>table>tbody>tr>td:last-child {
	text-align: right;
	padding-left: 20px;
}

canvas#genreChart {
	/* margin: 50px auto 20px auto; */
	min-width: 800px;
	max-width: 800px;
	min-height: 400px;
	max-height: 400px;
	padding: 20px 20px 10px 20px;
}