:root{
	/* Font size */
	--size-1: 16px;
	--size-2: 20px;
	--size-3: 24px;
	--size-4: 32px;
	--size-5: 48px;
	--size-6: 64px;
	--size-7: 80px;
	--size-8: 96px;
	--size-9: 112px;
	--size-10: 144px;

	/* Main colors */
	--black: #000000;
	--white: #ffffff;
	--navy: #0b022e;
	--blue: #81adf9;
	--green: #0cb352;
	--yellow: #ffd230;
	--red: #e60c2d;
	--pink: #ff3895;

	/* Fonts */

	--font-1: "bitcount-prop-single-square", sans-serif;
	--font-2: "paradroid-mono-soft", sans-serif;
}

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

html{
	scroll-behavior: smooth;
}

body{
	background-color: var(--navy);
	display: flex;
	flex-direction: column;
	min-height: 100vh;
	overscroll-behavior: none;
}

#pixel-overlay {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	pointer-events: none;
	z-index: -1;
}

.pixel {
	position: absolute;
	width: 8px;
	height: 8px;
	background-color: rgb(129, 173, 249, .6);
	animation: blink 1.5s infinite ease-in-out;
}

.pixel-1 { top: 5%; left: 10%; animation-delay: 0s; }
.pixel-2 { top: 10%; left: 90%; animation-delay: 0.4s; }
.pixel-3 { top: 25%; left: 80%; animation-delay: 0.8s; }
.pixel-4 { top: 30%; left: 6%; animation-delay: 1.2s; }
.pixel-5 { top: 42%; left: 88%; animation-delay: 1.6s; }
.pixel-6 { top: 55%; left: 9%; animation-delay: 2s; }
.pixel-7 { top: 66%; left: 88%; animation-delay: 2.4s; }
.pixel-8 { top: 72%; left: 44%; animation-delay: 2.8s; }
.pixel-9 { top: 80%; left: 12%; animation-delay: 3.2s; }
.pixel-10 { top: 90%; left: 92%; animation-delay: 3.6s; }

@keyframes blink {
	0%, 100% {
		opacity: 0;
	}
	50% {
		opacity: 1;
	}
}

h1{
	font-family: var(--font-1);
	font-size: var(--size-6);
	font-weight: 500;
	color: var(--red);
	line-height: var(--size-6);
	text-align: center;
	text-wrap: balance;
}

h2{
	font-family: var(--font-1);
	font-size: var(--size-4);
	font-weight: 500;
	color: var(--pink);
	line-height: var(--size-4);
	padding-top: var(--size-1);
	text-align: center;
	text-wrap: balance;
}

p{
	font-family: var(--font-2);
	font-weight: 400;
	text-wrap: balance;
}

#header{
	padding: var(--size-2);
	margin-top: var(--size-1);
	overflow: hidden;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
}

#main-content{
	color: var(--white);
	font-size: var(--size-2);
	line-height: var(--size-4);
	padding: var(--size-3);
	text-align: center;
	text-wrap: balance;
	width: 100%;
	display: flex;
	flex-direction: column;
	flex-grow: 1;
	gap: var(--size-2);
	position: relative;
	z-index: 2;
}

#instructions{
	font-size: var(--size-3);
	line-height: var(--size-4);
	color: var(--pink);
	margin-top: var(--size-4);
	text-align: center;
	text-wrap: balance;
}

#start{
	display: flex;
	justify-content: center;
	align-items: center;
}

.start-button{
	font-family: var(--font-1);
	font-size: var(--size-3);
	font-weight: 600;
	color: var(--navy);
	background-color: var(--yellow);
	border-radius: 100rem;
	min-height: var(--size-5);
	width: 300px;
	padding: var(--size-1);
	margin-top: var(--size-2);
	text-align: center;
}

dialog#game {
	font-family: var(--font-2);
	background-color: var(--navy);
	padding: var(--size-2);
	width: 95%;
	max-width: 500px;
	max-height: 90vh;
	overflow-y: auto;
	border: 2px solid var(--white);
	border-radius: var(--size-1);
	align-items: center;
	flex-direction: column;
	justify-content: flex-start;
	gap: var(--size-1);
	position: fixed;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	z-index: 10;
}

#modal-header {
	padding-bottom:  var(--size-2);
	width: 100%;
	display: flex;
	justify-content: space-between;
	align-items: center;
}

#progress-count {
	font-family: var(--font-1);
	font-size: var(--size-3);
	font-weight: 600;
	color: var(--pink);
}

.close-button {
	font-family: var(--font-1);
	font-size: var(--size-3);
	font-weight: 600;
	color: var(--pink);
	min-height: var(--size-5);
	background: none;
	border: none;
	cursor: pointer;
}

#progress-bar-container {
	background-color: var(--white);
	width: 100%;
	height: 10px;
	border-radius: 20px;
	overflow: hidden;
}

#progress-bar {
	background-color: var(--blue);
	width: 0%;
	height: 100%;
	transition: width 0.4s ease-in-out;
}

#question{
	font-family: var(--font-1);
	font-size: var(--size-3);
	font-weight: 500;
	color: var(--blue);
	margin-top: var(--size-3);
	margin-bottom: var(--size-2);
	text-align: left;
	text-wrap: balance;
	overflow-wrap: break-word;
}

