:root {
	/* --c-top: Khaki; */
	/* --c-middle: rgb(255, 255, 255); */
	/* --c-bottom: goldenrod; */
	--c-primary: rgb(47, 136, 99);
	--c-secondary: rgb(227, 125, 139);
	--c-bg: rgb(74, 151, 89);
}
body {
	background-color: rgb(74, 151, 89);
	font-family: "Lucida Sans", "Lucida Sans Regular", "Lucida Grande",
		"Lucida Sans Unicode", Geneva, Verdana, sans-serif;
	margin: 0;
	padding: 1rem;
	height: 100vh;
	height: 100dvh;
	box-sizing: border-box;
}

#base {
	z-index: 1;
}
#cheek {
	z-index: 2;
}
#eye {
	z-index: 3;
}
#brow {
	z-index: 4;
}
#mouth {
	z-index: 4;
}
#hat {
	z-index: 4;
}

.c-bottom {
	fill: var(--c-bottom);
}
.c-worry {
	--c-top: #37b9ff;
	--c-bottom: #fec92b;
}

#emojis-wrap {
	display: flex;
	flex-wrap: wrap;
	& svg {
		width: 50px;
	}
	max-height: 8rem;
	background-color: rgba(0, 0, 0, 0.203);
	overflow-y: scroll;
	border-radius: 10px;
}

#face-svg {
	width: 100%;
	height: auto;
	max-width: 20rem;
}

.face {
	display: grid;
	grid-template-areas: stack;
	place-items: center;
	width: 150px;

	& > img,
	& > svg {
		grid-area: stack;
		width: 200px;
	}
}

.cls-1,
.cls-2 {
	fill: #1a1a1a;
}
.cls-1 {
	opacity: 0;
}
/* face bg */
.cls-3 {
	fill: #022905;
}
.cls-skin {
	fill: rgb(236, 231, 130);
}
/* chin */
.cls-4 {
	fill: var(--c-bottom, crimson);
}
.cls-5 {
	fill: #fff;
}
line {
	stroke-linecap: round;
	stroke: #476475;
	stroke-miterlimit: 10;
	stroke-width: 4px;
}
.cls-6 {
	fill: red;
}
.cls-7 {
	fill: slategrey;
}
.cls-skyblue {
	fill: skyblue;
}
.cls-red {
	fill: #e62e49;
}
.cls-pink {
	fill: #ff608a;
}
.cls-pink-2 {
	fill: #c1506e;
}
.cls-gold {
	fill: rgb(237, 234, 159);
}
.cls-tounge {
	fill: red;
}
.cls-white {
	fill: white;
}
.cls-tooth {
	fill: rgb(170, 214, 215);
}
.cls-tooth-2 {
	fill: rgb(126, 151, 152);
}
.cls-water-2 {
	fill: #37b9ff;
}
.cls-water-1 {
	fill: #1778ff;
}
.cls-horns {
	fill: var(--c-bottom);
}
.cls-ice-2 {
	fill: #fff;
}
.cls-ice {
	fill: #cef;
}
.cls-brown-1,
.cls-brown-2 {
	fill: #1a1a1a;
}
.cls-brown-1 {
	opacity: 0;
}
.cls-brown-3 {
	fill: #9c3d29;
}
.cls-brown-4 {
	fill: #fec92b;
}
.cls-brown-5 {
	fill: #fdaf18;
}
.cls-brown-6 {
	fill: #fff;
}
.cls-brown-7 {
	fill: #c62d43;
}
.cls-brown-8 {
	fill: #bb5938;
}
.cls-brown-9 {
	fill: #de9c5a;
}
.cls-disguise-1,
.cls-disguise-2 {
	fill: #1a1a1a;
}
.cls-disguise-1 {
	opacity: 0;
}
.cls-disguise-3 {
	fill: #fec92b;
}
.cls-disguise-4 {
	fill: #fdaf18;
}
.cls-disguise-5 {
	fill: #9c3d29;
}
.cls-disguise-6 {
	fill: #bb5938;
}
.cls-disguise-10,
.cls-disguise-7 {
	fill: none;
	stroke: #476475;
	stroke-miterlimit: 10;
	stroke-width: 4px;
}
.cls-disguise-7 {
	stroke-linecap: round;
}
.cls-disguise-8 {
	fill: #fff;
}
.cls-disguise-9 {
	fill: #476475;
}
.cls-disguise-11 {
	fill: #fc9504;
}

