html,
body {
	margin: 0;
	padding: 0;
}

body {
	padding-top: 70px;
	padding-bottom: 70px;
	font-family: Arial, sans-serif;
	background-color: #f8f9fa;
	color: #333;
}

/* Header & Footer */
header.fixed-top,
footer.fixed-bottom {
	background-color: #fff;
	border: 1px solid #ddd;
	z-index: 1000;
}

/* Header Icon */
header i {
	margin-right: 10px;
	color: #333;
}

/* Section Titles */
#how-to-play h2 {
	font-size: 2rem;
	margin-bottom: 1rem;
}

#how-to-play h5 {
	font-size: 1rem;
	margin-bottom: 0.75rem;
}

/* Tutorial Box */
.tutorial {
	background-color: #f1f1f1;
	border: 2px solid #ccc;
	border-radius: 8px;
	padding: 1rem;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#tutorialArea {
	display: flex !important;
	justify-content: center !important;
	align-items: center;
	gap: 1.5rem;
}

#tutorialArea .flip-card {
	margin: 0 !important;
}

/* Cards */
.flip-card {
	width: 80px;
	height: 80px;
	perspective: 800px;
	margin: 5px;
	cursor: pointer;
}

.flip-card-inner {
	position: relative;
	width: 100%;
	height: 100%;
	transition: transform 0.6s ease-in-out;
	transform-style: preserve-3d;
}

.flip-card-front,
.flip-card-back {
	position: absolute;
	width: 100%;
	height: 100%;
	border: 2px solid #ccc;
	border-radius: 8px;
	background-color: #fff;
	backface-visibility: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 2rem;
	user-select: none;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.flip-card-back {
	transform: rotateY(180deg);
	background-color: #f8f8f8;
}

.flip-card-back > h2 {
	margin: auto;
	font-size: 2.5rem !important;
}

.flip-card.flipped .flip-card-inner {
	transform: rotateY(180deg);
}

.flip-card-front:hover,
.flip-card-back:hover {
	border-color: #7700ff;
	box-shadow: 0 0 8px rgba(140, 0, 255, 0.73);
}

/* Play Button */
#how-to-play .btn {
	padding: 0.5rem 1.25rem;
	font-size: 1rem;
}

/* Game Info */
#game p {
	font-size: 1rem;
	margin-bottom: 1rem;
}

/* Game Cards */
#game-cards {
	display: grid;
	gap: 1rem;
	justify-content: center;
	justify-items: center;
	grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
	max-width: 75%;
	margin: 0 auto;
}

/* Footer Icon */
footer i {
	color: #333;
	transition: color 0.2s ease;
}

footer i:hover {
	color: #000;
}

/* Animate Directed Clicks */
@keyframes green-glow {
	0%,
	100% {
		box-shadow: 0 0 3px rgba(174, 0, 255, 0.6),
			0 0 6px rgba(183, 0, 255, 0.4);
	}
	50% {
		box-shadow: 0 0 6px rgb(162, 0, 255), 0 0 12px rgba(174, 0, 255, 0.7);
	}
}

.click-me .flip-card-inner {
	animation: green-glow 2s ease-in-out infinite;
	border-color: #7700ff;
	border-radius: 8px;
}

/* Correct Guess */
.correct .flip-card-front,
.correct .flip-card-back {
	background-color: rgba(40, 167, 69, 0.15);
	border-color: #28a745;
}

.flip-card.correct .flip-card-inner {
	transform: rotateY(180deg) !important;
}

.flip-card.correct .flip-card-front,
.flip-card.correct .flip-card-back {
	background-color: rgba(40, 167, 69, 0.15) !important;
	border-color: #28a745 !important;
}

/* On Going Guess */
.guess .flip-card-front,
.guess .flip-card-back {
	background-color: rgba(0, 123, 255, 0.15);
	border-color: #007bff;
}

/* Wrong Guess */
.flip-card.flipped.wrong .flip-card-inner {
	transform: rotateY(180deg);
}

.flip-card.wrong .flip-card-back {
	background-color: rgba(220, 53, 69, 0.15);
	border-color: red;
}

@keyframes shake {
	0%,
	100% {
		transform: translateX(0);
	}
	20%,
	60% {
		transform: translateX(-5px);
	}
	40%,
	80% {
		transform: translateX(5px);
	}
}

.flip-card.wrong {
	animation: shake 0.5s ease-in-out;
}

.flip-card.wrong .flip-card-inner {
	transform: rotateY(180deg) !important;
}

.flip-card.wrong .flip-card-back {
	background-color: rgba(220, 53, 69, 0.15);
	border-color: red;
}

/* Media queries required to ensure mobile game fits better */
@media (max-width: 768px) {
	.flip-card {
		width: 60px;
		height: 60px;
	}

	#game-cards {
		grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
		gap: 0.5rem;
	}
}
