/* =============================================================================
   Hero Filter & Tools — hero-filter.css
   Filter panel, chips, cards, compare modal, collection bar
   ============================================================================= */

/* ── Filter Panel ─────────────────────────────────────────────────────────── */

.inv-hf-panel {
	background: #0d1424;
	border: 1px solid rgba(255, 255, 255, 0.07);
	border-radius: 0.75rem;
	padding: 1rem;
	margin-bottom: 1.5rem;
}

.inv-hf-panel__top {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	align-items: center;
	margin-bottom: 0.75rem;
}

.inv-hf-search {
	flex: 1 1 200px;
	min-width: 0;
	background: #111827;
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: 0.5rem;
	padding: 0.45rem 0.75rem 0.45rem 2rem;
	color: #f0f4ff;
	font-size: 0.8rem;
	font-family: 'Inter', sans-serif;
	outline: none;
	transition: border-color 0.15s;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236b7494' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: 0.6rem center;
}
.inv-hf-search:focus {
	border-color: #f59e0b;
}
.inv-hf-search::placeholder {
	color: #3d4560;
}

.inv-hf-sort {
	background: #111827;
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: 0.5rem;
	padding: 0.45rem 0.6rem;
	color: #c8cce8;
	font-size: 0.75rem;
	font-family: 'Inter', sans-serif;
	cursor: pointer;
	outline: none;
}
.inv-hf-sort:focus {
	border-color: #f59e0b;
}

/* ── Collection toggle tabs ───────────────────────────────────────────────── */

.inv-hf-coll-tabs {
	display: flex;
	gap: 2px;
	border-radius: 0.375rem;
	overflow: hidden;
	border: 1px solid rgba(255, 255, 255, 0.1);
}
.inv-hf-coll-tab {
	background: #111827;
	color: #6b7494;
	border: none;
	padding: 0.4rem 0.6rem;
	font-size: 0.7rem;
	font-family: 'Inter', sans-serif;
	cursor: pointer;
	transition: background 0.15s, color 0.15s;
}
.inv-hf-coll-tab.active {
	background: #f59e0b;
	color: #111827;
	font-weight: 600;
}
.inv-hf-coll-tab:hover:not(.active) {
	background: #1a2235;
	color: #c8cce8;
}

/* ── Collection Progress Bar ──────────────────────────────────────────────── */

.inv-hf-collection-bar {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	margin-bottom: 0.75rem;
}
.inv-hf-collection-bar__track {
	flex: 1;
	height: 6px;
	background: #1a2235;
	border-radius: 3px;
	overflow: hidden;
}
.inv-hf-collection-bar__fill {
	height: 100%;
	background: #f59e0b;
	border-radius: 3px;
	transition: width 0.3s ease;
}
.inv-hf-collection-bar__label {
	font-size: 0.7rem;
	color: #6b7494;
	white-space: nowrap;
}

/* ── Chip groups ──────────────────────────────────────────────────────────── */

.inv-hf-group {
	margin-bottom: 0.5rem;
}
.inv-hf-group:last-child {
	margin-bottom: 0;
}
.inv-hf-group__label {
	font-size: 0.6rem;
	font-weight: 600;
	color: #3d4560;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	margin-bottom: 0.3rem;
	font-family: 'Rajdhani', sans-serif;
}
.inv-hf-group__chips {
	display: flex;
	flex-wrap: wrap;
	gap: 0.3rem;
}

/* ── Filter Chips ─────────────────────────────────────────────────────────── */

