:root {
	--black: #121212;
	--light-black: #262626;
	--light-gray: #949497;
	--dark-gray: #717178;
	--white: #fff;
	--light-blue: #4ca6ff;
	--dark-blue: #177dff;
	--red: #d64d5b;
	--green: #4dd67b;
	--yellow: #f4dc73;
}

* {
	font-family: Sora, Arial, sans-serif;
	margin: 0px;
	padding: 0px;
	box-sizing: border-box;
	font-size: 16px;
}

body {
	background-color: var(--black);
	color: var(--light-gray);
	padding: 32px 112px;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
}

main {
	position: relative;
	flex: 1;
}

h2 {
	font-size: 40px;
	line-height: 136%;
	letter-spacing: 0.4px;
	color: var(--white);
	font-weight: bold;
	margin: 24px 0px 10px;
}

button {
	cursor: pointer;
}


@media only screen and (max-width: 885px) {
	body {
		padding: 32px 32px;
	}
}

@media only screen and (max-width: 720px) {
	body {
		padding: 16px 16px;
	}
}

/* HEADER */
header {
	display: flex;
	margin-bottom: 64px;

	#desktop-logo {
		display: block;
	}

	#mobile-logo {
		display: none;
	}

	.personal-best-container {
		display: flex;
		justify-content: flex-end;
		width: 100%;
		height: fit-content;

		img {
			width: 18px;
			margin-right: 10px;
		}

		p {
			width: fit-content;
			font-size: 18px;
		}

		#personal-best {
			margin-left: 8px;
		}
	}
}

@media only screen and (max-width: 760px) {
	header {
		margin-bottom: 32px;

		#desktop-logo {
			display: none;
		}

		#mobile-logo {
			display: block;
		}
	}
}

/* STATS BAR */
.stats-bar {
    background-color: var(--black);
	min-width: 100%;
	max-width: 100%;
	padding: 16px 0px;
	border-bottom: 1px solid var(--light-black);
	display: flex;
	justify-content: space-between;
	flex-wrap: wrap;
	row-gap: 20px;
    position: sticky;
    top: 0px;
    z-index: 10;
}

.stats {
	display: grid;
	grid-template-columns: auto auto auto;
	justify-content: start;
	align-items: center;
	margin-right: 64px;

	p {
		display: flex;
		align-items: center;
		gap: 6px;
		font-size: 20px;
	}
	p span {
		font-size: 24px;
		font-weight: bold;
		line-height: 100%;
	}
}
.wpm-stat-box {
	padding-right: 24px;
}

.accuracy-stat-box {
	padding: 0px 24px;
	border-left: 1px solid var(--dark-gray);
	border-right: 1px solid var(--dark-gray);
}

.time-stat-box {
	padding-left: 24px;
}

.desktop-toggles {
	display: flex;
	justify-self: end;
}

.toggle {
	padding: 6px 10px;
	border-radius: 8px;
	background-color: transparent;
	color: var(--white);
	border: 1px solid var(--dark-gray);
	cursor: pointer;
}

.toggle:hover,
.active {
	color: var(--light-blue);
	border: 1px solid var(--light-blue);
}

.toggle:hover svg path {
	fill: var(--light-blue);
}

.difficulty-toggles-section {
	display: flex;
	align-items: center;
	padding-right: 16px;

	p {
		margin-right: 14px;
	}

	.medium-toggle {
		margin: 0px 6px;
	}
}

.mode-toggles {
	display: flex;
	align-items: center;
	padding-left: 16px;
	border-left: 1px solid var(--dark-gray);

	p {
		margin-right: 6px;
	}

	.timed-toggle {
		margin: 0px 6px;
	}
}

.mobile-toggles {
	display: none;
}

.mode-menu,
.difficulty-menu {
	position: relative;
}

.menu {
	width: 100%;
	display: flex;
	flex-direction: column;
	background-color: var(--light-black);
	color: var(--white);
	border-radius: 8px;
	position: absolute;
	margin-top: 4px;

	div {
		padding: 8px 10px;
        display: flex;

        input {
            margin-right: 8px;
        }

        label{
            display: inline-block;
            width: 100%;
        }
	}
}

input:checked {
	accent-color: var(--light-blue);
}

.medium-input {
	border-top: 1px solid var(--dark-gray);
	border-bottom: 1px solid var(--dark-gray);
}

