.filter-container {
	margin-top: 16px;
}

.filter-row {
	display: flex;
	gap: 12px;
	align-items: center;
	flex-wrap: wrap;
	justify-content: center;
}


.leaderboard-button {
	background: rgba(0, 50, 0, 0.3);
	border: 1px solid #0f0;
	border-radius: 4px;
	color: #0f0;
	font-family: 'Courier New', monospace;
	padding: 8px 16px;
	font-size: 0.95rem;
	cursor: pointer;
	transition: all 0.3s ease;
	white-space: nowrap;
}

.leaderboard-button:hover {
	background: rgba(0, 255, 0, 0.1);
	transform: translateY(-1px);
	box-shadow: 0 0 10px rgba(0, 255, 0, 0.3);
}

.leaderboard-modal {
	display: none;
	position: fixed;
	z-index: 2000;
	left: 0;
	top: 0;
	width: 100%;
	height: 100%;
	background-color: rgba(0, 0, 0, 0.8);
	backdrop-filter: blur(4px);
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
}

.leaderboard-modal-content {
	background: #000;
	border: 2px solid #0f0;
	border-radius: 8px;
	margin: 5% auto;
	padding: 0;
	width: 90%;
	max-width: 700px;
	max-height: 80vh;
	display: flex;
	flex-direction: column;
	box-shadow: 0 0 30px rgba(0, 255, 0, 0.3);
}

.leaderboard-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 20px 24px;
	border-bottom: 1px solid #0f0;
	background: rgba(0, 50, 0, 0.2);
}

.leaderboard-header h2 {
	margin: 0;
	color: #0f0;
	font-family: 'Courier New', monospace;
	font-size: 1.5rem;
	text-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
}

.leaderboard-close {
	color: #0f0;
	font-size: 28px;
	font-weight: bold;
	cursor: pointer;
	transition: all 0.3s ease;
	line-height: 1;
	padding: 0 8px;
}

.leaderboard-close:hover {
	color: #ff0000;
	text-shadow: 0 0 10px rgba(255, 0, 0, 0.5);
}

.leaderboard-stats {
	display: flex;
	justify-content: space-around;
	padding: 20px;
	background: rgba(0, 50, 0, 0.1);
	border-bottom: 1px solid rgba(0, 255, 0, 0.2);
}

.stat-item {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
}

.stat-label {
	color: rgba(0, 255, 0, 0.7);
	font-family: 'Courier New', monospace;
	font-size: 0.9rem;
}

.stat-value {
	color: #0f0;
	font-family: 'Courier New', monospace;
	font-size: 1.8rem;
	font-weight: bold;
	text-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
}

.leaderboard-sort {
	display: flex;
	justify-content: center;
	gap: 12px;
	padding: 16px 24px;
	background: rgba(0, 50, 0, 0.05);
	border-bottom: 1px solid rgba(0, 255, 0, 0.2);
}

.leaderboard-sort-btn {
	background: rgba(0, 50, 0, 0.3);
	border: 1px solid #0f0;
	border-radius: 4px;
	color: #0f0;
	font-family: 'Courier New', monospace;
	padding: 8px 20px;
	font-size: 0.95rem;
	cursor: pointer;
	transition: all 0.3s ease;
	white-space: nowrap;
}

.leaderboard-sort-btn:hover {
	background: rgba(0, 255, 0, 0.1);
	transform: translateY(-1px);
}

.leaderboard-sort-btn.active {
	background: rgba(0, 255, 0, 0.2);
	border-width: 2px;
	box-shadow: 0 0 10px rgba(0, 255, 0, 0.3);
	font-weight: bold;
}

.leaderboard-body {
	overflow-y: auto;
	padding: 16px 24px;
	flex: 1;
}

/* Custom scrollbar styling for leaderboard */
.leaderboard-body::-webkit-scrollbar {
	width: 12px;
}

.leaderboard-body::-webkit-scrollbar-track {
	background: rgba(0, 0, 0, 0.5);
	border-left: 1px solid rgba(0, 255, 0, 0.2);
}

.leaderboard-body::-webkit-scrollbar-thumb {
	background: rgba(0, 255, 0, 0.3);
	border-radius: 6px;
	border: 2px solid rgba(0, 0, 0, 0.5);
}

.leaderboard-body::-webkit-scrollbar-thumb:hover {
	background: rgba(0, 255, 0, 0.5);
}

