/* ═══════════════════════════════════════════════════════════════════════════
   Public Pet Profile Panel
   Slide-in panel for viewing other players' pet character sheets.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Panel wrapper ─────────────────────────────────────────────────────────── */
#inv-ppv {
	position: fixed;
	inset: 0;
	z-index: 9000;
	pointer-events: none;
}

#inv-ppv.is-open {
	pointer-events: auto;
}

/* ── Backdrop ──────────────────────────────────────────────────────────────── */
.inv-ppv__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.72);
	opacity: 0;
	transition: opacity 0.28s ease;
	cursor: pointer;
}

#inv-ppv.is-open .inv-ppv__backdrop {
	opacity: 1;
}

/* ── Panel ─────────────────────────────────────────────────────────────────── */
.inv-ppv__panel {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	width: 100%;
	max-width: 460px;
	background: #080d1a;
	border-left: 1px solid rgba(245, 158, 11, 0.15);
	display: flex;
	flex-direction: column;
	transform: translateX(100%);
	transition: transform 0.3s cubic-bezier(0.32, 0, 0.67, 0);
	overflow: hidden;
}

#inv-ppv.is-open .inv-ppv__panel {
	transform: translateX(0);
	transition-timing-function: cubic-bezier(0.33, 1, 0.68, 1);
}

/* ── Header ────────────────────────────────────────────────────────────────── */
.inv-ppv__header {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 12px 14px;
	background: #0d1427;
	border-bottom: 1px solid rgba(245, 158, 11, 0.12);
	flex-shrink: 0;
}

.inv-ppv__back {
	background: none;
	border: 1px solid rgba(100, 116, 139, 0.35);
	border-radius: 8px;
	color: #94a3b8;
	cursor: pointer;
	padding: 6px 10px;
	font-size: 0.85rem;
	line-height: 1;
	transition: color 0.15s, border-color 0.15s;
	flex-shrink: 0;
}

.inv-ppv__back:hover {
	color: #f59e0b;
	border-color: rgba(245, 158, 11, 0.4);
}

.inv-ppv__user-info {
	flex: 1;
	min-width: 0;
}

