/* =============================================================================
   Global Chat Widget — WeAreInvictus210
   ============================================================================= */

/* ── Floating bubble (redesigned — gaming style) ──────────────────────────── */
.inv-chat-bubble {
	position: fixed;
	bottom: 24px;
	right: 24px;
	width: 56px;
	height: 56px;
	background: linear-gradient(135deg, #f59e0b, #d97706);
	border: none;
	border-radius: 50%;
	cursor: pointer;
	z-index: 9999;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #000;
	transition: transform 0.15s ease, box-shadow 0.15s ease;
	animation: invBubbleBreathe 3s ease-in-out infinite;
	flex-direction: column;
	gap: 0;
	padding: 0;
	overflow: visible;
}

@keyframes invBubbleBreathe {
	0%, 100% { box-shadow: 0 4px 20px rgba(245, 158, 11, 0.35); }
	50%      { box-shadow: 0 4px 30px rgba(245, 158, 11, 0.55), 0 0 12px rgba(245, 158, 11, 0.2); }
}

.inv-chat-bubble:hover {
	transform: scale(1.08);
	animation: none;
	box-shadow: 0 6px 28px rgba(245, 158, 11, 0.5);
}

/* Pulse ring */
.inv-chat-bubble__pulse {
	position: absolute;
	inset: -4px;
	border-radius: 50%;
	border: 2px solid rgba(245, 158, 11, 0.4);
	animation: invBubblePulse 2.5s ease-out infinite;
	pointer-events: none;
}

@keyframes invBubblePulse {
	0%   { transform: scale(1); opacity: 0.6; }
	100% { transform: scale(1.5); opacity: 0; }
}

/* Icon container */
.inv-chat-bubble__icon {
	display: flex;
	align-items: center;
	justify-content: center;
	margin-top: 2px;
}

/* LIVE label */
.inv-chat-bubble__live {
	font-family: 'Rajdhani', sans-serif;
	font-size: 0.5rem;
	font-weight: 800;
	letter-spacing: 0.12em;
	color: #000;
	line-height: 1;
	margin-top: -2px;
}

/* Unread badge */
.inv-chat-bubble__badge {
	position: absolute;
	top: -4px;
	right: -4px;
	min-width: 20px;
	height: 20px;
	padding: 0 5px;
	background: #ef4444;
	color: #fff;
	font-size: 0.68rem;
	font-weight: 700;
	border-radius: 10px;
	display: flex;
	align-items: center;
	justify-content: center;
	border: 2px solid #080d1a;
	line-height: 1;
	z-index: 3;
}

/* Mention pulse animation on bubble */
.inv-chat-bubble--mention {
	animation: invBubbleMention 0.6s ease-in-out 3;
}

@keyframes invBubbleMention {
	0%, 100% { transform: scale(1); }
	25%      { transform: scale(1.15); }
	50%      { transform: scale(0.95); }
	75%      { transform: scale(1.1); }
}

/* ── Widget card ───────────────────────────────────────────────────────────── */
.inv-chat-widget {
	position: fixed;
	top: calc(var(--inv-header-h, 64px) + 8px);
	bottom: 80px;
	right: 16px;
	width: calc(100vw - 32px);
	background: #111827;
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: 16px;
	z-index: 9998;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
	animation: invChatIn 0.2s ease;
}

@keyframes invChatIn {
	from { opacity: 0; transform: translateY(12px) scale(0.96); }
	to   { opacity: 1; transform: translateY(0) scale(1); }
}

@media (min-width: 641px) {
	.inv-chat-widget {
		width: 360px;
		top: auto;
		height: 500px;
		right: 24px;
		bottom: 88px;
	}
}

/* ── Header — two-row layout via flex-wrap ──────────────────────────────── */
.inv-chat-widget__header {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	padding: 0;
	border-bottom: 1px solid rgba(255, 255, 255, 0.06);
	flex-shrink: 0;
}

/* Row 2: online counts pushed left, controls pushed right */
.inv-chat-online {
	margin-left: 10px;
}
.inv-chat-widget__fullscreen {
	margin-left: auto;
	margin-right: 2px;
}
.inv-chat-widget__close {
	margin-right: 6px;
}

.inv-chat-widget__title {
	font-family: 'Rajdhani', sans-serif;
	font-size: 0.9rem;
	font-weight: 700;
	color: #f59e0b;
	text-transform: uppercase;
	letter-spacing: 0.06em;
}

.inv-chat-widget__fullscreen {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	background: none;
	border: none;
	color: rgba(255, 255, 255, 0.3);
	cursor: pointer;
	border-radius: 6px;
	transition: color 0.15s, background 0.15s;
	margin-left: auto;
}
.inv-chat-widget__fullscreen:hover {
	color: #fff;
	background: rgba(255, 255, 255, 0.06);
}

.inv-chat-widget__close {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	background: none;
	border: none;
	color: rgba(255, 255, 255, 0.4);
	cursor: pointer;
	border-radius: 6px;
	transition: color 0.15s, background 0.15s;
}

.inv-chat-widget__close:hover {
	color: #fff;
	background: rgba(255, 255, 255, 0.06);
}

/* ── Resize handles (desktop only) ──────────────────────────────────────── */
.inv-chat-resize {
	position: absolute;
	z-index: 2;
	display: none;
}
@media (min-width: 641px) {
	.inv-chat-resize { display: block; }
}
.inv-chat-resize--top {
	top: -3px;
	left: 12px;
	right: 12px;
	height: 6px;
	cursor: ns-resize;
}
.inv-chat-resize--left {
	top: 12px;
	left: -3px;
	bottom: 12px;
	width: 6px;
	cursor: ew-resize;
}
.inv-chat-resize--top-left {
	top: -4px;
	left: -4px;
	width: 14px;
	height: 14px;
	cursor: nwse-resize;
	border-radius: 4px;
}
.inv-chat-resize:hover {
	background: rgba(244, 114, 182, 0.15);
	border-radius: 3px;
}
.inv-chat-widget--fullscreen .inv-chat-resize { display: none !important; }

/* ── Fullscreen mode ────────────────────────────────────────────────────── */
.inv-chat-widget--fullscreen {
	top: 0 !important;
	left: 0 !important;
	right: 0 !important;
	bottom: 0 !important;
	width: 100% !important;
	height: 100% !important;
	max-height: none !important;
	border-radius: 0 !important;
	z-index: 99999 !important;
	animation: none !important;
}
.inv-chat-widget--fullscreen .inv-chat-fs-expand { display: none !important; }
.inv-chat-widget--fullscreen .inv-chat-fs-collapse { display: block !important; }
.inv-chat-widget--fullscreen .inv-chat-widget__header {
	padding: 14px 18px;
}
.inv-chat-widget--fullscreen .inv-chat-widget__title {
	font-size: 1.05rem;
}
.inv-chat-widget--fullscreen .inv-chat-msg__text {
	font-size: 0.85rem;
}
.inv-chat-widget--fullscreen .inv-chat-input {
	font-size: 0.9rem;
	padding: 12px 14px;
}

/* ── Messages area ─────────────────────────────────────────────────────────── */
.inv-chat-widget__messages {
	flex: 1;
	overflow-y: auto;
	padding: 10px 12px;
	display: flex;
	flex-direction: column;
	gap: 6px;
	-webkit-user-select: none;
	user-select: none;
	-webkit-touch-callout: none;
}

.inv-chat-empty {
	text-align: center;
	padding: 40px 14px;
	font-size: 0.78rem;
	color: #6b7494;
	margin: auto 0;
}

/* ── Single message ────────────────────────────────────────────────────────── */
.inv-chat-msg {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	padding: 6px 8px;
	border-radius: 8px;
	transition: background 0.12s;
	position: relative;
}

.inv-chat-msg:hover {
	background: rgba(255, 255, 255, 0.03);
}

/* ── Avatar with frame support ─────────────────────────────────────────────── */
.inv-chat-msg__avatar {
	position: relative;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: linear-gradient(135deg, #1a2540, #0d1424);
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 0.7rem;
	color: #6b7494;
	overflow: visible;
	position: relative;
}

.inv-chat-msg__avatar-photo {
	width: 76%;
	height: 76%;
	object-fit: cover;
	border-radius: 50%;
	position: absolute;
	top: 12%;
	left: 12%;
	z-index: 1;
}

.inv-chat-msg__avatar-frame {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	z-index: 2;
	pointer-events: none;
	object-fit: contain;
}

.inv-chat-msg__avatar-fallback {
	font-size: 0.7rem;
	color: #6b7494;
}

/* Fallback when no frame — show photo full size */
.inv-chat-msg__avatar-photo:only-child {
	width: 100%;
	height: 100%;
	top: 0;
	left: 0;
}

.inv-chat-msg__member-diamond {
	position: absolute;
	bottom: -2px;
	right: -2px;
	font-size: 0.55rem;
	z-index: 3;
	line-height: 1;
	filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.7));
	pointer-events: none;
}