/* Firefox scrollbar styling */
.leaderboard-body {
	scrollbar-width: thin;
	scrollbar-color: rgba(0, 255, 0, 0.3) rgba(0, 0, 0, 0.5);
}

.leaderboard-entry {
	display: grid;
	grid-template-columns: 50px 60px 1fr 100px;
	gap: 16px;
	align-items: center;
	padding: 12px;
	margin-bottom: 8px;
	background: rgba(0, 50, 0, 0.1);
	border: 1px solid rgba(0, 255, 0, 0.2);
	border-radius: 4px;
	transition: all 0.3s ease;
}

.leaderboard-entry:hover {
	background: rgba(0, 255, 0, 0.05);
	border-color: #0f0;
	transform: translateX(4px);
}

.leaderboard-rank {
	font-family: 'Courier New', monospace;
	color: #0f0;
	font-size: 1.2rem;
	font-weight: bold;
	text-align: center;
	display: flex;
	align-items: center;
	justify-content: center;
}

.leaderboard-rank.top-3 {
	font-size: 1.5rem;
}

.leaderboard-rank svg {
	filter: drop-shadow(0 0 4px rgba(0, 0, 0, 0.5));
}

.leaderboard-avatar {
	width: 48px;
	height: 48px;
	border-radius: 50%;
	border: 2px solid #0f0;
	box-shadow: 0 0 8px rgba(0, 255, 0, 0.2);
}