.inv-hf-chip {
	display: inline-flex;
	align-items: center;
	padding: 0.25rem 0.6rem;
	border-radius: 9999px;
	font-size: 0.7rem;
	font-weight: 500;
	font-family: 'Inter', sans-serif;
	color: #c8cce8;
	background: rgba(255, 255, 255, 0.05);
	border: 1px solid rgba(255, 255, 255, 0.08);
	cursor: pointer;
	transition: all 0.15s ease;
	user-select: none;
}
.inv-hf-chip:hover {
	background: rgba(255, 255, 255, 0.1);
	border-color: rgba(255, 255, 255, 0.15);
}
.inv-hf-chip.active {
	background: var(--chip-color, #f59e0b);
	color: #111827;
	border-color: var(--chip-color, #f59e0b);
	font-weight: 600;
}

/* ── Active tags bar ──────────────────────────────────────────────────────── */

.inv-hf-tags {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.3rem;
	margin-top: 0.75rem;
	padding-top: 0.6rem;
	border-top: 1px solid rgba(255, 255, 255, 0.05);
}
.inv-hf-tags:empty {
	display: none;
}
.inv-hf-tag {
	display: inline-flex;
	align-items: center;
	gap: 0.25rem;
	padding: 0.2rem 0.5rem;
	border-radius: 9999px;
	font-size: 0.65rem;
	font-weight: 500;
	color: #f0f4ff;
	background: rgba(245, 158, 11, 0.15);
	border: 1px solid rgba(245, 158, 11, 0.3);
	cursor: pointer;
	transition: all 0.15s;
}
.inv-hf-tag:hover {
	background: rgba(245, 158, 11, 0.3);
}
.inv-hf-tag__x {
	font-size: 0.75rem;
	line-height: 1;
	opacity: 0.6;
}
.inv-hf-reset {
	font-size: 0.65rem;
	color: #6b7494;
	background: none;
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: 9999px;
	padding: 0.2rem 0.5rem;
	cursor: pointer;
	transition: all 0.15s;
	font-family: 'Inter', sans-serif;
}
.inv-hf-reset:hover {
	color: #f0f4ff;
	border-color: rgba(255, 255, 255, 0.2);
}

/* ── Presets dropdown ─────────────────────────────────────────────────────── */

.inv-hf-presets {
	position: relative;
	display: inline-block;
}
.inv-hf-presets__btn {
	font-size: 0.65rem;
	color: #6b7494;
	background: none;
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: 9999px;
	padding: 0.2rem 0.5rem;
	cursor: pointer;
	transition: all 0.15s;
	font-family: 'Inter', sans-serif;
}
.inv-hf-presets__btn:hover {
	color: #f0f4ff;
	border-color: rgba(255, 255, 255, 0.2);
}
.inv-hf-presets__drop {
	display: none;
	position: absolute;
	bottom: calc(100% + 4px);
	right: 0;
	min-width: 180px;
	background: #111827;
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: 0.5rem;
	padding: 0.4rem 0;
	z-index: 50;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}
.inv-hf-presets__drop.open {
	display: block;
}
.inv-hf-presets__item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0.35rem 0.75rem;
	font-size: 0.7rem;
	color: #c8cce8;
	cursor: pointer;
	transition: background 0.1s;
}
.inv-hf-presets__item:hover {
	background: rgba(255, 255, 255, 0.05);
}
.inv-hf-presets__del {
	color: #6b7494;
	font-size: 0.75rem;
	padding: 0 0.2rem;
	cursor: pointer;
}
.inv-hf-presets__del:hover {
	color: #ef4444;
}
.inv-hf-presets__save {
	display: flex;
	gap: 0.3rem;
	padding: 0.35rem 0.75rem;
	border-top: 1px solid rgba(255, 255, 255, 0.05);
	margin-top: 0.2rem;
}
.inv-hf-presets__save input {
	flex: 1;
	min-width: 0;
	background: #0d1424;
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: 0.25rem;
	padding: 0.2rem 0.4rem;
	font-size: 0.65rem;
	color: #f0f4ff;
	outline: none;
}
.inv-hf-presets__save button {
	background: #f59e0b;
	color: #111827;
	border: none;
	border-radius: 0.25rem;
	padding: 0.2rem 0.4rem;
	font-size: 0.65rem;
	font-weight: 600;
	cursor: pointer;
}

/* ── Count + header ───────────────────────────────────────────────────────── */

.inv-hf-header {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 0.5rem;
	margin-bottom: 0.5rem;
}
.inv-hf-count {
	font-size: 0.75rem;
	color: #6b7494;
}
.inv-hf-count span {
	color: #f0f4ff;
	font-weight: 600;
}

/* ── Tier Rows (default layout) ───────────────────────────────────────────── */

.inv-hf-tier-rows {
	display: flex;
	flex-direction: column;
	gap: 5px;
}

.inv-hf-tier-row {
	display: flex;
	align-items: stretch;
	min-height: 110px;
	border-radius: 0.5rem;
	overflow: hidden;
	background: #0d1424;
	border: 1px solid rgba(255, 255, 255, 0.05);
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}
.inv-hf-tier-row.empty {
	display: none;
}

.inv-hf-tier-label {
	width: 88px;
	min-width: 88px;
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0.75rem 0.5rem;
	background: var(--tier-color);
}
.inv-hf-tier-label span {
	font-family: 'Rajdhani', sans-serif;
	font-weight: 700;
	font-size: 2.1rem;
	letter-spacing: 0.04em;
	line-height: 1;
	text-align: center;
	white-space: nowrap;
	text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
	color: #fff;
}
.inv-hf-tier-label.light span {
	color: #111827;
	text-shadow: 0 1px 3px rgba(255, 255, 255, 0.1);
}

.inv-hf-tier-heroes {
	display: flex;
	flex-wrap: nowrap;
	gap: 0.5rem;
	padding: 0.75rem;
	flex: 1;
	overflow-x: auto;
	overflow-y: visible;
	align-items: start;
	scrollbar-width: thin;
	scrollbar-color: #1e2d45 transparent;
}

@media (min-width: 640px) {
	.inv-hf-tier-heroes {
		flex-wrap: wrap;
		overflow-x: visible;
	}
	.inv-hf-tier-label {
		width: 100px;
		min-width: 100px;
	}
	.inv-hf-tier-label span {
		font-size: 2.6rem;
	}
}

/* ── Flat Grid (for non-tier sorts) ───────────────────────────────────────── */

.inv-hf-flat-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
	gap: 0.5rem;
}
@media (min-width: 640px) {
	.inv-hf-flat-grid {
		grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
		gap: 0.6rem;
	}
}

