.leaderboard-container {
	max-width: 800px;
	margin: 1rem auto;
	padding: 1rem;
	animation: fadeInUp 0.4s ease-out;
}

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

.header {
	text-align: center;
	background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
	border-top-left-radius: var(--border-radius);
	border-top-right-radius: var(--border-radius);
	padding: 32px 24px;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
	position: relative;
	overflow: hidden;
}

.header::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 4px;
	background: linear-gradient(90deg, #ffd429, #ff6e20, #82acff, #ffd429);
	background-size: 200% 100%;
	animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
	0%,
	100% {
		background-position: -200% 0;
	}
	50% {
		background-position: 200% 0;
	}
}

.title {
	font-size: 40px;
	font-family: 'rubikBold', sans-serif;
	color: var(--text-dark);
	margin-bottom: 8px;
	text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
	animation: titleGlow 0.4s ease-out 0.2s both;
}

@keyframes titleGlow {
	from {
		opacity: 0;
		transform: scale(0.9);
	}
	to {
		opacity: 1;
		transform: scale(1);
	}
}

.subtitle {
	color: var(--text-muted);
	font-size: 20px;
	font-weight: 500;
	animation: fadeIn 0.4s ease-out 0.2s both;
}

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

.leaderboard-player-count {
	color: var(--text-muted);
	font-size: 14px;
	font-weight: 500;
	animation: fadeIn 0.4s ease-out 0.2s both;
}

.time-filters {
	display: flex;
	gap: 10px;
	justify-content: center;
	margin-top: 20px;
	margin-bottom: 20px;
	padding: 0 24px;
	flex-direction: row;
	animation: slideInUp 0.4s ease-out 0.2s both;
}

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

