.rules-modal {
	width: 540px;
	max-width: calc(100% - 32px);
	height: min(604px, calc(100dvh - 32px));
	max-height: calc(100dvh - 32px);
	margin: auto;
	padding: 0;
	border: 1px solid rgba(255, 255, 255, .06);
	border-radius: 24px;
	background: #121212;
	color: #fff;
	box-shadow: 0 25px 50px -12px rgba(0, 0, 0, .25);
	font-family: Geist, Arial, sans-serif;
	overflow: hidden;
}

.rules-modal::backdrop {
	background: rgba(0, 0, 0, .64);
}

.rules-modal[open] {
	animation: payment-modal-enter .3s cubic-bezier(.22, 1, .36, 1) both;
}

.rules-modal[open]::backdrop {
	animation: payment-backdrop-enter .24s ease-out both;
}

html:has(.rules-modal[open]) {
	overflow: hidden;
}

.rules-modal-content {
	display: flex;
	flex-direction: column;
	height: 100%;
	min-height: 0;
	padding: 34px 24px 28px;
}

.rules-modal-content h2 {
	margin: 0 36px 22px 0;
	font-size: 18px;
	font-weight: 800;
	line-height: 1.68;
}

.rules-modal-scroll {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	overscroll-behavior: contain;
	scrollbar-width: thin;
	scrollbar-color: #746af6 #1b1b1b;
}

.rules-modal-scroll::-webkit-scrollbar {
	width: 5px;
}

.rules-modal-scroll::-webkit-scrollbar-button {
	display: none;
	width: 0;
	height: 0;
}

.rules-modal-scroll::-webkit-scrollbar-track {
	margin: 4px 0;
	background: #1b1b1b;
	border-radius: 5px;
}

.rules-modal-scroll::-webkit-scrollbar-thumb {
	background: linear-gradient(#a18cff, #746af6);
	border: 1px solid #1b1b1b;
	border-radius: 5px;
}

.rules-modal-scroll::-webkit-scrollbar-thumb:hover {
	background: #b7a7ff;
}

.rules-modal-section {
	margin: 0 14px 18px 0;
}

.rules-modal-section summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 0 0 10px;
	color: #6c6c71;
	font-family: 'Minecraft Bold Rus', sans-serif;
	font-size: 14px;
	font-weight: 800;
	line-height: 1.5;
	cursor: pointer;
	list-style: none;
	transition: color .2s ease;
}

.rules-modal-section summary:hover {
	color: #fff;
}

.rules-modal-section[open] summary {
	color: #fff;
}

.rules-modal-section summary::marker {
	content: '';
}

.rules-modal-section summary::-webkit-details-marker {
	display: none;
}

.rules-modal-section summary::after {
	content: '';
	display: block;
	flex: 0 0 9px;
	width: 9px;
	height: 5px;
	background: url('/img/main/rules-arrow.svg') center / contain no-repeat;
	transition: transform .22s ease;
}

.rules-modal-section[open] summary::after {
	transform: rotate(180deg);
}

.rules-modal-section summary:focus-visible,
.rules-modal-close:focus-visible {
	outline: 2px solid #b69aff;
	outline-offset: 3px;
}

.rules-modal-list {
	display: grid;
	gap: 14px;
	padding: 8px 0 2px;
}

.rules-modal-section[open] .rules-modal-list {
	animation: rules-list-enter .24s ease-out both;
}

@keyframes rules-list-enter {
	from {
		opacity: 0;
		transform: translateY(-6px);
	}

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

.rules-modal-item p {
	margin: 0;
	color: #fff;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.68;
}

.rules-modal-item .rules-modal-penalty {
	margin-top: 3px;
	color: rgba(208, 214, 230, .45);
}

.rules-modal-close {
	position: absolute;
	top: 12px;
	right: 12px;
	z-index: 2;
	display: grid;
	place-items: center;
	width: 32px;
	height: 32px;
	padding: 0;
	border: 0;
	background: transparent;
	color: #595c62;
	cursor: pointer;
	transition: color .2s ease, transform .14s ease;
}

.rules-modal-close:hover {
	color: #fff;
}

.rules-modal-close:active {
	transform: scale(.9);
}

@media (max-width: 900px) {
	.rules-modal {
		width: 100%;
		max-width: 100%;
		height: 100%;
		max-height: 100%;
		border-radius: 0;
	}

	.rules-modal-content {
		padding: 24px 20px;
	}
}
