/* Leaderboard Overlay */
#leaderboard-overlay,
#leaderboard-submit-overlay {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0, 0, 0, 0.7);
	display: flex;
	justify-content: center;
	align-items: center;
	z-index: 1000;
}

/* Leaderboard Modal */
#leaderboard-modal {
	background: linear-gradient(180deg, #ff9f18 0%, #ff6b00 100%);
	border: 4px solid #000;
	border-radius: 15px;
	width: 90%;
	max-width: 500px;
	max-height: 80vh;
	display: flex;
	flex-direction: column;
	box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

#leaderboard-header {
	background: linear-gradient(180deg, #ff4500 0%, #d63000 100%);
	border-radius: 11px 11px 0 0;
	padding: 15px 20px;
	text-align: center;
	border-bottom: 3px solid #000;
}

#leaderboard-title {
	font-size: 1.5em;
	font-weight: bold;
	color: #fff;
	text-shadow: 2px 2px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000;
}

#leaderboard-song-title {
	font-size: 1.1em;
	color: #fff;
	margin-top: 5px;
	text-shadow: 1px 1px 0 #000;
}

#leaderboard-difficulty {
	font-size: 0.9em;
	color: #ffe100;
	margin-top: 3px;
	text-shadow: 1px 1px 0 #000;
}

#leaderboard-content {
	flex: 1;
	overflow-y: auto;
	padding: 10px;
	background: #fff8e8;
}

#leaderboard-loading,
#leaderboard-empty,
#leaderboard-error {
	text-align: center;
	padding: 40px 20px;
	font-size: 1.2em;
	color: #666;
}

#leaderboard-error {
	color: #c00;
}

/* Leaderboard Table */
#leaderboard-table {
	width: 100%;
}

.leaderboard-row {
	display: flex;
	padding: 8px 10px;
	border-bottom: 1px solid #ddd;
	align-items: center;
}

.leaderboard-header-row {
	background: #ff9f18;
	font-weight: bold;
	color: #fff;
	text-shadow: 1px 1px 0 #000;
	border-radius: 5px;
	margin-bottom: 5px;
}

.leaderboard-row:not(.leaderboard-header-row):hover {
	background: #ffe8c8;
}

.leaderboard-rank {
	width: 50px;
	text-align: center;
	font-weight: bold;
}

.leaderboard-name {
	flex: 1;
	padding: 0 10px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.leaderboard-score {
	width: 100px;
	text-align: right;
	font-weight: bold;
	font-family: monospace;
}

/* Top 3 ranks styling */
.leaderboard-rank-1 {
	background: linear-gradient(90deg, #ffd700 0%, #fff8e8 30%);
}
.leaderboard-rank-1 .leaderboard-rank {
	color: #d4a500;
	font-size: 1.2em;
}

.leaderboard-rank-2 {
	background: linear-gradient(90deg, #c0c0c0 0%, #fff8e8 30%);
}
.leaderboard-rank-2 .leaderboard-rank {
	color: #888;
	font-size: 1.1em;
}

.leaderboard-rank-3 {
	background: linear-gradient(90deg, #cd7f32 0%, #fff8e8 30%);
}
.leaderboard-rank-3 .leaderboard-rank {
	color: #8b4513;
	font-size: 1.05em;
}

#leaderboard-footer {
	padding: 15px;
	text-align: center;
	border-top: 2px solid #000;
}

#leaderboard-close-btn {
	background: linear-gradient(180deg, #666 0%, #444 100%);
	color: #fff;
	border: 2px solid #000;
	border-radius: 8px;
	padding: 10px 30px;
	font-size: 1.1em;
	font-weight: bold;
	cursor: pointer;
	transition: transform 0.1s;
}

#leaderboard-close-btn:hover {
	transform: scale(1.05);
	background: linear-gradient(180deg, #888 0%, #555 100%);
}

/* Submit Modal */
#leaderboard-submit-modal {
	background: linear-gradient(180deg, #4CAF50 0%, #388E3C 100%);
	border: 4px solid #000;
	border-radius: 15px;
	padding: 25px;
	text-align: center;
	box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
	max-width: 400px;
	width: 90%;
}

#leaderboard-submit-title {
	font-size: 1.5em;
	font-weight: bold;
	color: #fff;
	text-shadow: 2px 2px 0 #000;
	margin-bottom: 10px;
}

#leaderboard-submit-score {
	font-size: 1.8em;
	font-weight: bold;
	color: #ffe100;
	text-shadow: 2px 2px 0 #000;
	margin-bottom: 20px;
}

#leaderboard-submit-form {
	margin-bottom: 20px;
}

#leaderboard-submit-form label {
	display: block;
	color: #fff;
	margin-bottom: 10px;
	text-shadow: 1px 1px 0 #000;
}

#leaderboard-name-input {
	width: 100%;
	padding: 12px;
	font-size: 1.2em;
	border: 3px solid #000;
	border-radius: 8px;
	text-align: center;
	box-sizing: border-box;
}

#leaderboard-name-input.error {
	border-color: #f00;
	background: #ffe8e8;
}

#leaderboard-submit-buttons {
	display: flex;
	gap: 10px;
	justify-content: center;
}

#leaderboard-submit-btn,
#leaderboard-cancel-btn {
	padding: 12px 25px;
	font-size: 1.1em;
	font-weight: bold;
	border: 2px solid #000;
	border-radius: 8px;
	cursor: pointer;
	transition: transform 0.1s;
}

#leaderboard-submit-btn {
	background: linear-gradient(180deg, #ff9f18 0%, #ff6b00 100%);
	color: #fff;
	text-shadow: 1px 1px 0 #000;
}

#leaderboard-submit-btn:hover:not(:disabled) {
	transform: scale(1.05);
}

#leaderboard-submit-btn:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

#leaderboard-cancel-btn {
	background: linear-gradient(180deg, #666 0%, #444 100%);
	color: #fff;
}

#leaderboard-cancel-btn:hover {
	transform: scale(1.05);
	background: linear-gradient(180deg, #888 0%, #555 100%);
}