.leaderboard-user {
	font-family: 'Courier New', monospace;
	color: #0f0;
	font-size: 1rem;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.leaderboard-count {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 4px;
}

.message-count {
	font-family: 'Courier New', monospace;
	color: #0f0;
	font-size: 1.1rem;
	font-weight: bold;
}

.star-total {
	font-family: 'Courier New', monospace;
	color: rgba(0, 255, 0, 0.7);
	font-size: 0.85rem;
}

.filter-input {
	background: rgba(0, 50, 0, 0.3);
	border: 1px solid #0f0;
	border-radius: 4px;
	color: #0f0;
	font-family: 'Courier New', monospace;
	padding: 8px 12px;
	width: auto;
	min-width: 200px;
	max-width: 300px;
	font-size: 0.95rem;
	transition: all 0.3s ease;
	box-sizing: border-box;
}

.filter-input::placeholder {
	color: rgba(0, 255, 0, 0.5);
}

.filter-input:focus {
	outline: none;
	border-color: #0f0;
	box-shadow: 0 0 10px rgba(0, 255, 0, 0.2);
	background: rgba(0, 50, 0, 0.5);
}

.sort-select {
	background: rgba(0, 50, 0, 0.3);
	border: 1px solid #0f0;
	border-radius: 4px;
	color: #0f0;
	font-family: 'Courier New', monospace;
	padding: 8px 12px;
	font-size: 0.95rem;
	cursor: pointer;
	transition: all 0.3s ease;
	box-sizing: border-box;
}

.sort-select:focus {
	outline: none;
	border-color: #0f0;
	box-shadow: 0 0 10px rgba(0, 255, 0, 0.2);
	background: rgba(0, 50, 0, 0.5);
}

.sort-select option {
	background: #000;
	color: #0f0;
}

.message-content {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.message-header {
	display: flex;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
}

.author {
	color: #0f0;
	font-size: 1rem;
	font-family: 'Courier New', monospace;
}

.jump-link {
	color: #79c0ff;
	margin-left: 4px;
}

.desc {
	opacity: 0.95;
	line-height: 1.5;
	overflow-wrap: break-word;
	text-align: left;
	color: #0f0;
	font-family: 'Courier New', monospace;
}

.time {
	font-family: 'Courier New', monospace;
	color: #0f0;
	font-size: 0.95rem;
	white-space: nowrap;
	text-align: right;
	display: flex;
	flex-direction: column;
	gap: 4px;
	align-items: flex-end;
}

.preview {
	display: flex;
	justify-content: flex-end;
}

.preview img {
	max-height: 120px;
	width: auto;
	object-fit: contain;
}

.video-link {
	display: inline-block;
	padding: 8px 16px;
	background: rgba(0, 50, 0, 0.3);
	border: 1px solid #0f0;
	border-radius: 4px;
	color: #79c0ff;
	text-decoration: none;
	text-align: center;
	font-family: 'Courier New', monospace;
	transition: all 0.3s ease;
}

.video-link:hover {
	background: rgba(0, 255, 0, 0.1);
	text-decoration: none;
	transform: translateY(-1px);
}

.markdown-content {
	font-size: 0.95rem;
	line-height: 1.4;
	color: #0f0;
	font-family: 'Courier New', monospace;
}

.markdown-content * {
	font-size: inherit !important;
	animation: none !important;
	text-shadow: none !important;
}

.markdown-content strong {
	font-weight: bold !important;
	color: #0f0;
	opacity: 1;
}

.markdown-content em {
	font-style: italic !important;
	opacity: 0.9;
}

.markdown-content strong em,
.markdown-content em strong {
	font-weight: bold !important;
	font-style: italic !important;
}

.markdown-content del {
	text-decoration: line-through !important;
	opacity: 0.8;
}

.markdown-content u {
	text-decoration: underline !important;
}

.markdown-content blockquote {
	border-left: 2px solid #0f0;
	margin: 4px 0;
	padding-left: 8px;
	opacity: 0.9;
}

.markdown-content code {
	background: rgba(0, 50, 0, 0.3);
	padding: 2px 6px;
	border-radius: 4px;
	border: 1px solid rgba(0, 255, 0, 0.2);
	display: inline-block;
	max-width: 100%;
	overflow-wrap: break-word;
	word-wrap: break-word;
	word-break: break-all;
	white-space: pre-wrap;
	font-size: 0.9em;
}

.markdown-content pre {
	background: rgba(0, 50, 0, 0.3);
	padding: 8px;
	border-radius: 4px;
	overflow-x: auto;
	border: 1px solid rgba(0, 255, 0, 0.2);
	margin: 8px 0;
	max-height: 200px;
	position: relative;
}

.markdown-content pre.expanded {
	max-height: none;
}

.markdown-content pre code {
	border: none;
	background: none;
	padding: 0;
}

.expand-button {
	position: absolute;
	bottom: 0;
	right: 0;
	background: rgba(0, 50, 0, 0.9);
	color: #0f0;
	border: 1px solid #0f0;
	border-radius: 4px;
	padding: 2px 8px;
	font-size: 0.8rem;
	cursor: pointer;
	margin: 4px;
	font-family: 'Courier New', monospace;
	transition: all 0.3s ease;
}

.expand-button:hover {
	background: rgba(0, 255, 0, 0.1);
}

.content-collapse {
	max-height: 100px;
	overflow: hidden;
	position: relative;
}

.content-collapse.expanded {
	max-height: none;
}

.content-collapse:not(.expanded)::after {
	content: '';
	position: absolute;
	bottom: 0;
	left: 0;
	width: 100%;
	height: 40px;
	background: linear-gradient(transparent, rgba(0, 50, 0, 0.9));
	pointer-events: none;
}

.markdown-content img {
	max-width: 100%;
	height: auto;
	border-radius: 4px;
	border: 1px solid #0f0;
	margin: 4px 0;
}

.markdown-content p {
	margin: 4px 0;
}

.markdown-content h1,
.markdown-content h2,
.markdown-content h3,
.markdown-content h4,
.markdown-content h5,
.markdown-content h6 {
	margin: 8px 0 4px 0;
	color: #0f0;
}

.markdown-content a,
a {
	color: #79c0ff;
	text-decoration: none;
	transition: color 0.3s;
	word-wrap: break-word;
	word-break: break-word;
	overflow-wrap: break-word;
	max-width: 100%;
	display: inline-block;
}

.markdown-content a:hover,
a:hover {
	text-decoration: underline;
	color: #0f0;
}

.jump-link {
	display: inline;
}

.grid {
	display: grid;
	grid-template-columns: 72px 60px 1fr 140px 140px;
	gap: 24px;
	align-items: center;
	margin: 0 auto;
	max-width: 100%;
	background-color: rgba(0, 50, 0, 0.1);
	border-radius: 8px;
	padding: 16px 24px;
}

.grid>.head {
	font-weight: 600;
	border-bottom: 1px solid #0f0;
	padding: 10px 0;
	color: #0f0;
	text-shadow: 0 0 5px #0f0;
}

.card {
	padding: 24px 0;
	border-bottom: 1px solid rgba(0, 255, 0, 0.2);
	transition: background-color 0.3s;
}

.card:hover {
	background-color: rgba(0, 255, 0, 0.05);
}

.star {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 80px;
	height: 32px;
	border-radius: 4px;
	background: rgba(0, 50, 0, 0.3);
	border: 1px solid #0f0;
	font-size: 1rem;
	color: #0f0;
	padding: 0;
	margin: 0;
	line-height: 1;
	font-family: 'Courier New', monospace;
}

.star .glyph {
	margin-right: 4px;
	font-size: 1rem;
	color: #ffd700;
	position: relative;
	top: -1px;
}

.star-container {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	padding: 2px;
}

.avatar {
	width: 48px;
	height: 48px;
	border-radius: 50%;
	border: 2px solid #0f0;
	box-shadow: 0 0 10px rgba(0, 255, 0, 0.2);
}

.thumb {
	width: 100%;
	max-width: 120px;
	height: auto;
	border-radius: 8px;
	border: 1px solid #0f0;
	box-shadow: 0 0 10px rgba(0, 255, 0, 0.2);
	cursor: pointer;
	transition: transform 0.3s;
}

.thumb:hover {
	transform: scale(1.05);
}

.channel {
	font-family: 'Courier New', monospace;
	background: rgba(0, 50, 0, 0.3);
	padding: 4px 12px;
	border-radius: 4px;
	border: 1px solid #0f0;
	color: #0f0;
	font-size: 0.95rem;
	white-space: nowrap;
	display: inline-block;
}

.pagination {
	margin-top: 20px;
	display: flex;
	justify-content: center;
	gap: 10px;
	align-items: center;
}

.pagination button {
	padding: 5px 10px;
	border: 1px solid #0f0;
	border-radius: 4px;
	color: #0f0;
	background: none;
	cursor: pointer;
	transition: all 0.3s;
}

.pagination button:hover:not(.current) {
	background: rgba(0, 255, 0, 0.1);
}

.pagination .current {
	background: rgba(0, 255, 0, 0.2);
}

.pagination button:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.pagination .ellipsis {
	color: #0f0;
	margin: 0 4px;
	font-weight: bold;
	user-select: none;
}

@media screen and (max-width: 768px) {
	.grid {
		grid-template-columns: 72px 1fr;
		gap: 16px;
	}

	.grid>.head {
		display: none;
	}

	header {
		margin-bottom: 16px;
	}

	.card {
		display: flex;
		flex-direction: column;
		gap: 16px;
		padding: 16px;
	}

	.message-header {
		flex-wrap: wrap;
		gap: 8px;
		justify-content: center;
		text-align: center;
		width: 100%;
	}

	.author {
		width: 100%;
		text-align: center;
	}

	.message-content {
		order: 2;
	}

	.time {
		order: 4;
		width: 100%;
		align-items: center;
		margin: 8px 0;
	}

	.preview {
		order: 5;
		justify-content: center;
	}

	.thumb {
		max-width: 100%;
		height: auto;
	}

	.jump-link {
		margin: 0;
	}

	.leaderboard-modal-content {
		margin: 2% auto;
		width: 95%;
		max-height: 90vh;
	}

	.leaderboard-header h2 {
		font-size: 1.2rem;
	}

	.leaderboard-stats {
		flex-direction: column;
		gap: 12px;
		padding: 16px;
	}

	.leaderboard-entry {
		grid-template-columns: 40px 48px 1fr;
		gap: 12px;
		padding: 10px;
	}

	.leaderboard-count {
		grid-column: 2 / 4;
		flex-direction: row;
		justify-content: space-between;
		align-items: center;
		margin-top: 8px;
	}

	.leaderboard-avatar {
		width: 40px;
		height: 40px;
	}

	.filter-row {
		flex-direction: column;
		width: 100%;
		gap: 8px;
		padding: 0 16px;
		box-sizing: border-box;
	}

	.filter-input,
	.sort-select,
	.leaderboard-button {
		width: 100%;
		max-width: 100%;
		min-width: 0;
		box-sizing: border-box;
	}

	.leaderboard-sort {
		flex-direction: column;
		gap: 8px;
		padding: 12px 16px;
	}

	.leaderboard-sort-btn {
		width: 100%;
	}
}


#loading {
	position: fixed;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	background: rgba(0, 0, 0, 0.8);
	padding: 20px;
	border-radius: 8px;
	border: 1px solid #0f0;
	color: #0f0;
	z-index: 1000;
}