/* ===== CSS Variables ===== */
:root {
	--sky-blue: #87CEEB;
	--sky-light: #B0E2FF;
	--grass-green: #7CB342;
	--grass-dark: #558B2F;
	--sunny-yellow: #FFD54F;
	--warm-orange: #FF8A65;
	--soft-brown: #8D6E63;
	--cloud-white: #FFFFFF;
	--text-dark: #4E342E;
	--shadow-color: rgba(0, 0, 0, 0.1);
}

/* ===== Reset & Base Styles ===== */
* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

html {
	scroll-behavior: smooth;
}

html {
	background: var(--grass-green);
}

body {
	font-family: 'Fredoka', sans-serif;
	background: linear-gradient(180deg, var(--sky-light) 0%, var(--sky-blue) 100%);
	min-height: 100vh;
	overflow-x: hidden;
	color: var(--text-dark);
	display: flex;
	flex-direction: column;
}

/* ===== Clouds ===== */
.clouds {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 300px;
	pointer-events: none;
	z-index: 0;
	overflow: hidden;
}

.cloud {
	position: absolute;
	background: var(--cloud-white);
	border-radius: 100px;
	opacity: 0.9;
}

.cloud::before,
.cloud::after {
	content: '';
	position: absolute;
	background: var(--cloud-white);
	border-radius: 50%;
}

.cloud-1 {
	width: 150px;
	height: 50px;
	top: 40px;
	animation: float-cloud 25s linear infinite;
}

.cloud-1::before {
	width: 70px;
	height: 70px;
	top: -35px;
	left: 20px;
}

.cloud-1::after {
	width: 50px;
	height: 50px;
	top: -25px;
	left: 70px;
}

.cloud-2 {
	width: 120px;
	height: 40px;
	top: 100px;
	animation: float-cloud 30s linear infinite;
	animation-delay: -10s;
}

.cloud-2::before {
	width: 55px;
	height: 55px;
	top: -28px;
	left: 15px;
}

.cloud-2::after {
	width: 40px;
	height: 40px;
	top: -20px;
	left: 55px;
}

.cloud-3 {
	width: 180px;
	height: 60px;
	top: 160px;
	animation: float-cloud 35s linear infinite;
	animation-delay: -20s;
}

.cloud-3::before {
	width: 80px;
	height: 80px;
	top: -40px;
	left: 30px;
}

.cloud-3::after {
	width: 60px;
	height: 60px;
	top: -30px;
	left: 90px;
}

@keyframes float-cloud {
	from {
		left: -200px;
	}
	to {
		left: 100%;
	}
}

/* ===== Sun ===== */
.sun {
	position: fixed;
	top: 30px;
	right: 50px;
	width: 80px;
	height: 80px;
	background: var(--sunny-yellow);
	border-radius: 50%;
	box-shadow:
		0 0 40px var(--sunny-yellow),
		0 0 80px rgba(255, 213, 79, 0.5);
	z-index: 1;
	animation: pulse-sun 3s ease-in-out infinite;
}

@keyframes pulse-sun {
	0%, 100% {
		transform: scale(1);
		box-shadow:
			0 0 40px var(--sunny-yellow),
			0 0 80px rgba(255, 213, 79, 0.5);
	}
	50% {
		transform: scale(1.05);
		box-shadow:
			0 0 50px var(--sunny-yellow),
			0 0 100px rgba(255, 213, 79, 0.6);
	}
}

/* ===== Container ===== */
.container {
	max-width: 1200px;
	margin: 0 auto;
	padding: 20px;
	position: relative;
	z-index: 2;
	flex: 1;
}

/* ===== Header ===== */
.header {
	text-align: center;
	padding: 40px 20px 30px;
}

.title {
	font-size: clamp(2rem, 6vw, 3.5rem);
	font-weight: 700;
	color: var(--grass-dark);
	text-shadow:
		3px 3px 0 var(--cloud-white),
		-1px -1px 0 var(--cloud-white),
		1px -1px 0 var(--cloud-white),
		-1px 1px 0 var(--cloud-white);
	animation: bounce-title 2s ease-in-out infinite;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 15px;
	flex-wrap: wrap;
}

.title-icon {
	display: inline-block;
	animation: sway 2s ease-in-out infinite;
}

.title-icon:last-child {
	animation-delay: -1s;
}

@keyframes bounce-title {
	0%, 100% {
		transform: translateY(0);
	}
	50% {
		transform: translateY(-5px);
	}
}

@keyframes sway {
	0%, 100% {
		transform: rotate(-5deg);
	}
	50% {
		transform: rotate(5deg);
	}
}

.tagline {
	font-size: clamp(1rem, 3vw, 1.5rem);
	color: var(--text-dark);
	margin-top: 10px;
	font-weight: 500;
	opacity: 0.9;
}

/* ===== Games Grid ===== */
.games-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 25px;
	padding: 20px 0 100px;
}

/* ===== Game Card ===== */
.game-card {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-decoration: none;
	color: inherit;
	background: var(--card-color, #FFFFFF);
	border-radius: 20px;
	padding: 25px;
	text-align: center;
	box-shadow:
		0 8px 20px var(--shadow-color),
		0 4px 8px rgba(0, 0, 0, 0.05);
	transition: transform 0.3s ease, box-shadow 0.3s ease;
	cursor: pointer;
	position: relative;
	overflow: hidden;
}

.game-card::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 5px;
	background: linear-gradient(90deg, var(--grass-green), var(--sunny-yellow), var(--warm-orange));
	opacity: 0;
	transition: opacity 0.3s ease;
}

