/* ========================================
   LEADERBOARD STYLES - CYBERPUNK THEME
   ======================================== */

/* Modal Overlay */
.leaderboard-modal {
	display: none;
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(10, 14, 39, 0.9);
	backdrop-filter: blur(4px);
	z-index: 1000;
	opacity: 0;
	transition: opacity 0.3s ease;
}

.leaderboard-modal.active {
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 1;
	animation: fadeIn 0.3s ease;
}

/* Modal Content */
.leaderboard-content {
	background: linear-gradient(135deg, #1a1f3a 0%, #0a0e27 100%);
	border: 2px solid #00ffff;
	border-radius: 20px;
	box-shadow:
		0 0 30px rgba(0, 255, 255, 0.5),
		0 0 60px rgba(255, 0, 255, 0.3),
		inset 0 0 20px rgba(0, 255, 255, 0.1);
	max-width: 600px;
	width: 90%;
	max-height: 80vh;
	overflow: hidden;
	animation: slideUp 0.4s ease;
}

/* Header */
.leaderboard-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 20px 30px;
	background: linear-gradient(90deg, rgba(0, 255, 255, 0.1), rgba(255, 0, 255, 0.1));
	border-bottom: 2px solid #00ffff;
}

.leaderboard-title {
	font-family: 'Orbitron', sans-serif;
	font-size: 28px;
	font-weight: 900;
	background: linear-gradient(45deg, #00ffff, #ff00ff, #00ffff);
	background-size: 200% 200%;
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
	background-clip: text;
	animation: gradientShift 3s ease infinite;
	text-shadow: 0 0 20px rgba(0, 255, 255, 0.5);
	margin: 0;
}

.leaderboard-close {
	background: transparent;
	border: 2px solid #ff00ff;
	color: #ff00ff;
	font-size: 32px;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	cursor: pointer;
	transition: all 0.3s ease;
	display: flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
}

.leaderboard-close:hover {
	background: #ff00ff;
	color: #0a0e27;
	box-shadow: 0 0 20px rgba(255, 0, 255, 0.8);
	transform: rotate(90deg);
}

/* Body */
.leaderboard-body {
	padding: 20px;
	max-height: 60vh;
	overflow-y: auto;
}

/* Custom Scrollbar */
.leaderboard-body::-webkit-scrollbar {
	width: 8px;
}

.leaderboard-body::-webkit-scrollbar-track {
	background: rgba(0, 255, 255, 0.1);
	border-radius: 10px;
}

.leaderboard-body::-webkit-scrollbar-thumb {
	background: linear-gradient(180deg, #00ffff, #ff00ff);
	border-radius: 10px;
}

/* Loading State */
.leaderboard-loading {
	text-align: center;
	padding: 40px 20px;
	color: #00ffff;
}

.loading-spinner {
	width: 50px;
	height: 50px;
	border: 4px solid rgba(0, 255, 255, 0.2);
	border-top: 4px solid #00ffff;
	border-radius: 50%;
	margin: 0 auto 20px;
	animation: spin 1s linear infinite;
}

/* Empty State */
.leaderboard-empty {
	text-align: center;
	padding: 60px 20px;
	color: #00ffff;
	font-size: 18px;
}

/* Error State */
.leaderboard-error {
	text-align: center;
	padding: 40px 20px;
	color: #ff00ff;
}

.retry-btn {
	margin-top: 20px;
	padding: 10px 30px;
	background: linear-gradient(45deg, #ff00ff, #00ffff);
	border: none;
	border-radius: 25px;
	color: white;
	font-weight: bold;
	cursor: pointer;
	transition: all 0.3s ease;
}

.retry-btn:hover {
	box-shadow: 0 0 20px rgba(255, 0, 255, 0.8);
	transform: scale(1.05);
}

/* Leaderboard Table */
.leaderboard-table {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.leaderboard-row {
	display: grid;
	grid-template-columns: 80px 1fr 120px;
	gap: 15px;
	padding: 15px 20px;
	background: rgba(0, 255, 255, 0.05);
	border: 1px solid rgba(0, 255, 255, 0.2);
	border-radius: 10px;
	align-items: center;
	transition: all 0.3s ease;
}

.leaderboard-row:hover:not(.header-row) {
	background: rgba(0, 255, 255, 0.1);
	border-color: #00ffff;
	box-shadow: 0 0 15px rgba(0, 255, 255, 0.3);
	transform: translateX(5px);
}

.header-row {
	background: rgba(255, 0, 255, 0.1);
	border-color: #ff00ff;
	font-weight: bold;
	color: #ff00ff;
	font-family: 'Orbitron', sans-serif;
}

/* Top 3 Ranks */
.rank-1 {
	background: linear-gradient(90deg, rgba(255, 215, 0, 0.1), rgba(0, 255, 255, 0.05));
	border-color: #FFD700;
}

.rank-2 {
	background: linear-gradient(90deg, rgba(192, 192, 192, 0.1), rgba(0, 255, 255, 0.05));
	border-color: #C0C0C0;
}

.rank-3 {
	background: linear-gradient(90deg, rgba(205, 127, 50, 0.1), rgba(0, 255, 255, 0.05));
	border-color: #CD7F32;
}

/* Columns */
.rank-col {
	display: flex;
	align-items: center;
	gap: 10px;
	font-family: 'Orbitron', sans-serif;
	font-weight: bold;
	color: #00ffff;
}

.rank-number {
	font-size: 20px;
}

.medal {
	font-size: 24px;
	animation: bounce 2s ease infinite;
}

.name-col {
	color: white;
	font-size: 16px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.score-col {
	text-align: right;
	font-family: 'Orbitron', sans-serif;
	font-weight: bold;
	font-size: 18px;
	color: #ff00ff;
}

/* Save Score Modal */
.save-score-content {
	max-width: 450px;
}

.save-score-body {
	padding: 30px;
	text-align: center;
}

.score-display {
	font-size: 24px;
	color: white;
	margin-bottom: 30px;
}

.neon-text {
	font-family: 'Orbitron', sans-serif;
	font-weight: 900;
	font-size: 36px;
	color: #00ffff;
	text-shadow:
		0 0 10px #00ffff,
		0 0 20px #00ffff,
		0 0 30px #00ffff;
}

.enter-name-text {
	color: #00ffff;
	font-size: 18px;
	margin-bottom: 15px;
}

.player-name-input {
	width: 100%;
	padding: 15px;
	background: rgba(0, 255, 255, 0.1);
	border: 2px solid #00ffff;
	border-radius: 10px;
	color: white;
	font-size: 18px;
	text-align: center;
	font-family: 'Orbitron', sans-serif;
	margin-bottom: 20px;
	transition: all 0.3s ease;
}

.player-name-input:focus {
	outline: none;
	border-color: #ff00ff;
	box-shadow: 0 0 20px rgba(255, 0, 255, 0.5);
}

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

.save-score-buttons {
	display: flex;
	gap: 15px;
	justify-content: center;
}

.save-btn,
.skip-btn {
	padding: 12px 30px;
	border: none;
	border-radius: 25px;
	font-family: 'Orbitron', sans-serif;
	font-weight: bold;
	font-size: 16px;
	cursor: pointer;
	transition: all 0.3s ease;
}

.save-btn {
	background: linear-gradient(45deg, #00ffff, #ff00ff);
	color: white;
}

.save-btn:hover:not(:disabled) {
	box-shadow: 0 0 25px rgba(0, 255, 255, 0.8);
	transform: scale(1.05);
}

.save-btn:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.skip-btn {
	background: transparent;
	border: 2px solid rgba(255, 255, 255, 0.3);
	color: rgba(255, 255, 255, 0.7);
}

.skip-btn:hover {
	border-color: #ff00ff;
	color: #ff00ff;
}

.save-error {
	color: #ff00ff;
	margin-top: 15px;
	min-height: 20px;
	font-size: 14px;
}

/* Animations */
@keyframes fadeIn {
	from {
		opacity: 0;
	}

	to {
		opacity: 1;
	}
}

@keyframes slideUp {
	from {
		transform: translateY(50px);
		opacity: 0;
	}

	to {
		transform: translateY(0);
		opacity: 1;
	}
}

@keyframes spin {
	to {
		transform: rotate(360deg);
	}
}

@keyframes gradientShift {

	0%,
	100% {
		background-position: 0% 50%;
	}

	50% {
		background-position: 100% 50%;
	}
}

@keyframes bounce {

	0%,
	100% {
		transform: translateY(0);
	}

	50% {
		transform: translateY(-5px);
	}
}

/* Mobile Responsive */
@media (max-width: 600px) {
	.leaderboard-content {
		width: 95%;
		max-height: 90vh;
	}

	.leaderboard-title {
		font-size: 22px;
	}

	.leaderboard-row {
		grid-template-columns: 60px 1fr 100px;
		gap: 10px;
		padding: 12px 15px;
	}

	.rank-number {
		font-size: 16px;
	}

	.medal {
		font-size: 20px;
	}

	.name-col {
		font-size: 14px;
	}

	.score-col {
		font-size: 16px;
	}

	.neon-text {
		font-size: 28px;
	}

	.save-score-buttons {
		flex-direction: column;
	}

	.save-btn,
	.skip-btn {
		width: 100%;
	}
}

/* -------------------------------------------------------- */
/*  GAME OVER OVERLAY                                      */
/* -------------------------------------------------------- */

.game-over-overlay {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(10, 14, 39, 0.9);
	backdrop-filter: blur(4px);
	z-index: 1000;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	border-radius: 10px;
	animation: fadeIn 0.5s ease;
}

.game-over-title {
	font-family: 'Orbitron', sans-serif;
	font-size: 3rem;
	font-weight: 900;
	color: var(--neon-pink);
	text-shadow: 0 0 20px var(--neon-pink);
	margin-bottom: 10px;
	text-transform: uppercase;
}

.game-over-score-label {
	font-size: 1.2rem;
	color: white;
	margin-bottom: 5px;
}

.game-over-score-value {
	font-family: 'Orbitron', sans-serif;
	font-size: 2.5rem;
	font-weight: bold;
	color: var(--neon-cyan);
	text-shadow: 0 0 15px var(--neon-cyan);
	margin-bottom: 30px;
}

.game-over-buttons {
	display: flex;
	gap: 15px;
}

.retry-button {
	background: linear-gradient(45deg, #ff006e, #ff9500);
	border: none;
	padding: 12px 30px;
	border-radius: 25px;
	color: white;
	font-family: 'Orbitron', sans-serif;
	font-weight: bold;
	font-size: 1.1rem;
	cursor: pointer;
	transition: all 0.3s ease;
	box-shadow: 0 0 15px rgba(255, 0, 110, 0.5);
}

.retry-button:hover {
	transform: scale(1.05);
	box-shadow: 0 0 25px rgba(255, 0, 110, 0.8);
}