/* Розыгрыш /sortition — стиль GameX (золото) */

.b16-sort {
	--b16-sort-accent: var(--gx-gold, #f5c518);
	--b16-sort-accent-2: var(--gx-gold-2, #d4a017);
	--b16-sort-panel: var(--gx-card, #15151a);
	--b16-sort-line: var(--gx-border, rgba(255, 255, 255, 0.07));
	padding: 4px 0 28px;
	color: var(--gx-text, #ececf1);
	font-family: "Montserrat", sans-serif;
}

.b16-sort__timer {
	text-align: center;
	margin-bottom: 18px;
	padding: 24px 18px 22px;
	border-radius: var(--gx-radius, 14px);
	background:
		radial-gradient(90% 80% at 50% 0%, rgba(245, 197, 24, 0.1), transparent 55%),
		linear-gradient(180deg, #17171f 0%, #101016 100%);
	border: 1px solid var(--b16-sort-line);
	box-shadow: var(--gx-shadow, 0 10px 30px rgba(0, 0, 0, 0.35));
}

.b16-sort__timer-title {
	margin: 0 0 16px;
	font-size: clamp(18px, 2.4vw, 24px);
	font-weight: 800;
	color: #fff;
	letter-spacing: 0.02em;
}

.b16-sort__timer-grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 120px));
	gap: 10px;
	justify-content: center;
}

.b16-sort__timer-cell {
	padding: 14px 8px;
	border-radius: 12px;
	background: rgba(0, 0, 0, 0.35);
	border: 1px solid rgba(245, 197, 24, 0.18);
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.b16-sort__timer-cell strong {
	display: block;
	font-size: clamp(22px, 4vw, 34px);
	font-weight: 800;
	line-height: 1.1;
	color: var(--b16-sort-accent);
	text-shadow: 0 0 18px rgba(245, 197, 24, 0.25);
}

.b16-sort__timer-cell span {
	display: block;
	margin-top: 4px;
	font-size: 12px;
	color: var(--gx-muted, #8b8b99);
	text-transform: lowercase;
	font-weight: 600;
}

.b16-sort__layout {
	display: grid;
	grid-template-columns: minmax(0, 1.55fr) minmax(260px, 0.9fr);
	gap: 14px;
	align-items: start;
	margin-bottom: 14px;
}

.b16-sort__main,
.b16-sort__side {
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.b16-sort__card {
	padding: 18px 18px 16px;
	border-radius: var(--gx-radius, 14px);
	background: linear-gradient(180deg, #17171f 0%, #121218 100%);
	border: 1px solid var(--b16-sort-line);
	box-shadow: var(--gx-shadow, 0 10px 30px rgba(0, 0, 0, 0.35));
}

.b16-sort__card-title {
	margin: 0 0 14px;
	font-size: 16px;
	font-weight: 800;
	color: #fff;
}

.b16-sort__prizes {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.b16-sort__prize {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 14px 16px;
	border-radius: 12px;
	background: rgba(255, 255, 255, 0.03);
	border: 1px solid rgba(245, 197, 24, 0.16);
	box-shadow: inset 3px 0 0 var(--b16-sort-accent), inset -3px 0 0 rgba(245, 197, 24, 0.2);
}

.b16-sort__prize-icon {
	width: 40px;
	height: 40px;
	border-radius: 10px;
	display: grid;
	place-items: center;
	background: var(--gx-gold-soft, rgba(245, 197, 24, 0.15));
	color: var(--b16-sort-accent);
	font-size: 18px;
	flex-shrink: 0;
	border: 1px solid rgba(245, 197, 24, 0.22);
}

.b16-sort__prize-title {
	font-size: 14px;
	font-weight: 700;
	line-height: 1.35;
	text-align: left;
	color: #fff;
}

.b16-sort__prize--btn {
	width: 100%;
	cursor: pointer;
	color: inherit;
	font: inherit;
	appearance: none;
	-webkit-appearance: none;
	transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.b16-sort__prize--btn:hover:not(:disabled) {
	background: rgba(245, 197, 24, 0.1);
	border-color: rgba(245, 197, 24, 0.4);
	transform: translateY(-1px);
}

.b16-sort__prize--btn:disabled {
	opacity: 0.55;
	cursor: default;
}

.b16-sort__card--win {
	border-color: rgba(245, 197, 24, 0.35);
	box-shadow: 0 0 0 1px rgba(245, 197, 24, 0.12), var(--gx-shadow, 0 10px 30px rgba(0, 0, 0, 0.35));
	background:
		radial-gradient(90% 100% at 50% 0%, rgba(245, 197, 24, 0.12), transparent 55%),
		linear-gradient(180deg, #17171f 0%, #121218 100%);
}

.b16-sort__prizes--pick {
	max-height: 360px;
	overflow: auto;
	padding-right: 4px;
}

.b16-sort__steps,
.b16-sort__rules {
	margin: 0 0 16px;
	padding-left: 1.25em;
	color: rgba(236, 236, 241, 0.78);
	font-size: 14px;
	line-height: 1.55;
}

.b16-sort__steps li + li,
.b16-sort__rules li + li {
	margin-top: 8px;
}

.b16-sort__steps a,
.b16-sort__rules a {
	color: var(--b16-sort-accent);
	font-weight: 700;
	text-decoration: none;
}

.b16-sort__steps a:hover,
.b16-sort__rules a:hover {
	text-decoration: underline;
	color: #ffe08a;
}

.b16-sort__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 48px;
	padding: 0 18px;
	border: 0;
	border-radius: 12px;
	background: linear-gradient(135deg, var(--b16-sort-accent), var(--b16-sort-accent-2));
	color: #111;
	font-size: 14px;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	text-decoration: none;
	cursor: pointer;
	transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
	box-shadow: 0 10px 24px rgba(245, 197, 24, 0.22);
}

.b16-sort__btn:hover:not(:disabled):not(.is-done) {
	transform: translateY(-1px);
	filter: brightness(1.06);
	color: #111;
	text-decoration: none;
}

.b16-sort__btn:disabled,
.b16-sort__btn.is-done {
	opacity: 0.9;
	cursor: default;
	background: rgba(255, 255, 255, 0.08);
	color: rgba(255, 255, 255, 0.72);
	box-shadow: none;
}

.b16-sort__join-msg {
	margin: 10px 0 0;
	font-size: 13px;
	font-weight: 600;
}

.b16-sort__join-msg.is-ok { color: #86efac; }
.b16-sort__join-msg.is-err { color: #fca5a5; }

.b16-sort__people {
	max-height: 280px;
	overflow: auto;
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding-right: 4px;
}

.b16-sort__person {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px 10px;
	border-radius: 10px;
	background: rgba(255, 255, 255, 0.03);
	border: 1px solid transparent;
	text-decoration: none;
	color: #fff;
	transition: background 0.15s ease, border-color 0.15s ease;
}

.b16-sort__person:hover {
	background: rgba(245, 197, 24, 0.08);
	border-color: rgba(245, 197, 24, 0.18);
	text-decoration: none;
	color: #fff;
}

.b16-sort__person .avatar-frame-wrap {
	position: relative !important;
	display: block !important;
	width: 32px !important;
	height: 32px !important;
	min-width: 32px !important;
	max-width: 32px !important;
	flex: 0 0 32px !important;
	overflow: visible !important;
	line-height: 0 !important;
}

.b16-sort__person .avatar-frame-wrap > img:first-child:not(.avatar_frame_overlay) {
	display: block !important;
	width: 32px !important;
	height: 32px !important;
	border-radius: 50% !important;
	object-fit: cover !important;
}

.b16-sort__person .avatar-frame-wrap > .avatar_frame_overlay,
.b16-sort__person .avatar-frame-wrap img.avatar_frame_overlay {
	position: absolute !important;
	left: 50% !important;
	top: 50% !important;
	right: auto !important;
	bottom: auto !important;
	transform: translate(-50%, -50%) !important;
	width: 46px !important;
	height: 46px !important;
	max-width: none !important;
	border-radius: 0 !important;
	object-fit: contain !important;
	pointer-events: none !important;
	z-index: 3 !important;
	margin: 0 !important;
}

.b16-sort__person-name {
	flex: 1 1 auto;
	min-width: 0;
	font-size: 13px;
	font-weight: 700;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.b16-sort__avatar {
	width: 32px;
	height: 32px;
	border-radius: 50%;
	object-fit: cover;
	flex: 0 0 32px;
	border: 1px solid rgba(245, 197, 24, 0.25);
}

.b16-sort__person em {
	font-style: normal;
	font-size: 12px;
	color: var(--gx-muted, #8b8b99);
	flex-shrink: 0;
	font-weight: 700;
}

.b16-sort__empty {
	margin: 0;
	font-size: 13px;
	color: var(--gx-muted, #8b8b99);
}

.b16-sort__card--info {
	margin-top: 0;
}

@media (max-width: 992px) {
	.b16-sort__layout {
		grid-template-columns: 1fr;
	}

	.b16-sort__timer-grid {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
}

@media (max-width: 520px) {
	.b16-sort__timer-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}
