@import url('https://fonts.googleapis.com/css2?family=Bangers&family=Nunito:wght@700;900&display=swap');

* {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

body {
	font-family: 'Nunito', Arial, sans-serif;
	background-color: #0a0a1a;
	background-image:
		radial-gradient(ellipse at 20% 20%, rgba(255, 220, 0, 0.08) 0%, transparent 50%),
		radial-gradient(ellipse at 80% 80%, rgba(255, 50, 50, 0.08) 0%, transparent 50%),
		radial-gradient(ellipse at 50% 50%, rgba(30, 100, 255, 0.06) 0%, transparent 70%);
	min-height: 100vh;
	padding: 20px;
	overflow-x: hidden;
}

/* Animated stars background */
body::before {
	content: '';
	position: fixed;
	top: 0; left: 0;
	width: 100%; height: 100%;
	background-image:
		radial-gradient(1px 1px at 10% 15%, white, transparent),
		radial-gradient(1px 1px at 25% 40%, white, transparent),
		radial-gradient(1px 1px at 40% 10%, white, transparent),
		radial-gradient(1px 1px at 60% 60%, white, transparent),
		radial-gradient(1px 1px at 75% 25%, white, transparent),
		radial-gradient(1px 1px at 85% 70%, white, transparent),
		radial-gradient(1px 1px at 15% 80%, white, transparent),
		radial-gradient(1px 1px at 50% 90%, white, transparent),
		radial-gradient(2px 2px at 90% 10%, rgba(255,220,0,0.8), transparent),
		radial-gradient(2px 2px at 5% 55%, rgba(255,220,0,0.8), transparent);
	pointer-events: none;
	z-index: 0;
}

h1 {
	font-family: 'Bangers', cursive;
	font-size: clamp(3rem, 8vw, 6rem);
	text-align: center;
	color: #FFD700;
	text-shadow:
		0 0 10px #FFD700,
		0 0 30px #FFD700,
		0 0 60px #FF8C00,
		4px 4px 0px #b8860b,
		-2px -2px 0px #8B6914;
	letter-spacing: 4px;
	padding: 30px 20px 10px;
	position: relative;
	z-index: 1;
	animation: titlePulse 3s ease-in-out infinite;
}

h1::after {
	content: '⚡';
	position: absolute;
	font-size: 0.6em;
	top: 20px;
	right: 10%;
	animation: zap 1.5s ease-in-out infinite alternate;
}

h1::before {
	content: '⚡';
	position: absolute;
	font-size: 0.6em;
	top: 20px;
	left: 10%;
	animation: zap 1.5s ease-in-out infinite alternate-reverse;
}

@keyframes titlePulse {
	0%, 100% { text-shadow: 0 0 10px #FFD700, 0 0 30px #FFD700, 0 0 60px #FF8C00, 4px 4px 0px #b8860b; }
	50% { text-shadow: 0 0 20px #FFD700, 0 0 50px #FFD700, 0 0 100px #FF8C00, 4px 4px 0px #b8860b; }
}

@keyframes zap {
	from { transform: scale(1) rotate(-10deg); opacity: 0.7; }
	to { transform: scale(1.3) rotate(10deg); opacity: 1; }
}

/* Subtitle / moves label */
.section-label {
	font-family: 'Bangers', cursive;
	font-size: 1.8rem;
	color: #fff;
	text-align: center;
	letter-spacing: 3px;
	margin: 20px 0 12px;
	text-shadow: 0 0 10px rgba(255,255,255,0.4);
	position: relative;
	z-index: 1;
}

/* ======= MOVES BUTTONS ======= */
#ability-list {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-bottom: 30px;
	justify-content: center;
	position: relative;
	z-index: 1;
	padding: 20px;
	background: rgba(255,255,255,0.03);
	border-radius: 20px;
	border: 1px solid rgba(255,215,0,0.15);
	box-shadow: inset 0 0 30px rgba(0,0,0,0.3);
}

.ability-button {
	padding: 10px 18px;
	background: linear-gradient(135deg, #1a1a3e 0%, #2a1a4e 100%);
	border: 2px solid #FFD700;
	border-radius: 30px;
	cursor: pointer;
	color: #FFD700;
	font-family: 'Nunito', sans-serif;
	font-weight: 900;
	font-size: 0.9rem;
	text-transform: capitalize;
	letter-spacing: 1px;
	transition: all 0.2s ease;
	box-shadow: 0 0 8px rgba(255, 215, 0, 0.3), inset 0 1px 0 rgba(255,255,255,0.1);
	position: relative;
	overflow: hidden;
}

.ability-button::before {
	content: '';
	position: absolute;
	top: -50%; left: -50%;
	width: 200%; height: 200%;
	background: linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.1) 50%, transparent 70%);
	transform: translateX(-100%);
	transition: transform 0.4s ease;
}

.ability-button:hover::before {
	transform: translateX(100%);
}

.ability-button:hover {
	background: linear-gradient(135deg, #FFD700 0%, #FF8C00 100%);
	color: #1a1a1a;
	border-color: #fff;
	transform: translateY(-3px) scale(1.05);
	box-shadow: 0 6px 20px rgba(255, 215, 0, 0.6), 0 0 30px rgba(255, 215, 0, 0.3);
}

.ability-button:active {
	transform: translateY(0) scale(0.98);
}

.ability-button.selected {
	background: linear-gradient(135deg, #FF4500 0%, #FF6B00 100%);
	color: white;
	border-color: #FF8C00;
	box-shadow: 0 0 20px rgba(255, 69, 0, 0.7), 0 4px 15px rgba(255, 69, 0, 0.4);
}

/* ======= POKEMON GRID ======= */
#pokemon-list {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
	gap: 14px;
	position: relative;
	z-index: 1;
}

#pokemon-list.loading {
	display: flex;
	justify-content: center;
	align-items: center;
	min-height: 200px;
}

.loading-text {
	font-family: 'Bangers', cursive;
	font-size: 2.5rem;
	color: #FFD700;
	text-shadow: 0 0 20px #FFD700;
	animation: loadingPulse 0.8s ease-in-out infinite alternate;
	letter-spacing: 4px;
}

@keyframes loadingPulse {
	from { opacity: 0.3; transform: scale(0.95); }
	to { opacity: 1; transform: scale(1.05); }
}

.pokemon-card {
	border: 2px solid rgba(255, 215, 0, 0.3);
	border-radius: 16px;
	padding: 12px 8px;
	text-align: center;
	cursor: pointer;
	background: linear-gradient(160deg, #12123a 0%, #1a1a4a 60%, #0d0d2a 100%);
	transition: all 0.25s ease;
	position: relative;
	overflow: hidden;
	box-shadow: 0 4px 15px rgba(0,0,0,0.4);
}

/* Pokeball circle watermark */
.pokemon-card::before {
	content: '';
	position: absolute;
	bottom: -25px; right: -25px;
	width: 80px; height: 80px;
	border-radius: 50%;
	border: 8px solid rgba(255,255,255,0.04);
	pointer-events: none;
}

.pokemon-card::after {
	content: '';
	position: absolute;
	bottom: -20px; right: -20px;
	width: 40px; height: 40px;
	border-radius: 50%;
	background: rgba(255,255,255,0.03);
	pointer-events: none;
}

.pokemon-card:hover {
	border-color: #FFD700;
	transform: translateY(-6px) scale(1.04);
	box-shadow:
		0 10px 30px rgba(255, 215, 0, 0.3),
		0 0 20px rgba(255, 215, 0, 0.15),
		inset 0 1px 0 rgba(255,255,255,0.1);
	background: linear-gradient(160deg, #1e1e5a 0%, #2a2a6a 60%, #141450 100%);
}

.pokemon-card:active {
	transform: translateY(-2px) scale(1.01);
}

.pokemon-card img {
	width: 96px;
	height: 96px;
	image-rendering: pixelated;
	filter: drop-shadow(0 0 6px rgba(255, 215, 0, 0.5));
	transition: all 0.25s ease;
}

.pokemon-card:hover img {
	filter: drop-shadow(0 0 12px rgba(255, 215, 0, 0.9)) brightness(1.1);
	transform: scale(1.1);
}

.pokemon-card p {
	color: #e0e0ff;
	font-weight: 900;
	font-size: 0.8rem;
	text-transform: capitalize;
	margin-top: 6px;
	letter-spacing: 0.5px;
}

/* ======= POPUP ======= */
.popup {
	display: none;
	position: fixed;
	top: 0; left: 0;
	width: 100%; height: 100%;
	background-color: rgba(0, 0, 20, 0.85);
	backdrop-filter: blur(6px);
	z-index: 1000;
	animation: fadeIn 0.2s ease;
}

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

.popup-content {
	background: linear-gradient(160deg, #0e0e30 0%, #1a1a4a 50%, #0a0a20 100%);
	border: 3px solid #FFD700;
	border-radius: 24px;
	max-width: 480px;
	width: 90%;
	margin: 80px auto;
	padding: 36px 32px;
	box-shadow:
		0 0 40px rgba(255, 215, 0, 0.4),
		0 0 80px rgba(255, 100, 0, 0.2),
		0 20px 60px rgba(0,0,0,0.6);
	position: relative;
	animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
	text-align: center;
}

@keyframes popIn {
	from { transform: scale(0.5) translateY(50px); opacity: 0; }
	to { transform: scale(1) translateY(0); opacity: 1; }
}

/* Corner decorations */
.popup-content::before {
	content: '★';
	position: absolute;
	top: 12px; left: 16px;
	color: #FFD700;
	font-size: 1.2rem;
	opacity: 0.6;
}
.popup-content::after {
	content: '★';
	position: absolute;
	top: 12px; right: 16px;
	color: #FFD700;
	font-size: 1.2rem;
	opacity: 0.6;
}

#popup-title {
	font-family: 'Bangers', cursive;
	font-size: clamp(1.6rem, 5vw, 2.4rem);
	color: #FFD700;
	text-shadow: 0 0 15px rgba(255, 215, 0, 0.6), 2px 2px 0 #8B6914;
	letter-spacing: 2px;
	margin-bottom: 16px;
	line-height: 1.2;
}

#popup-effect {
	color: #c8c8ff;
	font-size: 1rem;
	line-height: 1.6;
	background: rgba(255,255,255,0.05);
	border-radius: 12px;
	padding: 14px 18px;
	border: 1px solid rgba(255,255,255,0.1);
	margin-bottom: 24px;
}

#popup-close {
	display: inline-block;
	padding: 12px 40px;
	background: linear-gradient(135deg, #FF4500 0%, #FF6B00 100%);
	border: 2px solid #FF8C00;
	border-radius: 30px;
	cursor: pointer;
	color: white;
	font-family: 'Bangers', cursive;
	font-size: 1.4rem;
	letter-spacing: 2px;
	transition: all 0.2s ease;
	box-shadow: 0 4px 15px rgba(255, 69, 0, 0.5), 0 0 20px rgba(255, 69, 0, 0.2);
}

#popup-close:hover {
	background: linear-gradient(135deg, #FF6B00 0%, #FFD700 100%);
	border-color: #FFD700;
	transform: translateY(-3px) scale(1.05);
	box-shadow: 0 8px 25px rgba(255, 150, 0, 0.6);
	color: #1a1a1a;
}

#popup-close:active {
	transform: translateY(0) scale(0.98);
}

/* ======= SCROLLBAR ======= */
::-webkit-scrollbar {
	width: 8px;
}
::-webkit-scrollbar-track {
	background: #0a0a1a;
}
::-webkit-scrollbar-thumb {
	background: #FFD700;
	border-radius: 4px;
}
