*,
*::before,
*::after {
	box-sizing: border-box;
}

:root {
	--primary: #1b181b;
	--secondary: #2f2c2f;
	--highlight-dark: #431a64;
	--highlight-light: #500b88;
	--text-color: #f5f8f5;
	--player-font: "Press Start 2P", "Gill Sans", "Gill Sans MT", Calibri,
		"Trebuchet MS", sans-serif;
	--sans-font: "Poppins", sans-serif;
	--animation-length: 0.2s;
}

html,
body {
	height: 100%;
}

body {
	margin: 0;
	background-color: var(--primary);
	display: flex;
	justify-content: center;
	align-items: center;
	font-family: var(--sans-font);
	color: var(--text-color);
}

.hidden {
	visibility: hidden;
	opacity: 0;
	pointer-events: none;
}

button {
	cursor: pointer;
}

a {
	text-decoration: none;
}

/* HAMBURGER MENU */

.menu {
	background-color: transparent;
	position: absolute;
	top: 16px;
	left: 8px;
	padding: 1em 0.5em;
	border: 0;
	z-index: 10;
}

.hamburger {
	display: block;
	position: relative;
}

.hamburger,
.hamburger::before,
.hamburger::after {
	width: 3.2em;
	height: 6px;
	background: linear-gradient(
		135deg,
		var(--highlight-dark),
		var(--highlight-light)
	);
	border-radius: 2px;

	transition: transform 350ms ease, opacity 200ms linear;
}

.hamburger::before,
.hamburger::after {
	content: "";
	position: absolute;
	left: 0;
}

.hamburger::before {
	bottom: 12px;
}
.hamburger::after {
	top: 12px;
}

.menu[aria-expanded="true"] .hamburger {
	transform: rotate(45deg);
}

.menu[aria-expanded="true"] .hamburger::before {
	opacity: 0;
}

.menu[aria-expanded="true"] .hamburger::after {
	transform: rotate(90deg) translate(-12px);
}

.modal {
	position: absolute;
	top: 0;
	left: 0;
	background-color: rgba(0, 0, 0, 0.5);
	height: 100%;
	width: 100%;
	z-index: 9;
	display: flex;
	justify-content: center;
	align-items: center;
	transition: opacity var(--animation-length) ease-in-out;
}

.modal-content {
	background-color: var(--secondary);
	padding: 10px 20px;
	border-radius: 5px;
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	max-width: 50ch;
	filter: drop-shadow(0 0 0.75rem rgba(0, 0, 0, 0.5));
}

.modal.begin-fade-in {
	transform: translateY(0px) !important;
}

.modal.begin-fade-in .modal-content {
	animation: slide-up var(--animation-length) forwards;
}

.menu-container .modal-content {
	position: absolute;
	top: 64px;
	left: 12px;
	transition: all 0.25s ease;
	transform: translateY(0px);
	-ms-transform: translateY(0px); /* IE 9 */
	-moz-transform: translateY(0px); /* Firefox */
	-webkit-transform: translateY(0px); /* Safari and Chrome */
	-o-transform: translateY(0px); /* Opera */
	z-index: 10;
}

.modal-content .hidden {
	display: none;
}

.menu[aria-expanded="false"] + .menu-container .modal-content {
	transform: translateY(-16px);
	-ms-transform: translateY(-16px); /* IE 9 */
	-moz-transform: translateY(-16px); /* Firefox */
	-webkit-transform: translateY(-16px); /* Safari and Chrome */
	-o-transform: translateY(-16px); /* Opera */
}

.main-menu {
	text-align: center;
	user-select: none;
	overflow-y: hidden;
}

.menu-container .btn-menu {
	background-color: transparent;
	border: 0;
	text-align: center;
	color: var(--text-color);
	font-family: var(--sans-font);
	font-weight: 600;
	letter-spacing: 1.5px;
	text-decoration: none;
	transition: all var(--animation-length) ease-in-out;
}

.btn-menu:hover {
	font-size: 0.9rem;
}

.modal-content hr {
	width: 100%;
	border-style: solid;
	border-width: 2px 0px 0px 0px;
	border-color: var(--highlight-light);
}

.modal-btn {
	margin: 20px 0;
	width: 8rem;
}

.rule-text {
	font-size: 1.2rem;
	padding: 20px 0px;
	line-height: 1.6;
}

.rule-text b {
	font-family: var(--player-font);
	font-size: 1.5rem;
}

.rule-text a {
	color: var(--highlight-light);
	border-radius: 4px;
	background-color: #e0e3e091;
	padding: 2px 4px;
	transition: all var(--animation-length) ease-in-out;
	font-weight: 600;
}