.game-card:hover {
	transform: translateY(-10px) scale(1.02);
	box-shadow:
		0 15px 35px rgba(0, 0, 0, 0.15),
		0 8px 15px rgba(0, 0, 0, 0.1);
}

.game-card:hover::before {
	opacity: 1;
}

.game-card:hover .game-icon {
	animation: wiggle 0.5s ease-in-out;
}

.game-card:hover .play-button {
	background: var(--grass-green);
	transform: scale(1.05);
}

/* ===== Game Icon ===== */
.game-icon {
	font-size: 4rem;
	margin-bottom: 15px;
	display: block;
	filter: drop-shadow(2px 2px 3px rgba(0, 0, 0, 0.1));
}

@keyframes wiggle {
	0%, 100% {
		transform: rotate(0deg);
	}
	25% {
		transform: rotate(-10deg) scale(1.1);
	}
	75% {
		transform: rotate(10deg) scale(1.1);
	}
}

/* ===== Game Title ===== */
.game-title {
	font-size: 1.4rem;
	font-weight: 600;
	color: var(--card-text, var(--text-dark));
	margin-bottom: 8px;
}

/* ===== Game Description ===== */
.game-description {
	font-size: 1rem;
	color: var(--card-text, var(--text-dark));
	opacity: 0.8;
	margin-bottom: 15px;
	line-height: 1.4;
}

/* ===== Play Button ===== */
.play-button {
	background: var(--warm-orange);
	color: white;
	border: none;
	padding: 12px 28px;
	border-radius: 25px;
	font-family: 'Fredoka', sans-serif;
	font-size: 1rem;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.3s ease;
	box-shadow: 0 4px 10px rgba(255, 138, 101, 0.4);
}

.play-button:hover {
	box-shadow: 0 6px 15px rgba(124, 179, 66, 0.5);
}

.play-button:active {
	transform: scale(0.98);
}

/* ===== Footer ===== */
.footer {
	position: relative;
	background: var(--grass-green);
	padding-top: 60px;
	padding-bottom: 20px;
	margin-top: auto;
}

/* ===== Grass ===== */
.grass {
	position: absolute;
	bottom: 60px;
	left: 0;
	width: 100%;
	display: flex;
	justify-content: space-around;
	pointer-events: none;
}

.grass-blade {
	width: 8px;
	height: 40px;
	background: linear-gradient(180deg, var(--grass-dark) 0%, var(--grass-green) 100%);
	border-radius: 50% 50% 0 0;
	transform-origin: bottom center;
	animation: sway-grass 2s ease-in-out infinite;
}

.grass-blade:nth-child(odd) {
	animation-delay: -0.5s;
	height: 50px;
}

.grass-blade:nth-child(3n) {
	animation-delay: -1s;
	height: 35px;
}

@keyframes sway-grass {
	0%, 100% {
		transform: rotate(-5deg);
	}
	50% {
		transform: rotate(5deg);
	}
}

/* ===== Flowers ===== */
.flowers {
	display: flex;
	justify-content: space-around;
	padding: 0 10%;
	margin-bottom: 15px;
}

.flower {
	font-size: 2rem;
	animation: bounce-flower 1.5s ease-in-out infinite;
	filter: drop-shadow(1px 2px 2px rgba(0, 0, 0, 0.2));
}

.flower:nth-child(1) { animation-delay: 0s; }
.flower:nth-child(2) { animation-delay: 0.2s; }
.flower:nth-child(3) { animation-delay: 0.4s; }
.flower:nth-child(4) { animation-delay: 0.6s; }
.flower:nth-child(5) { animation-delay: 0.8s; }

@keyframes bounce-flower {
	0%, 100% {
		transform: translateY(0) rotate(0deg);
	}
	50% {
		transform: translateY(-8px) rotate(5deg);
	}
}

/* ===== Footer Text ===== */
.footer-text {
	text-align: center;
	color: var(--cloud-white);
	font-size: 1.1rem;
	font-weight: 500;
	text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
	.sun {
		width: 60px;
		height: 60px;
		right: 20px;
		top: 20px;
	}

	.games-grid {
		grid-template-columns: repeat(2, 1fr);
		gap: 20px;
	}

	.game-card {
		padding: 20px;
	}

	.game-icon {
		font-size: 3rem;
	}

	.game-title {
		font-size: 1.2rem;
	}

	.flowers {
		padding: 0 5%;
	}

	.flower {
		font-size: 1.5rem;
	}
}

@media (max-width: 480px) {
	.container {
		padding: 10px;
	}

	.header {
		padding: 30px 10px 20px;
	}

	.title {
		gap: 10px;
	}

	.games-grid {
		grid-template-columns: 1fr;
		gap: 15px;
		padding-bottom: 80px;
	}
}

/* ===== Accessibility ===== */
@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
	}
}

/* ===== Focus States ===== */
.game-card:focus,
.play-button:focus {
	outline: 3px solid var(--sunny-yellow);
	outline-offset: 3px;
}

.play-button:focus {
	outline-offset: 2px;
}
