/* =========================
   BASE / RESET
   ========================= */

* {
	box-sizing: border-box;
}

section:last-of-type {
	margin-bottom: 1.5rem;
}

.game-intro {
	max-width: 720px;
	margin: 3rem auto;
	padding: 2rem 2.5rem;

	background: linear-gradient(
		180deg,
		rgba(255, 255, 255, 0.55),
		rgba(255, 255, 255, 0.35)
	);

	border-radius: 1.5rem;
	box-shadow: 0 12px 30px rgba(120, 80, 180, 0.15);

	backdrop-filter: blur(6px);
}

.game-intro p {
	margin: 0;

	font-size: 1.05rem;
	line-height: 1.7;
	color: #4b2b63;

	text-align: center;
}

.bedtime-story {
	max-width: 900px;
	margin: 3rem auto 1.5rem auto;
	margin-bottom: 1.5rem;
	padding: 2.5rem 3rem;

	background: linear-gradient(
		180deg,
		rgba(255, 255, 255, 0.85),
		rgba(255, 255, 255, 0.65)
	);

	border-radius: 24px;

	box-shadow:
		0 20px 40px rgba(0, 0, 0, 0.08),
		inset 0 1px 0 rgba(255, 255, 255, 0.6);

	backdrop-filter: blur(8px);

	font-family: "Georgia", "Times New Roman", serif;
	color: #4b3a55;

	line-height: 1.7;
}

.bedtime-story h2 {
	margin-top: 0;
	margin-bottom: 1.5rem;

	font-size: 1.6rem;
	font-weight: 600;
	letter-spacing: 0.02em;

	text-align: center;

	color: #6a4c93;
}

.bedtime-story p {
	margin-bottom: 1.2rem;
	font-size: 1.05rem;

	text-align: left;
}

.bedtime-story p:last-child {
	margin-bottom: 0;
	opacity: 0.9;
	font-style: italic;
}