.cls-vomit-1,
.cls-vomit-2 {
	fill: #1a1a1a;
}
.cls-vomit-1 {
	opacity: 0;
}
.cls-vomit-3 {
	fill: #fec92b;
}
.cls-vomit-4 {
	fill: #fdaf18;
}
.cls-vomit-5 {
	fill: #39b54a;
}
.cls-vomit-6 {
	fill: #008751;
}
.cls-vomit-7 {
	fill: #fff;
}
.cls-vomit-8 {
	fill: #65d666;
}
.cls-monocle-7 {
	fill: #7b97a6;
}
.cls-monocle-8 {
	opacity: 0.2;
}
.cls-monocle-10,
.cls-monocle-9 {
	fill: none;
	stroke: #7b97a6;
	stroke-linecap: round;
	stroke-miterlimit: 10;
	stroke-width: 4px;
}
.cls-monocle-10 {
	stroke-dasharray: 0.85 4.23;
}
.cls-party-1,
.cls-party-2 {
	fill: #1a1a1a;
}
.cls-party-1 {
	opacity: 0;
}
.cls-party-3 {
	fill: #fec92b;
}
.cls-party-4 {
	fill: #fdaf18;
}
.cls-party-5 {
	fill: none;
	stroke: #1778ff;
	stroke-linecap: round;
	stroke-miterlimit: 10;
	stroke-width: 3px;
}
.cls-party-6 {
	fill: #ff608a;
}
.cls-party-7 {
	fill: #a0f;
}
.cls-party-8 {
	fill: #65d666;
}
.cls-party-9 {
	fill: #37b9ff;
}
.cls-party-10 {
	fill: #e62e49;
}
.cls-party-11 {
	fill: #ff366a;
}
.cls-robot-1,
.cls-robot-2 {
	fill: #1a1a1a;
}
.cls-robot-1 {
	opacity: 0;
}
.cls-robot-3 {
	fill: #7b97a6;
}
.cls-robot-4 {
	fill: #d3dee3;
}
.cls-robot-5 {
	fill: #abc0c9;
}
.cls-robot-6 {
	fill: #1778ff;
}
.cls-robot-7 {
	fill: none;
	stroke: #fec92b;
	stroke-linecap: round;
	stroke-miterlimit: 10;
	stroke-width: 3px;
	stroke-dasharray: 4 7;
}
.cls-robot-8 {
	fill: #0049c7;
}
.cls-robot-9 {
	fill: #e62e49;
}
.cls-robot-10 {
	fill: #ffa8a1;
}
.cls-shadow {
	fill: black;
	opacity: 0.1;
}
.cls-sunglasses-1,
.cls-sunglasses-2 {
	fill: #1a1a1a;
}
.cls-sunglasses-1 {
	opacity: 0;
}
.cls-sunglasses-3 {
	fill: #fec92b;
}
.cls-sunglasses-4 {
	fill: #fdaf18;
}
.cls-sunglasses-5 {
	fill: #fff;
}
.cls-sunglasses-6 {
	fill: #324652;
}
.cls-sunglasses-7 {
	fill: #476475;
}
.cls-sunglasses-8 {
	fill: #5d7c8c;
}

#category-tabs {
	--br: 10px;
	list-style: none;
	display: flex;
	width: 100%;
	justify-content: space-evenly;

	& > button {
		flex: 1;
		border: solid navy 1px;
		padding: 0.3rem;
		background: linear-gradient(
			180deg,
			skyblue 10%,
			rgb(79, 147, 174) 60%,
			rgb(62, 62, 197) 80%,
			navy 100%
		);
		color: white;
	}

	& > button.selected {
		background: linear-gradient(
			180deg,
			navy 10%,
			rgb(79, 147, 174) 60%,
			rgb(62, 62, 197) 80%,
			skyblue 100%
		);
		color: rgb(199, 199, 199);
	}

	& > button:first-child {
		border-top-left-radius: var(--br);
		border-bottom-left-radius: var(--br);
	}
	& > button:last-child {
		border-top-right-radius: var(--br);
		border-bottom-right-radius: var(--br);
	}
}

