/* Import Google font */
@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;500;600;700&display=swap');

* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
	text-decoration: none;
	font-family: 'Open Sans', sans-serif;
}

body {
	display: flex;
	align-items: center;
	text-align: center;
	justify-content: center;
	min-height: 100vh;
	background: #212837;
	overflow: hidden;
}

/* Styling of Author of the Website 😎 */
a {
	color: #c73664;
}

.title {
	font-size: 2rem;
	color: aquamarine;
}

.author {
	font-size: 1rem;
	font-weight: 400;
	text-align: center;
	transition: all 0.85s;
}

.wrapper {
	width: 90vmin;
	height: 90vmin;
	display: flex;
	overflow: hidden;
	flex-direction: column;
	justify-content: center;
	background: #293447;
	box-shadow: 0 20px 40px rgba(52, 87, 220, 0.2);
}

.game-details {
	color: #B8C6DC;
	font-weight: 500;
	font-size: 1.2rem;
	padding: 20px 27px;
	display: flex;
	justify-content: space-between;
}

/* Styling of game board */
.play-board {
	height: 100%;
	width: 100%;
	display: grid;
	background: #212837;
	grid-template: repeat(30, 1fr) / repeat(60, 1fr);
}

.play-board .headRight {
	background: url('./images/headRight.png');
	background-position: center;
	background-repeat: no-repeat;
	background-size: contain;
}

.play-board .headLeft {
	background: url('./images/headLeft.png');
	background-position: center;
	background-repeat: no-repeat;
	background-size: contain;
}

.play-board .headUp {
	background: url('./images/headUp.png');
	background-position: center;
	background-repeat: no-repeat;
	background-size: contain;
}

.play-board .headDown {
	background: url('./images/headDown.png');
	background-position: center;
	background-repeat: no-repeat;
	background-size: contain;
}

.play-board .tail {
	background: url('./images/tail.png');
	background-position: center;
	background-repeat: no-repeat;
	background-size: contain;
}

/* Styling of controls */
.controls {
	display: none;
	justify-content: space-between;
}

.controls i {
	padding: 25px 0;
	text-align: center;
	font-size: 1.3rem;
	color: #B8C6DC;
	width: calc(100% / 4);
	cursor: pointer;
	border-right: 1px solid #171B26;
}

/* Styling of game over */
p {
	font-family: 'VT323';
	font-size: 8em;
	text-align: center;
	animation-name: example;
	animation-duration: 1s;
	animation-iteration-count: infinite;
}

@keyframes example {
	0% {
		color: lime;
		text-shadow: 0 0 20px green;
	}

	25% {
		color: green;
		text-shadow: 2px 2px 2px lime;
		transform: translate(-2px, 1px);
	}

	40% {
		color: lime;
		text-shadow: none;
		transform: translate(0, 0);
	}

	50% {
		color: green;
		text-shadow: 5px 5px 2px blue, -5px -5px 2px red;
		transform: translate(0px, 5px);
	}

	70% {
		color: lime;
		text-shadow: none;
		transform: translate(0, 0);
	}

	80% {
		color: lime;
		text-shadow: 0 0 20px green;
		transform: translate(-2px, 1px);
	}

	100% {
		color: lime;
		text-shadow: none;
	}
}

/* Adding responsiveness */
@media screen and (max-width: 800px) {
	.author {
		font-size: calc(5px + 0.7vw);
	}

	.title {
		font-size: calc(2rem - 1.2rem);
	}

	.wrapper {
		width: 90vmin;
		height: 215vmin;
	}

	img {
		width: 80%;
		height: 40%;
	}

	.game-details {
		font-size: 1rem;
		padding: 15px 27px;
	}

	.controls {
		display: flex;
	}

	.controls i {
		padding: 15px 0;
		font-size: 1rem;
	}
}

/* Joystick Control */
.joystick-container {
	display: none;
	position: fixed;
	bottom: 20px;
	right: 20px;
	z-index: 1000;
}

.joystick {
	width: 120px;
	height: 120px;
}

.joystick-bg {
	width: 100%;
	height: 100%;
	background: rgba(255, 255, 255, 0.1);
	border: 3px solid rgba(255, 255, 255, 0.3);
	border-radius: 50%;
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	touch-action: none;
}

.joystick-stick {
	width: 50px;
	height: 50px;
	background: rgba(255, 255, 255, 0.5);
	border-radius: 50%;
	position: absolute;
	cursor: grab;
	transition: all 0.1s;
}

.joystick-stick:active {
	cursor: grabbing;
}

/* Mobile Responsive */
@media (max-width: 768px) {
	.wrapper {
		width: 95vw;
		height: 95vw;
		max-width: 400px;
		max-height: 400px;
	}

	.game-details {
		padding: 10px 15px;
		font-size: 0.9rem;
	}

	.title {
		font-size: 1.2rem;
	}

	.author {
		font-size: 0.8rem;
	}

	.controls {
		gap: 10px;
	}

	.controls i {
		padding: 10px 0;
		font-size: 1.2rem;
	}
}

@media (max-width: 480px) {
	.wrapper {
		width: 90vw;
		height: 90vw;
		max-width: 350px;
		max-height: 350px;
	}

	.game-details {
		padding: 8px 10px;
		font-size: 0.8rem;
		flex-direction: column;
		gap: 5px;
	}

	.title {
		font-size: 1rem;
	}

	.author {
		font-size: 0.7rem;
	}

	.controls {
		gap: 8px;
	}

	.controls i {
		padding: 8px 0;
		font-size: 1rem;
	}
}

/* Navigation Buttons */
.navigation-buttons {
	position: fixed;
	bottom: 0;
	left: 0;
	right: 0;
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 12px 20px;
	background: linear-gradient(135deg, #293447 0%, #212837 100%);
	border-top: 1px solid rgba(184, 198, 220, 0.2);
	z-index: 500;
	gap: 12px;
}

.nav-btn {
	flex: 1;
	padding: 12px 16px;
	background: rgba(184, 198, 220, 0.1);
	border: 1px solid rgba(184, 198, 220, 0.3);
	border-radius: 6px;
	color: #B8C6DC;
	font-weight: 600;
	font-size: 13px;
	cursor: pointer;
	transition: all 0.3s ease;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	text-decoration: none;
}

.nav-btn:hover {
	background: rgba(184, 198, 220, 0.2);
	border-color: rgba(184, 198, 220, 0.5);
	box-shadow: 0 4px 12px rgba(184, 198, 220, 0.1);
	transform: translateY(-2px);
}

.nav-btn:active {
	transform: translateY(0);
}

.nav-btn i {
	font-size: 16px;
}

/* Adjust wrapper for navigation buttons */
body {
	padding-bottom: 60px;
}

@media (max-width: 768px) {
	body {
		padding-bottom: 70px;
	}

	.navigation-buttons {
		padding: 10px 15px;
	}

	.nav-btn {
		padding: 10px 12px;
		font-size: 12px;
	}

	.nav-btn i {
		font-size: 14px;
	}
}

@media (max-width: 480px) {
	body {
		padding-bottom: 65px;
	}

	.navigation-buttons {
		padding: 8px 10px;
		gap: 8px;
	}

	.nav-btn {
		padding: 8px 10px;
		font-size: 11px;
	}

	.nav-btn i {
		font-size: 12px;
	}
}