.member-portrait-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 16px;
	margin: 16px 0;
	padding: 0;
}

.member-portrait-card {
	position: relative;
	background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
	border-radius: 12px;
	box-shadow: 0 2px 12px rgba(0,0,0,0.06);
	overflow: hidden;
	transition: box-shadow 0.3s ease, transform 0.3s ease;
	display: flex;
	flex-direction: column;
}
.member-portrait-card:hover {
	box-shadow: 0 6px 24px rgba(0,0,0,0.12);
	transform: translateY(-2px);
}

.member-portrait-card.m_vip {
	border: 1px solid rgba(255,193,7,0.35);
}
.member-portrait-card.m_star {
	background: linear-gradient(135deg, #fffbe6 0%, #ffffff 100%);
}
.member-portrait-card.m_admin {
	background: #f6f6f9;
	border: 1px solid rgba(0,0,0,0.06);
}

/* Gold star + VIP */
.member-portrait-card.m_star_gold,
.member-portrait-card.m_vip {
	background: linear-gradient(135deg, #fff8e1 0%, #ffffff 100%);
	border: 1px solid rgba(255, 215, 0, 0.35);
	box-shadow: 0 0 12px rgba(255, 215, 0, 0.15);
}
.member-portrait-card.m_star_gold:hover,
.member-portrait-card.m_vip:hover {
	box-shadow: 0 0 24px rgba(255, 215, 0, 0.35), 0 6px 24px rgba(0,0,0,0.12);
	transform: translateY(-2px);
}

/* Yellow star */
.member-portrait-card.m_star_yellow {
	background: linear-gradient(135deg, #fffde7 0%, #ffffff 100%);
	border: 1px solid rgba(255, 193, 7, 0.25);
	box-shadow: 0 0 10px rgba(255, 193, 7, 0.12);
}
.member-portrait-card.m_star_yellow:hover {
	box-shadow: 0 0 18px rgba(255, 193, 7, 0.3), 0 6px 24px rgba(0,0,0,0.12);
	transform: translateY(-2px);
}

/* Red star (moderation) */
.member-portrait-card.m_star_red {
	background: linear-gradient(135deg, #f3e5f5 0%, #ffffff 100%);
	border: 1px solid rgba(156, 39, 176, 0.2);
	box-shadow: 0 0 12px rgba(156, 39, 176, 0.15);
}
.member-portrait-card.m_star_red:hover {
	box-shadow: 0 0 24px rgba(156, 39, 176, 0.35), 0 6px 24px rgba(0,0,0,0.12);
	transform: translateY(-2px);
}

.member-portrait-photo-wrap {
	position: relative;
	width: 100%;
	aspect-ratio: 3 / 4;
	overflow: hidden;
	background: #1a1a2e;
	border-radius: 12px 12px 0 0;
	display: flex;
	align-items: center;
	justify-content: center;
}

.member-portrait-photo-wrap::before {
	content: '';
	position: absolute;
	top: -10%;
	left: -10%;
	right: -10%;
	bottom: -10%;
	background-image: var(--bg-img);
	background-size: cover;
	background-position: center;
	filter: blur(14px) brightness(0.6);
	z-index: 0;
}

.member-portrait-photo {
	position: relative;
	z-index: 1;
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.member-portrait-placeholder-bg {
	position: absolute;
	inset: 0;
	z-index: 0;
}

.member-portrait-placeholder-svg {
	position: relative;
	z-index: 1;
	display: block;
	width: 70%;
	height: auto;
}

.member-portrait-online {
	position: absolute;
	top: 8px;
	left: 8px;
	z-index: 2;
	line-height: 0;
}
.member-portrait-photo-link {
	position: absolute;
	inset: 0;
	z-index: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	text-decoration: none;
	color: inherit;
}
.member-portrait-photo-link .member-portrait-photo {
	width: 100%;
	height: 100%;
	object-fit: contain;
	display: block;
}

.member-portrait-online img {
	display: block;
	width: auto;
	height: auto;
	max-height: 22px;
}

.member-portrait-status {
	position: absolute;
	bottom: 8px;
	right: 8px;
	z-index: 2;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 2px;
	pointer-events: none;
}
.member-portrait-status img {
	width: auto;
	max-height: 48px;
	filter: drop-shadow(0 1px 2px rgba(0,0,0,0.5));
	display: block;
}

.member-portrait-actions {
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	z-index: 3;
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 6px;
	padding: 8px 10px;
	overflow: hidden;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.25s ease, visibility 0.25s ease;
	pointer-events: auto;
	border-radius: 0 0 12px 12px;
}
.member-portrait-actions::before {
	content: '';
	position: absolute;
	top: -20px;
	left: -10%;
	right: -10%;
	bottom: -10%;
	background-image: var(--bg-img);
	background-size: cover;
	background-position: center bottom;
	filter: blur(12px) brightness(0.5);
	z-index: -1;
}
.member-portrait-actions::after {
	content: '';
	position: absolute;
	inset: 0;
	background: rgba(0,0,0,0.35);
	z-index: -1;
}
.member-portrait-card:hover .member-portrait-actions,
.member-portrait-card.active .member-portrait-actions {
	opacity: 1;
	visibility: visible;
}

.member-portrait-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	padding: 0;
	color: #fff;
	background: var(--c-stihi-grad);
	border: none;
	border-radius: 50%;
	text-decoration: none;
	cursor: pointer;
	box-shadow: 0 2px 8px rgba(0,0,0,0.25);
	transition: transform 0.2s ease, box-shadow 0.2s ease;
	white-space: nowrap;
}
.member-portrait-btn:hover {
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(0,0,0,0.35);
	text-decoration: none;
	color: #fff;
}
.member-portrait-btn:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
}
.member-portrait-btn.secondary {
	background: rgba(255,255,255,0.15);
	border: 1px solid rgba(255,255,255,0.3);
}
.member-portrait-btn.secondary:hover {
	background: rgba(255,255,255,0.25);
}

.action-icon {
	width: 18px;
	height: 18px;
	pointer-events: none;
}

.member-portrait-meta {
	padding: 10px 12px 12px;
	display: flex;
	flex-direction: column;
	gap: 3px;
}
.member-portrait-name {
	font-size: 14px;
	font-weight: 600;
	color: #1a6fc4;
	line-height: 1.25;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.member-portrait-name a {
	color: #1a6fc4;
	text-decoration: none;
}
.member-portrait-name a:hover {
	color: #0d4a8a;
}
.member-portrait-age,
.member-portrait-location {
	font-size: 12px;
	color: #777;
	line-height: 1.3;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.member-portrait-gifts {
	display: flex;
	align-items: center;
	gap: 4px;
	margin-top: 4px;
	min-height: 20px;
}
.member-portrait-gifts img {
	height: 20px;
	width: auto;
	display: block;
}
.member-portrait-admin {
	font-size: 10px;
	color: #aaa;
	margin-top: 2px;
}

.member-portrait-comment {
	overflow: hidden;
	white-space: nowrap;
	position: relative;
	font-size: 11px;
	color: #888;
	margin-top: 2px;
}
.marquee-track {
	display: inline-block;
}
.marquee-track span {
	display: inline-block;
	padding-right: 30em;
}
.marquee-track.animate {
	animation-name: marquee-scroll;
	animation-timing-function: linear;
	animation-iteration-count: infinite;
}
@keyframes marquee-scroll {
	0% { transform: translateX(0); }
	100% { transform: translateX(-50%); }
}

.member-portrait-card.is-birthday .member-portrait-photo-wrap {
	box-shadow: inset 0 0 0 2px #4caf50;
}

@media (max-width: 479px) {
	.member-portrait-grid {
		grid-template-columns: repeat(2, 1fr);
		gap: 10px;
	}
	.member-portrait-card {
		border-radius: 10px;
	}
	.member-portrait-photo-wrap {
		border-radius: 10px 10px 0 0;
	}
	.member-portrait-actions {
		border-radius: 0 0 10px 10px;
	}
	.member-portrait-btn {
		width: 32px;
		height: 32px;
	}
	.member-portrait-meta {
		padding: 8px 10px 10px;
	}
	.member-portrait-name {
		font-size: 13px;
	}
}

@media (min-width: 480px) and (max-width: 767px) {
	.member-portrait-grid {
		grid-template-columns: repeat(3, 1fr);
		gap: 12px;
	}
}

@media (min-width: 768px) and (max-width: 1199px) {
	.member-portrait-grid {
		grid-template-columns: repeat(4, 1fr);
		gap: 16px;
	}
}

@media (min-width: 1200px) and (max-width: 1919px) {
	.member-portrait-grid {
		grid-template-columns: repeat(5, 1fr);
		gap: 16px;
	}
}

@media (min-width: 1920px) {
	.member-portrait-grid {
		grid-template-columns: repeat(6, 1fr);
		gap: 18px;
	}
}