#options{
	display: flex;
	flex-direction: column;
	gap: var(--size-2);
	width: 100%;
}

#options button{
	font-size: var(--size-1);
	color: var(--white);
	min-height: var(--size-5);
	padding: var(--size-1);
	width: 100%;
	border: 2px solid var(--white);
	border-radius: 10px;
	cursor: pointer;
}

button.option-correct {
	color: var(--white);
	background-color: var(--green);
}

button.option-incorrect {
	color: var(--white);
	background-color: var(--red);
}

#end-screen {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	gap: var(--size-2);
}

.result-heading {
	font-family: var(--font-1);
	font-size: var(--size-4);
	font-weight: 600;
	color: var(--yellow);
	text-align: center;
	text-wrap: balance;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	flex-wrap: wrap;
}

.result-icon {
	width: 90px;
	height: 90px;
	object-fit: contain;
	vertical-align: middle;
}

.result-message {
	font-family: var(--font-2);
	font-size: var(--size-2);
	color: var(--white);
	text-align: center;
	line-height: var(--size-4);
	text-wrap: balance;
}

.restart-button {
	font-family: var(--font-1);
	font-size: var(--size-3);
	font-weight: 600;
	color: var(--navy);
	background-color: var(--yellow);
	padding: var(--size-1);
	margin: var(--size-1);
	border-radius: 100rem;
	min-height: var(--size-5);
	width: 90%;
	text-align: center;
	cursor: pointer;
}

#footer{
	background-color: var(--blue);
	padding: var(--size-1);
	margin-top: auto;
	overflow: hidden;
}

#footer p{
		color: var(--navy);
		font-size: var(--size-1);
		line-height: var(--size-3);
		text-align: center;
	}


@media (min-width: 650px){
	h1{
		font-size: var(--size-7);
		line-height: var(--size-7);
	}
}

@media (min-width: 768px){

	.pixel{
		height: 12px;
		width: 12px;
	}

	.pixel-7 { top: 62%; left: 88%; animation-delay: 2.4s; }
	.pixel-8 { top: 72%; left: 30%; animation-delay: 2.8s; }

	h1{
		font-size: var(--size-7);
		line-height: var(--size-7);
	}

	h2{
		font-size: var(--size-5);
		padding-top: var(--size-3);
	}

	#instructions{
		font-size: var(--size-4);
		line-height: calc(1.5*var(--size-4));
		margin-bottom: var(--size-2);
	}

	.start-button {
		font-size: var(--size-4);
		margin-bottom: var(--size-5);
	}

	#progress-count {
		font-size: var(--size-4);
	}

	.close-button{
		font-size: var(--size-4);
	}

	#question {
		font-size: var(--size-4);
		margin-top: var(--size-4);
		margin-bottom: var(--size-4);
	}

	#options{
		gap: var(--size-4);
	}

	#options button{
		font-size: var(--size-3);
		min-height: var(--size-6);
	}

	.result-heading{
		font-size: var(--size-5);
	}

	.result-icon {
		width: 120px;
		height: 120px;
	}

	.result-message{
		font-size: var(--size-4);
		line-height: var(--size-5);
	}

	.restart-button{
		font-size: var(--size-4);
	}

	#footer p{
		font-size: var(--size-2);
	}
}

@media (min-width: 1024px){

	.pixel{
		height: 16px;
		width: 16px;
	}

	.pixel-1 { top: 3%; left: 10%; animation-delay: 0s; }
	.pixel-2{ top: 16%; left: 90%; animation-delay: 0.4s; }
	.pixel-4{ top: 20%; left: 20%; animation-delay: 1.2s; }
	.pixel-5 { top: 42%; left: 95%; animation-delay: 1.6s; }
	.pixel-8 { top: 67%; left: 24%; animation-delay: 2.8s; }
	.pixel-9 { top: 86%; left: 47%; animation-delay: 3.2s; }
	.pixel-10 { top: 80%; left: 68%; animation-delay: 3.6s; }

	h1{
		font-size: var(--size-8);
		line-height: var(--size-8);
	}

	h2{
		font-size: var(--size-6);
		padding-top: var(--size-4);
	}

	#main-content{
		font-size: var(--size-3);
		line-height: var(--size-4);
		text-align: center;
		margin-top: var(--size-2);
	}

	#instructions{
		font-size: var(--size-4);
		line-height: calc(1.5*var(--size-4));
		margin-bottom: var(--size-2);
	}

	#progress-count {
		font-size: var(--size-4);
	}
	
	.close-button {
		font-size: var(--size-4);
	}

	#question {
		font-size: var(--size-4);
	}

	#options button{
		font-size: var(--size-3);
	}

	.start-button:hover{
		background-color: var(--white);
		transition: 500ms ease-in-out;
	}

	.close-button:hover {
		color: var(--white);
		transition: color 0.3s ease;
	}

	#options button:hover{
		color: var(--navy);
		background-color: var(--white);
	}

	.restart-button:hover {
		color: var(--navy);
		background-color: var(--white);
	}
}