.tileset-grid {
	display: grid;
	/* grid-template-columns: 1fr 1fr 1fr; */
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr));
	gap: 0.2rem;
	align-content: baseline;

	& > button {
		height: 5rem;
		border-radius: 15px;
		/* aspect-ratio: 1; */

		& > svg {
			filter: drop-shadow(rgba(0, 0, 0, 0.329) 2px 2px 3px);
			height: 100%;
		}
	}
}

button:hover,
a:hover {
	cursor: pointer;
	filter: brightness(1.2);
}
button:active,
a:active {
	cursor: pointer;
	filter: brightness(0.8);
}

.stack {
	display: grid;
	grid-template-areas: "stack";

	& > div {
		grid-area: stack;
	}
}

.hidden {
	visibility: hidden;
}
.none {
	display: none;
}

.avatar-preview {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	margin-bottom: 1rem;
}

.grid {
	display: grid;
  gap: 1rem;
}

.z-0 {
	z-index: 0;
}

fieldset {
	background-color: whitesmoke;
	border-radius: 5px;
	display: grid;
	gap: 0.4rem;

	& legend {
		font-size: 1.2rem;
		font-weight: bold;
		background-color: whitesmoke;
		border-radius: 5px;
		padding-inline: 0.3rem;
		border: #0000001c 2px solid;
	}
	& label {
		display: flex;
		justify-content: space-between;
		align-items: start;
		gap: 10px;
	}
}

#sync-state {
	background-color: rgb(177, 177, 177);
	border-radius: 30%;
	width: 20px;
	display: grid;
	place-items: center;
	/* place-content: center; */
	/* width: 10px; */
	transition-property: background-color;
	transition-duration: 400ms;

	&[data-sync-state="connecting"] {
		background-color: rgb(112, 112, 124);
	}
	&[data-sync-state="paused"] {
		background-color: rgb(171, 210, 168);
	}
	&[data-sync-state="syncing"] {
		background-color: rgb(1, 181, 1);
	}
	&[data-sync-state="connected"] {
		background-color: rgb(136, 141, 226);
	}
	&[data-sync-state="error"] {
		background-color: rgb(196, 63, 63);
	}
}

aside[role="toolbar"] {
	display: flex;
	gap: 0.5rem;
	flex-wrap: wrap;
	justify-content: end;
	max-width: 42rem;
}

#sync-state {
	position: absolute;
	top: 10px;
	right: 10px;
}

input[type="range"] {
	appearance: none;
	width: 100%;
	height: 1.5em;
	outline: none;
	border-radius: 99px;
	background: rgb(99, 99, 99);
	box-shadow: inset 3px 3px 2px rgb(87, 87, 87);
	cursor: pointer;
	transition: all ease-in-out 0.3s;

	&::-webkit-slider-thumb {
		-webkit-appearance: none;
		position: relative;
		width: 30px;
		height: 30px;
		border-radius: 50%;
		background: rgb(66, 66, 66);
		border: 1px solid #664aff;
		box-shadow: 3px 3px 8px rgba(0, 0, 0, 0.774), inset 1px 1px 1px #25ecd1;
		transition: all ease-in-out 0.5s;
		cursor: ew-resize;

		&::before {
			position: absolute;
			content: "xxxxxxx";
			top: 0;
			right: 0;
			bottom: 0;
			left: 0;
			background-image: linear-gradient(
				to bottom,
				hsl(344, 100%, 50%),
				hsl(31, 100%, 40%)
			);
			z-index: -1;
			transition: opacity 0.5s linear;
		}
	}
}

#messages-wrap {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 20rem));
	gap: 1rem;
	align-content: baseline;
	justify-content: center;
}

.msg-card {
	background-color: white;
	border-radius: 10px;
	padding: 1rem;
	margin-block: 0;

	&.new {
		border: double yellow 3px;
	}
}

form {
	max-width: 30rem;
	display: grid;
	gap: 0.7rem;

	& > label,
	& > fieldset > label {
		display: flex;
		flex-direction: column;
		justify-content: start;
	}

	& textarea {
		width: 100%;
		box-sizing: border-box;
		min-height: 10rem;
		resize: vertical;
	}

	& .success {
		background-color: green;
		color: white;
		margin-block: 0;
		padding: 0.2rem;
		visibility: hidden;
	}
}