/* ── Hero Card ────────────────────────────────────────────────────────────── */

.inv-hf-card {
	display: flex;
	flex-direction: column;
	align-items: center;
	width: 82px;
	flex-shrink: 0;
	text-decoration: none;
	color: #c8cce8;
	background: #111827;
	border: 1px solid rgba(255, 255, 255, 0.07);
	border-radius: 0.5rem;
	overflow: hidden;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
	transition: all 0.15s ease;
	cursor: pointer;
	position: relative;
}
.inv-hf-card:hover {
	border-color: var(--tier-color, rgba(255, 255, 255, 0.2));
	transform: translateY(-3px) scale(1.04);
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 0 1px var(--tier-color, transparent);
}
.inv-hf-card.owned {
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3), inset 0 0 0 2px rgba(245, 158, 11, 0.3);
}
.inv-hf-card.compare-selected {
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3), inset 0 0 0 2px rgba(59, 130, 246, 0.5);
}

.inv-hf-card__img {
	width: 82px;
	height: 82px;
	overflow: hidden;
	background: #1a2235;
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	position: relative;
}
.inv-hf-card__img img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: top;
	display: block;
}
.inv-hf-card__placeholder {
	color: #2d3a52;
}

/* Card action buttons (heart + compare) */
.inv-hf-card__actions {
	position: absolute;
	top: 2px;
	right: 2px;
	display: flex;
	flex-direction: column;
	gap: 2px;
	opacity: 0;
	transition: opacity 0.15s;
}
.inv-hf-card:hover .inv-hf-card__actions {
	opacity: 1;
}
.inv-hf-card__act-btn {
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.6);
	border: none;
	color: #6b7494;
	font-size: 0.6rem;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 0.15s;
	padding: 0;
	line-height: 1;
}
.inv-hf-card__act-btn:hover {
	background: rgba(0, 0, 0, 0.8);
	color: #f0f4ff;
}
.inv-hf-card__act-btn.owned {
	color: #f59e0b;
	opacity: 1;
}
.inv-hf-card__act-btn--shield svg {
	display: block;
}
.inv-hf-card__act-btn.compare-active {
	color: #3b82f6;
	opacity: 1;
}
/* Always show heart if owned */
.inv-hf-card.owned .inv-hf-card__actions {
	opacity: 1;
}
.inv-hf-card.compare-selected .inv-hf-card__actions {
	opacity: 1;
}

