:root {
	--dark0: #0a0a0a;
	--dark1: #141414;
	--dark2: #1f1f1f;
	--dark3: #292929;
	--border: rgba(255,255,255,0.1);
	--scroll: rgba(255,255,255,0.2);
	--highlight: rgba(255,255,255,0.05);
	--focus: rgba(255,255,255,0.25);
	--text: #ffffff;
}

html, body, main, aside { height: 100%; }

* {
	margin: 0;
	font-family: Lexend, sans-serif;
	color: var(--text);
}

*::-webkit-scrollbar { width: 2px; }
*::-webkit-scrollbar-thumb {
	background: var(--scroll);
	border-radius: 99px;
}

body {
	background-color: var(--dark1);
	display: grid;
}

/*nav*/

nav {
	display: flex;
	gap: 5px 10px;
	padding: 10px 15px;
	background: var(--dark1);
	border-bottom: 1px solid var(--border);
	flex-wrap: wrap;
	position: relative;
}

#brand {
	position: relative;
	display: flex;
	align-items: center;
	cursor: pointer;
	gap: 10px;
	
}
#brand img { height: 32px; width: 32px; }
#brand h1 { font-size: 1.5rem; }


#tooltip {
	position: absolute;
	top: 40px;
	left: 0;
	padding: 5px 10px;
	background: var(--dark2);
	border-radius: 5px;
	font-size: 0.8rem;
	border: 1px solid var(--border);
	box-shadow: 0 5px 15px rgba(0,0,0,0.5);
	white-space: nowrap;
	z-index: 99;
	opacity: 0;
	visibility: hidden;
	transition: 0.2s;
}

#brand:hover #tooltip {
	opacity: 1;
	visibility: visible;
}

#search {
	flex: 1;
	min-width: 200px;
	background: var(--dark0);
	border: 1px solid var(--border);
	border-radius: 5px;
	padding: 5px 10px;
	outline: none;
}
#search:focus { border-color: var(--focus); }

#filters {
	display: flex;
	gap: 5px 10px;
	flex: 1;
}

.dropdown {
	position: relative;
	white-space: nowrap;
}

.dropdown-header {
	background: var(--dark0);
	border: 1px solid var(--border);
	padding: 5px 10px;
	border-radius: 5px;
	cursor: pointer;
	display: flex;
	align-items: center;
	gap: 5px;
}

.dropdown-header::after {
	content: "expand_more";
	font-family: "Material Icons";
	opacity: 0.5;
}

.elipsis { opacity: 0.5; }

.dropdown-menu {
	position: absolute;
	top: calc(100% + 5px);
	left: 0;
	background: var(--dark2);
	border: 1px solid var(--border);
	border-radius: 5px;
	flex-direction: column;
	max-height: 200px;
	overflow-y: auto;
	z-index: 99;
	opacity: 0;
	display: none;
}

.dropdown.open .dropdown-header {
	border-color: var(--focus);
}

.dropdown.open .dropdown-menu {
	display: flex;
	opacity: 1;
}

.option {
	display: flex;
	align-items: center;
	gap: 5px;
	padding: 5px 20px 5px 5px;
	cursor: pointer;
	font-size: 0.8rem;
}

.option:hover {
	background: var(--highlight);
}

.tags {
	display: flex;
	flex-wrap: wrap;
	gap: 5px;
	margin-top: 10px;
}

.tag {
	background: var(--dark1);
	border: 1px solid var(--border);
	border-radius: 5px;
	display: flex;
	align-items: center;
	gap: 5px;
	padding: 5px 10px;
	font-size: 0.8rem;
}

.icon {
	width: 20px;
	height: 20px;
	display: flex;
	justify-content: center;
	align-items: center;
	position: relative;
}

.icon img {
	max-width: 100%;
	max-height: 100%;
}

.icon-group {
	display: flex;
	gap: 2px;
}

#clear {
	background: var(--dark0);
	border: 1px solid #ff6666;
	border-radius: 5px;
	padding: 3px;
	cursor: pointer;
	transition: 0.1s;
	
}

#clear:hover {
	background: rgba(255,64,64,0.05);
	border-color: #ff4040;
	color: #ff4040;
}

