@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
	color-scheme: light;
	--bg: #f6f7fb;
	--surface: #ffffff;
	--surface-muted: #f1f5f9;
	--text: #1f2937;
	--text-muted: #6b7280;
	--border: #e5e7eb;
	--brand: #4f46e5;
	--brand-dark: #4338ca;
	--shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
	--radius: 14px;
}

* {
	box-sizing: border-box;
}

body {
	margin: 0;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
	line-height: 1.6;
	color: var(--text);
	background-image: url("assets/DefaultBanner.png"),
		radial-gradient(circle at top, #ffffff 0%, var(--bg) 45%),
		linear-gradient(120deg, #eef2ff 0%, #f8fafc 35%, #ecfeff 100%);
	background-size: cover, cover, cover;
	background-position: top center, center, center;
	background-repeat: no-repeat;
	overflow-x: hidden;
}

img {
	max-width: 100%;
	display: block;
}

a {
	color: var(--brand);
	text-decoration: none;
	font-weight: 600;
}

a:hover,
a:focus {
	color: var(--brand-dark);
	text-decoration: underline;
}

header {
	background: var(--surface);
	border-bottom: 1px solid var(--border);
	position: relative;
	z-index: 1;
}

body.nav-open header {
	z-index: 10000;
}

body.nav-open main,
body.nav-open footer,
body.nav-open .content-wrapper {
	z-index: 0;
}

.top-bar {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	align-items: center;
	gap: 1.5rem;
	padding: 1.25rem 3rem;
}

.top-bar__logo img {
	width: 230px;
	height: auto;
	margin: 0 auto;
}

.top-bar__nav {
	display: flex;
	gap: 1rem;
	align-items: center;
	width: 100%;
	justify-content: space-evenly;
}

.top-bar__nav--left {
	justify-content: space-evenly;
}

.top-bar__nav--right {
	justify-content: space-evenly;
}

.top-bar__menu-button {
	display: none;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	background: transparent;
	border: none;
	color: var(--text);
	border-radius: 999px;
	padding: 0.6rem 0.75rem;
	font-weight: 600;
	font-size: 1.15rem;
	cursor: pointer;
}

.top-bar__menu-button i {
	font-size: 1.4rem;
}

.mobile-menu {
	display: none;
}

.top-bar__link {
	color: var(--text);
	text-decoration: none;
	font-weight: 600;
	padding: 0.55rem 1rem;
	border-radius: 999px;
	font-size: 1.15rem;
	transition: background 0.2s ease, color 0.2s ease;
}

.top-bar__link:hover,
.top-bar__link:focus {
	background: var(--surface-muted);
	color: var(--brand);
	outline: none;
}

.divider {
	height: 4px;
	background: rgba(210, 92, 112, 1);
}

main {
	width: min(1100px, 100%);
	margin: 0 auto;
	padding: 2.5rem 1.75rem 4rem;
	flex: 1;
	position: relative;
	z-index: 1;
	animation: fadeInUp 0.8s ease both;
}

section {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 1.6rem 1.8rem;
	box-shadow: var(--shadow);
	transition: transform 0.6s ease, opacity 0.6s ease;
}

section + section {
	margin-top: 1.5rem;
}

.page-hero {
	background: linear-gradient(135deg, #eef2ff 0%, #ffffff 60%);
	border: 1px solid #e0e7ff;
}

.page-hero h1 {
	margin-top: 0;
	font-size: clamp(1.75rem, 2vw + 1rem, 2.4rem);
}

.page-hero p {
	color: var(--text-muted);
	margin-bottom: 0;
}

h1, h2, h3 {
	color: var(--text);
	margin-top: 0;
}

ol, ul {
	padding-left: 1.2rem;
}

.content-wrapper {
	display: grid;
	grid-template-columns: minmax(220px, 280px) 1fr;
	gap: 2rem;
	align-items: start;
	width: min(1200px, 100%);
	margin: 0 auto;
	padding: 2.5rem 1.75rem 4rem;
	flex: 1;
	position: relative;
	z-index: 1;
	animation: fadeInUp 0.8s ease both;
}

.content-wrapper main {
	width: 100%;
	margin: 0;
	padding: 0;
}

.content-wrapper nav {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 1.5rem;
	position: sticky;
	top: 1.5rem;
	box-shadow: var(--shadow);
}

.content-wrapper nav h2 {
	font-size: 1rem;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--text-muted);
}

.content-wrapper nav ul {
	list-style: none;
	margin: 1rem 0 0;
	padding: 0;
	display: grid;
	gap: 0.6rem;
}

.content-wrapper nav button,
.content-wrapper nav a {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	font-weight: 600;
	background: transparent;
	border: none;
	color: var(--brand);
	padding: 0;
	cursor: pointer;
	font-size: 0.95rem;
}

.content-wrapper nav button:hover,
.content-wrapper nav a:hover {
	color: var(--brand-dark);
	text-decoration: underline;
}

.content-wrapper nav ul ul {
	margin-left: 1rem;
	display: none;
}

.back-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin-top: 1.25rem;
	padding: 0.6rem 1.1rem;
	background: var(--brand);
	color: #fff;
	border-radius: 999px;
	font-size: 0.95rem;
	font-weight: 600;
	text-decoration: none;
	box-shadow: 0 8px 20px rgba(79, 70, 229, 0.25);
}

.back-button:hover {
	background: var(--brand-dark);
	color: #fff;
	text-decoration: none;
}

footer {
	background: var(--surface);
	text-align: center;
	padding: 1.25rem 1rem;
	border-top: 4px solid rgba(104, 105, 169, 1);
	color: var(--text-muted);
	position: relative;
	z-index: 1;
}

.bubbles {
	position: fixed;
	inset: 0;
	overflow: hidden;
	z-index: 0;
	pointer-events: none;
}

body.game-active .bubbles {
	z-index: 4;
}

.bubble {
	position: absolute;
	top: -15%;
	width: 120px;
	height: 120px;
	border-radius: 50%;
	background: rgba(79, 70, 229, 0.18);
	border: 1px solid rgba(79, 70, 229, 0.28);
	animation: bubbleFall 18s linear infinite;
	filter: blur(0.2px);
	cursor: pointer;
	pointer-events: auto;
}

.bubble--popped {
	animation: bubblePop 0.35s ease forwards;
	pointer-events: none;
}

body.game-active .bubble:not(.bubble--popped) {
	animation: none;
}

.bubble:nth-child(1) { left: 5%; width: 120px; height: 120px; animation-duration: 22s; }
.bubble:nth-child(2) { left: 18%; width: 80px; height: 80px; animation-duration: 18s; animation-delay: 2s; }
.bubble:nth-child(3) { left: 32%; width: 140px; height: 140px; animation-duration: 26s; animation-delay: 1s; }
.bubble:nth-child(4) { left: 48%; width: 90px; height: 90px; animation-duration: 20s; animation-delay: 3s; }
.bubble:nth-child(5) { left: 62%; width: 160px; height: 160px; animation-duration: 28s; animation-delay: 0.5s; }
.bubble:nth-child(6) { left: 75%; width: 70px; height: 70px; animation-duration: 17s; animation-delay: 4s; }
.bubble:nth-child(7) { left: 88%; width: 110px; height: 110px; animation-duration: 24s; animation-delay: 1.5s; }
.bubble:nth-child(8) { left: 12%; width: 60px; height: 60px; animation-duration: 16s; animation-delay: 5s; }
.bubble:nth-child(9) { left: 40%; width: 95px; height: 95px; animation-duration: 21s; animation-delay: 2.5s; }
.bubble:nth-child(10) { left: 68%; width: 130px; height: 130px; animation-duration: 25s; animation-delay: 0s; }

@keyframes bubbleFall {
	0% {
		transform: translateY(-10vh) scale(1);
		opacity: 0;
	}
	10% {
		opacity: 0.7;
	}
	100% {
		transform: translateY(120vh) scale(1.05);
		opacity: 0;
	}
}

@keyframes bubblePop {
	0% {
		transform: scale(1);
		opacity: 0.8;
	}
	100% {
		transform: scale(0.3);
		opacity: 0;
	}
}

header,
main,
footer,
.content-wrapper {
	transition: transform 0.6s ease, opacity 0.6s ease;
	pointer-events: none;
}

header *,
main *,
footer *,
.content-wrapper * {
	pointer-events: auto;
}

body.game-active header *,
body.game-active main *,
body.game-active footer *,
body.game-active .content-wrapper * {
	pointer-events: none;
}

body.game-active header {
	transform: translateY(-120%);
	opacity: 0;
	pointer-events: none;
}

body.game-active main,
body.game-active .content-wrapper {
	transform: none;
	opacity: 1;
	pointer-events: none;
}

body.game-active footer {
	transform: translateY(140%);
	opacity: 0;
	pointer-events: none;
}

body.game-active main section:nth-of-type(odd),
body.game-active .content-wrapper main section:nth-of-type(odd) {
	transform: translateX(-120%);
	opacity: 0;
}

body.game-active main section:nth-of-type(even),
body.game-active .content-wrapper main section:nth-of-type(even) {
	transform: translateX(120%);
	opacity: 0;
}

body.game-active .content-wrapper nav {
	transform: translateX(-120%);
	opacity: 0;
}

.game-hud {
	position: fixed;
	top: 1rem;
	left: 50%;
	transform: translateX(-50%);
	background: rgba(255, 255, 255, 0.92);
	border: 1px solid var(--border);
	box-shadow: var(--shadow);
	border-radius: 999px;
	padding: 0.5rem 1rem;
	display: none;
	align-items: center;
	gap: 1rem;
	z-index: 5;
}

body.game-active .game-hud {
	display: inline-flex;
}

.game-score {
	font-weight: 700;
	font-size: 1rem;
}

.game-level {
	font-weight: 600;
	font-size: 0.95rem;
	color: var(--text-muted);
}

.game-lives {
	font-weight: 600;
	font-size: 0.95rem;
	color: var(--text-muted);
}

.game-back {
	border: none;
	background: var(--brand);
	color: #fff;
	border-radius: 999px;
	padding: 0.4rem 0.9rem;
	font-weight: 600;
	cursor: pointer;
	box-shadow: 0 8px 18px rgba(79, 70, 229, 0.3);
}

.game-back:hover {
	background: var(--brand-dark);
}

@keyframes fadeInUp {
	from {
		opacity: 0;
		transform: translateY(12px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@media (max-width: 960px) {
	.top-bar {
		grid-template-columns: 1fr;
		justify-items: center;
		gap: 0.5rem;
		padding: 1rem 1.25rem;
	}

	.top-bar__nav {
		justify-content: center;
		flex-wrap: wrap;
	}

	.top-bar__logo img {
		width: 190px;
	}

	.top-bar__link {
		font-size: 1.05rem;
		padding: 0.45rem 0.9rem;
	}

	main {
		padding: 2rem 1.1rem 3rem;
	}

	section {
		padding: 1.4rem 1.3rem;
	}

	.content-wrapper {
		grid-template-columns: 1fr;
		padding: 2rem 1.1rem 3rem;
	}

	.content-wrapper nav {
		position: static;
	}
}

@media (max-width: 720px) {
	.top-bar {
		grid-template-columns: 1fr auto 1fr;
		justify-items: center;
		align-items: center;
		row-gap: 0.75rem;
	}

	.top-bar__menu-button {
		display: inline-flex;
		padding: 0.7rem;
		font-size: 1.6rem;
		grid-column: 1;
		justify-self: start;
		position: relative;
		z-index: 10001;
	}

	.top-bar__logo {
		grid-column: 2;
		justify-self: center;
		margin: 0 auto;
	}

	.top-bar__nav--left,
	.top-bar__nav--right {
		display: none;
	}

	.mobile-menu {
		display: block;
		position: fixed;
		inset: 0;
		background: transparent;
		z-index: 9999;
		opacity: 0;
		pointer-events: none;
		transform: translateY(-16px);
		transition: opacity 0.3s ease, transform 0.3s ease;
		padding: 4.5rem 1.25rem 2rem;
	}

	.mobile-menu ul {
		list-style: none;
		margin: 0;
		padding: 1rem;
		max-width: 320px;
		display: grid;
		gap: 0.75rem;
		background: var(--surface);
		border-radius: 16px;
		border: 1px solid var(--border);
		box-shadow: var(--shadow);
		pointer-events: auto;
		position: relative;
		z-index: 10000;
	}

	body.nav-open .mobile-menu {
		opacity: 1;
		pointer-events: none;
		transform: translateY(0);
	}
}

body.nav-open {
	overflow: auto;
}

@media (max-width: 600px) {
	.top-bar__nav {
		gap: 0.6rem;
	}

	.top-bar__link {
		font-size: 1rem;
		padding: 0.4rem 0.75rem;
	}

	.top-bar__logo img {
		width: 165px;
	}

	main {
		padding: 1.6rem 0.9rem 2.5rem;
	}

	section {
		padding: 1.2rem 1.1rem;
	}

	.game-hud {
		flex-wrap: wrap;
		gap: 0.6rem;
	}

	.bubble {
		width: 90px;
		height: 90px;
	}
}
