/* ── Leaderboard Styles ─────────────────────────── */

.leaderboard-container {
	width: min(900px, 100%);
	padding: clamp(1.5rem, 2vw + 1rem, 2.6rem);
	animation: reveal 800ms ease-out;
}

.leaderboard-header {
	text-align: center;
	margin-bottom: 2.5rem;
}

.leaderboard-header h1 {
	font-family: "DM Serif Display", serif;
	font-size: clamp(2.2rem, 4vw + 1rem, 3.2rem);
	line-height: 1.1;
	letter-spacing: 0.3px;
	margin-bottom: 0.5rem;
	background: linear-gradient(135deg, var(--accent), var(--accent-strong));
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
	background-clip: text;
}

.leaderboard-subtitle {
	font-size: clamp(1rem, 0.7vw + 0.8rem, 1.15rem);
	color: var(--text-soft);
	letter-spacing: 0.5px;
}

.leaderboard-content {
	background: var(--card-bg);
	border: 1px solid var(--card-border);
	border-radius: 22px;
	backdrop-filter: blur(10px);
	box-shadow: var(--shadow);
	padding: clamp(1.5rem, 2vw, 2rem);
	margin-bottom: 1.5rem;
	animation: reveal 800ms ease-out 100ms both;
}

.leaderboard-stats {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
	gap: 1rem;
	margin-bottom: 1.8rem;
}

.stat-box {
	display: flex;
	flex-direction: column;
	align-items: center;
	padding: 1rem;
	background: rgba(255, 255, 255, 0.04);
	border: 1px solid rgba(255, 209, 102, 0.15);
	border-radius: 14px;
	transition: all 200ms ease;
}

.stat-box:hover {
	background: rgba(255, 209, 102, 0.08);
	border-color: rgba(255, 209, 102, 0.3);
}

.stat-label {
	font-size: 0.85rem;
	color: var(--text-soft);
	margin-bottom: 0.35rem;
	text-transform: uppercase;
	letter-spacing: 0.4px;
	font-weight: 600;
}

.stat-value {
	font-size: 1.6rem;
	font-weight: 700;
	color: var(--accent);
}

.leaderboard-table-wrapper {
	overflow-x: auto;
	border-radius: 12px;
	margin-bottom: 1rem;
}

.leaderboard-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.95rem;
}

.leaderboard-table thead {
	background: rgba(255, 209, 102, 0.08);
	border-bottom: 2px solid var(--card-border);
}

.leaderboard-table th {
	padding: 1rem;
	text-align: left;
	color: var(--accent);
	font-weight: 700;
	letter-spacing: 0.3px;
	font-size: 0.9rem;
	text-transform: uppercase;
}

.rank-col {
	width: 80px;
}

.name-col {
	flex: 1;
}

.score-col {
	width: 120px;
	text-align: right;
}

.leaderboard-table tbody tr {
	border-bottom: 1px solid rgba(255, 255, 255, 0.06);
	transition: all 150ms ease;
	animation: fadeIn 400ms ease-out forwards;
}

.leaderboard-table tbody tr:hover {
	background: rgba(255, 209, 102, 0.06);
}

.leaderboard-table td {
	padding: 0.95rem 1rem;
	color: var(--text-main);
}

.rank-col {
	color: var(--accent);
	font-weight: 700;
	font-size: 1.05rem;
}

.rank-medal {
	display: inline-block;
	margin-right: 0.5rem;
}

.name-col {
	font-weight: 500;
}

.leaderboard-name-link {
	color: var(--accent);
	text-decoration: none;
	font-weight: 600;
	transition: all 150ms ease;
	border-bottom: 2px solid transparent;
	padding-bottom: 2px;
}

.leaderboard-name-link:hover {
	color: var(--accent-strong);
	border-bottom-color: var(--accent-strong);
}

.score-col {
	text-align: right;
	color: var(--accent-strong);
	font-weight: 600;
	font-size: 1.05rem;
}

.score-update {
	animation: scoreUpdate 600ms ease;
}

.loading-row td {
	padding: 2rem 1rem;
	text-align: center;
	color: var(--text-soft);
	font-style: italic;
}

.back-link {
	display: inline-flex;
	align-items: center;
	color: var(--accent);
	text-decoration: none;
	font-weight: 600;
	font-size: 0.95rem;
	padding: 0.6rem 1rem;
	border: 1px solid rgba(255, 209, 102, 0.3);
	border-radius: 999px;
	background: rgba(255, 209, 102, 0.06);
	transition: all 180ms ease;
	gap: 0.5rem;
}

.back-link:hover {
	background: rgba(255, 209, 102, 0.12);
	border-color: var(--accent);
	transform: translateX(-2px);
}

/* ── Animations ─────────────────────────── */

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

@keyframes scoreUpdate {
	0%, 100% {
		background: transparent;
	}
	50% {
		background: rgba(255, 209, 102, 0.15);
	}
}

/* ── Responsive ─────────────────────────── */

@media (max-width: 600px) {
	.leaderboard-container {
		padding: clamp(1rem, 2vw, 1.5rem);
	}

	.leaderboard-header h1 {
		font-size: clamp(1.8rem, 4vw, 2.4rem);
		margin-bottom: 0.3rem;
	}

	.leaderboard-subtitle {
		font-size: 0.95rem;
	}

	.leaderboard-content {
		padding: clamp(1rem, 2vw, 1.5rem);
		margin-bottom: 1.2rem;
	}

	.leaderboard-stats {
		grid-template-columns: 1fr 1fr;
		gap: 0.75rem;
		margin-bottom: 1.2rem;
	}

	.stat-box {
		padding: 0.75rem;
	}

	.stat-label {
		font-size: 0.75rem;
	}

	.stat-value {
		font-size: 1.3rem;
	}

	.leaderboard-table {
		font-size: 0.85rem;
	}

	.leaderboard-table th {
		padding: 0.7rem 0.5rem;
		font-size: 0.8rem;
	}

	.leaderboard-table td {
		padding: 0.7rem 0.5rem;
	}

	.rank-col {
		width: 50px;
	}

	.score-col {
		width: 90px;
	}

	.back-link {
		font-size: 0.9rem;
		padding: 0.5rem 0.8rem;
	}
}