.inv-chat-msg__body {
	min-width: 0;
	flex: 1;
}

.inv-chat-msg__meta {
	display: flex;
	align-items: center;
	gap: 6px;
	margin-bottom: 1px;
}

/* ── Username with profile link ────────────────────────────────────────────── */
.inv-chat-msg__name {
	font-size: 0.72rem;
	font-weight: 600;
	color: #e2e8f0;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: 120px;
}

.inv-chat-msg__badges {
	display: inline-flex;
	align-items: center;
	gap: 2px;
	margin-left: 3px;
	vertical-align: middle;
}

.inv-chat-msg__badge-icon {
	width: 14px;
	height: 14px;
	object-fit: contain;
	border-radius: 2px;
	flex-shrink: 0;
}

.inv-chat-msg__badge-emoji {
	font-size: 0.7rem;
	line-height: 1;
}

.inv-chat-msg__name-link {
	color: inherit;
	text-decoration: none;
	transition: color 0.12s;
}

.inv-chat-msg__name-link:hover {
	color: #f59e0b;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.inv-chat-msg__level {
	font-size: 0.58rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	padding: 1px 4px;
	border-radius: 3px;
	line-height: 1.3;
}

.inv-chat-msg__level--scout     { background: rgba(156, 163, 175, 0.15); color: #9ca3af; }
.inv-chat-msg__level--commander { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.inv-chat-msg__level--warlord   { background: rgba(239, 68, 68, 0.15); color: #ef4444; }

/* Subscriber username colors — Commander=amber, Warlord=red */
.inv-chat-name--commander       { color: #f59e0b !important; }
.inv-chat-name--commander:hover { color: #fbbf24 !important; }
.inv-chat-name--warlord         { color: #ef4444 !important; }
.inv-chat-name--warlord:hover   { color: #fca5a5 !important; }

/* ── Role badges (admin / mod) ─────────────────────────────────────────── */
.inv-chat-msg__role {
	font-size: 0.58rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	padding: 1px 5px;
	border-radius: 3px;
	line-height: 1.3;
}

.inv-chat-msg__role--admin { background: rgba(245, 158, 11, 0.2); color: #f59e0b; }
.inv-chat-msg__role--mod   { background: rgba(59, 130, 246, 0.2); color: #3b82f6; }

.inv-chat-msg__time {
	font-size: 0.6rem;
	color: #4b5563;
	margin-left: auto;
	white-space: nowrap;
}

.inv-chat-msg__text {
	font-size: 0.78rem;
	color: #c8cce8;
	line-height: 1.4;
	word-break: break-word;
}

/* Allow text selection only on devices with a mouse (desktop) */
@media (hover: hover) and (pointer: fine) {
	.inv-chat-msg__text {
		-webkit-user-select: text;
		user-select: text;
	}
}

/* ── Chat links ────────────────────────────────────────────────────────────── */
.inv-chat-link {
	color: #93c5fd;
	text-decoration: underline;
	text-underline-offset: 2px;
	word-break: break-all;
}

.inv-chat-link:hover {
	color: #60a5fa;
}

/* ── @Mention highlights ───────────────────────────────────────────────────── */
.inv-chat-mention {
	color: #f59e0b;
	font-weight: 600;
}

.inv-chat-mention--self {
	background: rgba(245, 158, 11, 0.15);
	padding: 1px 3px;
	border-radius: 3px;
}

/* ── Mention / Reply message highlight ────────────────────────────────────── */
.inv-chat-msg--highlight {
	border-left: 3px solid #f59e0b;
	background: rgba(245, 158, 11, 0.06);
	animation: invMsgHighlight 1s ease-out;
}

@keyframes invMsgHighlight {
	0%   { background: rgba(245, 158, 11, 0.18); }
	100% { background: rgba(245, 158, 11, 0.06); }
}

/* ── Typing indicator ─────────────────────────────────────────────────────── */
.inv-chat-typing {
	padding: 4px 14px;
	font-size: 0.72rem;
	color: rgba(255, 255, 255, 0.45);
	font-style: italic;
	animation: invTypingPulse 1.5s ease-in-out infinite;
}

@keyframes invTypingPulse {
	0%, 100% { opacity: 0.45; }
	50%      { opacity: 0.8; }
}

/* ── Emoji picker ─────────────────────────────────────────────────────────── */
.inv-chat-emoji-btn {
	width: 36px;
	height: 36px;
	background: transparent;
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: 8px;
	color: #9ca3af;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	transition: color 0.15s, border-color 0.15s;
}

.inv-chat-emoji-btn:hover {
	color: #f59e0b;
	border-color: rgba(245, 158, 11, 0.3);
}

.inv-chat-emoji-panel {
	position: absolute;
	bottom: 100%;
	right: 0;
	width: 240px;
	background: #1a2234;
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: 10px;
	box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.5);
	z-index: 10003;
	overflow: hidden;
	margin-bottom: 6px;
}

.inv-chat-emoji-tabs {
	display: flex;
	gap: 2px;
	padding: 6px 6px 4px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.inv-chat-emoji-tab {
	flex: 1;
	background: transparent;
	border: none;
	font-size: 1rem;
	padding: 4px;
	border-radius: 6px;
	cursor: pointer;
	opacity: 0.5;
	transition: opacity 0.15s, background 0.15s;
}

.inv-chat-emoji-tab:hover {
	opacity: 0.8;
	background: rgba(255, 255, 255, 0.05);
}

.inv-chat-emoji-tab--active {
	opacity: 1;
	background: rgba(245, 158, 11, 0.15);
}

.inv-chat-emoji-grid {
	display: grid;
	grid-template-columns: repeat(6, 1fr);
	gap: 2px;
	padding: 6px;
}

.inv-chat-emoji-item {
	background: transparent;
	border: none;
	font-size: 1.2rem;
	padding: 6px;
	border-radius: 6px;
	cursor: pointer;
	transition: background 0.12s, transform 0.12s;
	line-height: 1;
}

.inv-chat-emoji-item:hover {
	background: rgba(255, 255, 255, 0.08);
	transform: scale(1.15);
}

/* ── Reactions ────────────────────────────────────────────────────────────── */
.inv-chat-msg__react-btn {
	background: transparent;
	border: none;
	color: rgba(255, 255, 255, 0.2);
	font-size: 0.75rem;
	font-weight: 700;
	cursor: pointer;
	padding: 0 4px;
	line-height: 1;
	opacity: 0;
	transition: opacity 0.15s, color 0.15s;
}

.inv-chat-msg:hover .inv-chat-msg__react-btn {
	opacity: 1;
}

.inv-chat-msg__react-btn:hover {
	color: #f59e0b;
}

.inv-chat-reactions {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	margin-top: 4px;
}

.inv-chat-reaction {
	display: inline-flex;
	align-items: center;
	gap: 3px;
	padding: 2px 6px;
	background: rgba(255, 255, 255, 0.05);
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: 12px;
	font-size: 0.75rem;
	cursor: pointer;
	transition: background 0.12s, border-color 0.12s;
	color: #e2e8f0;
	line-height: 1.4;
}

.inv-chat-reaction:hover {
	background: rgba(255, 255, 255, 0.1);
	border-color: rgba(255, 255, 255, 0.15);
}

.inv-chat-reaction--active {
	background: rgba(245, 158, 11, 0.12);
	border-color: rgba(245, 158, 11, 0.35);
}

.inv-chat-reaction__count {
	font-size: 0.65rem;
	color: rgba(255, 255, 255, 0.5);
	font-weight: 600;
}

/* ── React picker popup ───────────────────────────────────────────────────── */
.inv-chat-react-picker {
	position: absolute;
	top: -6px;
	right: 4px;
	display: flex;
	gap: 2px;
	padding: 4px 6px;
	background: #1a2234;
	border: 1px solid rgba(255, 255, 255, 0.12);
	border-radius: 20px;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
	z-index: 10004;
	transform: translateY(-100%);
}

.inv-chat-react-picker__item {
	background: transparent;
	border: none;
	font-size: 1rem;
	padding: 3px;
	border-radius: 6px;
	cursor: pointer;
	transition: transform 0.1s, background 0.1s;
	line-height: 1;
}

.inv-chat-react-picker__item:hover {
	background: rgba(255, 255, 255, 0.1);
	transform: scale(1.25);
}

/* ── Pet badge in messages (mini avatar) ───────────────────────────────────── */
.inv-chat-msg__pet {
	width: 16px;
	height: 16px;
	border-radius: 3px;
	object-fit: contain;
	margin-left: 3px;
	vertical-align: middle;
	opacity: 0.85;
}

.inv-chat-msg__pet--elder {
	opacity: 1;
	filter: drop-shadow(0 0 3px rgba(245, 158, 11, 0.6));
}

.inv-chat-msg__pet--inactive {
	opacity: 0.25;
	filter: grayscale(1);
}

/* ── Pet tip (from /pet command) ──────────────────────────────────────────── */
.inv-chat-pet-tip {
	margin-top: 4px;
	padding: 6px 10px;
	background: rgba(245, 158, 11, 0.06);
	border-left: 2px solid rgba(245, 158, 11, 0.5);
	border-radius: 0 6px 6px 0;
	font-size: 0.75rem;
	color: #d1d5db;
	display: flex;
	align-items: center;
	gap: 6px;
	line-height: 1.4;
}

.inv-chat-pet-tip__icon {
	width: 20px;
	height: 20px;
	border-radius: 4px;
	object-fit: contain;
	flex-shrink: 0;
}

.inv-chat-pet-tip__name {
	color: #f59e0b;
	font-weight: 600;
	white-space: nowrap;
}

.inv-chat-pet-tip__text {
	font-style: italic;
}

/* ── Autonomous pet messages ──────────────────────────────────────────────── */
.inv-chat-msg--pet {
	background: rgba(245, 158, 11, 0.04);
	border-left: 2px solid rgba(245, 158, 11, 0.3);
	padding-left: 6px;
}

.inv-chat-msg--pet .inv-chat-msg__avatar-photo {
	border-radius: 6px;
	object-fit: contain;
	background: rgba(0, 0, 0, 0.2);
}

.inv-chat-msg__pet-name {
	color: #f59e0b;
	font-weight: 600;
}

.inv-chat-msg__pet-owner {
	font-size: 0.6rem;
	color: rgba(255, 255, 255, 0.3);
	margin-left: 4px;
	font-style: italic;
}

.inv-chat-msg__pet-mood {
	font-size: 0.7rem;
}

/* Pet mood-based border colors */
.inv-chat-msg--pet-ecstatic { border-left-color: #f59e0b; background: rgba(245, 158, 11, 0.06); }
.inv-chat-msg--pet-happy    { border-left-color: #22c55e; background: rgba(34, 197, 94, 0.04); }
.inv-chat-msg--pet-content  { border-left-color: #6b7280; background: rgba(107, 114, 128, 0.04); }
.inv-chat-msg--pet-hungry   { border-left-color: #ef4444; background: rgba(239, 68, 68, 0.04); }
.inv-chat-msg--pet-sad      { border-left-color: #3b82f6; background: rgba(59, 130, 246, 0.04); }
.inv-chat-msg--pet-sick     { border-left-color: #8b5cf6; background: rgba(139, 92, 246, 0.04); }
.inv-chat-msg--pet-hibernating { border-left-color: #374151; background: rgba(55, 65, 81, 0.04); opacity: 0.6; }

/* ── Online indicator ─────────────────────────────────────────────────────── */
.inv-chat-online {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	font-size: 0.62rem;
	color: rgba(255, 255, 255, 0.28);
	font-family: 'Inter', sans-serif;
}

.inv-chat-online__dot {
	width: 6px;
	height: 6px;
	background: #22c55e;
	border-radius: 50%;
	flex-shrink: 0;
	animation: invOnlinePulse 2s ease-in-out infinite;
}

@keyframes invOnlinePulse {
	0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4); }
	50%      { box-shadow: 0 0 0 3px rgba(34, 197, 94, 0); }
}

.inv-chat-online__count {
	font-weight: 600;
}

.inv-chat-online__count::after {
	content: ' online';
	font-weight: 400;
}

.inv-chat-pets-online {
	display: inline-flex;
	align-items: center;
	gap: 3px;
	font-size: 0.62rem;
	color: rgba(245, 158, 11, 0.35);
	font-family: 'Inter', sans-serif;
}

.inv-chat-pets-online__icon {
	font-size: 0.7rem;
	line-height: 1;
}

.inv-chat-pets-online__count {
	font-weight: 600;
}

.inv-chat-pets-online__count::after {
	content: ' pets';
	font-weight: 400;
}

/* ── @Mention autocomplete dropdown ────────────────────────────────────────── */
.inv-chat-mention-list {
	position: absolute;
	bottom: 100%;
	left: 0;
	right: 0;
	background: #1a2234;
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: 10px;
	padding: 4px;
	box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.5);
	z-index: 10002;
	max-height: 180px;
	overflow-y: auto;
	margin-bottom: 4px;
}

.inv-chat-mention-item {
	display: flex;
	align-items: center;
	gap: 8px;
	width: 100%;
	padding: 6px 10px;
	background: none;
	border: none;
	color: #c8cce8;
	font-size: 0.78rem;
	cursor: pointer;
	border-radius: 6px;
	transition: background 0.1s;
	text-align: left;
}

.inv-chat-mention-item:hover {
	background: rgba(255, 255, 255, 0.06);
	color: #fff;
}

.inv-chat-mention-item__avatar {
	width: 22px;
	height: 22px;
	border-radius: 50%;
	object-fit: cover;
	flex-shrink: 0;
}

.inv-chat-mention-item__avatar--fallback {
	display: flex;
	align-items: center;
	justify-content: center;
	background: linear-gradient(135deg, #1a2540, #0d1424);
	font-size: 0.6rem;
	color: #6b7494;
}

.inv-chat-mention-item__name {
	font-weight: 500;
}

/* ── /Command palette ──────────────────────────────────────────────────────── */
.inv-chat-cmd-palette {
	position: absolute;
	bottom: 100%;
	left: 0;
	right: 0;
	background: #1a2234;
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: 10px;
	padding: 4px;
	box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.5);
	z-index: 10002;
	margin-bottom: 4px;
}

.inv-chat-cmd-palette__item {
	display: flex;
	align-items: center;
	gap: 8px;
	width: 100%;
	padding: 8px 10px;
	background: none;
	border: none;
	color: #c8cce8;
	font-size: 0.78rem;
	cursor: pointer;
	border-radius: 6px;
	transition: background 0.1s;
	text-align: left;
}

.inv-chat-cmd-palette__item:hover {
	background: rgba(255, 255, 255, 0.06);
	color: #fff;
}

.inv-chat-cmd-palette__icon {
	font-size: 0.9rem;
	flex-shrink: 0;
}

.inv-chat-cmd-palette__label {
	font-weight: 700;
	color: #f59e0b;
	font-family: 'Rajdhani', sans-serif;
}

.inv-chat-cmd-palette__desc {
	color: #6b7494;
	font-size: 0.7rem;
	margin-left: auto;
}

/* ── Lineup card embed in chat ─────────────────────────────────────────────── */
.inv-chat-lineup {
	margin-top: 3px;
	border-radius: 6px;
	overflow: hidden;
	border: 1px solid rgba(255, 255, 255, 0.08);
	background: #0d1424;
}

.inv-chat-lineup__inner {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 5px 8px;
	text-decoration: none;
	color: inherit;
	transition: background 0.12s;
}

.inv-chat-lineup__inner:hover {
	background: rgba(255, 255, 255, 0.04);
}

.inv-chat-lineup__portraits {
	display: flex;
	align-items: center;
	flex-shrink: 0;
}

.inv-chat-lineup__portrait {
	width: 22px;
	height: 22px;
	border-radius: 4px;
	overflow: hidden;
	background: #1a2235;
	border: 1.5px solid #0d1424;
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #2d3a52;
	font-size: 0.6rem;
}

.inv-chat-lineup__portrait img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.inv-chat-lineup__info {
	min-width: 0;
	flex: 1;
}

.inv-chat-lineup__title {
	font-size: 0.65rem;
	font-weight: 600;
	color: #e2e8f0;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.inv-chat-lineup__footer {
	display: flex;
	align-items: center;
	gap: 5px;
	margin-top: 1px;
}

.inv-chat-lineup__tier {
	font-size: 0.5rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	padding: 0 4px;
	border-radius: 3px;
	color: #fff;
	line-height: 1.4;
}

.inv-chat-lineup__view {
	font-size: 0.58rem;
	color: #f59e0b;
	font-weight: 500;
	margin-left: auto;
}

.inv-chat-lineup__loading,
.inv-chat-lineup__error {
	padding: 8px;
	text-align: center;
	font-size: 0.65rem;
	color: #6b7494;
}

/* ── Lineup search overlay ─────────────────────────────────────────────────── */
.inv-chat-lineup-search {
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	background: #111827;
	border-top: 1px solid rgba(255, 255, 255, 0.06);
	z-index: 10003;
	display: flex;
	flex-direction: column;
	max-height: 260px;
}

.inv-chat-lineup-search__header {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 10px 12px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.06);
	flex-shrink: 0;
}

.inv-chat-lineup-search__input {
	flex: 1;
	height: 32px;
	padding: 0 10px;
	background: #0d1529;
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: 6px;
	color: #e2e8f0;
	font-size: 0.78rem;
	font-family: 'Inter', sans-serif;
	outline: none;
}

.inv-chat-lineup-search__input:focus {
	border-color: rgba(245, 158, 11, 0.4);
}

.inv-chat-lineup-search__close {
	width: 28px;
	height: 28px;
	background: none;
	border: none;
	color: rgba(255, 255, 255, 0.4);
	font-size: 1.2rem;
	cursor: pointer;
	border-radius: 6px;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: color 0.12s;
}

.inv-chat-lineup-search__close:hover {
	color: #fff;
}

.inv-chat-lineup-search__results {
	overflow-y: auto;
	flex: 1;
	padding: 4px;
}

.inv-chat-lineup-search__item {
	display: flex;
	align-items: center;
	gap: 10px;
	width: 100%;
	padding: 8px 10px;
	background: none;
	border: none;
	color: #c8cce8;
	font-size: 0.78rem;
	cursor: pointer;
	border-radius: 6px;
	transition: background 0.1s;
	text-align: left;
}

.inv-chat-lineup-search__item:hover {
	background: rgba(255, 255, 255, 0.06);
}

.inv-chat-lineup-search__portraits {
	display: flex;
	align-items: center;
	flex-shrink: 0;
}

.inv-chat-lineup-search__portrait {
	width: 24px;
	height: 24px;
	border-radius: 4px;
	overflow: hidden;
	background: #1a2235;
	border: 1px solid #0d1424;
	position: relative;
}

.inv-chat-lineup-search__portrait img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.inv-chat-lineup-search__info {
	display: flex;
	align-items: center;
	gap: 6px;
	min-width: 0;
	flex: 1;
}

.inv-chat-lineup-search__title {
	font-weight: 500;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.inv-chat-lineup-search__tier {
	font-size: 0.55rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	padding: 1px 5px;
	border-radius: 3px;
	color: #fff;
	line-height: 1.4;
	flex-shrink: 0;
}

.inv-chat-lineup-search__empty {
	padding: 20px 12px;
	text-align: center;
	font-size: 0.75rem;
	color: #6b7494;
}

/* ── Hero card embed ──────────────────────────────────────────────────────── */
.inv-chat-hero {
	margin-top: 3px;
	border-radius: 6px;
	overflow: hidden;
	border: 1px solid rgba(255, 255, 255, 0.08);
	background: #0d1424;
}

.inv-chat-hero__inner {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 5px 8px;
	text-decoration: none;
	color: inherit;
	transition: background 0.12s;
}

.inv-chat-hero__inner:hover {
	background: rgba(255, 255, 255, 0.04);
}

.inv-chat-hero__thumb {
	width: 28px;
	height: 28px;
	border-radius: 4px;
	overflow: hidden;
	background: #1a2235;
	border: 1.5px solid #0d1424;
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #2d3a52;
	font-size: 0.7rem;
}

.inv-chat-hero__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.inv-chat-hero__info {
	min-width: 0;
	flex: 1;
}

.inv-chat-hero__title {
	font-size: 0.65rem;
	font-weight: 600;
	color: #e2e8f0;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.inv-chat-hero__footer {
	display: flex;
	align-items: center;
	gap: 5px;
	margin-top: 1px;
}

.inv-chat-hero__tier {
	font-size: 0.5rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	padding: 0 4px;
	border-radius: 3px;
	color: #fff;
	line-height: 1.4;
}

.inv-chat-hero__rating {
	display: flex;
	gap: 1px;
}

.inv-chat-hero__star {
	font-size: 0.5rem;
	color: #2d3a52;
}

.inv-chat-hero__star.filled {
	color: #f59e0b;
}

.inv-chat-hero__view {
	font-size: 0.58rem;
	color: #f59e0b;
	font-weight: 500;
	margin-left: auto;
}

.inv-chat-hero__loading,
.inv-chat-hero__error {
	padding: 8px;
	text-align: center;
	font-size: 0.65rem;
	color: #6b7494;
}

/* ── Hero search overlay ──────────────────────────────────────────────────── */
.inv-chat-hero-search {
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	background: #111827;
	border-top: 1px solid rgba(255, 255, 255, 0.06);
	z-index: 10003;
	display: flex;
	flex-direction: column;
	max-height: 260px;
}

.inv-chat-hero-search__header {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 10px 12px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.06);
	flex-shrink: 0;
}

.inv-chat-hero-search__input {
	flex: 1;
	height: 32px;
	padding: 0 10px;
	background: #0d1529;
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: 6px;
	color: #e2e8f0;
	font-size: 0.78rem;
	font-family: 'Inter', sans-serif;
	outline: none;
}

.inv-chat-hero-search__input:focus {
	border-color: rgba(245, 158, 11, 0.4);
}

.inv-chat-hero-search__close {
	width: 28px;
	height: 28px;
	background: none;
	border: none;
	color: rgba(255, 255, 255, 0.4);
	font-size: 1.2rem;
	cursor: pointer;
	border-radius: 6px;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: color 0.12s;
}

.inv-chat-hero-search__close:hover {
	color: #fff;
}

.inv-chat-hero-search__results {
	overflow-y: auto;
	flex: 1;
	padding: 4px;
}

.inv-chat-hero-search__item {
	display: flex;
	align-items: center;
	gap: 10px;
	width: 100%;
	padding: 8px 10px;
	background: none;
	border: none;
	color: #c8cce8;
	font-size: 0.78rem;
	cursor: pointer;
	border-radius: 6px;
	transition: background 0.1s;
	text-align: left;
}

.inv-chat-hero-search__item:hover {
	background: rgba(255, 255, 255, 0.06);
}

.inv-chat-hero-search__thumb {
	width: 28px;
	height: 28px;
	border-radius: 4px;
	overflow: hidden;
	background: #1a2235;
	border: 1px solid #0d1424;
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #2d3a52;
	font-size: 0.55rem;
}

.inv-chat-hero-search__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.inv-chat-hero-search__info {
	display: flex;
	align-items: center;
	gap: 6px;
	min-width: 0;
	flex: 1;
}

.inv-chat-hero-search__title {
	font-weight: 500;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.inv-chat-hero-search__tier {
	font-size: 0.55rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	padding: 1px 5px;
	border-radius: 3px;
	color: #fff;
	line-height: 1.4;
	flex-shrink: 0;
}

.inv-chat-hero-search__empty {
	padding: 20px 12px;
	text-align: center;
	font-size: 0.75rem;
	color: #6b7494;
}

/* ── Ring card ─────────────────────────────────────────────────────────────── */
.inv-chat-ring {
	margin-top: 3px;
	border-radius: 6px;
	overflow: hidden;
	border: 1px solid rgba(255, 255, 255, 0.08);
	background: #0d1424;
}

.inv-chat-ring__inner {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 4px 8px;
	text-decoration: none;
	color: inherit;
}

.inv-chat-ring__inner:hover {
	background: rgba(255, 255, 255, 0.04);
}

.inv-chat-ring__thumb {
	width: 22px;
	height: 22px;
	border-radius: 4px;
	overflow: hidden;
	background: #1a2235;
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 0.9rem;
}

.inv-chat-ring__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.inv-chat-ring__title {
	font-size: 0.65rem;
	font-weight: 600;
	color: #e2e8f0;
}

.inv-chat-ring__view {
	font-size: 0.58rem;
	color: #f59e0b;
	font-weight: 500;
	margin-left: auto;
}

.inv-chat-ring__loading,
.inv-chat-ring__error {
	padding: 8px;
	text-align: center;
	font-size: 0.65rem;
	color: #6b7494;
}

/* ── Ring search overlay ──────────────────────────────────────────────────── */
.inv-chat-ring-search {
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	background: #111827;
	border-top: 1px solid rgba(255, 255, 255, 0.08);
	z-index: 100;
	display: flex;
	flex-direction: column;
	max-height: 280px;
}

.inv-chat-ring-search__header {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 8px 10px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.inv-chat-ring-search__input {
	flex: 1;
	height: 32px;
	padding: 0 10px;
	background: #0d1529;
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: 6px;
	color: #e2e8f0;
	font-size: 0.78rem;
	font-family: 'Inter', sans-serif;
	outline: none;
}

.inv-chat-ring-search__input:focus {
	border-color: rgba(245, 158, 11, 0.4);
}

.inv-chat-ring-search__close {
	width: 28px;
	height: 28px;
	background: none;
	border: none;
	color: #6b7494;
	font-size: 1.1rem;
	cursor: pointer;
	border-radius: 6px;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.15s, color 0.15s;
}

.inv-chat-ring-search__close:hover {
	background: rgba(255, 255, 255, 0.06);
	color: #e2e8f0;
}

.inv-chat-ring-search__results {
	overflow-y: auto;
	flex: 1;
	padding: 4px;
}

.inv-chat-ring-search__item {
	display: flex;
	align-items: center;
	gap: 8px;
	width: 100%;
	padding: 8px 10px;
	background: none;
	border: none;
	border-radius: 6px;
	cursor: pointer;
	text-align: left;
	transition: background 0.1s;
	color: inherit;
}

.inv-chat-ring-search__item:hover {
	background: rgba(255, 255, 255, 0.04);
}

.inv-chat-ring-search__thumb {
	width: 32px;
	height: 32px;
	border-radius: 6px;
	overflow: hidden;
	background: #1a2235;
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 1rem;
}

.inv-chat-ring-search__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.inv-chat-ring-search__info {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.inv-chat-ring-search__title {
	font-size: 0.78rem;
	font-weight: 600;
	color: #e2e8f0;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	line-height: 1.4;
	flex-shrink: 0;
}

.inv-chat-ring-search__empty {
	padding: 20px 12px;
	text-align: center;
	font-size: 0.75rem;
	color: #6b7494;
}

/* ── Input bar ─────────────────────────────────────────────────────────────── */
.inv-chat-widget__input {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 10px 12px;
	border-top: 1px solid rgba(255, 255, 255, 0.06);
	flex-shrink: 0;
}

.inv-chat-input {
	flex: 1;
	height: 36px;
	padding: 0 12px;
	background: #0d1529;
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: 8px;
	color: #e2e8f0;
	font-size: 16px; /* prevents iOS zoom on focus */
	font-family: 'Inter', sans-serif;
	outline: none;
	transition: border-color 0.15s;
}

.inv-chat-input:focus {
	border-color: rgba(245, 158, 11, 0.4);
}

.inv-chat-input::placeholder {
	color: #4b5563;
}

.inv-chat-input:disabled {
	opacity: 0.4;
	cursor: not-allowed;
}

.inv-chat-send {
	width: 36px;
	height: 36px;
	background: #f59e0b;
	border: none;
	border-radius: 8px;
	color: #000;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	transition: opacity 0.15s;
	-webkit-tap-highlight-color: transparent;
	touch-action: manipulation;
	-webkit-user-select: none;
	user-select: none;
}

.inv-chat-send:hover {
	opacity: 0.85;
}

.inv-chat-send:disabled {
	opacity: 0.4;
	cursor: not-allowed;
}

/* ── Mute bar ──────────────────────────────────────────────────────────────── */
.inv-chat-mute-bar {
	display: none;
	padding: 8px 12px;
	background: rgba(239, 68, 68, 0.1);
	border-top: 1px solid rgba(239, 68, 68, 0.2);
	color: #ef4444;
	font-size: 0.72rem;
	font-weight: 500;
	text-align: center;
	flex-shrink: 0;
}

/* ── Guest CTA ─────────────────────────────────────────────────────────────── */
.inv-chat-widget__guest {
	padding: 12px;
	border-top: 1px solid rgba(255, 255, 255, 0.06);
	flex-shrink: 0;
	text-align: center;
}

.inv-chat-guest-cta {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 36px;
	padding: 0 20px;
	background: #f59e0b;
	color: #000;
	font-size: 0.75rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	border-radius: 8px;
	text-decoration: none;
	transition: opacity 0.15s;
}

.inv-chat-guest-cta:hover {
	opacity: 0.85;
}

/* ── Admin context menu ────────────────────────────────────────────────────── */
.inv-chat-ctx {
	position: absolute;
	min-width: 150px;
	background: #1a2234;
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: 10px;
	padding: 4px;
	box-shadow: 0 12px 36px rgba(0, 0, 0, 0.6);
	z-index: 10000;
	overflow: hidden;
}

.inv-chat-ctx__header {
	padding: 6px 10px 4px;
	font-size: 0.6rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: #6b7494;
	border-top: 1px solid rgba(255, 255, 255, 0.06);
	margin-top: 2px;
}

.inv-chat-ctx__item {
	display: block;
	width: 100%;
	padding: 7px 10px;
	background: none;
	border: none;
	color: #c8cce8;
	font-size: 0.75rem;
	font-weight: 500;
	text-align: left;
	cursor: pointer;
	border-radius: 6px;
	transition: background 0.1s, color 0.1s;
}

.inv-chat-ctx__item:hover {
	background: rgba(255, 255, 255, 0.06);
	color: #fff;
}

.inv-chat-ctx__item--red {
	color: #ef4444;
}

.inv-chat-ctx__item--red:hover {
	background: rgba(239, 68, 68, 0.12);
	color: #f87171;
}

/* ── Toast notification (spam / error) ────────────────────────────────────── */
.inv-chat-toast {
	position: absolute;
	left: 12px;
	right: 12px;
	bottom: 60px;
	padding: 8px 14px;
	background: rgba(239, 68, 68, 0.95);
	color: #fff;
	font-size: 0.72rem;
	font-weight: 600;
	border-radius: 8px;
	text-align: center;
	z-index: 10001;
	pointer-events: none;
	opacity: 0;
	transform: translateY(8px);
	transition: opacity 0.25s ease, transform 0.25s ease;
}

.inv-chat-toast--visible {
	opacity: 1;
	transform: translateY(0);
}

/* ── System messages (ephemeral) ──────────────────────────────────────────── */
.inv-chat-system {
	text-align: center;
	font-size: 0.68rem;
	color: #6b7494;
	font-style: italic;
	padding: 4px 8px;
}

/* =============================================================================
   Chat inside Sidebar — Override fixed positioning
   ============================================================================= */

.inv-sidebar__chat-slot .inv-chat-widget {
	position: static !important;
	width: 100% !important;
	height: 100% !important;
	max-height: none !important;
	border-radius: 0 !important;
	border: none !important;
	box-shadow: none !important;
	animation: none !important;
	background: transparent;
}

.inv-sidebar__chat-slot .inv-chat-widget__header {
	padding: 10px 14px;
}

.inv-sidebar__chat-slot .inv-chat-widget__close {
	display: none;
}

.inv-sidebar__chat-slot .inv-chat-widget__messages {
	flex: 1;
	min-height: 0;
}

/* Chat bubble always visible — no longer relocated to sidebar */

/* ── Reply button on messages ─────────────────────────────────────────────── */
.inv-chat-msg__reply-btn {
	background: none;
	border: none;
	color: #3d4560;
	font-size: 0.85rem;
	cursor: pointer;
	padding: 0 2px;
	margin-left: auto;
	line-height: 1;
	opacity: 0;
	transition: opacity 0.15s, color 0.15s;
}

.inv-chat-msg:hover .inv-chat-msg__reply-btn {
	opacity: 1;
}

.inv-chat-msg__reply-btn:hover {
	color: #f59e0b;
}

/* ── Reply quote block (in message body) ─────────────────────────────────── */
.inv-chat-reply-quote {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 4px 8px;
	margin-bottom: 4px;
	background: rgba(255, 255, 255, 0.03);
	border-left: 2px solid #f59e0b;
	border-radius: 0 4px 4px 0;
	cursor: pointer;
	transition: background 0.12s;
}

.inv-chat-reply-quote:hover {
	background: rgba(255, 255, 255, 0.06);
}

.inv-chat-reply-quote__author {
	font-family: 'Inter', sans-serif;
	font-size: 0.62rem;
	font-weight: 700;
	color: #f59e0b;
	flex-shrink: 0;
}

.inv-chat-reply-quote__text {
	font-family: 'Inter', sans-serif;
	font-size: 0.62rem;
	color: #6b7494;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	min-width: 0;
}

/* ── Reply preview bar (above input) ─────────────────────────────────────── */
.inv-chat-reply-preview {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 6px 12px;
	background: rgba(245, 158, 11, 0.06);
	border-top: 1px solid rgba(245, 158, 11, 0.15);
	border-left: 3px solid #f59e0b;
	flex-shrink: 0;
}

.inv-chat-reply-preview__icon {
	font-size: 0.85rem;
	color: #f59e0b;
	flex-shrink: 0;
}

.inv-chat-reply-preview__author {
	font-family: 'Inter', sans-serif;
	font-size: 0.65rem;
	font-weight: 700;
	color: #f59e0b;
	flex-shrink: 0;
}

.inv-chat-reply-preview__text {
	font-family: 'Inter', sans-serif;
	font-size: 0.68rem;
	color: #6b7494;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	min-width: 0;
}

.inv-chat-reply-preview__cancel {
	margin-left: auto;
	flex-shrink: 0;
	background: none;
	border: none;
	color: #6b7494;
	font-size: 1.1rem;
	cursor: pointer;
	padding: 0 2px;
	line-height: 1;
	transition: color 0.12s;
}

.inv-chat-reply-preview__cancel:hover {
	color: #ef4444;
}

/* ── Message highlight animation (scroll-to-reply) ───────────────────────── */
.inv-chat-msg--highlight {
	animation: invChatHighlight 1.5s ease-out;
}

@keyframes invChatHighlight {
	0%   { background: rgba(245, 158, 11, 0.15); }
	100% { background: transparent; }
}

/* ── Inline embed cards (when mixed with text in same message) ────────────── */
.inv-chat-msg__text + .inv-chat-lineup,
.inv-chat-msg__text + .inv-chat-hero,
.inv-chat-msg__text + .inv-chat-ring,
.inv-chat-lineup + .inv-chat-msg__text,
.inv-chat-hero + .inv-chat-msg__text,
.inv-chat-ring + .inv-chat-msg__text {
	margin-top: 4px;
}

/* ── Card preview bar (above input, before send) ──────────────────────────── */
.inv-chat-card-preview {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 6px 12px;
	background: rgba(245, 158, 11, 0.08);
	border-top: 1px solid rgba(245, 158, 11, 0.2);
	flex-shrink: 0;
	min-height: 0;
}

.inv-chat-card-preview__icon {
	font-size: 0.85rem;
	flex-shrink: 0;
}

.inv-chat-card-preview__label {
	font-family: 'Inter', sans-serif;
	font-size: 0.65rem;
	font-weight: 700;
	color: #f59e0b;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	flex-shrink: 0;
}

.inv-chat-card-preview__title {
	font-family: 'Inter', sans-serif;
	font-size: 0.72rem;
	color: #e2e8f0;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	min-width: 0;
}

.inv-chat-card-preview__cancel {
	margin-left: auto;
	flex-shrink: 0;
	background: none;
	border: none;
	color: #6b7494;
	font-size: 1.1rem;
	cursor: pointer;
	padding: 0 2px;
	line-height: 1;
	transition: color 0.12s;
}

.inv-chat-card-preview__cancel:hover {
	color: #ef4444;
}

/* ── Compact cards inside sidebar chat ────────────────────────────────────── */
.inv-sidebar__chat-slot .inv-chat-lineup,
.inv-sidebar__chat-slot .inv-chat-hero,
.inv-sidebar__chat-slot .inv-chat-ring {
	border-radius: 6px;
}

.inv-sidebar__chat-slot .inv-chat-lineup__inner,
.inv-sidebar__chat-slot .inv-chat-hero__inner {
	padding: 5px 8px;
	gap: 8px;
}

.inv-sidebar__chat-slot .inv-chat-lineup__portrait {
	width: 22px;
	height: 22px;
	border-radius: 4px;
}

.inv-sidebar__chat-slot .inv-chat-hero__thumb {
	width: 28px;
	height: 28px;
	border-radius: 4px;
}

.inv-sidebar__chat-slot .inv-chat-lineup__title,
.inv-sidebar__chat-slot .inv-chat-hero__title,
.inv-sidebar__chat-slot .inv-chat-ring__title {
	font-size: 0.65rem;
}

.inv-sidebar__chat-slot .inv-chat-lineup__tier,
.inv-sidebar__chat-slot .inv-chat-hero__tier {
	font-size: 0.5rem;
	padding: 0 4px;
}

.inv-sidebar__chat-slot .inv-chat-lineup__view,
.inv-sidebar__chat-slot .inv-chat-hero__view,
.inv-sidebar__chat-slot .inv-chat-ring__view {
	font-size: 0.58rem;
}

.inv-sidebar__chat-slot .inv-chat-hero__star {
	font-size: 0.5rem;
}

.inv-sidebar__chat-slot .inv-chat-ring__inner {
	padding: 4px 8px;
	gap: 6px;
}

.inv-sidebar__chat-slot .inv-chat-ring__thumb {
	width: 22px;
	height: 22px;
	border-radius: 4px;
}

/* =============================================================================
   Chat Channels (tabs)
   ============================================================================= */

/* Row 1: full width, so it wraps above the meta row */
.inv-chat-tabs {
	display: flex;
	width: 100%;
	border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.inv-chat-tab {
	flex: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 5px;
	padding: 9px 6px 8px;
	background: transparent;
	border: none;
	border-bottom: 2px solid transparent;
	border-radius: 0;
	color: #4b5563;
	font-family: 'Rajdhani', sans-serif;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	cursor: pointer;
	transition: color 0.15s, border-color 0.15s, background 0.15s;
	white-space: nowrap;
}

.inv-chat-tab svg {
	opacity: 0.6;
	transition: opacity 0.15s;
}

.inv-chat-tab:hover {
	color: #9ca3af;
	background: rgba(255,255,255,0.03);
}

.inv-chat-tab:hover svg {
	opacity: 0.8;
}

.inv-chat-tab.is-active {
	color: #f59e0b;
	border-bottom-color: #f59e0b;
	background: rgba(245,158,11,0.05);
}

.inv-chat-tab.is-active svg {
	opacity: 1;
}

/* ── Chat panels ─────────────────────────────────────────────────────────── */

.inv-chat-panel {
	display: flex;
	flex-direction: column;
	flex: 1;
	min-height: 0;
	overflow: hidden;
}

/* =============================================================================
   Pet Private Chat
   ============================================================================= */

.inv-chat-pet-messages {
	display: flex !important;
	flex-direction: column;
	gap: 8px;
	padding: 12px 10px !important;
}

.inv-chat-pet-meta {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 5px 12px;
	background: rgba(245,158,11,0.06);
	border-bottom: 1px solid rgba(245,158,11,0.10);
	font-size: 11px;
	gap: 8px;
	flex-shrink: 0;
}

.inv-pcc-meta__free { color: #9ca3af; }
.inv-pcc-meta__cost { color: #f59e0b; font-weight: 600; }
.inv-pcc-meta__limit { color: #6b7280; font-style: italic; }

.inv-pcc-msg {
	display: flex;
	align-items: flex-end;
	gap: 6px;
	max-width: 88%;
}

.inv-pcc-msg--user {
	align-self: flex-end;
	flex-direction: row-reverse;
}

.inv-pcc-msg--pet {
	align-self: flex-start;
}

.inv-pcc-msg__bubble {
	padding: 8px 12px;
	border-radius: 14px;
	font-size: 13px;
	line-height: 1.45;
	word-break: break-word;
}

.inv-pcc-msg--user .inv-pcc-msg__bubble {
	background: #1e3a8a;
	color: #dbeafe;
	border-bottom-right-radius: 4px;
}

.inv-pcc-msg--pet .inv-pcc-msg__bubble {
	background: #1a2238;
	color: #d1d5db;
	border-bottom-left-radius: 4px;
	box-shadow: 0 0 14px rgba(245,158,11,0.08);
}

.inv-pcc-msg__avatar {
	width: 30px;
	height: 30px;
	object-fit: contain;
	flex-shrink: 0;
	margin-bottom: 2px;
}

.inv-pcc-msg__avatar-fallback {
	width: 30px;
	height: 30px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 18px;
	flex-shrink: 0;
}

/* =============================================================================
   Per-user theme colors — each message shows the sender's theme color
   dark  = default (no class added, uses base #c8cce8)
   gold  = warm amber tone
   blood = crimson tone
   invblue = sky blue tone
   ============================================================================= */

/* ── Gold theme ──────────────────────────────────────────────────────────── */
.inv-chat-theme--gold .inv-chat-msg__name-link {
	color: #f0c645;
}

/* ── Blood Red theme ─────────────────────────────────────────────────────── */
.inv-chat-theme--blood .inv-chat-msg__name-link {
	color: #e85c5c;
}

/* ── Invictus Blue theme ─────────────────────────────────────────────────── */
.inv-chat-theme--invblue .inv-chat-msg__name-link {
	color: #5a9ef5;
}

/* ── Pet chat out-of-coins modal ─────────────────────────────────────────── */
.inv-pcc-modal {
	position: fixed;
	inset: 0;
	z-index: 10000;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	visibility: hidden;
	transition: opacity 200ms ease, visibility 200ms ease;
}
.inv-pcc-modal.is-open {
	opacity: 1;
	visibility: visible;
}
.inv-pcc-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.7);
	backdrop-filter: blur(4px);
}
.inv-pcc-modal__card {
	position: relative;
	z-index: 1;
	background: linear-gradient(180deg, #1a2234 0%, #111827 100%);
	border: 1px solid rgba(245, 158, 11, 0.4);
	border-radius: 12px;
	width: min(420px, calc(100% - 32px));
	max-width: 420px;
	padding: 24px;
	box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.04);
	transform: translateY(20px) scale(0.96);
	transition: transform 200ms ease;
}
.inv-pcc-modal.is-open .inv-pcc-modal__card {
	transform: translateY(0) scale(1);
}
.inv-pcc-modal__header {
	font-family: 'Rajdhani', sans-serif;
	font-weight: 700;
	font-size: 1.25rem;
	color: #f59e0b;
	margin-bottom: 14px;
	text-align: center;
}
.inv-pcc-modal__body {
	color: #d1d5db;
	font-size: 0.92rem;
	line-height: 1.5;
	margin-bottom: 20px;
}
.inv-pcc-modal__msg {
	margin: 0 0 16px;
}
.inv-pcc-modal__stats {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
}
.inv-pcc-modal__stat {
	background: rgba(8, 13, 26, 0.8);
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: 8px;
	padding: 10px 12px;
	text-align: center;
}
.inv-pcc-modal__stat span {
	display: block;
	font-size: 0.72rem;
	color: #9ca3af;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	margin-bottom: 4px;
}
.inv-pcc-modal__stat b {
	font-family: 'Rajdhani', sans-serif;
	font-size: 1.15rem;
	color: #f3f4f6;
	font-weight: 700;
}
.inv-pcc-modal__stat b.low {
	color: #ef4444;
}
.inv-pcc-modal__actions {
	display: flex;
	gap: 10px;
	justify-content: center;
}
.inv-pcc-modal__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 10px 18px;
	border-radius: 6px;
	font-family: 'Rajdhani', sans-serif;
	font-weight: 600;
	font-size: 0.92rem;
	cursor: pointer;
	border: none;
	text-decoration: none;
	transition: transform 0.12s, background 0.18s;
}
.inv-pcc-modal__btn:hover {
	transform: translateY(-1px);
}
.inv-pcc-modal__btn--primary {
	background: linear-gradient(135deg, #f59e0b, #b45309);
	color: #000;
}
.inv-pcc-modal__btn--primary:hover {
	background: linear-gradient(135deg, #fbbf24, #d97706);
}
.inv-pcc-modal__btn--ghost {
	background: rgba(255, 255, 255, 0.06);
	color: #d1d5db;
}
.inv-pcc-modal__btn--ghost:hover {
	background: rgba(255, 255, 255, 0.12);
}