#clear .material-icons {
	color: #ff6666;
	transition: 0.1s;
}
#clear:hover .material-icons {
	color: #ff4040;
}


/*main*/

main {
    min-height: 0;
    overflow-y: auto;
    display: flex;
    gap: 10px;
    padding: 20px;
    flex-wrap: wrap;
    align-content: flex-start;
    justify-content: center;
	background-image:
		linear-gradient(var(--dark3) 1px, transparent 1px),
		linear-gradient(90deg, var(--dark3) 1px, transparent 1px);
	background-size: 40px 40px;
	background-position: calc(50% - 20px) 15px;
	box-sizing: border-box;
}

main img {
	width: 70px;
	aspect-ratio: 1 / 1;
	object-fit: contain;
	border-radius: 15px;
	cursor: pointer;
	transition: transform 0.15s ease;
	box-shadow: 0 0 5px 0px #000;
}

main img:hover {
	transform: scale(1.05);
}

/*aside*/

aside {
	background: var(--dark2);
	padding: 10px;
	overflow-y: auto;
    min-height: 0;
	box-sizing: border-box;
	border-left: 1px solid var(--border);
}

aside h2, aside h3 { text-align: center; }

.build {
	background: var(--dark1);
	border: 1px solid var(--border);
	border-radius: 10px;
	padding: 10px;
	margin-top: 10px;
	display: flex;
    flex-direction: column;
	gap: 5px;
}

.gear {
	display: grid;
	grid-template-columns: 100px auto;
	gap: 5px;
}

.beascuit, .toppings {
	position: relative;
	aspect-ratio: 1 / 1;
	display: flex;
	justify-content: center;
}

.gear img {
	position: absolute;
	height: 100%;
	object-fit: contain;
}

.gear ul {
	padding-left: 5px;
	display: flex;
	flex-direction: column;
	justify-content: center;
	list-style: none;
}

.gear li::before { content: "✦ "; }
.build p { font-size: .8rem; }
.toppings img:not(:first-child) { width: 31%; }
.toppings img:nth-child(2) { left:50%; top:27%; transform:translate(-50%,-50%) rotate(0deg); }
.toppings img:nth-child(3) { left:28%; top:45%; transform:translate(-50%,-50%) rotate(-72deg); }
.toppings img:nth-child(4) { left:72%; top:45%; transform:translate(-50%,-50%) rotate(72deg); }
.toppings img:nth-child(5) { left:36%; top:71%; transform:translate(-50%,-50%) rotate(-144deg); }
.toppings img:nth-child(6) { left:64%; top:71%; transform:translate(-50%,-50%) rotate(144deg); }

@media (min-width: 801px) {
	aside {
		grid-column: 2;
		grid-row: 1 / 3;
	}
	body {
		grid-template-columns: auto 350px;
		grid-template-rows: auto 1fr;
	}
}

@media (max-width: 810px) {
	#filters {
		gap: 5px;
	}
	main {
		padding: 10px;
		background-position: calc(50% - 20px) 5px;
	}
	.dropdown-header { font-size: .8rem; }
	.icon {
		width: 16px;
		height: 16px;
	}
	aside {
		border-left: none;
		border-top: 1px solid var(--border);
	}
	aside h2 { font-size: 1.17rem; }
	body {
		grid-template-rows: auto 1fr 300px;
	}
}

.filter-btn {
	display: none;
	align-items: center;
	padding: 3px;
	cursor: pointer;
	background: var(--dark0);
	border: 1px solid var(--border);
	border-radius: 5px;
}

@media (max-width: 1450px) {
	.filter-btn {
		display: flex;
	}

	#filters {
		display: none;
		position: absolute;
		top: calc(100% + 5px);
		max-width: calc(100% - 30px);
		flex-wrap: wrap;
		z-index: 99;
	}
	.filter-btn.active {
		border-color: var(--focus);
	}
	#filters.open {
		display: flex;
	}
}

@media (max-width: 500px) {
	#brand h1 { display: none; }
}

.option.active {
	background: var(--highlight);
	border-left: 2px solid var(--focus);
}