/* ===== RESET & BASE ===== */
*,
*::before,
*::after {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

:root {
	--primary: #8b5cf6;
	--primary-light: #a78bfa;
	--primary-dark: #7c3aed;
	--accent: #ec4899;
	--accent-light: #f472b6;
	--warning: #fbbf24;
	--success: #34d399;
	--danger: #ef4444;
	--bg-dark: #1e1b4b;
	--bg-gradient: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #4338ca 100%);
	--glass: rgba(255, 255, 255, 0.1);
	--glass-border: rgba(255, 255, 255, 0.2);
	--text: #f8fafc;
	--text-dim: #cbd5e1;
	--shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.3);
	--shadow-glow: 0 0 20px rgba(139, 92, 246, 0.5);
}

html,
body {
	width: 100%;
	height: 100%;
	overflow: hidden;
	font-family: "Nunito", -apple-system, BlinkMacSystemFont, sans-serif;
	background: var(--bg-gradient);
	color: var(--text);
	-webkit-font-smoothing: antialiased;
	touch-action: manipulation;
}

/* ===== SCREENS ===== */
.screen {
	position: fixed;
	inset: 0;
	display: none;
	flex-direction: column;
	align-items: center;
	overflow-x: hidden;
	overflow-y: auto;
	padding: 1rem;
}

.screen.active {
	display: flex;
}

/* ===== BACKGROUND EFFECTS ===== */
.stars-bg,
.practice-bg {
	position: fixed;
	inset: 0;
	pointer-events: none;
	overflow: hidden;
}

