@charset "utf-8";
@import './reset.css';

* { 
	transition: 0.2s ease-in-out; 
	font-family: "Geo";
}


/* Fonts */

.geo-regular {
  font-family: "Geo", sans-serif;
  font-weight: 400;
  font-style: normal;
}

.geo-regular-italic {
  font-family: "Geo", sans-serif;
  font-weight: 400;
  font-style: italic;
}


/* Background */

.background {
	height: 100svh;
    background-image: url('../media/background.png');
    background-repeat: no-repeat;        
    background-position: center;         
    background-size: cover; 
    opacity: 0.9;
	display: flex;
	justify-content: center;
	flex-wrap: wrap;
	position: relative;
}

.title {
	font-size: 100px;
	text-align: center;
	width: 100%;
	margin-top: 30px;
	margin-bottom: -135px;
	color: #000;
    text-shadow:
    0 0 5px #0ff,
    0 0 10px #0ff,
    0 0 20px #0ff,
    0 0 40px #0ff;
}



/* Game */

.start-button {
	visibility: visible;
	opacity: 1;
	position: absolute;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
	input {
		color: #278cff;
		font-weight: 700;
		font-size: 46px;
		width: 160px;
		height: 80px;
		border-radius: 8px;
		border: 1px solid #9eb4f0;
		box-shadow: 1px 1px 5px #3d4980;
	}
	input:hover {
		translate: 0 -3px;
		box-shadow: 1px 7px 10px #566297;
	}
	input:active {
		background-color: #0731bb;
		border: 1px solid #002a9c;
		color: rgb(17, 0, 63);
	}
}

.start-countdown {
	visibility: hidden;
	opacity: 0;
	font-size: 150px;
	color: #000;
	text-shadow: 0 0 8px rgb(0 0 0 / 0.3);
	position: absolute;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
}

.start-countdown.anim {
	animation: 1s zoom ease-in-out;
}

@keyframes zoom {
	0% { 
		font-size: 150px; 
		opacity: 1;
	}
	100% { 
		font-size: 40px; 
		opacity: 0;
	}
}

.game-container {
/* To turn invisible, visibility: hidden and opacity: 0. Visible - visibility: visible opacity: 1 */
	visibility: hidden;
	opacity: 0;
	background-color: rgb(242, 249, 255);
    background-image: url('../media/gameplay.png');
    background-repeat: no-repeat;        
    background-position: center;         
    background-size: cover; 
	text-align: center;
	padding: 20px;
	margin-top: 50px;
	height: 70%;
	width: 60%;
	border-radius: 10px;
	/* border: 1px solid #9eb4f0; */
	box-shadow: 1px 1px 5px #606ca1;
	display: flex;
	flex-direction: column;
}

/* code for the timer */
.timer {
    font-size: 28px;
    color: #4d4949;
    font-weight: 700;
    margin-top: 15px;
    text-shadow: 0 0 4px rgb(0 0 0 / 0.15);
    text-align: center;
}

.timer p {
    margin: 0;
    padding: 5px 0;
}

#time-remaining {
    color: #151719;
    font-weight: 900;
    font-size: 32px;
}


.displayed-word {
	font-size: 52px;
	margin-top: 12px;
}

.typed-word {
	font-size: 26px;
	margin-top: 20px;
	input { 
		height: 68px;
		width: 300px;
		padding: 0 8px;
		border: 1px solid #636568;
		border-radius: 8px;
		text-align: center; 
	}
	input:focus { box-shadow: 0 0 3px #7893b3; }
}

/* Scoreboard */

.scoreboard-title {
	margin-top: 20px;
	font-size: 20px;
}

.scoreboard-title h4{
	font-size: 25px;
}

#scoreboard {
	overflow-y: auto;
	border: 2px double rgb(99 101 104 / 0.3);
	border-radius: 8px;
	background-color: #fff;
	padding: 8px;
	height: 45%;
	max-height: 380px;
}

#scoreboard::-webkit-scrollbar {
  display: none;
}