.rule-text a:hover {
	background-color: #e0e3e0b1;
}

.rule-text p:first-of-type {
	margin-top: 40px;
}

.rule-text p:last-of-type {
	margin-bottom: 40px;
}

.dark-light-mode-container {
	height: 72px;
	display: grid;
	grid-template-columns: 1fr;
	overflow: hidden;
}

.material-symbols-outlined {
	cursor: pointer;
	font-size: 60px;
	margin-top: 8px;
	transition: transform 0.35s ease-in-out;
	grid-row-start: 1;
	grid-column-start: 1;
}

.material-symbols-outlined[aria-selected="true"] {
	transform: translateY(200px);
}

/* GRADIENT BORDER */

.gradient-border {
	position: relative;
	border: 4px solid transparent;
	border-radius: 12px;
	background-clip: padding-box;
	display: flex;
	align-items: center;
	justify-content: center;
}

.gradient-border::after {
	position: absolute;
	top: -6px;
	bottom: -6px;
	left: -6px;
	right: -6px;
	background: linear-gradient(
		135deg,
		var(--highlight-dark),
		var(--highlight-light)
	);
	content: "";
	z-index: -1;
	border-radius: 12px;
}

/* ACTION BOX */
.action-container {
	background-color: var(--secondary);
	height: 75vh;
	width: 65vw;
	padding: 20px;
	display: flex;
	flex-direction: column;
	justify-content: space-around;
	border-radius: 12px;
	filter: drop-shadow(0 0 0.5rem rgba(0, 0, 0, 0.477));
}

.brand-container {
	display: flex;
	flex-direction: column;
	justify-content: space-around;
	margin-bottom: -5vh;
}

.logo {
	height: 24vh;
}

.action-container h1 {
	padding-top: 20px;
	font-size: 1.8vw;
	font-family: var(--player-font);
	text-align: center;
}

/* BUTTONS */

.btn-container {
	width: 100%;
	display: flex;
	justify-content: space-around;
	align-items: center;
	position: relative;
}

.btn {
	background-image: linear-gradient(
		135deg,
		var(--highlight-dark),
		var(--highlight-light)
	);
	border-radius: 40px;
	border: 0;
	box-sizing: border-box;
	color: var(--text-color);
	display: block;
	font: 1.25rem var(--sans-font);
	font-weight: 600;
	text-align: center;
	height: 60px;
	letter-spacing: 1px;
	margin: 10px 20px;
	padding: 4px;
	position: relative;
	text-decoration: none;
	text-transform: uppercase;
	width: clamp(144px, 15vmax, 256px);
	max-width: 50vw;
	z-index: 2;
}

.btn:hover {
	color: #fff;
}

.btn:disabled,
a.btn.disabled {
	filter: contrast(75%);
	pointer-events: none;
	cursor: default;
}

.btn:disabled span,
a.btn.disabled span {
	background: transparent;
}

.btn span {
	align-items: center;
	background: var(--secondary);
	border-radius: 40px;
	display: flex;
	justify-content: center;
	height: 100%;
	transition: all var(--animation-length) ease-in-out;
	width: 100%;
	/* Prevents span from becoming the target when clicking on game buttons */
	pointer-events: none;
}

.btn:hover span {
	background: transparent;
}