.bedtime-story::before {
	content: "";
	display: block;

	width: 100%;
	height: 6px;

	margin-bottom: 1.5rem;

	border-radius: 6px;

	background: linear-gradient(90deg, #ffd6e8, #e0c3fc, #cce7ff);
}

@media (max-width: 768px) {
	.bedtime-story {
		padding: 2rem 1.8rem;
		margin: 2rem 1rem 3rem 1rem;
	}

	.bedtime-story h2 {
		font-size: 1.4rem;
	}

	.bedtime-story p {
		font-size: 1rem;
	}
}

/* =========================
   PAGE STRUCTURE
   ========================= */
html {
	min-height: 100%;
	background: linear-gradient(180deg, #fff6a8 0%, #ffd1f0 45%, #c9f4ff 100%);
}

body {
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	margin: 0;
	background: transparent;
	color: #3b145f;
}

.character-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 1.5rem;
	margin-top: 1.5rem;
}

.character-card {
	background: rgba(255, 255, 255, 0.85);
	border-radius: 18px;
	padding: 1.2rem;
	text-align: center;
	box-shadow: 0 0 20px rgba(255, 122, 217, 0.25);
}

.character-card img {
	width: 120px;
	height: auto;
	margin-bottom: 0.8rem;
}

.character-card h3 {
	margin: 0.4rem 0;
	color: #5b1a7a;
}

.character-card p {
	font-size: 0.9rem;
	opacity: 0.85;
}

/* =========================
   PAGINATION
   ========================= */

.pagination {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 1.5rem;
	margin: 3rem 0 1rem;
}

.pagination button {
	padding: 0.5rem 1.2rem;
	border-radius: 999px;
	border: none;
	cursor: pointer;
	background: linear-gradient(135deg, #ff7ad9, #ffd84d);
	color: #3b145f;
	font-size: 0.9rem;
}

.pagination button:disabled {
	opacity: 0.4;
	cursor: default;
}

#pageIndicator {
	font-weight: 600;
	color: #5b1a7a;
}

/* =========================
   CREW INTRO IMAGE
   ========================= */

.crew-intro {
	max-width: 1000px;
	margin: 1.5rem auto 2.5rem auto;
	text-align: center;
}

.crew-intro img {
	width: 100%;
	max-width: 520px;
	border-radius: 24px;
	background: white;
	padding: 0.6rem;

	box-shadow:
		0 0 30px rgba(255, 97, 210, 0.45),
		0 0 40px rgba(122, 252, 255, 0.45);
}

/* =========================
   GLOBAL OVERLAY
   ========================= */

.overlay {
	position: fixed;
	inset: 0;
	z-index: 999;

	background: rgba(255, 255, 255, 0.75);
	backdrop-filter: blur(10px);

	display: flex;
	align-items: center;
	justify-content: center;
}

.overlay.hidden {
	display: none;
}

.overlay-content {
	max-width: 800px;
	width: 90%;
	max-height: 85vh;
	overflow-y: auto;

	background: linear-gradient(180deg, #fff0fa 0%, #ffffff 100%);

	border-radius: 24px;
	padding: 2rem;

	box-shadow:
		0 0 40px rgba(255, 97, 210, 0.5),
		0 0 50px rgba(122, 252, 255, 0.5);

	position: relative;
}

.overlay-section.hidden {
	display: none;
}

.close {
	position: absolute;
	top: 1.2rem;
	right: 1.2rem;

	width: 42px;
	height: 42px;

	display: flex;
	align-items: center;
	justify-content: center;

	border-radius: 50%;
	border: none;

	background: linear-gradient(135deg, #ff7ad9, #ffd84d);
	color: #3b145f;

	font-size: 1.2rem;
	font-weight: bold;
	line-height: 1;

	cursor: pointer;
	box-shadow: 0 0 18px rgba(255, 122, 217, 0.45);
}

/* =========================
   NAV BAR
   ========================= */

.main-nav {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 1.5rem;

	max-width: 1000px;
	margin: 0 auto 2rem auto;
}

.nav-actions {
	display: flex;
	gap: 0.8rem;
}

/* =========================
   HERO
   ========================= */

.hero {
	max-width: 800px;
	margin: 0 auto 3rem auto;
}

/* =========================
   CARD GRID
   ========================= */
.card-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 2rem;
	margin-top: 2rem;
}

.card {
	display: flex;
	flex-direction: column;
	gap: 0.8rem;
}

/* Responsive fallback */
@media (max-width: 1000px) {
	.card-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 600px) {
	.card-grid {
		grid-template-columns: 1fr;
	}
}

/* =========================
   LAYOUT
   ========================= */

header,
section {
	max-width: 1000px;
	margin: auto;
	margin-bottom: 3rem;
}

.hidden {
	display: none;
}

.game-layout {
	display: flex;
	flex-direction: column;
	gap: 1.5rem;
}

/* =========================
   TYPOGRAPHY
   ========================= */

h1,
h2,
h3 {
	color: #42015a;
	text-align: center;
}

h1 {
	text-shadow:
		0 0 6px rgba(255, 97, 210, 0.6),
		0 0 14px rgba(122, 252, 255, 0.5);
	font-size: 3.5rem;
}

h2 {
	text-shadow:
		0 0 6px rgba(255, 97, 210, 0.6),
		0 0 14px rgba(122, 252, 255, 0.5);
	font-size: 2.5rem;
}

p {
	line-height: 1.6;
}

/* =========================
   CREW SECTION
   ========================= */

.crew img {
	width: 50%;
	border-radius: 16px;
	background: white;
	padding: 0.5rem;
	box-shadow:
		0 0 25px rgba(255, 97, 210, 0.4),
		0 0 35px rgba(122, 252, 255, 0.35);
}

/* =========================
   LEVEL CARDS
   ========================= */

.card {
	background: linear-gradient(180deg, #ffffff 0%, #fff0fa 100%);

	border-radius: 20px;
	padding: 1rem;

	box-shadow:
		0 0 20px rgba(255, 97, 210, 0.25),
		0 0 30px rgba(122, 252, 255, 0.25);

	transition:
		transform 0.25s ease,
		box-shadow 0.25s ease;
}

.card:hover {
	transform: translateY(-4px);
	box-shadow:
		0 0 30px rgba(255, 97, 210, 0.5),
		0 0 40px rgba(122, 252, 255, 0.5);
}

.card-thumbnail {
	width: 100%;
	height: 140px;
	object-fit: cover;
	border-radius: 14px;
	margin-bottom: 0.6rem;
}

.card-crew {
	width: 100%;
	max-width: 120px;
	display: block;
	margin: 0.4rem auto 0.6rem auto;
	border-radius: 10px;
	box-shadow: 0 0 10px rgba(255, 97, 210, 0.4);
}

.play-button {
	display: inline-block;
	margin-top: 0.6rem;
	padding: 0.4rem 0.9rem;
	border-radius: 999px;
	background: linear-gradient(135deg, #ffe66d, #ff61d2, #7afcff);
	color: #42015a;
	text-decoration: none;
	text-align: center;
	font-weight: 600;
	box-shadow: 0 0 12px rgba(255, 97, 210, 0.4);
}

/* =========================
   HUD
   ========================= */

.hud {
	font-size: 1.1rem;
	color: #42015a;
	background: rgba(255, 255, 255, 0.7);
	padding: 0.6rem 1rem;
	border-radius: 999px;
	width: fit-content;
	box-shadow: 0 0 15px rgba(255, 97, 210, 0.3);
}

/* =========================
   SIDE PANEL
   ========================= */

.side-panel {
	background: linear-gradient(180deg, #ffffff 0%, #fff0fa 100%);
	padding: 1.2rem;
	border-radius: 20px;
	width: 100%;

	box-shadow:
		0 0 30px rgba(255, 97, 210, 0.35),
		0 0 40px rgba(122, 252, 255, 0.3);
}

.side-panel ul {
	list-style: none;
	padding: 0;
	margin: 0;
}

.side-panel li {
	margin-bottom: 0.9rem;
	opacity: 0.6;
	transition:
		opacity 0.3s ease,
		color 0.3s ease;
}

.side-panel li.found {
	opacity: 1;
	color: #ff61d2;
	text-shadow: 0 0 8px rgba(255, 97, 210, 0.6);
}

.hint {
	margin-top: 1.2rem;
	font-size: 0.9rem;
	opacity: 0.8;
	color: #42015a;
}

/* =========================
   PANEL TOGGLE
   ========================= */

.panel-toggle {
	margin-bottom: 0.8rem;
	font-size: 0.85rem;
	background: white;
	border: 2px solid #ff61d2;
	color: #ff61d2;
	border-radius: 999px;
	padding: 0.3rem 0.8rem;
	cursor: pointer;
	box-shadow: 0 0 12px rgba(255, 97, 210, 0.4);
}

.side-panel.collapsed ul,
.side-panel.collapsed .hint {
	display: none;
}

/* =========================
   GAME IMAGE + TARGETS
   ========================= */

.game-container {
	width: 100%;
	max-width: 1000px;
}

.aspect-box {
	position: relative;
	width: 100%;
	aspect-ratio: 3508 / 2480;
	background: white;
	border-radius: 20px;
	overflow: hidden;

	box-shadow:
		0 0 40px rgba(255, 97, 210, 0.4),
		0 0 50px rgba(122, 252, 255, 0.4);
}

.aspect-box img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: contain;
	pointer-events: none;
}

.target {
	position: absolute;
	width: 44px;
	height: 44px;
	transform: translate(-50%, -50%);
	cursor: pointer;
	z-index: 10;
}

.target.found {
	border-radius: 50%;
	outline: 3px solid #ffe66d;
	box-shadow:
		0 0 15px rgba(255, 230, 109, 0.9),
		0 0 25px rgba(255, 97, 210, 0.8);
}

/* =========================
   SOLUTION OVERLAY
   ========================= */

#solution {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	display: none;
	pointer-events: none;
}

/* =========================
   LEVEL COMPLETE OVERLAY
   ========================= */

.level-complete {
	position: fixed;
	inset: 0;
	background: rgba(255, 255, 255, 0.65);
	backdrop-filter: blur(6px);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 100;
}

.level-complete-content {
	background: linear-gradient(180deg, #fff0fa 0%, #ffffff 100%);
	padding: 2rem;
	border-radius: 24px;
	text-align: center;

	box-shadow:
		0 0 50px rgba(255, 97, 210, 0.6),
		0 0 60px rgba(122, 252, 255, 0.5);
}

.level-complete h2 {
	color: #ff61d2;
}

.level-complete p {
	margin-bottom: 1.5rem;
}

.levels {
	margin-bottom: 5rem;
}

/* =========================
   BUTTONS
   ========================= */

button {
	margin-top: 1.2rem;
	padding: 0.7rem 1.3rem;
	border-radius: 999px;
	border: none;

	background: linear-gradient(135deg, #ffe66d 0%, #ff61d2 50%, #7afcff 100%);

	color: #42015a;
	font-weight: 600;
	cursor: pointer;

	box-shadow:
		0 0 20px rgba(255, 97, 210, 0.5),
		0 0 30px rgba(122, 252, 255, 0.5);

	transition:
		transform 0.2s ease,
		box-shadow 0.2s ease;
}

button:hover {
	transform: translateY(-2px);
	box-shadow:
		0 0 30px rgba(255, 97, 210, 0.8),
		0 0 40px rgba(122, 252, 255, 0.8);
}

/* =========================
   FOOTER
   ========================= */
.site-footer {
	padding: 2rem 0 1.5rem;
	text-align: center;
	font-size: 0.9rem;
	color: #5b1a7a;
	opacity: 0.75;
	padding-bottom: 2rem;
	margin-top: 1.5rem;
}

/* =========================
   MOBILE ADJUSTMENTS
   ========================= */

@media (max-width: 600px) {
	/* ---- NAV BAR ---- */

	.main-nav {
		flex-direction: column;
		align-items: stretch;
		gap: 1rem;
		margin-bottom: 1.5rem;
	}

	.nav-actions {
		justify-content: center;
		flex-wrap: wrap;
		gap: 0.6rem;
	}

	.nav-actions button,
	.nav-actions a {
		flex: 1 1 auto;
		text-align: center;
		min-width: 120px;
	}

	/* ---- GLOBAL OVERLAY ---- */

	.overlay {
		padding: 1rem;
		align-items: flex-start;
	}

	.overlay-content {
		width: 100%;
		max-height: calc(100vh - 2rem);
		padding: 1.4rem 1.2rem 1.6rem;
		border-radius: 20px;
	}

	.close {
		top: 0.8rem;
		right: 0.8rem;
		width: 46px;
		height: 46px;
		font-size: 1.3rem;
	}

	.overlay-content p {
		font-size: 0.95rem;
	}

	.level-complete-content {
		width: 90%;
		padding: 1.6rem 1.4rem;
		border-radius: 22px;
	}

	.level-complete h2 {
		font-size: 1.6rem;
	}
}