.timed-input {
	border-bottom: 1px solid var(--dark-gray);
}

@media only screen and (max-width: 720px) {
	.stats {
		width: 100%;
		grid-template-columns: 1fr 1fr 1fr;
		justify-content: space-evenly;
		margin-right: 0px;

		p {
			flex-direction: column;
		}
	}
	.desktop-toggles {
		display: none;
	}

	.mobile-toggles {
		display: flex;
		justify-content: space-evenly;
		width: 100%;
		gap: 16px;
	}

	.difficulty-menu,
	.mode-menu {
		width: 100%;
	}

	.toggle {
		width: 100%;
	}
}

/* PASSAGE */
.passage-box {
	width: 100%;
	position: relative;
}

.passage,
.passage span {
	font-size: 40px;
	line-height: 136%;
	letter-spacing: 0.4px;
}

.passage {
    min-height: 540px;
	padding: 32px 16px 64px;
	border-bottom: 1px solid var(--light-black);
    margin-bottom: 32px;
}

.passage span {
	padding: 0px;
	scroll-margin-top: 160px;
}

.go-again-button,
.restart-button {
	font-size: 20px;
	font-weight: 500;
	line-height: 120%;
	letter-spacing: -0.3px;
	padding: 10px 16px;
	border-radius: 12px;
	border: none;
	display: flex;
	gap: 6px;
}

.restart-button {
	background-color: var(--dark-gray);
	color: var(--white);
	margin: auto auto;
	display: flex;
}

#mobile-keyboard-trigger {
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
	z-index: -5;
	left: -50%;
    top: 50%;
}

.start-typing-window {
	backdrop-filter: blur(10px);
	font-size: 20px;
	font-weight: 500;
	position: absolute;
	height: 100%;
	width: 100%;
	z-index: 2;
	top: 0px;
	left: 0px;
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	gap: 20px;
}

.start-typing-window h1{
	font-size: inherit;
	color: var(--light-gray);
	font-weight: 400;
	margin: 0px;
}

.start-typing-button {
	background-color: var(--dark-blue);
	font-size: inherit;
	font-weight: inherit;
	color: var(--white);
	border: none;
	padding: 16px 24px;
	border-radius: 12px;
}

@media only screen and (max-width: 760px) {
	.start-typing-window {
		justify-content: start;
		padding-top: 120px;
	}
}

@media only screen and (max-width: 500px) {
	.passage,
	.passage span {
		font-size: 32px;
	}
}

/* TEST COMPLETE WINDOW*/
.test-complete-window {
	width: 100%;
	height: 100%;
	background-color: var(--black);
	position: absolute;
	top: 0px;
	left: 0px;
	z-index: 15;
	display: flex;
}

.test-complete-container{
    position: relative;
    width: 100%;
    text-align: center;
    display: flex;
	flex-direction: column;
	align-items: center;
}

.complete-check {
	box-shadow: 0px 0px 32px var(--green);
	background-color: transparent;
	border-radius: 100%;
	margin-top: 64px;
}

p {
	font-size: 20px;
}

.test-results {
	display: flex;
	flex-wrap: wrap;
	margin: 20px 0px 32px;
	gap: 20px;
}

.result-box {
	padding: 16px 24px;
	border-radius: 8px;
	border: 1px solid var(--dark-gray);
	min-width: 160px;
}

.result {
	margin-bottom: 10px;
}

.result-number,
.result-number span {
	font-size: 24px;
	font-weight: bold;
}

.wpm-result {
	color: var(--white);
}

.accuracy-result,
#incorrect-characters {
	color: var(--red);
}

#correct-characters {
	color: var(--green);
}

.go-again-button {
	background-color: var(--white);
	color: var(--black);
}

.red-star {
	position: absolute;
	top: 0px;
	left: 0px;
}

.yellow-star {
	position: absolute;
	bottom: 0px;
	right: 0px;
}

@media only screen and (max-width: 760px) {
	.result-box {
		width: 100%;
		text-align: left;
	}

	.red-star {
		top: 0px;
		left: 0px;
	}

	.yellow-star {
		bottom: 0px;
		right: 0px;
	}
}

footer {
	margin-top: 64px;
	text-align: center;
}

a {
	color: var(--light-blue);
}


.hidden{
    display: none;
}