.btn-teacher {
	background-image: linear-gradient(135deg, #0c1d75, #1912a8);
}

.btn-toucher {
	background-image: linear-gradient(135deg, #631513, #89110d);
}

.btn-terrorist {
	background-image: linear-gradient(135deg, #140b15, rgb(28, 14, 39));
}

/* GAME -- SINGLEPLAYER */

.high-score {
	position: absolute;
	top: 24px;
	font-size: 1.15rem;
	font-family: var(--player-font);
}

.game-container {
	display: flex;
	gap: 5vh;
}

.singleplayer {
	width: 65vw;
	flex-direction: column;
	align-items: center;
}

.score {
	font-family: var(--player-font);
	margin-bottom: 0px;
}

.image-answer-container {
	position: relative;
	overflow: hidden;
	height: 100%;
	border-radius: 8px;
	width: 100%;
	display: flex;
	align-items: center;
}

.game-img {
	height: 50vh;
	max-width: 80vw;
	border-radius: 8px;
	position: relative;
}

.background {
	position: absolute;
	top: 0;
	left: 0;
	z-index: 1;
	height: 100%;
	width: 100%;
	filter: blur(8px);
}
.headshot {
	object-fit: contain;
	z-index: 2;
}

.answer {
	position: absolute;
	width: 100%;
	background-color: rgba(255, 255, 255, 0.61);
	backdrop-filter: blur(5px);
	display: flex;
	justify-content: center;
	align-items: center;
	font-family: var(--player-font);
	font-size: 1.25rem;
	transition: all 0.1s ease-in-out;
	opacity: 1;
	z-index: 3;
	user-select: none;
}

.teacher {
	color: #00178c;
}

.toucher {
	color: #700f0e;
}

.terrorist {
	color: #242424;
}

/* PLAYERS -- TWO PLAYERS */

.two-player .game-img {
	width: 25vw;
}

.players-container {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 20px;
	max-width: 100%;
}

.player {
	background-color: var(--secondary);
	display: flex;
	flex-direction: column;
	height: 100%;
}

.player-name {
	font: 2.2rem var(--player-font);
	margin: 20px 0;
	cursor: pointer;
	transition: all 0.1s ease-in-out;
}

.player-name:hover {
	opacity: 0.7;
}

.score-container {
	width: 100%;
	display: flex;
	flex-direction: row;
	justify-content: space-evenly;
}

.score-container h3 {
	margin: 0px 0px 20px 0px;
	font-weight: 400;
	font-size: 1.5rem;
	font-family: var(--player-font);
	text-align: center;
}

.next-btn-container {
	position: absolute;
	top: -0.5%;
	right: -0.5%;
	height: 101%;
	width: 101%;
	border-radius: 12px;
	background-color: rgba(0, 0, 0, 0.215);
	z-index: 5;
	display: flex;
	justify-content: center;
	align-items: center;
	filter: drop-shadow(0 0 0.75rem black);
}

.singleplayer .next-btn-container {
	top: -25%;
	right: auto;
	width: 120%;
	height: 150%;
}

.btn-next {
	height: 80px;
	width: clamp(192px, 16vmax, 342px);
	font-size: 1.5rem;
}

/* CHANGING PLAYER NAMES */

.modal-change-player-names {
	z-index: 20;
}

.name-change-form {
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	margin-bottom: 3vh;
	width: 100%;
}

.modal-content input[type="text"],
.modal-content input[type="number"] {
	height: 5vh;
	border-radius: 6px;
	border: 0;
	text-align: center;
	font-size: 1.25rem;
	font-family: var(--sans-font);
}

.modal-content input[type="text"] {
	width: 100%;
}

.invalid-entry {
	color: #9d0500;
}

.invalid-entry input {
	border: 3px solid #b30600 !important;
}

.invalid-entry::after {
	margin-top: 8px;
	color: #9d0500;
	content: "Invalid Entry";
	font-weight: 600;
	font-size: 1.2rem;
}

.duration-container.invalid-entry {
	margin-bottom: 60px;
}

.duration-container.invalid-entry::after {
	position: absolute;
	top: 60px;
	content: "Duration must be between 15 and 300 seconds";
	text-align: center;
	font-size: 1rem;
}

.empty-string::after {
	content: "Name can't be empty";
}

.full-string::after {
	content: "Name limited to 16 characters";
	font-size: 1.1rem;
}

/* TWITCH LOGIN */

.twitch-login .modal-content {
	max-width: 392px;
}

.twitch-login {
	background-color: var(--primary);
	z-index: 7;
}

.twitch-login .modal-content {
	padding: 6vh 2vw;
}

.twitch-logo {
	height: 20vh;
	object-fit: contain;
	user-select: none;
}

.twitch-login input {
	margin-bottom: 3vh;
}

.twitch-login fieldset {
	margin: 40px 0px;
	min-width: 85%;
}

.radio-container {
	display: flex;
	flex-direction: row-reverse;
	align-items: baseline;
}

.radio-container input {
	appearance: none;
	border-radius: 50%;
	width: 1.25rem;
	height: 1.25rem;
	border: 2px solid var(--text-color);
	transition: var(--animation-length) all ease-in-out;
	margin: 10px 0px 10px auto;
	position: relative;
	top: 4px;
	cursor: pointer;
}

.radio-container input:checked {
	border: 6px solid #6c2498;
	background-color: var(--text-color);
	position: relative;
}

.radio-container label {
	font-family: var(--sans-font);
	font-weight: 600;
	font-size: 1.25rem;
	cursor: pointer;
}

.duration-container {
	position: relative;
	display: flex;
	justify-content: space-evenly;
	align-items: center;
	margin-bottom: 40px;
}

.modal-settings .duration-container {
	margin-bottom: 10px;
}

.duration-container label {
	font-size: 1.25rem;
	width: 50%;
}

.duration-container label p,
.duration-container label small {
	display: inline;
}

.duration-container label small {
	font-size: 0.85rem;
}

.duration-container input {
	width: 5rem;
	margin: 0;
}

.twitch-login .btn {
	min-width: 85%;
	height: 65px;
	font-size: 1.15rem;
}

/* SETTINGS MENU */

.settings {
	background-color: var(--text-color);
	color: var(--primary);
	position: absolute;
	top: -62px;
	right: 16px;
	padding: 5px;
	font-size: 50px;
	z-index: 0;
	border-radius: 4px;
}

.settings:hover {
	transform: translateY(50px);
}

.modal-settings .modal-content {
	position: relative;
	display: flex;
	gap: 20px;
	padding: 30px 20px;
}

.close-settings {
	position: absolute;
	top: 0;
	right: 0;
	font-size: 30px;
	margin: 8px;
	opacity: 0.5;
	transition: opacity var(--animation-length) ease-in-out;
}

.close-settings:hover {
	opacity: 1;
}

.modal-settings h1 {
	font-family: var(--player-font);
	font-size: 1.5rem;
}

.switch-container {
	display: flex;
	flex-direction: row;
	width: 100%;
	align-items: center;
	justify-content: center;
}

.btn-switch {
	height: 50px;
	width: 100px;
	margin-right: 0;
	font-size: 40px !important;
}

.btn-switch span {
	position: relative;
}

.btn-switch span p {
	transition: all var(--animation-length) ease-in-out;
	position: absolute;
	left: 5px;
}

.btn-switch:hover {
	color: inherit;
}

.btn-switch:hover span {
	background-color: var(--secondary);
}

.btn-switch[aria-checked="true"] span {
	background-color: transparent;
}

.btn-switch[aria-checked="true"] span p {
	left: 53px;
}

/* CONGRATULATIONS MODAL */

.modal-congratulations {
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	text-align: center;
	background-color: rgba(0, 0, 0, 0.75);
	color: #f5f8f5;
	z-index: 5;
}

.modal-congratulations h1 {
	font-family: var(--player-font);
	max-width: 80vw;
	line-height: 1.5;
}

.scores-container {
	display: flex;
	flex-direction: row;
	font-size: 0.8rem;
	gap: 5vw;
	max-width: 90vw;
}

/* FADING OUT */

.begin-fade-out {
	pointer-events: none;
	animation: fade-out var(--animation-length) forwards;
}

.begin-fade-in {
	animation: fade-in var(--animation-length) forwards,
		slide-up var(--animation-length) forwards;
}

/* Keyframes */

@keyframes fade-in {
	0% {
		opacity: 0;
	}
	100% {
		opacity: 1;
	}
}

@keyframes fade-out {
	0% {
		opacity: 1;
	}
	100% {
		opacity: 0;
	}
}

@keyframes slide-up {
	0% {
		transform: translateY(5px);
	}
	100% {
		transform: translateY(0px);
	}
}

/* MEDIA QUERIES */

@media (max-width: 1200px) {
	.score-container h3 {
		font-size: 1rem;
	}
}

@media (max-width: 1024px) {
	.action-container h1 {
		font-size: 0px;
	}

	.btn {
		font-size: 0.95rem;
	}

	.score {
		font-size: 1.5rem;
	}

	.high-score {
		font-size: 1rem;
	}
	.game-container {
		gap: 2vh;
		margin-top: 10vh;
		width: 80vw;
	}

	.two-player {
		flex-direction: column;
		position: absolute;
		top: 0;
	}

	.two-player .game-img {
		width: 80vw;
	}

	.players-container {
		flex-direction: row;
		padding: 0 0 40px 0;
		max-width: 80vw;
	}

	.players-container .btn-container {
		flex-direction: column;
	}

	.player {
		width: 100%;
	}

	.player-name {
		font-size: 1.5rem;
	}

	.score-container h3 {
		font-size: 0.6rem;
	}

	body {
		overflow-y: scroll;
	}

	.next-btn-container {
		height: 90.5%;
	}

	.singleplayer .next-btn-container {
		top: -5%;
		height: 110%;
		width: 100%;
	}
}

@media (max-width: 768px) {
	.btn-container {
		flex-direction: column;
	}

	.btn {
		font-size: 1.2rem;
		width: clamp(256px, 12vmax, 512px);
	}

	.btn-switch {
		width: 100px;
	}

	.modal-content {
		max-width: 80vw;
	}

	.players-container {
		flex-direction: column;
	}

	.score-container h3 {
		font-size: 1rem;
	}

	.next-btn-container {
		height: 95.5%;
	}

	.singleplayer .next-btn-container {
		top: 0;
		height: 100%;
		width: 80%;
	}

	.modal-congratulations h1 {
		font-size: 1.2rem;
	}
}
