/* Home page community bar: site stats, who's online, Discord.
   Narrow widths (container query on .hmBarWrap) wrap it into rows. */

.hmBarWrap { container: hmbar / inline-size; }

.hmBar {
	display: flex;
	align-items: center;
	gap: 16px;
	margin: 10px 0;
	padding: 14px 16px;
	background: #161B1D;
	border: 1px solid #232B33;
	border-radius: 14px;
	color: #E6EDF3;
}

.hmStats {
	display: flex;
	align-items: center;
	gap: 22px;
	flex-shrink: 0;
}

.hmStat {
	display: flex;
	align-items: center;
	gap: 10px;
	min-width: 0;
	color: #E6EDF3;
	text-decoration: none;
}

a.hmStat:hover { color: #B8D86B; }

.hmStatIcon {
	width: 38px;
	height: 38px;
	border-radius: 10px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 15px;
	flex-shrink: 0;
}

.hmStatMembers { background: rgba(184,216,107,.12); color: #B8D86B; }
.hmStatMaps { background: rgba(86,137,229,.15); color: #8DB0F2; }
.hmStatDownloads { background: rgba(245,196,81,.12); color: #F5C451; }

.hmStatText {
	display: flex;
	flex-direction: column;
	line-height: 1.15;
	min-width: 0;
}

.hmStatText b {
	font-size: 19px;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
}

.hmStatText span {
	font-size: 12.5px;
	color: #8B97A6;
}

.hmOnline {
	flex: 1;
	min-width: 0;
	display: flex;
	align-items: center;
	gap: 12px;
	padding-left: 18px;
	border-left: 1px solid #232B33;
	min-height: 38px;
}

.hmPulse {
	position: relative;
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: #63E6BE;
	flex-shrink: 0;
	margin: 0 4px;
}

.hmPulse::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: 50%;
	background: #63E6BE;
	animation: hmPulse 2s ease-out infinite;
}

@keyframes hmPulse {
	from { transform: scale(1); opacity: .55; }
	to { transform: scale(2.8); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
	.hmPulse::after { animation: none; opacity: .2; transform: scale(1.8); }
}

.hmOnlineText {
	display: flex;
	flex-direction: column;
	line-height: 1.2;
	white-space: nowrap;
}

.hmOnlineText b {
	font-size: 16px;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
}

.hmOnlineText span {
	font-size: 12.5px;
	color: #8B97A6;
	font-variant-numeric: tabular-nums;
}

.hmOnlineNames {
	flex: 1;
	min-width: 0;
	font-size: 13px;
	color: #63E6BE;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	text-align: right;
}

.hmDiscord {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	height: 40px;
	padding: 0 16px;
	border-radius: 10px;
	background: #5865F2;
	color: #fff;
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
	flex-shrink: 0;
	transition: filter .15s;
}

.hmDiscord:hover { color: #fff; filter: brightness(1.12); }

.hmDiscord svg {
	width: 18px;
	height: 18px;
	fill: #fff;
}

@container hmbar (max-width: 900px) {
	.hmBar { flex-wrap: wrap; row-gap: 12px; }
	.hmStats { flex: 1 1 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding-bottom: 12px; border-bottom: 1px solid #232B33; }
	.hmOnline { padding-left: 0; border-left: none; }
}

@container hmbar (max-width: 520px) {
	.hmBar { padding: 12px; }
	.hmStats { gap: 8px; }
	.hmStat { flex-direction: column; align-items: flex-start; gap: 6px; }
	.hmStatIcon { width: 30px; height: 30px; border-radius: 8px; font-size: 13px; }
	.hmStatText b { font-size: 17px; }
	.hmOnline { flex: 1 1 100%; }
	.hmDiscord { flex: 1 1 100%; }
}