.inv-ppv__username {
	font-family: 'Rajdhani', sans-serif;
	font-size: 1.05rem;
	font-weight: 700;
	color: #f1f5f9;
	line-height: 1.1;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.inv-ppv__level-badge {
	font-size: 0.7rem;
	font-weight: 600;
	color: #94a3b8;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.inv-ppv__level-badge.is-commander { color: #f59e0b; }
.inv-ppv__level-badge.is-warlord   { color: #ef4444; }

.inv-ppv__avatar {
	width: 38px;
	height: 38px;
	border-radius: 50%;
	object-fit: cover;
	border: 2px solid rgba(245, 158, 11, 0.3);
	flex-shrink: 0;
}

.inv-ppv__avatar-placeholder {
	width: 38px;
	height: 38px;
	border-radius: 50%;
	background: #1e293b;
	border: 2px solid rgba(100, 116, 139, 0.25);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 1.2rem;
	flex-shrink: 0;
}

/* ── Body scroll ───────────────────────────────────────────────────────────── */
.inv-ppv__body {
	flex: 1;
	overflow-y: auto;
	overflow-x: hidden;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: thin;
	scrollbar-color: rgba(245, 158, 11, 0.2) transparent;
}

.inv-ppv__body::-webkit-scrollbar { width: 4px; }
.inv-ppv__body::-webkit-scrollbar-track { background: transparent; }
.inv-ppv__body::-webkit-scrollbar-thumb { background: rgba(245, 158, 11, 0.2); border-radius: 2px; }

/* ── Loading spinner ───────────────────────────────────────────────────────── */
.inv-ppv__spinner {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 60px 20px;
}

.inv-ppv__spinner::after {
	content: '';
	width: 36px;
	height: 36px;
	border: 3px solid rgba(245, 158, 11, 0.15);
	border-top-color: #f59e0b;
	border-radius: 50%;
	animation: ppv-spin 0.8s linear infinite;
}

@keyframes ppv-spin { to { transform: rotate(360deg); } }

/* ── Error state ───────────────────────────────────────────────────────────── */
.inv-ppv__error {
	padding: 40px 20px;
	text-align: center;
	color: #6b7280;
	font-size: 0.9rem;
	line-height: 1.6;
}

/* ── Pet switcher ──────────────────────────────────────────────────────────── */
.inv-ppv__switcher {
	display: flex;
	gap: 8px;
	padding: 10px 14px;
	overflow-x: auto;
	scrollbar-width: none;
	border-bottom: 1px solid rgba(255, 255, 255, 0.05);
	flex-shrink: 0;
}

.inv-ppv__switcher::-webkit-scrollbar { display: none; }

.inv-ppv__switcher-btn {
	flex-shrink: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
	background: rgba(255, 255, 255, 0.04);
	border: 1.5px solid transparent;
	border-radius: 10px;
	cursor: pointer;
	padding: 6px 8px;
	min-width: 54px;
	transition: background 0.15s, border-color 0.15s;
}

.inv-ppv__switcher-btn:hover {
	background: rgba(245, 158, 11, 0.08);
	border-color: rgba(245, 158, 11, 0.3);
}

.inv-ppv__switcher-btn.is-active {
	background: rgba(245, 158, 11, 0.1);
	border-color: rgba(245, 158, 11, 0.55);
}

.inv-ppv__switcher-img {
	width: 36px;
	height: 36px;
	object-fit: contain;
	border-radius: 4px;
}

.inv-ppv__switcher-name {
	font-size: 0.6rem;
	font-weight: 600;
	color: #94a3b8;
	text-align: center;
	max-width: 48px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	text-transform: uppercase;
	letter-spacing: 0.03em;
}

.inv-ppv__switcher-btn.is-active .inv-ppv__switcher-name { color: #f59e0b; }

/* ── Pet hero section ──────────────────────────────────────────────────────── */
.inv-ppv__pet-hero {
	display: flex;
	align-items: flex-end;
	gap: 14px;
	padding: 16px 14px 12px;
	background: linear-gradient(180deg, #0d1427 0%, #080d1a 100%);
	border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.inv-ppv__pet-portrait {
	width: 80px;
	height: 80px;
	object-fit: contain;
	flex-shrink: 0;
	filter: drop-shadow(0 4px 16px rgba(0, 0, 0, 0.5));
}

.inv-ppv__pet-meta {
	flex: 1;
	min-width: 0;
}

.inv-ppv__pet-name {
	font-family: 'Rajdhani', sans-serif;
	font-size: 1.2rem;
	font-weight: 700;
	color: #f1f5f9;
	line-height: 1.1;
	margin-bottom: 3px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.inv-ppv__pet-badges {
	display: flex;
	flex-wrap: wrap;
	gap: 5px;
	margin-bottom: 4px;
}

.inv-ppv__badge {
	font-size: 0.62rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	padding: 2px 7px;
	border-radius: 4px;
	background: rgba(255, 255, 255, 0.08);
	color: #94a3b8;
}

.inv-ppv__badge--species { background: rgba(245, 158, 11, 0.12); color: #f59e0b; }
.inv-ppv__badge--path    { background: rgba(59, 130, 246, 0.12);  color: #60a5fa; }
.inv-ppv__badge--rare    { background: rgba(168, 85, 247, 0.12);  color: #c084fc; }

.inv-ppv__pet-level {
	font-size: 0.75rem;
	color: #64748b;
}

.inv-ppv__pet-level strong {
	color: #94a3b8;
}

/* ── Arena rank (inside hero) ──────────────────────────────────────────────── */
.inv-ppv__arena-rank {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	flex-shrink: 0;
}

.inv-ppv__arena-label {
	font-size: 0.6rem;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: #475569;
	margin-bottom: 1px;
}

.inv-ppv__arena-pts {
	font-family: 'Rajdhani', sans-serif;
	font-size: 1.1rem;
	font-weight: 700;
	color: #f59e0b;
	line-height: 1;
}

.inv-ppv__arena-num {
	font-size: 0.68rem;
	color: #64748b;
	text-align: right;
}

/* ── Section label ─────────────────────────────────────────────────────────── */
.inv-ppv__section-label {
	font-size: 0.65rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	color: #475569;
	padding: 10px 14px 4px;
}

/* ── Stats grid ────────────────────────────────────────────────────────────── */
.inv-ppv__stats {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 1px;
	padding: 0 14px 10px;
	background: transparent;
}

.inv-ppv__stat {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 2px;
	background: rgba(255, 255, 255, 0.03);
	border: 1px solid rgba(255, 255, 255, 0.05);
	border-radius: 8px;
	padding: 8px 6px;
}

.inv-ppv__stat-icon {
	font-size: 0.8rem;
	line-height: 1;
}

.inv-ppv__stat-val {
	font-family: 'Rajdhani', sans-serif;
	font-size: 1rem;
	font-weight: 700;
	color: #f1f5f9;
	line-height: 1;
}

.inv-ppv__stat-key {
	font-size: 0.58rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: #475569;
}

/* ── Charsheet ─────────────────────────────────────────────────────────────── */
.inv-ppv__charsheet {
	padding: 0 14px 10px;
}

.inv-ppv__cs-grid {
	display: grid;
	grid-template-columns: 1fr 90px 1fr;
	gap: 5px;
	align-items: start;
}

.inv-ppv__cs-col {
	display: flex;
	flex-direction: column;
	gap: 5px;
}

.inv-ppv__cs-center {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 4px 0;
}

.inv-ppv__cs-pet-img {
	width: 74px;
	height: 74px;
	object-fit: contain;
	filter: drop-shadow(0 2px 12px rgba(0, 0, 0, 0.6));
}

.inv-ppv__cs-bottom {
	display: flex;
	justify-content: center;
	gap: 5px;
	margin-top: 2px;
}

/* ── Equipment slot ────────────────────────────────────────────────────────── */
.inv-ppv__slot {
	position: relative;
	width: 100%;
	aspect-ratio: 1;
	border-radius: 8px;
	border: 1.5px solid rgba(255, 255, 255, 0.08);
	background: rgba(255, 255, 255, 0.03);
	cursor: default;
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: border-color 0.15s;
}

.inv-ppv__slot.has-item {
	border-color: var(--sl-color, rgba(156, 163, 175, 0.35));
	box-shadow: 0 0 0 1px rgba(var(--sl-rgb, 156,163,175), 0.1) inset;
	cursor: pointer;
}

.inv-ppv__slot.has-item:hover {
	border-color: var(--sl-color, rgba(156, 163, 175, 0.6));
}

.inv-ppv__slot.r-1 { --sl-color: rgba(156,163,175,0.4); --sl-rgb: 156,163,175; }
.inv-ppv__slot.r-2 { --sl-color: rgba(34,197,94,0.45);  --sl-rgb: 34,197,94; }
.inv-ppv__slot.r-3 { --sl-color: rgba(59,130,246,0.45); --sl-rgb: 59,130,246; }
.inv-ppv__slot.r-4 { --sl-color: rgba(168,85,247,0.45); --sl-rgb: 168,85,247; }
.inv-ppv__slot.r-5 { --sl-color: rgba(245,158,11,0.5);  --sl-rgb: 245,158,11; }
.inv-ppv__slot.r-6 { --sl-color: rgba(239,68,68,0.5);   --sl-rgb: 239,68,68; }

.inv-ppv__slot__img {
	width: 76%;
	height: 76%;
	object-fit: contain;
}

.inv-ppv__slot__img.ghost {
	opacity: 0.13;
	mix-blend-mode: screen;
	filter: grayscale(1);
}

.inv-ppv__slot__empty-lbl {
	font-size: 0.52rem;
	color: #374151;
	text-align: center;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	padding: 2px;
}

.inv-ppv__slot__upg {
	position: absolute;
	top: 2px;
	left: 3px;
	font-size: 0.55rem;
	font-weight: 700;
	color: #f59e0b;
	background: rgba(0, 0, 0, 0.7);
	border-radius: 3px;
	padding: 1px 3px;
	line-height: 1;
	pointer-events: none;
}

.inv-ppv__slot__rarity-dot {
	position: absolute;
	bottom: 3px;
	right: 3px;
	width: 5px;
	height: 5px;
	border-radius: 50%;
	background: var(--sl-color, #9ca3af);
	pointer-events: none;
}

/* ── Active set bonuses ────────────────────────────────────────────────────── */
.inv-ppv__sets {
	padding: 0 14px 12px;
}

.inv-ppv__set-item {
	background: rgba(255, 255, 255, 0.03);
	border: 1px solid rgba(255, 255, 255, 0.07);
	border-radius: 8px;
	padding: 8px 10px;
	margin-bottom: 5px;
}

.inv-ppv__set-name {
	font-family: 'Rajdhani', sans-serif;
	font-size: 0.85rem;
	font-weight: 700;
	color: #f1f5f9;
	margin-bottom: 4px;
}

.inv-ppv__set-tier {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 0.72rem;
	margin-bottom: 2px;
}

.inv-ppv__set-tier-num {
	font-weight: 700;
	color: #64748b;
	min-width: 18px;
}

.inv-ppv__set-tier-num.active {
	color: #22c55e;
}

.inv-ppv__set-tier-text {
	color: #64748b;
}

.inv-ppv__set-tier-text.active {
	color: #94a3b8;
}

/* ── Item tooltip ──────────────────────────────────────────────────────────── */
#inv-ppv-tooltip {
	position: fixed;
	z-index: 9900;
	width: 230px;
	background: #0f172a;
	border: 1px solid rgba(245, 158, 11, 0.2);
	border-radius: 10px;
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.7);
	padding: 12px;
	pointer-events: none;
	opacity: 0;
	transform: scale(0.95);
	transition: opacity 0.12s ease, transform 0.12s ease;
}

#inv-ppv-tooltip.is-visible {
	opacity: 1;
	transform: scale(1);
}

.inv-ppv-tt__name {
	font-family: 'Rajdhani', sans-serif;
	font-size: 0.95rem;
	font-weight: 700;
	color: #f1f5f9;
	margin-bottom: 2px;
	line-height: 1.2;
}

.inv-ppv-tt__rarity {
	font-size: 0.65rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	margin-bottom: 8px;
}

.inv-ppv-tt__divider {
	height: 1px;
	background: rgba(255, 255, 255, 0.07);
	margin: 7px 0;
}

.inv-ppv-tt__main-stat {
	font-size: 0.8rem;
	font-weight: 600;
	color: #f59e0b;
	margin-bottom: 5px;
}

.inv-ppv-tt__affix {
	font-size: 0.72rem;
	color: #94a3b8;
	margin-bottom: 2px;
}

.inv-ppv-tt__affix-val {
	font-weight: 600;
	color: #22c55e;
}

.inv-ppv-tt__set-name {
	font-size: 0.72rem;
	font-weight: 700;
	color: #a855f7;
	margin-top: 5px;
}

.inv-ppv-tt__set-bonus {
	font-size: 0.67rem;
	color: #64748b;
	margin-top: 2px;
}

.inv-ppv-tt__set-bonus.active {
	color: #22c55e;
}

.inv-ppv-tt__upg {
	font-size: 0.68rem;
	color: #f59e0b;
	font-weight: 600;
	margin-top: 4px;
}

.inv-ppv-tt__dungeon {
	font-size: 0.64rem;
	color: #475569;
	margin-top: 3px;
}

/* ── Mobile adjustments ────────────────────────────────────────────────────── */
@media (max-width: 480px) {
	.inv-ppv__panel {
		max-width: 100%;
	}

	.inv-ppv__cs-grid {
		grid-template-columns: 1fr 70px 1fr;
	}

	.inv-ppv__cs-pet-img {
		width: 58px;
		height: 58px;
	}

	.inv-ppv__stat-val {
		font-size: 0.9rem;
	}
}
