/* Правила серверов */

.rs-page {
	--rs-accent: #e11d2e;
	--rs-panel: rgba(16, 16, 20, 0.92);
	--rs-line: rgba(255, 255, 255, 0.07);
	--rs-text: rgba(255, 255, 255, 0.88);
	--rs-muted: rgba(255, 255, 255, 0.48);
	max-width: 1180px;
	margin: 0 auto 36px;
	padding: 8px 14px 28px;
	box-sizing: border-box;
}

.rs-hero {
	margin: 4px 0 18px;
}

.rs-hero__eyebrow {
	margin: 0 0 6px;
	font-size: 11px;
	font-weight: 750;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--rs-muted);
}

.rs-hero__title {
	margin: 0 0 8px;
	font-size: clamp(22px, 3vw, 30px);
	font-weight: 800;
	line-height: 1.2;
	color: #fff;
}

.rs-hero__sub {
	margin: 0;
	max-width: 46ch;
	font-size: 14px;
	line-height: 1.5;
	color: var(--rs-muted);
}

/* Выбор сервера — две крупные плитки */
.rs-picker {
	margin-bottom: 18px;
}

.rs-picker__grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
	gap: 14px;
}

.rs-server {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 8px;
	min-height: 132px;
	padding: 18px 18px 16px;
	border-radius: 18px;
	border: 1px solid var(--rs-line);
	background:
		linear-gradient(145deg, color-mix(in srgb, var(--rs-accent) 18%, transparent) 0%, transparent 42%),
		var(--rs-panel);
	color: var(--rs-text);
	text-align: left;
	cursor: pointer;
	overflow: hidden;
	transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.rs-server:hover {
	transform: translateY(-2px);
	border-color: color-mix(in srgb, var(--rs-accent) 45%, rgba(255, 255, 255, 0.12));
}

.rs-server.is-active {
	border-color: color-mix(in srgb, var(--rs-accent) 70%, #fff 10%);
	box-shadow:
		0 0 0 1px color-mix(in srgb, var(--rs-accent) 35%, transparent),
		0 18px 40px -24px color-mix(in srgb, var(--rs-accent) 70%, transparent);
}

.rs-server__glow {
	position: absolute;
	inset: auto -20% -40% auto;
	width: 180px;
	height: 180px;
	border-radius: 50%;
	background: radial-gradient(circle, color-mix(in srgb, var(--rs-accent) 35%, transparent), transparent 70%);
	pointer-events: none;
	opacity: 0.55;
}

.rs-server__top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	gap: 10px;
	position: relative;
	z-index: 1;
}

.rs-server__icon {
	width: 42px;
	height: 42px;
	border-radius: 14px;
	display: grid;
	place-items: center;
	background: color-mix(in srgb, var(--rs-accent) 18%, rgba(255, 255, 255, 0.04));
	border: 1px solid color-mix(in srgb, var(--rs-accent) 35%, transparent);
	color: var(--rs-accent);
	font-size: 22px;
}

.rs-server__badge {
	font-size: 10px;
	font-weight: 800;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	padding: 5px 9px;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.06);
	color: rgba(255, 255, 255, 0.7);
}

.rs-server.is-active .rs-server__badge {
	background: color-mix(in srgb, var(--rs-accent) 22%, transparent);
	color: #fff;
}

.rs-server__name {
	position: relative;
	z-index: 1;
	font-size: 17px;
	font-weight: 800;
	line-height: 1.25;
	color: #fff;
}

.rs-server__addr {
	position: relative;
	z-index: 1;
	font-size: 12px;
	color: var(--rs-muted);
	font-variant-numeric: tabular-nums;
}

.rs-server__check {
	position: absolute;
	top: 14px;
	right: 14px;
	width: 26px;
	height: 26px;
	border-radius: 50%;
	display: grid;
	place-items: center;
	background: var(--rs-accent);
	color: #fff;
	font-size: 16px;
	opacity: 0;
	transform: scale(0.7);
	transition: opacity 0.15s ease, transform 0.15s ease;
	z-index: 2;
}

.rs-server.is-active .rs-server__check {
	opacity: 1;
	transform: scale(1);
}

.rs-server.is-active .rs-server__badge {
	margin-right: 28px;
}

.rs-layout {
	display: grid;
	grid-template-columns: minmax(280px, 350px) minmax(0, 1fr);
	gap: 20px;
	align-items: start;
}

.rs-panel {
	background: var(--rs-panel);
	border: 1px solid var(--rs-line);
	border-radius: 18px;
	padding: 14px;
}

.rs-panel__head {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 12px;
	font-size: 13px;
	font-weight: 750;
	color: #fff;
}

.rs-panel__head i {
	color: var(--rs-accent);
	font-size: 18px;
}

.rs-panel__head em {
	font-style: normal;
	color: var(--rs-muted);
	font-weight: 600;
}

.rs-aside {
	position: sticky;
	top: 88px;
}

.rs-aside .rs-panel {
	background: #181818;
	border: 1px solid rgba(255, 255, 255, 0.04);
	border-radius: 12px;
	padding: 20px;
}

.rs-aside .rs-panel__head {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 20px;
	padding-bottom: 15px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.04);
	font-size: 18px;
	font-weight: 600;
	color: #fff;
}

.rs-aside .rs-panel__head i {
	width: 40px;
	height: 40px;
	border-radius: 8px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: rgba(95, 101, 220, 0.1);
	color: #5f65dc;
	font-size: 20px;
	flex-shrink: 0;
}

.rs-cats {
	display: flex;
	flex-direction: column;
	gap: 0;
	max-height: calc(100vh - 240px);
	overflow: auto;
	list-style: none;
	margin: 0;
	padding: 0;
}