.inv-hf-card__name {
	width: 100%;
	padding: 0.2rem 0.25rem 0.15rem;
	font-size: 0.6rem;
	font-weight: 500;
	text-align: center;
	line-height: 1.3;
	color: #6b7494;
	overflow: hidden;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	word-break: break-word;
	transition: color 0.15s;
}
.inv-hf-card:hover .inv-hf-card__name {
	color: #f0f4ff;
}

.inv-hf-card__badges {
	display: none;
	flex-wrap: wrap;
	justify-content: center;
	gap: 2px;
	padding: 0 0.25rem 0.1rem;
}
.inv-hf-card__badge {
	font-size: 0.45rem;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: #6b7494;
	background: rgba(255, 255, 255, 0.05);
	border-radius: 2px;
	padding: 0 0.25rem;
}

.inv-hf-card__rating {
	font-family: 'Rajdhani', sans-serif;
	font-weight: 700;
	font-size: 0.85rem;
	color: var(--tier-color, #c8cce8);
	line-height: 1;
	padding-bottom: 0.15rem;
}

.inv-hf-card__stars {
	display: flex;
	gap: 1px;
	padding-bottom: 0.3rem;
	font-size: 0.5rem;
	line-height: 1;
}
.inv-hf-card__star {
	color: #3d4560;
}
.inv-hf-card__star.filled {
	color: #f59e0b;
}

@media (min-width: 1024px) {
	.inv-hf-card {
		width: 90px;
	}
	.inv-hf-card__img {
		width: 90px;
		height: 90px;
	}
	.inv-hf-card__badges {
		display: flex;
	}
}
/* In flat grid, cards fill the cell */
.inv-hf-flat-grid .inv-hf-card {
	width: 100%;
}
.inv-hf-flat-grid .inv-hf-card__img {
	width: 100%;
	aspect-ratio: 1;
	height: auto;
}

/* ── Compare Bar (fixed bottom) ───────────────────────────────────────────── */

.inv-hf-compare-bar {
	position: fixed;
	bottom: 0;
	left: 0;
	right: 0;
	background: #111827;
	border-top: 1px solid rgba(255, 255, 255, 0.1);
	padding: 0.5rem 1rem;
	display: flex;
	align-items: center;
	gap: 0.5rem;
	z-index: 40;
	transform: translateY(100%);
	transition: transform 0.25s ease;
	box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.4);
}
.inv-hf-compare-bar.visible {
	transform: translateY(0);
}
.inv-hf-compare-bar__label {
	font-size: 0.75rem;
	font-weight: 600;
	color: #c8cce8;
	font-family: 'Rajdhani', sans-serif;
	white-space: nowrap;
}
.inv-hf-compare-bar__thumbs {
	display: flex;
	gap: 0.3rem;
	flex: 1;
	overflow-x: auto;
}
.inv-hf-compare-bar__thumb {
	position: relative;
	width: 36px;
	height: 36px;
	border-radius: 0.375rem;
	overflow: hidden;
	border: 2px solid #3b82f6;
	flex-shrink: 0;
	cursor: pointer;
}
.inv-hf-compare-bar__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}
.inv-hf-compare-bar__thumb-x {
	position: absolute;
	top: -2px;
	right: -2px;
	width: 14px;
	height: 14px;
	border-radius: 50%;
	background: #ef4444;
	color: #fff;
	font-size: 0.55rem;
	display: flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
}
.inv-hf-compare-bar__actions {
	display: flex;
	gap: 0.3rem;
}
.inv-hf-compare-btn {
	background: #3b82f6;
	color: #fff;
	border: none;
	border-radius: 0.375rem;
	padding: 0.4rem 0.75rem;
	font-size: 0.7rem;
	font-weight: 600;
	cursor: pointer;
	font-family: 'Inter', sans-serif;
	transition: background 0.15s;
}
.inv-hf-compare-btn:hover {
	background: #2563eb;
}
.inv-hf-compare-btn:disabled {
	opacity: 0.4;
	cursor: default;
}
.inv-hf-compare-clear {
	background: none;
	border: 1px solid rgba(255, 255, 255, 0.1);
	color: #6b7494;
	border-radius: 0.375rem;
	padding: 0.4rem 0.6rem;
	font-size: 0.7rem;
	cursor: pointer;
	font-family: 'Inter', sans-serif;
	transition: all 0.15s;
}
.inv-hf-compare-clear:hover {
	color: #f0f4ff;
	border-color: rgba(255, 255, 255, 0.2);
}

