@import url("https://fonts.googleapis.com/css2?family=Ephesis&family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap");

* {
	box-sizing: border-box;
}

body {
	height: 100vh;
	height: 100dvh;
	width: 100%;
	margin: 0;
	background: radial-gradient(circle at 50% 0%, #1a3c25, #050505 75%);
	color: #f0f0f0;
	font-family: "Inter", system-ui, -apple-system, sans-serif;
	display: flex;
	align-items: center;
	justify-content: center;
	position: relative;
	overflow: hidden;
}

#ui {
	position: absolute;
	top: 30px;
	left: 0;
	right: 0;
	text-align: center;
	width: 100%;
	z-index: 100;
	pointer-events: none;
}

h1 {
	font-family: "Ephesis", cursive;
	font-weight: 600;
	font-style: normal;
	margin: 0 0 10px 0;
	letter-spacing: -0.5px;
	font-size: clamp(2.5rem, 4vw, 3rem);
	text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.5);
}

#hint {
	font-family: "Inter", sans-serif;
	pointer-events: auto;
	font-size: 0.9rem;
	color: #ccc;
	background: rgba(255, 255, 255, 0.15);
	padding: 8px 16px;
	border-radius: 20px;
	border: 2px solid rgba(255, 255, 255, 0.4);
	backdrop-filter: blur(25px);
	display: inline-block;
	margin-top: 0;
}

#board-container {
	background: rgba(255, 255, 255, 0.15);
	padding: 10px;
	box-shadow: 10px 10px 5px rgba(0, 0, 0, 0.5);
	width: 90vw;
	max-width: 650px;
	aspect-ratio: 1 / 1;
	max-height: 70vh;
}

#board {
	display: grid;
	position: relative;
	grid-template-columns: repeat(8, 1fr);
	grid-template-rows: repeat(8, 1fr);
	width: 100%;
	height: 100%;
}

.tile {
	width: 100%;
	height: 100%;
	background: #ebecd0;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	overflow: hidden;
	font-size: clamp(10px, 2.5vw, 14px);
	color: rgba(0, 0, 0, 0.5);
	transition: all 0.3s ease;
}

.tile.dark {
	background: #779556;
}

.tile:hover {
	box-shadow: inset 0 0 0 4px rgba(255, 255, 255, 0.3);
}

.tile.start {
	background: #00cc66 !important;
}

.tile.start::after {
	content: "";
	width: 75%;
	height: 75%;
	background-image: url("assets/knight.svg");
	background-repeat: no-repeat;
	background-position: center;
	background-size: contain;
	opacity: 0.3;
}

.tile.end {
	background: #f0544f !important;
}

.tile.end::after {
	content: "";
	width: 55%;
	height: 55%;
	background-image: url("assets/flag.svg");
	background-repeat: no-repeat;
	background-position: center;
	background-size: contain;
	opacity: 0.3;
}

.tile.path {
	background: #ead637 !important;
	box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.1);
}

.tile.visited::before {
	content: "";
	width: 25%;
	height: 25%;
	background: rgba(0, 0, 0, 0.2);
	border-radius: 50%;
	animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#knight-piece {
	width: 12.5%;
	height: 12.5%;
	position: absolute;
	top: 0;
	left: 0;
	z-index: 50;
	pointer-events: none;
	background-image: url("assets/knight.svg");
	background-size: 65%;
	background-repeat: no-repeat;
	background-position: center;
	filter: drop-shadow(5px 5px 2px rgba(0, 0, 0, 0.4));
	transition: top 0.45s ease-in-out, left 0.45s ease-in-out;
}

#knight-piece.jumping {
	transform: scale(1.2) translateY(-10px);
	transition: transform 0.3s ease;
}

#board.locked .tile:not(.path, .tile.start, .tile.end) {
	opacity: 0.25;
	filter: blur(0.5px);
	transition: ease-in 0.3s;
}

#board.locked .path {
	box-shadow: 0 0 10px rgba(234, 214, 55, 0.5);
}

@keyframes popIn {
	0% {
		transform: scale(0);
		opacity: 0;
	}
	100% {
		transform: scale(1);
		opacity: 1;
	}
}

.footer {
	position: absolute;
	bottom: 30px;
	display: flex;
	align-items: center;
	gap: 12px;
	font-family: "Inter", sans-serif;
	font-size: 0.8rem;
	font-weight: 300;
	letter-spacing: 2px;
	text-transform: uppercase;
	text-decoration: none;
	color: rgba(255, 255, 255, 0.5);
	z-index: 10;
	transition: all 0.3s ease;
}

.footer:hover {
	color: white;
	transform: translateY(-3px);
	filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.4));
}

.footer svg {
	opacity: 0.8;
}

@media (max-width: 500px) {
	#ui {
		top: 10%;
	}
	#hint {
		margin-top: 10px;
	}
}