.rs-cat {
	display: flex;
	align-items: center;
	gap: 12px;
	width: 100%;
	padding: 15px;
	margin-bottom: 10px;
	border-radius: 8px;
	border: 1px solid rgba(255, 255, 255, 0.04);
	background: rgba(22, 22, 22, 1);
	color: #fff;
	text-align: left;
	cursor: pointer;
	transition: all 0.3s;
	box-sizing: border-box;
}

.rs-cat:last-child {
	margin-bottom: 0;
}

.rs-cat:hover {
	border-color: #5f65dc;
	background: rgba(95, 101, 220, 0.05);
}

.rs-cat.is-active {
	border-color: #5f65dc;
	background: rgba(95, 101, 220, 0.1);
}

.rs-cat__icon {
	width: 40px;
	height: 40px;
	border-radius: 8px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(95, 101, 220, 0.1);
	color: #5f65dc;
	font-size: 20px;
	flex-shrink: 0;
}

.rs-cat.is-active .rs-cat__icon {
	color: #5f65dc;
	background: rgba(95, 101, 220, 0.1);
}

.rs-cat__body,
.rs-cat__meta {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 0;
}

.rs-cat__name {
	font-size: 15px;
	font-weight: 600;
	line-height: 1.25;
	margin-bottom: 3px;
	color: #fff;
}

.rs-cat__desc,
.rs-cat__count {
	font-size: 12px;
	color: rgba(255, 255, 255, 0.7);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.rs-main {
	display: flex;
	flex-direction: column;
	gap: 14px;
	min-width: 0;
}

.rs-search {
	display: flex;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
}

.rs-search__field {
	position: relative;
	flex: 1 1 240px;
	min-width: 0;
}

.rs-search__field > i {
	position: absolute;
	left: 12px;
	top: 50%;
	transform: translateY(-50%);
	color: var(--rs-muted);
	pointer-events: none;
}

.rs-search__field input {
	width: 100%;
	box-sizing: border-box;
	padding: 12px 36px 12px 36px;
	border-radius: 12px;
	border: 1px solid var(--rs-line);
	background: rgba(255, 255, 255, 0.03);
	color: #fff;
	outline: none;
}

.rs-search__field input:focus {
	border-color: color-mix(in srgb, var(--rs-accent) 55%, transparent);
}

.rs-search__clear {
	position: absolute;
	right: 8px;
	top: 50%;
	transform: translateY(-50%);
	width: 28px;
	height: 28px;
	border: 0;
	border-radius: 8px;
	background: rgba(255, 255, 255, 0.06);
	color: #fff;
	cursor: pointer;
}

.rs-search__all {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 12px;
	color: var(--rs-muted);
	cursor: pointer;
	user-select: none;
	white-space: nowrap;
}

.rs-search__count {
	margin-top: 10px;
	font-size: 12px;
	color: var(--rs-muted);
}

.rs-search__count strong {
	color: #fff;
}

.rs-placeholder {
	display: grid;
	place-items: center;
	gap: 8px;
	padding: 36px 16px;
	text-align: center;
	color: var(--rs-muted);
}

.rs-placeholder i {
	font-size: 34px;
	opacity: 0.55;
}

.rs-placeholder p {
	margin: 0;
	font-size: 13px;
	max-width: 28ch;
}

.rs-rules {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.rs-rule {
	padding: 14px 14px 12px;
	border-radius: 14px;
	border: 1px solid var(--rs-line);
	background: rgba(255, 255, 255, 0.025);
}

.rs-rule__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	margin-bottom: 8px;
}

.rs-rule__num {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 42px;
	padding: 4px 8px;
	border-radius: 8px;
	background: color-mix(in srgb, var(--rs-accent) 16%, transparent);
	color: #fff;
	font-size: 12px;
	font-weight: 800;
}

.rs-rule__cat {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin-bottom: 8px;
	font-size: 11px;
	color: var(--rs-muted);
}

.rs-rule__text {
	font-size: 14px;
	line-height: 1.55;
	color: var(--rs-text);
}

.rs-rule__text p {
	margin: 0 0 8px;
}

.rs-rule__text p:last-child {
	margin-bottom: 0;
}

.rs-rule__punish {
	margin-top: 10px;
	padding: 10px 12px;
	border-radius: 10px;
	background: color-mix(in srgb, var(--rs-accent) 12%, transparent);
	border: 1px solid color-mix(in srgb, var(--rs-accent) 28%, transparent);
	color: #ffc9ce;
	font-size: 13px;
	line-height: 1.4;
}

.rs-rule mark {
	background: color-mix(in srgb, var(--rs-accent) 35%, transparent);
	color: #fff;
	border-radius: 3px;
	padding: 0 2px;
}

.rs-empty {
	padding: 24px;
	text-align: center;
	color: var(--rs-muted);
	border: 1px dashed var(--rs-line);
	border-radius: 16px;
}

@media (max-width: 900px) {
	.rs-layout {
		grid-template-columns: 1fr;
	}

	.rs-aside {
		position: static;
	}

	.rs-cats {
		max-height: none;
		display: flex;
		flex-direction: column;
	}
}

@media (max-width: 640px) {
	.rs-page {
		padding: 8px 8px 24px;
	}

	.rs-picker__grid {
		grid-template-columns: 1fr;
	}

	.rs-server {
		min-height: 110px;
	}

	.rs-aside .rs-panel {
		padding: 14px;
	}

	.rs-aside .rs-panel__head {
		font-size: 16px;
		margin-bottom: 14px;
		padding-bottom: 12px;
	}
}

/* fallback без color-mix */
@supports not (background: color-mix(in srgb, red 10%, blue)) {
	.rs-server.is-active {
		border-color: var(--rs-accent);
	}
}