.flex {
	display: flex;
	gap: 1rem;
}

hr {
	margin-block: 2rem;
}

button.delete {
	/* border-radius: 50%; */
	/* padding: 1rem; */
	position: absolute;
	top: 0;
	right: 0;

	&:hover {
		background-color: red;
		color: white;
	}
}

::-webkit-scrollbar {
	-webkit-appearance: none;
	width: 7px;
}
::-webkit-scrollbar-thumb {
	border-radius: 8px;
	background-color: rgba(0, 0, 0, 0.5);
	-webkit-box-shadow: 0 0 1px rgba(255, 255, 255, 0.5);
}

#part-tiles {
	max-height: 20em;
	/* overflow-y: scroll; */
	background-color: rgba(0, 0, 0, 0.134);
	border-radius: 10px;

	& > .tileset-grid {
		max-height: 20em;
		overflow-y: scroll;
	}
}

/* ANIMATION */
.anim-fade-in {
	opacity: 0;
	animation: fadeIn 1s ease-in forwards;
}

@keyframes fadeIn {
	from {
		opacity: 0;
		transform: translateY(10px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}
.emoji-thumbnail {
	& .delete-btn {
		transition: opacity, scale 300ms;
		scale: 0.7;
		transform-origin: 25% 25%;
		opacity: 0;
	}
	&:hover .delete-btn {
		opacity: 1;
		scale: 1;
	}
}

.btn {
	position: relative;
	background-color: var(--c-primary, green);
	border-radius: 100px;
	display: inline-flex;
	padding-inline: 1rem;
	align-items: center; /* Centers content vertically */
	justify-content: center; /* Centers content horizontally */
	padding: 1rem 2rem; /* Added vertical padding for better appearance */
	text-decoration: none;
	color: white;
	transition: background-color, filter, color 0.2s ease;
	min-height: 1rem;
  gap: 1rem;

	& :is(h1, h2, h3, h4, h5, h6) {
		margin-bottom: 0;
	}

	&::after {
		/* position: absolute; */
		/* right: 5px; */
		content: "➤";
		/* color: var(--c-bg); */
	}
}

a {
	color: var(--c-primary);

	&:hover {
		color: var(--c-secondary);
	}
	/* &:hover::after {
		color: white;
	} */
}

.card {
	background-color: whitesmoke;
	border-radius: 3px;
	box-shadow: rgba(0, 0, 0, 0.27) 3px 3px 3px;
	padding: 1rem;

	& h3:first-child {
		margin-top: 0;
		text-transform: capitalize;
	}

	& a {
		text-decoration: none;

		&:hover h3 {
			text-decoration: underline dotted;
		}
	}
}

.card-grid {
	display: grid;
	gap: 1rem;
	/* grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 20rem)); */
}

.side-by-side {
	display: flex;
	flex-wrap: wrap;
	gap: 2rem;
	& div:first-child {
		flex: 30%;
	}
	& div:last-child {
		flex: 1fr;
	}
	/* flex: content; */
}

.settings-wrap {
	margin-left: auto;
	/* width: min(15em, 100%); */
}

.spaced-out {
	display: flex;
}

.vertical-space-between {
	display: flex;
	flex-direction: column;
	justify-content: space-between;
}

#db-message {
	border-left-width: 5px;
	border-left-style: solid;
	border-left-color: var(--c-status, orange);
	&:empty {
		visibility: hidden;
	}
}

/* [popover] {
  position: fixed;
  inset: 0;
  width: fit-content;
  height: fit-content;
  margin: auto;
  border: solid;
  padding: 0.25em;
  overflow: auto;
  color: CanvasText;
  background-color: Canvas;
} */

:popover-open {
	/* margin-left: auto; */
	width: min(15em, 100%);
	/* height: 100px; */
	position: absolute;
	inset: unset;
	bottom: 1rem;
	right: 1rem;
	margin: 0;
}

#settings::backdrop {
	backdrop-filter: blur(2px) brightness(0.5);
}