.top-score {
	display: flex;
	justify-content: space-around;
	font-size: 18px;
}

/* Game Over */

#game-over-container {
	visibility: hidden;
	opacity: 0;
	background-color: rgb(242, 249, 255);
    background-image: url('../media/gameEnd.png');
    background-repeat: no-repeat;        
    background-position: center;         
    background-size: cover; 
	width: 50%;
	height: 40%;
	position: absolute;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
	text-align: center;
	padding: 20px;
	border-radius: 10px;
	border: 1px solid #9eb4f0;
	box-shadow: 1px 1px 5px #606ca1;
	h2 {
		margin-top: 40px;
		font-size: 60px;
        color: #fff;
	}
	p {
        font-size: 30px;
        font-weight: 600;
        border: 1px solid #346aff;
        background-color: #346aff;
        border-radius: 10px;
        padding: 0px 6px;
        color: #000;
    }
	#game-over-score { font-weight: 600; }
	input { 
		margin-top: 50px;
		background-color: #346aff;
		padding: 4px;
		border-radius: 8px;
		border: 1.5px solid #1654fc;
		box-shadow: 1px 1px 2px #7a8ee7;
		width: 80px;
		height: 48px;
		font-weight: 600;
		font-size: 22px;
	}
	input:hover {
		translate: 0 -3px;
		box-shadow: 1px 3px 4px #7a8ee7;
	}
	input:active {
		border-color: gray;
		background-color: whitesmoke;
	}
}

#game-over-container div + div {
    margin-top: 20px;
    display: flex;
    justify-content: center;
}

/* Media Queries */

@media (max-width: 1023px) and (min-width: 620px) {
    .title {
        font-size: 78px;
    }
    .game-container {
        margin-top: 20px; 
    }
    .start-button input {
        font-size: 40px;
    }
    .start-countdown {
        font-size: 120px;
    }
    .timer {
        font-size: 24px;
    }
    #time-remaining {
        font-size: 28px;
    }
    .displayed-word {
        font-size: 42px;
    }
    .typed-word input {
        height: 60px;
        width: 250px;
        font-size: 22px;
    }
    .scoreboard-title h4 {
        font-size: 22px;
    }
    .top-score {
        font-size: 16px;
    }
    #game-over-container h2 {
        font-size: 50px;
    }
    #game-over-container p {
        font-size: 26px;
    }
    #game-over-container input {
        font-size: 20px;
        height: 44px;
        width: 70px;
    }
}

@media (max-width: 619px) and (min-width: 320px) {
    .title {
        font-size: 66px;
    }
    .start-button input {
        font-size: 32px;
    }
    .start-countdown {
        font-size: 100px;
    }
    .timer {
        font-size: 20px;
    }
    #time-remaining {
        font-size: 24px;
    }
    .displayed-word {
        font-size: 30px;
    }
    .typed-word input {
        height: 54px;
        width: 80%;
        font-size: 18px;
    }
    .scoreboard-title h4 {
        font-size: 20px;
    }
    .top-score {
        font-size: 14px;
    }
    #game-over-container h2 {
        font-size: 40px;
    }
    #game-over-container p {
        font-size: 22px;
    }
    #game-over-container input {
        font-size: 18px;
        height: 40px;
        width: 60px;
    }
}

@media (max-width: 319px) {
    .title {
        font-size: 54px;
    }
    .start-button input {
        font-size: 28px;
    }
    .start-countdown {
        font-size: 80px;
    }
    .timer {
        font-size: 18px;
    }
    #time-remaining {
        font-size: 20px;
    }
    .displayed-word {
        font-size: 22px;
    }
    .typed-word input {
        height: 50px;
        width: 90%;
        font-size: 16px;
    }
    .scoreboard-title h4 {
        font-size: 18px;
    }
    .top-score {
        font-size: 12px;
    }
    #game-over-container h2 {
        font-size: 36px;
    }
    #game-over-container p {
        font-size: 18px;
    }
    #game-over-container input {
        font-size: 16px;
        height: 36px;
        width: 50px;
    }
}
