:root {
	--text-color: #fff;
	--highlight-color: #5e6e7d;
	--background-color-a: #485460; 
	--background-color-b: #1e272e;

	--red: #ff5e57;
	--orange: #ffc048;
	--yellow: #ffdd59;
	--green: #0be881;
	--blue: #4bcffa;
	--purple: #575fcf;
	--pink: #ef5777;

	--header-height: 75px;
	--page-width: 500px;
	--player-height: 50px;
	--input-height: 25px;
	--border-radius-round: 9999px;
	--shadow: 0 0 8px 4px var(--background-color-b);
	--transition-a: 300ms ease-in-out;
	--transition-b: 150ms ease-in-out;
	--font-family: "Work Sans", sans-serif;
}

html {
	font-size: 16px;
}

body {
	color: var(--text-color);
	background-color: var(--background-color-b);
	font-family: var(--font-family);
	margin: 0;
	overflow-x: hidden;
}

p {
	font-size: 1rem;
	font-family: var(--font-family);
	font-weight: 400;
}

header {
	display: flex;
	align-items: center;
    justify-content: space-between;
	height: var(--header-height);
	width: 100%;
	padding: 20px;
	background-color: var(--background-color-a);
	box-sizing: border-box;
}

header h1 {
	text-transform: uppercase;
}

main {
	display: flex;
	gap: 30px;
	flex-direction: column;
	max-width: var(--page-width);
	margin: 45px auto 75px auto;
}

main h2 {
	margin: 0;
}

/* #region GUESS */

#guess {
	display: none;
	gap: 7.5px;
	align-items: center;
    justify-content: center;
	height: 25px;
}

#guess.active {
	display: flex;
}

#guess p {
	margin: 0;
	margin-right: 2.5px;
}

#guess input::-webkit-outer-spin-button,
#guess input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

#guess input {
	-moz-appearance: textfield;
}

#toggle-guess-visibility {
	color: var(--text-color);
	background: none;
	border: none;
	padding: 0;
}

#toggle-guess-visibility:after {
	content: "\f06e";
	font-family: "Font Awesome 6 Free";
	font-weight: 900;
	font-size: 1.25rem;
}

#toggle-guess-visibility.active:after {
	content: "\f070";
}

#player-list.hidden-guesses .guess .number {
	filter: blur(3.5px);
}

#answer {
	display: none;
	width: fit-content;
    margin: auto;
	padding: 5px 10px;
	background-color: var(--background-color-a);
	border-radius: var(--border-radius-round);
	font-size: 1.25rem;
    font-weight: 600;
}

#answer.active {
	display: block;
}

/* #endregion */

/* #region PLAYER LIST */

#player-list {
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding: 0;
	margin: 0;
	list-style: none;
}

#player-list .player {
	position: relative;
	display: flex;
	justify-content: space-between;
	height: var(--player-height);
	padding: 0 10px;
	background-color: var(--background-color-a);
	border-radius: var(--border-radius-round);
	overflow: hidden;
}

.player span {
	display: flex;
	gap: 7.5px;
	align-items: center;
}

.player .profile .avatar {
	position: relative;
	display: flex;
    justify-content: center;
    align-items: center;
	width: calc(var(--player-height) - 10px);
	height: calc(var(--player-height) - 10px);
	color: var(--text-color);
	background-color: var(--red);
	font-weight: 700;
	font-size: 1.25rem;
	border-radius: 50%;
	overflow: hidden;
	cursor: default;

	user-select: none;
		-ms-user-select: none;
		-moz-user-select: none;
		-khtml-user-select: none;
		-webkit-user-select: none;
		-webkit-touch-callout: none;
}

.player .avatar:before {
	content: "\f068";
	position: absolute;
	top: 0;
	left: 0;
	display: flex;
	justify-content: center;
    align-items: center;
	width: 100%;
	height: 100%;
	background-color: var(--red);
	font-family: "Font Awesome 6 Free";
	font-weight: 900;
	font-size: 1.25rem;
	opacity: 0;
	transition: opacity var(--transition-a);
}

.player .avatar:hover:before {
	opacity: 1;
	cursor: pointer;
}

.player .avatar.purple {
	background-image: linear-gradient(135deg, var(--blue), var(--purple));
}

.player .avatar.orange {
	background-image: linear-gradient(135deg, var(--yellow), var(--red));
}

.player .avatar.red {
	background-image: linear-gradient(135deg, var(--pink), var(--red));
}

.player .avatar.green {
	background-image: linear-gradient(135deg, var(--blue), var(--green));
}

.player .score {
	position: absolute;
	left: 50%;
	top: 0;
}

.player .correction {
	font-size: 1rem;
}

.player .correction.winner {
	color: var(--green);
}

.player .correction:not(.winner) {
	color: var(--red);
}

.player .correction:after {
	font-family: "Font Awesome 6 Free";
	font-weight: 900;
}

.player .correction.correct:after {
	content: "\f00c";
}

.player .correction.up:after {
	content: "\f0d8";
}

.player .correction.down:after {
	content: "\f0d7";
}

/* #endregion */

/* #region ADD PLAYER*/

#add-player {
	display: flex;
    align-items: center;
	gap: 15px;
}

#add-player span {
	display: flex;
	gap: 7.5px;
	align-items: center;
	height: var(--input-height);
	opacity: 0;
	transition: opacity var(--transition-a);
}

#add-player span.active {
	opacity: 1;
}

#add-player span button, 
#guess button {
	height: var(--input-height);
	width: var(--input-height);
	font-size: 1rem;
}

#add-player button, 
#guess button {
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--text-color);
	background-color: var(--background-color-a);
	border: none;
	border-radius: 50%;
	aspect-ratio: 1;
	-webkit-tap-highlight-color: transparent;
	transition: background-color var(--transition-a);
	cursor: pointer;
}

#add-player > button {
	height: calc(var(--player-height) - 10px);
	width: calc(var(--player-height) - 10px);
	margin-left: 10px;
	font-size: 1.25rem;
}

#add-player button:hover, 
#guess button:hover {
	background-color: var(--green);
}

#add-player input, 
#guess input {
	height: var(--input-height);
	color: var(--text-color);
	background-color: var(--background-color-a);
	border: none;
	border-radius: var(--border-radius-round);
	outline: none;
	font-family: var(--font-family);
	font-size: 0.75rem;
	padding: 5px 10px;
}

/* #endregion */

aside {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	pointer-events: none;
}

/* #region CONTROLLER BUTTON */

aside #controller-button {
	position: fixed;
	bottom: 15px;
	left: calc(50% + calc(var(--page-width) / 2));
	transform: translateX(-100%);
	font-family: var(--font-family);
	font-weight: 700;
	font-size: 1.25rem;
	padding: 5px 10px;
	color: var(--text-color);
	background-color: var(--background-color-a);
	border: none;
	border-radius: var(--border-radius-round);
	outline: none;
	box-shadow: var(--shadow);
	opacity: 0;
	text-transform: uppercase;
	pointer-events: all;
	transition: var(--transition-b);
	transition-property: background-color, opacity;
	cursor: pointer;
}

aside #controller-button.active {
	opacity: 1;
}

aside #controller-button:hover {
	background-color: var(--highlight-color);
}

/* #endregion */

/* #region RESPONSIVENESS */

@media screen and (max-width: 500px) {
	main {
		margin: 45px 15px 75px 15px;
	}

	aside #controller-button {
		right: 15px;
		left: unset;
		transform: none;
	}
}

/* #endregion */