/* ── Compare Modal ────────────────────────────────────────────────────────── */

.inv-hf-modal-overlay {
	display: none;
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.7);
	backdrop-filter: blur(4px);
	z-index: 100;
	align-items: center;
	justify-content: center;
	padding: 1rem;
}
.inv-hf-modal-overlay.open {
	display: flex;
}
.inv-hf-modal {
	background: #0d1424;
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: 0.75rem;
	width: 100%;
	max-width: 700px;
	max-height: 80vh;
	overflow-y: auto;
	box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6);
}
.inv-hf-modal__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 1rem 1.25rem;
	border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.inv-hf-modal__title {
	font-family: 'Rajdhani', sans-serif;
	font-weight: 700;
	font-size: 1.2rem;
	color: #f0f4ff;
	letter-spacing: 0.03em;
}
.inv-hf-modal__close {
	background: none;
	border: none;
	color: #6b7494;
	font-size: 1.5rem;
	cursor: pointer;
	line-height: 1;
	padding: 0.2rem;
}
.inv-hf-modal__close:hover {
	color: #f0f4ff;
}

.inv-hf-modal__heroes {
	display: flex;
	gap: 1rem;
	padding: 1rem 1.25rem;
	justify-content: center;
}
.inv-hf-modal__hero {
	text-align: center;
	flex: 1;
	max-width: 200px;
}
.inv-hf-modal__hero-img {
	width: 80px;
	height: 80px;
	border-radius: 0.5rem;
	overflow: hidden;
	margin: 0 auto 0.5rem;
	border: 2px solid var(--tier-color, #3d4560);
}
.inv-hf-modal__hero-img img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}
.inv-hf-modal__hero-name {
	font-size: 0.8rem;
	font-weight: 600;
	color: #f0f4ff;
	margin-bottom: 0.15rem;
}
.inv-hf-modal__hero-tier {
	font-size: 0.65rem;
	color: var(--tier-color, #6b7494);
	font-weight: 600;
}

/* Stat comparison bars */
.inv-hf-modal__stats {
	padding: 0 1.25rem 1.25rem;
}
.inv-hf-stat-row {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	margin-bottom: 0.6rem;
}
.inv-hf-stat-row:last-child {
	margin-bottom: 0;
}
.inv-hf-stat-label {
	width: 70px;
	flex-shrink: 0;
	font-size: 0.65rem;
	font-weight: 600;
	color: #6b7494;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	text-align: right;
}
.inv-hf-stat-bars {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 3px;
}
.inv-hf-stat-bar {
	height: 14px;
	border-radius: 3px;
	display: flex;
	align-items: center;
	position: relative;
}
.inv-hf-stat-bar__fill {
	height: 100%;
	border-radius: 3px;
	transition: width 0.3s ease;
	min-width: 2px;
}
.inv-hf-stat-bar__val {
	font-size: 0.55rem;
	font-weight: 600;
	color: #f0f4ff;
	padding-left: 0.3rem;
	position: absolute;
	right: 4px;
}
.inv-hf-stat-bar:nth-child(1) .inv-hf-stat-bar__fill {
	background: rgba(245, 158, 11, 0.6);
}
.inv-hf-stat-bar:nth-child(2) .inv-hf-stat-bar__fill {
	background: rgba(59, 130, 246, 0.6);
}
.inv-hf-stat-bar:nth-child(3) .inv-hf-stat-bar__fill {
	background: rgba(16, 185, 129, 0.6);
}

/* ── No results ───────────────────────────────────────────────────────────── */

.inv-hf-empty {
	text-align: center;
	padding: 3rem 1rem;
	color: #3d4560;
	font-size: 0.85rem;
}

/* ── Mobile scroll snap ───────────────────────────────────────────────────── */

@media (max-width: 639px) {
	.inv-hf-tier-heroes {
		scroll-snap-type: x mandatory;
	}
	.inv-hf-tier-heroes .inv-hf-card {
		scroll-snap-align: start;
	}
}