.time-filter-btn {
	padding: 10px 18px;
	border: 2px solid #e2e8f0;
	background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
	color: #64748b;
	border-radius: 25px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	white-space: nowrap;
	min-width: 85px;
	text-align: center;
	position: relative;
	overflow: hidden;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.time-filter-btn::before {
	content: '';
	position: absolute;
	top: 0;
	left: -100%;
	width: 100%;
	height: 100%;
	background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
	transition: left 0.3s;
}

.time-filter-btn:hover::before {
	left: 100%;
}

.time-filter-btn:hover {
	border-color: #cbd5e1;
	background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.time-filter-btn.active {
	background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
	border-color: var(--primary);
	color: white;
	transform: translateY(-1px);
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.time-filter-btn.active:hover {
	background: linear-gradient(135deg, var(--primary-hover) 0%, var(--primary) 100%);
	border-color: var(--primary-hover);
	transform: translateY(-2px);
	box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.leaderboard {
	background: linear-gradient(135deg, #ffffff 0%, #fefefe 100%);
	border-bottom-left-radius: var(--border-radius);
	border-bottom-right-radius: var(--border-radius);
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
	overflow: hidden;
	border: 1px solid rgba(0, 0, 0, 0.05);
}

.player-card {
	display: flex;
	align-items: center;
	padding: 22px;
	border-bottom: 1px solid rgba(241, 245, 249, 0.8);
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	position: relative;
	animation: slideInRight 0.3s ease-out both;
	animation-delay: calc(var(--index, 0) * 0.1s);
	background: linear-gradient(135deg, transparent 0%, rgba(248, 250, 252, 0.3) 100%);
	cursor: pointer;
}

/* make each nth child has interchangiong background color to the player card */

.player-card:nth-child(even) {
	background: linear-gradient(135deg, #f1f5f9 0%, rgba(241, 245, 249, 0.5) 100%);
}
.player-card:nth-child(odd) {
	background: linear-gradient(135deg, #f8fafc 0%, rgba(248, 250, 252, 0.5) 100%);
}

.player-card:nth-child(1) {
	--index: 0;
}
.player-card:nth-child(2) {
	--index: 1;
}
.player-card:nth-child(3) {
	--index: 2;
}
.player-card:nth-child(4) {
	--index: 3;
}
.player-card:nth-child(5) {
	--index: 4;
}
.player-card:nth-child(6) {
	--index: 5;
}
.player-card:nth-child(7) {
	--index: 6;
}
.player-card:nth-child(8) {
	--index: 7;
}
.player-card:nth-child(9) {
	--index: 8;
}
.player-card:nth-child(10) {
	--index: 9;
}

@keyframes slideInRight {
	from {
		opacity: 0;
		transform: translateX(-30px);
	}
	to {
		opacity: 1;
		transform: translateX(0);
	}
}

.player-card:last-child {
	border-bottom: none;
}

.player-card:hover {
	background: linear-gradient(135deg, #f8fafc 0%, rgba(248, 250, 252, 0.9) 100%);
	transform: translateX(4px) scale(1.01);
	box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.player-card::before {
	content: '';
	position: absolute;
	left: 0;
	top: 0;
	bottom: 0;
	width: 0;
	background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
	transition: width 0.3s ease;
}

.player-card:hover::before {
	width: 4px;
}

.rank-badge {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border-radius: 14px;
	font-weight: 700;
	font-size: 18px;
	margin-inline-start: 10px;
	margin-inline-end: 12px;
	flex-shrink: 0;
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
	position: relative;
	overflow: hidden;
	cursor: inherit;
}

.rank-medal {
	font-size: 32px;
	margin: 0 12px;
	flex-shrink: 0;
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
	cursor: inherit;
}

.avatar {
	width: 55px;
	height: 55px;
	border-radius: 50%;
	background: linear-gradient(135deg, #667eea, #764ba2);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 30px;
	margin-inline-start: 12px;
	margin-inline-end: 30px;
	flex-shrink: 0;
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
	position: relative;
	overflow: hidden;
	cursor: inherit;
}

.rank-badge::before {
	content: '';
	position: absolute;
	top: -50%;
	left: -50%;
	width: 200%;
	height: 200%;
	background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.3), transparent);
	transform: rotate(45deg);
	transition: all 0.6s;
	opacity: 0;
}

.player-card:hover .rank-badge::before {
	animation: shine 0.6s ease-in-out;
}

@keyframes shine {
	0% {
		opacity: 0;
		transform: translateX(-100%) translateY(-100%) rotate(45deg);
	}
	50% {
		opacity: 1;
		transform: translateX(0%) translateY(0%) rotate(45deg);
	}
	100% {
		opacity: 0;
		transform: translateX(100%) translateY(100%) rotate(45deg);
	}
}

.player-card:hover .rank-medal {
	transform: scale(1.15);
	filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.rank-1 {
	background: linear-gradient(135deg, #ffd429 0%, #ffed4e 100%);
	color: #d97706;
	box-shadow: 0 4px 15px rgba(255, 212, 41, 0.4);
}

.rank-2 {
	background: linear-gradient(135deg, #bed4ff 0%, #dae4ff 100%);
	color: #5c626e;
	box-shadow: 0 4px 15px rgba(190, 212, 255, 0.4);
}

.rank-3 {
	background: linear-gradient(135deg, #ffc077 0%, #ffd4a3 100%);
	color: #e24f00;
	box-shadow: 0 4px 15px rgba(255, 192, 119, 0.4);
}

.rank-default {
	background: linear-gradient(135deg, #f1f5f9 0%, #f8fafc 100%);
	color: #64748b;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.player-card:hover .rank-badge {
	transform: scale(1.1) rotate(5deg);
}

.avatar::before {
	content: '';
	position: absolute;
	background: linear-gradient(45deg, #667eea, #764ba2, #667eea);
	border-radius: 50%;
	z-index: -1;
	opacity: 0;
	transition: opacity 0.3s ease;
}

.player-card:hover .avatar {
	transform: scale(1.1);
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.player-card:hover .avatar::before {
	opacity: 1;
	animation: avatarGlow 2s linear infinite;
}

@keyframes avatarGlow {
	0% {
		transform: rotate(0deg);
	}
	100% {
		transform: rotate(360deg);
	}
}

.current-player {
	background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 50%, #86efac 100%) !important;
	border-left: 4px solid #10b981 !important;
	position: relative;
}

.current-player::before {
	content: '';
	position: absolute;
	left: 0;
	top: 0;
	bottom: 0;
	width: 6px;
	background: linear-gradient(to bottom, #10b981, #059669, #10b981);
}

@keyframes currentPlayerGlow {
	0% {
		box-shadow: 0 4px 20px rgba(16, 185, 129, 0.3);
	}
	100% {
		box-shadow: 0 8px 30px rgba(16, 185, 129, 0.5);
	}
}

.current-player:hover {
	background: linear-gradient(135deg, #bbf7d0 0%, #86efac 50%, #4ade80 100%) !important;
	box-shadow: 0 8px 35px rgba(16, 185, 129, 0.4);
}

.current-player .nickname {
	color: #064e3b;
	font-weight: 700;
}

.me-text {
	color: #10b981;
	font-weight: 700;
	font-size: 14px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.me-indicator {
	position: absolute;
	top: 10px;
	right: 15px;
	background: linear-gradient(135deg, #10b981, #059669);
	color: white;
	padding: 4px 8px;
	border-radius: 12px;
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.5px;
	box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
	animation: mePulse 2s ease-in-out infinite;
}

@keyframes mePulse {
	0%,
	100% {
		transform: scale(1);
		opacity: 1;
	}
	50% {
		transform: scale(1.1);
		opacity: 0.8;
	}
}

.player-info {
	flex: 1;
	min-width: 0;
	transition: transform 0.3s ease;
	cursor: inherit;
}

.player-card:hover .player-info {
	transform: translateX(2px);
}

.nickname {
	font-size: 18px;
	font-weight: 600;
	color: #0f172a;
	margin-bottom: 6px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	transition: color 0.3s ease;
	cursor: inherit;
}

.player-card:hover .nickname {
	color: #1e293b;
}

.stats-row {
	display: flex;
	gap: 20px;
	align-items: center;
	cursor: inherit;
}

.stat {
	font-size: 14px;
	color: #64748b;
	transition: all 0.3s ease;
	position: relative;
	cursor: inherit;
}

.stat::after {
	content: '';
	position: absolute;
	bottom: -2px;
	left: 0;
	width: 0;
	height: 2px;
	background: linear-gradient(90deg, #059669, #10b981);
	transition: width 0.3s ease;
}

.player-card:hover .stat::after {
	width: 100%;
}

.stat-value {
	font-weight: 700;
	color: var(--text-dark);
	transition: all 0.3s ease;
	display: inline-block;
	cursor: inherit;
}

.player-card:hover .stat-value {
	transform: scale(1.05);
	color: #047857;
}

.win-rate {
	color: var(--text-dark);
	font-weight: 700;
}

.crown {
	font-size: 36px;
	animation: bounce 2s infinite, crownGlow 3s ease-in-out infinite alternate;
	filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.6));
}

.sort-filters {
	display: flex;
	gap: 5px;
	justify-content: center;
	margin-top: 16px;
	margin-bottom: 8px;
	padding: 0 10px;
	flex-direction: row;
	animation: slideInUp 0.4s ease-out 0.3s both;
}

.sort-filter-btn {
	padding: 12px 20px;
	border: 2px solid #e2e8f0;
	background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
	color: #64748b;
	border-radius: 25px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	white-space: nowrap;
	min-width: 140px;
	text-align: center;
	position: relative;
	overflow: hidden;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
}

.sort-filter-btn::before {
	content: '';
	position: absolute;
	top: 0;
	left: -100%;
	width: 100%;
	height: 100%;
	background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
	transition: left 0.3s;
}

.sort-filter-btn:hover::before {
	left: 100%;
}

.sort-filter-btn:hover {
	border-color: #cbd5e1;
	background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.sort-filter-btn.active {
	background: linear-gradient(135deg, #10b981 0%, #059669 100%);
	border-color: #10b981;
	color: white;
	box-shadow: 0 6px 20px rgba(16, 185, 129, 0.3);
}

.sort-filter-btn.active:hover {
	transform: translateY(-2px);
	box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
}

@keyframes bounce {
	0%,
	20%,
	50%,
	80%,
	100% {
		transform: translateY(0);
	}
	40% {
		transform: translateY(-6px);
	}
	60% {
		transform: translateY(-3px);
	}
}

@keyframes crownGlow {
	0% {
		filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.6));
	}
	100% {
		filter: drop-shadow(0 0 15px rgba(255, 215, 0, 0.9));
	}
}

/* Mobile Responsive */
@media (max-width: 640px) {
	.leaderboard-container {
		margin: 0.5rem 0.5rem;
	}

	.title {
		font-size: 28px;
	}

	.subtitle {
		font-size: 18px;
	}

	.leaderboard-player-count {
		font-size: 12px;
	}

	.time-filters {
		gap: 8px;
		padding: 0 16px;
	}

	.time-filter-btn {
		padding: 8px 14px;
		font-size: 13px;
		min-width: 75px;
	}

	.sort-filters {
		gap: 8px;
		padding: 0 16px;
		margin-top: 12px;
	}

	.sort-filter-btn {
		padding: 10px 14px;
		font-size: 12px;
		min-width: 20%;
		width: 35%;
		max-width: 50%;
	}

	.player-card {
		padding: 18px;
	}

	.me-indicator {
		top: 8px;
		right: 10px;
		padding: 3px 6px;
		font-size: 9px;
	}

	.me-text {
		font-size: 12px;
	}

	.rank-badge {
		width: 38px;
		height: 38px;
		font-size: 16px;
		margin: 0 6px;
	}

	.rank-medal {
		font-size: 26px;
		margin: 0;
	}

	.avatar {
		width: 46px;
		height: 46px;
		font-size: 28px;
		margin-inline-end: 10px;
	}

	.player-info {
		margin-inline-start: 10px;
	}

	.nickname {
		font-size: 16px;
	}

	.stats-row {
		gap: 12px;
		flex-wrap: wrap;
	}

	.stat {
		font-size: 13px;
	}
}

@media (max-width: 480px) {
	.header {
		padding: 12px 16px;
	}

	.time-filters {
		flex-wrap: wrap;
		gap: 6px;
		padding: 0 14px;
		margin-top: 16px;
		margin-bottom: 8px;
	}

	.time-filter-btn {
		padding: 8px 12px;
		font-size: 12px;
		min-width: 70px;
	}

	.sort-filters {
		gap: 6px;
		padding: 0 14px;
		margin-top: 10px;
		/* flex-direction: column; */
		align-items: center;
	}

	.sort-filter-btn {
		padding: 8px;
		font-size: 12px;
		min-width: 50%;
	}

	.player-card {
		padding: 16px;
	}

	.player-info {
		margin-inline-start: 6px;
	}

	.me-indicator {
		top: 6px;
		right: 8px;
		padding: 2px 4px;
		font-size: 8px;
	}

	.me-text {
		font-size: 11px;
	}

	.stats-row {
		gap: 5px;
	}

	.nickname {
		font-size: 15px;
		margin-bottom: 2px;
	}

	.crown {
		font-size: 24px;
	}

	.rank-badge {
		width: 38px;
		height: 38px;
		margin: 0 3px;
	}

	.rank-medal {
		font-size: 20px;
		margin: 0;
	}

	.avatar {
		width: 42px;
		height: 42px;
		font-size: 25px;
		margin-inline-end: 6px;
	}
}

@media (max-width: 350px) {
	.time-filters {
		flex-wrap: wrap;
	}
	.sort-filters {
		flex-wrap: wrap;
	}
	.sort-filter-btn {
		min-width: 100%;
	}
}

/* Top 3 special styling */
.top-3 {
	background: linear-gradient(135deg, #fefce8 0%, #fef3c7 50%, #fef7cd 100%);
	border-left: 4px solid #f59e0b;
	border-bottom: 0px;
	position: relative;
	overflow: hidden;
}

.top-3::after {
	content: '';
	position: absolute;
	top: 0;
	right: 0;
	width: 50px;
	height: 100%;
	background: linear-gradient(90deg, transparent, rgba(245, 158, 11, 0.1));
	pointer-events: none;
}

.top-3.rank-1 {
	background: linear-gradient(135deg, #fefce8 0%, #fef3c7 50%, #ffedd5 100%);
	border-left-color: #ffd429;
	box-shadow: 0 4px 20px rgba(255, 212, 41, 0.2);
}

.top-3.rank-1::after {
	background: linear-gradient(90deg, transparent, rgba(255, 212, 41, 0.15));
}

.top-3.rank-2 {
	background: linear-gradient(135deg, #f8fafc 0%, #e0f2fe 50%, #dbeafe 100%);
	border-left-color: #82acff;
	box-shadow: 0 4px 20px rgba(130, 172, 255, 0.2);
}

.top-3.rank-2::after {
	background: linear-gradient(90deg, transparent, rgba(130, 172, 255, 0.15));
}

.top-3.rank-3 {
	background: linear-gradient(135deg, #fff7ed 0%, #fed7aa 50%, #fde68a 100%);
	border-left-color: #ff6e20;
	box-shadow: 0 4px 20px rgba(255, 110, 32, 0.2);
}

.top-3.rank-3::after {
	background: linear-gradient(90deg, transparent, rgba(255, 110, 32, 0.15));
}

.top-3:hover {
	transform: translateX(6px) scale(1.02);
	box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

/* Pulse animation for top performers */
/* .top-3 .stat-value {
	animation: pulse 2s ease-in-out infinite;
} */

@keyframes pulse {
	0%,
	100% {
		transform: scale(1);
	}
	50% {
		transform: scale(1.05);
	}
}