.stars-bg::before {
	content: "";
	position: absolute;
	inset: 0;
	background:
		radial-gradient(2px 2px at 20px 30px, #fff, transparent),
		radial-gradient(2px 2px at 40px 70px, rgba(255, 255, 255, 0.8), transparent),
		radial-gradient(1px 1px at 90px 40px, #fff, transparent),
		radial-gradient(
			2px 2px at 160px 120px,
			rgba(255, 255, 255, 0.8),
			transparent
		),
		radial-gradient(1px 1px at 230px 80px, #fff, transparent),
		radial-gradient(
			2px 2px at 300px 150px,
			rgba(255, 255, 255, 0.6),
			transparent
		),
		radial-gradient(1px 1px at 350px 60px, #fff, transparent),
		radial-gradient(
			2px 2px at 450px 200px,
			rgba(255, 255, 255, 0.7),
			transparent
		),
		radial-gradient(1px 1px at 500px 50px, #fff, transparent);
	background-size: 550px 250px;
	animation: twinkle 5s ease-in-out infinite alternate;
}

@keyframes twinkle {
	from {
		opacity: 0.6;
	}
	to {
		opacity: 1;
	}
}

.floating-island {
	position: absolute;
	top: 8%;
	right: 10%;
	animation: float 6s ease-in-out infinite;
}

.island-emoji {
	font-size: clamp(3rem, 8vw, 6rem);
}

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

/* ===== MENU SCREEN ===== */
.game-title {
	font-family: "Fredoka One", cursive;
	font-size: clamp(2rem, 6vw, 4rem);
	text-align: center;
	margin-top: clamp(1rem, 4vh, 3rem);
	text-shadow:
		2px 2px 0 var(--primary-dark),
		0 0 30px rgba(139, 92, 246, 0.6);
	line-height: 1.1;
}

.letter-bounce {
	display: inline-block;
	animation: letterBounce 2s ease-in-out infinite;
}

.letter-bounce:nth-child(1) {
	animation-delay: 0s;
}
.letter-bounce:nth-child(2) {
	animation-delay: 0.1s;
}
.letter-bounce:nth-child(3) {
	animation-delay: 0.2s;
}
.letter-bounce:nth-child(4) {
	animation-delay: 0.3s;
}
.letter-bounce:nth-child(5) {
	animation-delay: 0.4s;
}
.letter-bounce:nth-child(6) {
	animation-delay: 0.5s;
}
.letter-bounce:nth-child(7) {
	animation-delay: 0.6s;
}
.letter-bounce:nth-child(8) {
	animation-delay: 0.7s;
}
.letter-bounce:nth-child(9) {
	animation-delay: 0.8s;
}
.letter-bounce:nth-child(10) {
	animation-delay: 0.9s;
}
.letter-bounce:nth-child(11) {
	animation-delay: 1s;
}

@keyframes letterBounce {
	0%,
	100% {
		transform: translateY(0);
	}
	50% {
		transform: translateY(-8px);
	}
}

.sparkle {
	display: inline-block;
	animation: sparkleSpin 3s ease-in-out infinite;
}

@keyframes sparkleSpin {
	0%,
	100% {
		transform: rotate(0deg) scale(1);
	}
	50% {
		transform: rotate(180deg) scale(1.3);
	}
}

.tagline {
	font-size: clamp(0.9rem, 2.5vw, 1.2rem);
	color: var(--text-dim);
	margin: 0.75rem 0 1.5rem;
	text-align: center;
	max-width: 500px;
}

/* ===== BUTTONS ===== */
.btn {
	font-family: "Nunito", sans-serif;
	font-size: clamp(0.95rem, 2vw, 1.1rem);
	font-weight: 700;
	padding: 0.8rem 2rem;
	border: none;
	border-radius: 50px;
	cursor: pointer;
	transition: all 0.2s ease;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	box-shadow: var(--shadow-soft);
	color: #fff;
	text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
	user-select: none;
	-webkit-tap-highlight-color: transparent;
}

.btn:active {
	transform: scale(0.95);
}

.btn-primary {
	background: linear-gradient(135deg, var(--primary), var(--primary-light));
}
.btn-primary:hover {
	box-shadow: var(--shadow-glow);
	transform: translateY(-2px);
}

.btn-glow {
	animation: glowPulse 2s ease-in-out infinite alternate;
}

@keyframes glowPulse {
	from {
		box-shadow: 0 0 10px rgba(139, 92, 246, 0.4);
	}
	to {
		box-shadow:
			0 0 25px rgba(139, 92, 246, 0.8),
			0 0 50px rgba(139, 92, 246, 0.3);
	}
}

.btn-secondary {
	background: rgba(255, 255, 255, 0.15);
	backdrop-filter: blur(10px);
	border: 1px solid var(--glass-border);
	font-size: clamp(0.85rem, 2vw, 1rem);
	padding: 0.7rem 1.5rem;
}
.btn-secondary:hover {
	background: rgba(255, 255, 255, 0.25);
	transform: translateY(-1px);
}

.btn-danger {
	background: linear-gradient(135deg, var(--danger), #dc2626);
}
.btn-danger:hover {
	box-shadow: 0 0 15px rgba(239, 68, 68, 0.5);
}

.btn-icon {
	font-size: 1.2em;
}

.btn-back {
	background: none;
	border: 1px solid var(--glass-border);
	color: var(--text);
	padding: 0.5rem 1rem;
	border-radius: 50px;
	font-family: "Nunito", sans-serif;
	font-weight: 700;
	font-size: 0.95rem;
	cursor: pointer;
	transition: all 0.2s;
	backdrop-filter: blur(10px);
}
.btn-back:hover {
	background: rgba(255, 255, 255, 0.1);
}

.btn-pause {
	background: rgba(0, 0, 0, 0.4);
	border: 1px solid var(--glass-border);
	color: #fff;
	padding: 0.4rem 0.8rem;
	border-radius: 12px;
	font-size: 1.2rem;
	cursor: pointer;
	backdrop-filter: blur(10px);
}
.btn-pause:hover {
	background: rgba(0, 0, 0, 0.6);
}

.btn-install,
.btn-dismiss {
	background: var(--primary);
	color: #fff;
	border: none;
	border-radius: 8px;
	padding: 0.4rem 0.8rem;
	font-family: "Nunito", sans-serif;
	font-weight: 700;
	cursor: pointer;
}

.btn-dismiss {
	background: rgba(255, 255, 255, 0.2);
	font-size: 1.1rem;
	padding: 0.2rem 0.5rem;
}

.btn-tutorial-next {
	background: linear-gradient(135deg, var(--accent), var(--accent-light));
	color: #fff;
	border: none;
	border-radius: 50px;
	padding: 0.7rem 2rem;
	font-family: "Nunito", sans-serif;
	font-weight: 700;
	font-size: 1rem;
	cursor: pointer;
	margin-top: 1rem;
	transition: all 0.2s;
}
.btn-tutorial-next:hover {
	transform: scale(1.05);
	box-shadow: 0 0 20px rgba(236, 72, 153, 0.5);
}

.menu-buttons {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
	width: min(90%, 320px);
	margin: 0 auto;
}

/* ===== STATS BAR ===== */
.stats-bar {
	display: flex;
	justify-content: center;
	gap: 0.6rem;
	margin-top: auto;
	margin-bottom: 1.5rem;
	flex-wrap: wrap;
}

.stat-pill {
	background: rgba(255, 255, 255, 0.1);
	backdrop-filter: blur(10px);
	border: 1px solid var(--glass-border);
	border-radius: 50px;
	padding: 0.4rem 0.9rem;
	font-size: 0.85rem;
	font-weight: 600;
	display: flex;
	align-items: center;
	gap: 0.35rem;
	animation: fadeInUp 0.6s ease both;
}

.stat-icon {
	font-size: 1.1em;
}

/* ===== GAME CANVAS ===== */
#game-canvas {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	z-index: 1;
}

/* ===== HUD ===== */
.hud {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	z-index: 10;
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	padding: clamp(0.5rem, 1.5vw, 1rem) clamp(0.75rem, 2vw, 1.5rem);
	pointer-events: none;
}

.hud > * {
	pointer-events: auto;
}

.hud-left,
.hud-right,
.hud-center {
	display: flex;
	flex-direction: column;
	gap: 0.4rem;
}

.hud-center {
	align-items: center;
	position: absolute;
	left: 50%;
	transform: translateX(-50%);
}

.hud-score,
.hud-level {
	background: rgba(0, 0, 0, 0.4);
	backdrop-filter: blur(10px);
	border: 1px solid var(--glass-border);
	border-radius: 12px;
	padding: 0.35rem 0.75rem;
	font-size: 0.9rem;
	font-weight: 700;
	display: flex;
	align-items: center;
	gap: 0.35rem;
}

.hud-icon {
	font-size: 1.1em;
}

.hud-combo {
	font-family: "Fredoka One", cursive;
	font-size: clamp(0.9rem, 2.5vw, 1.3rem);
	color: var(--warning);
	text-shadow: 0 0 10px rgba(251, 191, 36, 0.5);
	opacity: 0;
	transition: opacity 0.3s;
}

.hud-combo.active {
	opacity: 1;
	animation: pulseCombo 0.5s ease;
}

@keyframes pulseCombo {
	0% {
		transform: scale(1);
	}
	50% {
		transform: scale(1.2);
	}
	100% {
		transform: scale(1);
	}
}

.hud-accuracy {
	font-size: 0.8rem;
	color: var(--text-dim);
	background: rgba(0, 0, 0, 0.3);
	padding: 0.2rem 0.6rem;
	border-radius: 50px;
}

/* ===== HEARTS BAR ===== */
.hearts-bar {
	position: absolute;
	bottom: clamp(70px, 15vh, 120px);
	left: 50%;
	transform: translateX(-50%);
	z-index: 10;
	display: flex;
	gap: 0.5rem;
	background: rgba(0, 0, 0, 0.4);
	backdrop-filter: blur(10px);
	border: 1px solid var(--glass-border);
	border-radius: 50px;
	padding: 0.4rem 0.8rem;
}

.heart {
	font-size: clamp(1.3rem, 3vw, 1.8rem);
	transition: all 0.3s;
	filter: drop-shadow(0 0 4px rgba(236, 72, 153, 0.5));
}

.heart.lost {
	opacity: 0.3;
	transform: scale(0.7);
	filter: grayscale(1);
}

.heart.animated {
	animation: heartBeat 0.4s ease;
}

@keyframes heartBeat {
	0%,
	100% {
		transform: scale(1);
	}
	30% {
		transform: scale(1.3);
	}
	60% {
		transform: scale(1);
	}
}

/* ===== TARGET WORD DISPLAY ===== */
.target-display {
	position: absolute;
	bottom: clamp(0.75rem, 2vh, 1.5rem);
	left: 50%;
	transform: translateX(-50%);
	z-index: 10;
	background: rgba(0, 0, 0, 0.5);
	backdrop-filter: blur(15px);
	border: 1px solid var(--glass-border);
	border-radius: 20px;
	padding: clamp(0.5rem, 1.5vh, 1rem) clamp(1rem, 3vw, 2rem);
	display: flex;
	align-items: center;
	gap: 0.15em;
	font-family: "Fredoka One", cursive;
	font-size: clamp(1.5rem, 5vw, 3rem);
	letter-spacing: 0.1em;
	text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
	pointer-events: none;
}

.target-word {
	color: var(--text-dim);
}

.target-typed {
	color: var(--success);
	text-shadow: 0 0 8px rgba(52, 211, 153, 0.6);
}

/* ===== OVERLAYS ===== */
.overlay {
	position: absolute;
	inset: 0;
	z-index: 100;
	background: rgba(0, 0, 0, 0.75);
	backdrop-filter: blur(8px);
	display: flex;
	align-items: center;
	justify-content: center;
	animation: fadeIn 0.3s ease;
}

.overlay.hidden {
	display: none;
}

@keyframes fadeIn {
	from {
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}

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

.overlay-card {
	background: linear-gradient(
		135deg,
		rgba(49, 46, 129, 0.95),
		rgba(67, 56, 202, 0.95)
	);
	border: 1px solid var(--glass-border);
	border-radius: 24px;
	padding: clamp(1.5rem, 4vh, 2.5rem) clamp(1.5rem, 4vw, 3rem);
	text-align: center;
	max-width: min(90%, 420px);
	box-shadow: var(--shadow-soft), var(--shadow-glow);
	animation: popupIn 0.4s ease-out;
}

@keyframes popupIn {
	from {
		transform: scale(0.8) translateY(30px);
		opacity: 0;
	}
	to {
		transform: scale(1) translateY(0);
		opacity: 1;
	}
}

.overlay-card h2 {
	font-family: "Fredoka One", cursive;
	font-size: clamp(1.5rem, 4vw, 2rem);
	margin-bottom: 0.75rem;
}

.overlay-card p {
	font-size: clamp(0.85rem, 2vw, 1rem);
	color: var(--text-dim);
	margin-bottom: 0.5rem;
}

.overlay-card .btn {
	width: 100%;
	margin-top: 0.75rem;
}

.level-card .level-stars {
	font-size: clamp(2rem, 5vw, 3rem);
	margin-bottom: 0.5rem;
}

.level-stats p {
	margin: 0.3rem 0;
	color: var(--text);
}

.level-stats span {
	color: var(--warning);
	font-weight: 700;
}

.gameover-emoji {
	font-size: clamp(3rem, 8vw, 5rem);
	margin-bottom: 0.5rem;
}

.gameover-message {
	font-size: 1rem;
	margin-bottom: 1rem;
	color: var(--accent-light);
}

.gameover-stats p {
	font-size: 0.95rem;
	margin: 0.25rem 0;
}

.gameover-stats span {
	color: var(--warning);
	font-weight: 700;
}

.gameover-buttons {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	margin-top: 1rem;
}

/* ===== TUTORIAL ===== */
.tutorial .tutorial-card {
	background: linear-gradient(
		135deg,
		rgba(49, 46, 129, 0.98),
		rgba(76, 29, 149, 0.98)
	);
	border-radius: 28px;
	padding: clamp(2.2rem, 5vh, 3.5rem) clamp(2rem, 5vw, 3.5rem);
	max-width: min(92%, 520px);
	box-shadow:
		0 8px 40px rgba(139, 92, 246, 0.3),
		0 0 60px rgba(139, 92, 246, 0.1);
}

.tutorial .tutorial-card h2 {
	font-family: "Fredoka One", cursive;
	font-size: clamp(1.4rem, 4vw, 2rem);
	margin-bottom: 1rem;
	color: #fff;
	text-shadow: 0 2px 8px rgba(139, 92, 246, 0.4);
}

.tutorial .tutorial-card p {
	font-size: clamp(0.95rem, 2.5vw, 1.15rem);
	line-height: 1.6;
	color: var(--text-dim);
	margin: 0.6rem 0;
}

.tutorial .tutorial-card kbd {
	background: linear-gradient(135deg, var(--primary), var(--primary-light));
	padding: 0.25rem 0.7rem;
	border-radius: 8px;
	font-family: "Fredoka One", cursive;
	font-size: 0.95em;
	color: #fff;
	box-shadow: 0 2px 10px rgba(139, 92, 246, 0.4);
}

.tutorial .tutorial-card .btn {
	margin-top: 1.2rem;
}

.tutorial-slides {
	position: relative;
}

.tutorial-slide {
	display: none;
	animation: slideIn 0.4s ease;
}

.tutorial-slide.active {
	display: block;
}

@keyframes slideIn {
	from {
		transform: translateX(40px);
		opacity: 0;
	}
	to {
		transform: translateX(0);
		opacity: 1;
	}
}

.tutorial-slide h2 {
	font-family: "Fredoka One", cursive;
	font-size: clamp(1.3rem, 3.5vw, 1.8rem);
	margin-bottom: 0.75rem;
}

.tutorial-slide p {
	font-size: clamp(0.85rem, 2.2vw, 1.05rem);
	margin: 0.5rem 0;
	line-height: 1.5;
}

.tutorial-dots {
	display: flex;
	justify-content: center;
	gap: 0.5rem;
	margin-top: 1rem;
}

.dot {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.3);
	transition: all 0.3s;
}

.dot.active {
	background: var(--primary-light);
	box-shadow: 0 0 8px rgba(167, 139, 250, 0.6);
	transform: scale(1.3);
}

/* ===== PRACTICE MODE ===== */
.screen-header {
	display: flex;
	align-items: center;
	width: 100%;
	max-width: 600px;
	gap: 1rem;
	margin-bottom: 1rem;
}

.screen-header h2 {
	font-family: "Fredoka One", cursive;
	font-size: 1.4rem;
}

.practice-viewport {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	flex: 1;
	gap: 2rem;
}

.practice-char-display {
	font-family: "Fredoka One", cursive;
	font-size: clamp(6rem, 18vw, 14rem);
	color: var(--primary-light);
	text-shadow:
		0 0 40px rgba(167, 139, 250, 0.5),
		3px 3px 0 var(--primary-dark);
	animation: practicePulse 1.5s ease-in-out infinite alternate;
}

@keyframes practicePulse {
	from {
		transform: scale(1);
	}
	to {
		transform: scale(1.08);
	}
}

.practice-hint {
	font-size: 1.1rem;
	color: var(--text-dim);
	background: rgba(0, 0, 0, 0.3);
	padding: 0.6rem 1.2rem;
	border-radius: 50px;
}

.practice-hint kbd {
	background: linear-gradient(135deg, var(--primary), var(--primary-light));
	padding: 0.2rem 0.6rem;
	border-radius: 8px;
	font-family: "Fredoka One", cursive;
	font-size: 1.2em;
	color: #fff;
	box-shadow: 0 2px 10px rgba(139, 92, 246, 0.4);
}

.practice-progress {
	width: min(90%, 400px);
	margin-bottom: 2rem;
	display: flex;
	align-items: center;
	gap: 1rem;
}

.practice-bar {
	flex: 1;
	height: 12px;
	background: rgba(255, 255, 255, 0.15);
	border-radius: 10px;
	overflow: hidden;
}

.practice-fill {
	height: 100%;
	background: linear-gradient(90deg, var(--primary), var(--accent));
	border-radius: 10px;
	width: 0%;
	transition: width 0.4s ease;
	box-shadow: 0 0 10px rgba(139, 92, 246, 0.5);
}

.practice-progress span {
	font-weight: 700;
	min-width: 70px;
	text-align: right;
}

/* ===== PROFILE SCREEN ===== */
.profile-card {
	background: rgba(255, 255, 255, 0.08);
	backdrop-filter: blur(20px);
	border: 1px solid var(--glass-border);
	border-radius: 24px;
	padding: clamp(1.5rem, 4vh, 2.5rem);
	max-width: min(90%, 500px);
	text-align: center;
}

.avatar-preview {
	font-size: clamp(3rem, 8vw, 5rem);
	margin-bottom: 0.75rem;
	animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
	0%,
	100% {
		transform: translateY(0) scale(1);
	}
	50% {
		transform: translateY(-8px) scale(1.05);
	}
}

.player-name-input {
	width: 100%;
	max-width: 260px;
	padding: 0.6rem 1rem;
	font-family: "Nunito", sans-serif;
	font-size: 1rem;
	font-weight: 700;
	text-align: center;
	color: var(--text);
	background: rgba(255, 255, 255, 0.1);
	border: 1px solid var(--glass-border);
	border-radius: 50px;
	outline: none;
	transition: all 0.2s;
	margin-bottom: 1rem;
}

.player-name-input:focus {
	border-color: var(--primary-light);
	box-shadow: 0 0 15px rgba(139, 92, 246, 0.3);
	background: rgba(255, 255, 255, 0.15);
}

.player-name-input::placeholder {
	color: rgba(255, 255, 255, 0.4);
}

.avatar-picker {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 0.4rem;
	max-width: 260px;
	margin: 0 auto 1.5rem;
}

.avatar-btn {
	font-size: clamp(1.5rem, 4vw, 2rem);
	padding: 0.5rem;
	background: rgba(255, 255, 255, 0.08);
	border: 2px solid transparent;
	border-radius: 14px;
	cursor: pointer;
	transition: all 0.2s;
}

.avatar-btn:hover {
	background: rgba(255, 255, 255, 0.15);
	transform: scale(1.1);
}

.avatar-btn.active {
	border-color: var(--primary-light);
	background: rgba(139, 92, 246, 0.3);
	box-shadow: 0 0 12px rgba(139, 92, 246, 0.4);
}

.profile-stats {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 0.6rem;
	margin-bottom: 1.5rem;
}

.profile-stat {
	background: rgba(255, 255, 255, 0.06);
	border: 1px solid var(--glass-border);
	border-radius: 16px;
	padding: 0.75rem;
	display: flex;
	flex-direction: column;
	align-items: center;
}

.ps-icon {
	font-size: 1.4rem;
}

.ps-num {
	font-family: "Fredoka One", cursive;
	font-size: 1.3rem;
	color: var(--warning);
}

.ps-label {
	font-size: 0.7rem;
	color: var(--text-dim);
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

/* ===== CHALLENGES ===== */
.challenges-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 1rem;
	max-width: 700px;
	width: 100%;
	align-content: start;
	margin-top: 1rem;
}

.challenge-card {
	background: rgba(255, 255, 255, 0.08);
	backdrop-filter: blur(15px);
	border: 1px solid var(--glass-border);
	border-radius: 20px;
	padding: 1.25rem;
	text-align: center;
	transition: all 0.25s;
	cursor: pointer;
	user-select: none;
}

.challenge-card:hover {
	transform: translateY(-4px);
	box-shadow: 0 8px 25px rgba(139, 92, 246, 0.25);
	border-color: rgba(167, 139, 250, 0.4);
}

.challenge-card.completed {
	border-color: rgba(52, 211, 153, 0.5);
	background: rgba(52, 211, 153, 0.1);
}

.challenge-status {
	font-size: 0.8rem;
	font-weight: 700;
	color: var(--text-dim);
}
.challenge-card.completed .challenge-status {
	color: var(--success);
}

.challenge-icon {
	font-size: 2.2rem;
	margin-bottom: 0.5rem;
}

.challenge-card h3 {
	font-family: "Fredoka One", cursive;
	font-size: 1.1rem;
	margin-bottom: 0.3rem;
}

.challenge-card p {
	font-size: 0.85rem;
	color: var(--text-dim);
}

.challenge-progress-bar {
	height: 6px;
	background: rgba(255, 255, 255, 0.15);
	border-radius: 4px;
	margin: 0.75rem 0 0.5rem;
	overflow: hidden;
}

.challenge-progress-fill {
	height: 100%;
	background: linear-gradient(90deg, var(--primary), var(--accent));
	border-radius: 4px;
	width: 0%;
	transition: width 0.4s;
}

/* ===== INSTALL PROMPT ===== */
.install-prompt {
	position: fixed;
	bottom: 1rem;
	left: 50%;
	transform: translateX(-50%);
	z-index: 200;
	background: linear-gradient(135deg, var(--primary), var(--primary-dark));
	color: #fff;
	padding: 0.7rem 1.2rem;
	border-radius: 50px;
	display: flex;
	align-items: center;
	gap: 0.6rem;
	font-weight: 700;
	font-size: 0.85rem;
	box-shadow: var(--shadow-glow);
	max-width: 90%;
	animation: slideUp 0.5s ease;
}

@keyframes slideUp {
	from {
		transform: translateX(-50%) translateY(100px);
		opacity: 0;
	}
	to {
		transform: translateX(-50%) translateY(0);
		opacity: 1;
	}
}

.install-prompt.hidden {
	display: none;
}

/* ===== CANVAS PARTICLES ===== */
.particle {
	position: absolute;
	pointer-events: none;
	z-index: 5;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 480px) {
	.game-title {
		font-size: 2.2rem;
	}
	.hud-center {
		position: static;
		transform: none;
		align-items: flex-end;
	}
	.hearts-bar {
		bottom: 60px;
		padding: 0.3rem 0.6rem;
	}
	.target-display {
		font-size: 1.5rem;
		bottom: 0.5rem;
		padding: 0.4rem 1rem;
	}
	.hud {
		padding: 0.4rem;
	}
	.hud-score,
	.hud-level {
		font-size: 0.8rem;
		padding: 0.25rem 0.5rem;
	}
	.challenges-grid {
		grid-template-columns: 1fr;
	}
	.level-progress-wrap {
		bottom: 55px;
		height: 8px;
	}
	.powerup-indicator {
		top: 42px;
		font-size: 0.8rem;
	}
	.difficulty-badge {
		font-size: 0.65rem;
		padding: 0.15rem 0.6rem;
	}
}

@media (max-height: 600px) {
	.game-title {
		font-size: 2rem;
		margin-top: 0.5rem;
	}
	.tagline {
		display: none;
	}
	.floating-island {
		top: 5%;
		right: 5%;
	}
	.island-emoji {
		font-size: 2.5rem;
	}
	.target-display {
		font-size: 1.3rem;
	}
	.hearts-bar {
		bottom: 55px;
	}
}

/* ===== SCREEN SHAKE ===== */
@keyframes screenShake {
	0% {
		transform: translate(0, 0);
	}
	10% {
		transform: translate(-4px, 2px);
	}
	20% {
		transform: translate(4px, -2px);
	}
	30% {
		transform: translate(-3px, 3px);
	}
	40% {
		transform: translate(3px, -1px);
	}
	50% {
		transform: translate(-2px, 2px);
	}
	60% {
		transform: translate(2px, -3px);
	}
	70% {
		transform: translate(-1px, 1px);
	}
	80% {
		transform: translate(1px, -2px);
	}
	90% {
		transform: translate(-1px, 1px);
	}
	100% {
		transform: translate(0, 0);
	}
}

.shake-screen {
	animation: screenShake 0.35s ease-out;
}

/* ===== LEVEL PROGRESS BAR ===== */
.level-progress-wrap {
	position: absolute;
	bottom: clamp(60px, 12vh, 100px);
	left: 50%;
	transform: translateX(-50%);
	z-index: 10;
	width: min(80%, 300px);
	height: 10px;
	background: rgba(0, 0, 0, 0.4);
	border: 1px solid var(--glass-border);
	border-radius: 10px;
	overflow: hidden;
	backdrop-filter: blur(10px);
}

.level-progress-fill {
	height: 100%;
	background: linear-gradient(90deg, var(--primary), var(--accent));
	border-radius: 10px;
	width: 0%;
	transition: width 0.4s ease;
	box-shadow: 0 0 10px rgba(139, 92, 246, 0.4);
}

/* ===== POWER-UP INDICATOR ===== */
.powerup-indicator {
	position: absolute;
	top: clamp(50px, 8vh, 80px);
	left: 50%;
	transform: translateX(-50%);
	z-index: 10;
	font-family: "Fredoka One", cursive;
	font-size: clamp(0.9rem, 2.5vw, 1.2rem);
	color: var(--warning);
	text-shadow: 0 0 12px rgba(251, 191, 36, 0.5);
	opacity: 0;
	transition: opacity 0.3s;
	pointer-events: none;
}

.powerup-indicator.active {
	opacity: 1;
	animation: pulseCombo 1s ease-in-out infinite;
}

/* ===== ADAPTIVE DIFFICULTY BADGE ===== */
.difficulty-badge {
	position: absolute;
	top: clamp(4px, 1vh, 8px);
	left: 50%;
	transform: translateX(-50%);
	z-index: 10;
	background: rgba(0, 0, 0, 0.5);
	border: 1px solid var(--glass-border);
	border-radius: 50px;
	padding: 0.2rem 0.8rem;
	font-size: 0.75rem;
	font-weight: 700;
	color: var(--text-dim);
	opacity: 0;
	transition: opacity 0.5s;
	pointer-events: none;
}

.difficulty-badge.active {
	opacity: 1;
}

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

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
	width: 6px;
}
::-webkit-scrollbar-track {
	background: transparent;
}
::-webkit-scrollbar-thumb {
	background: rgba(255, 255, 255, 0.2);
	border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
	background: rgba(255, 255, 255, 0.35);
}

/* ===== TYPING PET ===== */
.typing-pet {
	position: fixed;
	bottom: clamp(90px, 18vh, 140px);
	left: clamp(10px, 2vw, 20px);
	z-index: 12;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.25rem;
	pointer-events: none;
	transition: transform 0.3s ease;
}
.pet-emoji {
	font-size: clamp(2.2rem, 5vw, 3.5rem);
	transition:
		transform 0.3s ease,
		filter 0.3s ease;
}
.pet-emoji.happy {
	animation: petHappy 0.6s ease;
}
.pet-emoji.celebrate {
	animation: petCelebrate 1s ease infinite;
}
.pet-emoji.sad {
	filter: grayscale(0.7) brightness(0.6);
	animation: petSad 0.5s ease;
}
.pet-emoji.shake {
	animation: petShake 0.4s ease;
}
@keyframes petHappy {
	0%,
	100% {
		transform: translateY(0) scale(1);
	}
	25% {
		transform: translateY(-10px) scale(1.15);
	}
	50% {
		transform: translateY(0) scale(1.1);
	}
	75% {
		transform: translateY(-5px) scale(1.15);
	}
}
@keyframes petCelebrate {
	0%,
	100% {
		transform: rotate(0deg) scale(1);
	}
	25% {
		transform: rotate(-10deg) scale(1.1);
	}
	50% {
		transform: rotate(10deg) scale(1.1);
	}
	75% {
		transform: rotate(-5deg) scale(1.15);
	}
}
@keyframes petSad {
	0% {
		transform: translateY(0);
	}
	50% {
		transform: translateY(8px);
	}
	100% {
		transform: translateY(0);
	}
}
@keyframes petShake {
	0%,
	100% {
		transform: translateX(0);
	}
	25% {
		transform: translateX(-4px);
	}
	50% {
		transform: translateX(4px);
	}
	75% {
		transform: translateX(-2px);
	}
}
.pet-bubble {
	font-family: "Nunito", sans-serif;
	font-size: 0.7rem;
	font-weight: 700;
	color: var(--text);
	background: rgba(139, 92, 246, 0.85);
	padding: 0.3rem 0.7rem;
	border-radius: 12px;
	max-width: 120px;
	text-align: center;
	opacity: 0;
	transform: translateY(5px);
	transition:
		opacity 0.3s,
		transform 0.3s;
	pointer-events: none;
}
.pet-bubble.visible {
	opacity: 1;
	transform: translateY(0);
}

/* ===== WORD IMAGE POPUP ===== */
.word-popup {
	position: absolute;
	z-index: 15;
	left: 50%;
	top: 40%;
	transform: translate(-50%, -50%) scale(0.5);
	background: rgba(255, 255, 255, 0.15);
	backdrop-filter: blur(20px);
	border: 1px solid var(--glass-border);
	border-radius: 24px;
	padding: clamp(1rem, 3vh, 2rem);
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.5rem;
	transition:
		opacity 0.3s,
		transform 0.3s;
	opacity: 0;
	pointer-events: none;
}
.word-popup.visible {
	transform: translate(-50%, -50%) scale(1);
	opacity: 1;
	pointer-events: auto;
}
.word-popup-emoji {
	font-size: clamp(4rem, 12vw, 8rem);
	animation: wordPopIn 0.5s ease;
	text-shadow: 0 0 30px rgba(255, 255, 255, 0.5);
}
@keyframes wordPopIn {
	0% {
		transform: scale(0) rotate(-20deg);
	}
	60% {
		transform: scale(1.2) rotate(5deg);
	}
	100% {
		transform: scale(1) rotate(0deg);
	}
}
.word-popup-text {
	font-family: "Fredoka One", cursive;
	font-size: clamp(1rem, 3vw, 1.5rem);
	color: var(--text);
}

/* ===== ACHIEVEMENT TOAST ===== */
.achievement-toast {
	position: fixed;
	top: clamp(60px, 10vh, 100px);
	left: 50%;
	z-index: 200;
	background: linear-gradient(135deg, var(--primary), var(--primary-dark));
	border: 1px solid var(--glass-border);
	border-radius: 50px;
	padding: 0.6rem 1.2rem;
	display: flex;
	align-items: center;
	gap: 0.75rem;
	box-shadow: var(--shadow-glow);
	transition:
		opacity 0.4s ease,
		transform 0.4s ease;
	opacity: 0;
	transform: translateX(-50%) translateY(-40px);
	pointer-events: none;
	max-width: 90%;
}
.achievement-toast.visible {
	opacity: 1;
	transform: translateX(-50%) translateY(0);
}
.toast-icon {
	font-size: 1.8rem;
}
.toast-title {
	font-family: "Fredoka One", cursive;
	font-size: 0.8rem;
	color: var(--warning);
	letter-spacing: 0.03em;
}
.toast-desc {
	font-family: "Nunito", sans-serif;
	font-weight: 700;
	font-size: 0.95rem;
	color: #fff;
}

/* ===== LEVEL PROGRESS BAR ===== */
.level-progress-wrap {
	position: absolute;
	bottom: clamp(60px, 12vh, 100px);
	left: 50%;
	transform: translateX(-50%);
	z-index: 10;
	width: min(80%, 300px);
	height: 10px;
	background: rgba(0, 0, 0, 0.4);
	border: 1px solid var(--glass-border);
	border-radius: 10px;
	overflow: hidden;
	backdrop-filter: blur(10px);
}
.level-progress-fill {
	height: 100%;
	background: linear-gradient(90deg, var(--primary), var(--accent));
	border-radius: 10px;
	width: 0%;
	transition: width 0.4s ease;
	box-shadow: 0 0 10px rgba(139, 92, 246, 0.4);
}

/* ===== POWER-UP INDICATOR ===== */
.powerup-indicator {
	position: absolute;
	top: clamp(50px, 8vh, 80px);
	left: 50%;
	transform: translateX(-50%);
	z-index: 10;
	font-family: "Fredoka One", cursive;
	font-size: clamp(0.9rem, 2.5vw, 1.2rem);
	color: var(--warning);
	text-shadow: 0 0 12px rgba(251, 191, 36, 0.5);
	opacity: 0;
	transition: opacity 0.3s;
	pointer-events: none;
}
.powerup-indicator.active {
	opacity: 1;
	animation: pulseCombo 1s ease-in-out infinite;
}

/* ===== ADAPTIVE DIFFICULTY BADGE ===== */
.difficulty-badge {
	position: fixed;
	top: clamp(4px, 1vh, 8px);
	left: 50%;
	transform: translateX(-50%);
	z-index: 10;
	background: rgba(0, 0, 0, 0.5);
	border: 1px solid var(--glass-border);
	border-radius: 50px;
	padding: 0.2rem 0.8rem;
	font-size: 0.75rem;
	font-weight: 700;
	color: var(--text-dim);
	opacity: 0;
	transition: opacity 0.5s;
	pointer-events: none;
}
.difficulty-badge.active {
	opacity: 1;
}

@media (max-width: 480px) {
	.level-progress-wrap {
		bottom: 55px;
		height: 8px;
	}
	.powerup-indicator {
		top: 42px;
		font-size: 0.8rem;
	}
	.difficulty-badge {
		font-size: 0.65rem;
		padding: 0.15rem 0.6rem;
	}
}
