/**
 * WeaveLink™ - Authentic Wowhead-Style Entity Links & Containment
 *
 * Provides strict 18x18 icon containment to prevent theme distortion,
 * unified Cinescore DNA (1-10) rarity colors, and seamless ScryTech integration.
 */

:root {
	/* Cinescore DNA Unified 7-Tier Rarity Spectrum */
	--nx-cs-mythic: #e5c158;
	--nx-cs-legendary: #ff8000;
	--nx-cs-epic: #a335ee;
	--nx-cs-rare: #0070dd;
	--nx-cs-uncommon: #1eff00;
	--nx-cs-common: #ffffff;
	--nx-cs-scrap: #9d9d9d;
	--nx-cs-nr: var(--cs-brand, #a855f7);

	/* WoWhead & RPG Aliases */
	--nx-wl-artifact: var(--nx-cs-mythic);
	--nx-wl-mythic: var(--nx-cs-mythic);
	--nx-wl-legendary: var(--nx-cs-legendary);
	--nx-wl-epic: var(--nx-cs-epic);
	--nx-wl-rare: var(--nx-cs-rare);
	--nx-wl-uncommon: var(--nx-cs-uncommon);
	--nx-wl-common: var(--nx-cs-common);
	--nx-wl-poor: var(--nx-cs-scrap);
	--nx-wl-burn: var(--nx-cs-scrap);
	--nx-wl-trash: var(--nx-cs-scrap);
	--nx-wl-basic: var(--nx-cs-rare);
	--nx-wl-nr: var(--nx-cs-nr);
	--nx-wl-heirloom: #00ccff;
}

/* Base WeaveLink Anchor */
a.nx-weavelink,
.nx-weavelink {
	display: inline-flex !important;
	align-items: center !important;
	vertical-align: baseline !important;
	text-decoration: none !important;
	gap: 5px !important;
	line-height: inherit !important;
	font-weight: 600 !important;
	font-size: inherit !important;
	cursor: pointer !important;
	transition: filter 0.15s ease, text-shadow 0.15s ease, opacity 0.15s ease !important;
	white-space: nowrap !important;
	padding: 0 2px !important;
}

a.nx-weavelink:hover,
.nx-weavelink:hover {
	text-decoration: underline !important;
	filter: brightness(1.25) !important;
	text-shadow: 0 0 8px currentColor !important;
}

/* Strict 18x18 Icon Frame (Prevents Theme 100% Width Distortion) */
.nx-weavelink .nx-wl-icon-frame {
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	width: 18px !important;
	height: 18px !important;
	min-width: 18px !important;
	min-height: 18px !important;
	max-width: 18px !important;
	max-height: 18px !important;
	flex-shrink: 0 !important;
	vertical-align: -3px !important;
	border-radius: 3px !important;
	overflow: hidden !important;
	box-shadow: 0 0 4px rgba(0, 0, 0, 0.6) !important;
	border: 1px solid rgba(255, 255, 255, 0.25) !important;
	background: #0b0f19 !important;
	margin: 0 !important;
	padding: 0 !important;
}

/* Strict Image Size Reset */
.nx-weavelink .nx-wl-icon-frame img.nx-wl-icon,
.nx-weavelink img.nx-wl-icon {
	display: block !important;
	width: 18px !important;
	height: 18px !important;
	min-width: 18px !important;
	min-height: 18px !important;
	max-width: 18px !important;
	max-height: 18px !important;
	object-fit: cover !important;
	margin: 0 !important;
	padding: 0 !important;
	border: none !important;
	border-radius: 2px !important;
}

/* Link Title */
.nx-weavelink .nx-wl-title {
	line-height: inherit !important;
	color: inherit !important;
}

/* =========================================================================
   Unified 7-Tier Cinescore Quality Classes
   ========================================================================= */

/* 95–100: Mythic / Artifact (#E5C158 Prismatic Champagne Gold) */
.nx-wl-quality-mythic,
.nx-wl-quality-artifact {
	color: var(--nx-cs-mythic) !important;
}
.nx-wl-quality-mythic:hover,
.nx-wl-quality-artifact:hover {
	text-shadow: 0 0 10px rgba(229, 193, 88, 0.75), 0 0 16px rgba(229, 193, 88, 0.4) !important;
}

/* 85–94: Legendary (#FF8000 Sunset / Solar Amber) */
.nx-wl-quality-legendary {
	color: var(--nx-cs-legendary) !important;
}
.nx-wl-quality-legendary:hover {
	text-shadow: 0 0 10px rgba(255, 128, 0, 0.75), 0 0 16px rgba(255, 128, 0, 0.4) !important;
}

/* 75–84: Epic (#A335EE Deep Arcane Amethyst) */
.nx-wl-quality-epic {
	color: var(--nx-cs-epic) !important;
}
.nx-wl-quality-epic:hover {
	text-shadow: 0 0 10px rgba(163, 53, 238, 0.75), 0 0 16px rgba(163, 53, 238, 0.4) !important;
}

/* 60–74: Rare (#0070DD Cobalt Sapphire Blue) */
.nx-wl-quality-rare,
.nx-wl-quality-basic {
	color: var(--nx-cs-rare) !important;
}
.nx-wl-quality-rare:hover,
.nx-wl-quality-basic:hover {
	text-shadow: 0 0 10px rgba(0, 112, 221, 0.75), 0 0 16px rgba(0, 112, 221, 0.4) !important;
}

/* 45–59: Uncommon (#1EFF00 Meadow Emerald Green) */
.nx-wl-quality-uncommon {
	color: var(--nx-cs-uncommon) !important;
}
.nx-wl-quality-uncommon:hover {
	text-shadow: 0 0 10px rgba(30, 255, 0, 0.75), 0 0 16px rgba(30, 255, 0, 0.4) !important;
}

/* 25–44: Common (#FFFFFF Slate / Crisp White) */
.nx-wl-quality-common {
	color: var(--nx-cs-common) !important;
}
.nx-wl-quality-common:hover {
	text-shadow: 0 0 8px rgba(255, 255, 255, 0.6) !important;
}

/* 0–24: Scrap / Poor / Trash / Burn (#9D9D9D Corroded Ash Grey) */
.nx-wl-quality-scrap,
.nx-wl-quality-poor,
.nx-wl-quality-burn,
.nx-wl-quality-trash {
	color: var(--nx-cs-scrap) !important;
}
.nx-wl-quality-scrap:hover,
.nx-wl-quality-poor:hover,
.nx-wl-quality-burn:hover,
.nx-wl-quality-trash:hover {
	text-shadow: 0 0 8px rgba(157, 157, 157, 0.6) !important;
}

/* Unrated / NR (Technomancy Brand Adaptive Color) */
.nx-wl-quality-nr,
.nx-wl-quality-unrated {
	color: var(--nx-cs-nr) !important;
}
.nx-wl-quality-nr:hover,
.nx-wl-quality-unrated:hover {
	text-shadow: 0 0 10px var(--nx-cs-nr) !important;
}

.nx-wl-quality-heirloom {
	color: var(--nx-wl-heirloom) !important;
}

/* Entity Type Fallback Accents (Only apply if common or unclassified) */
.nx-wl-quality-common.nx-wl-type-cdb_character,
.nx-wl-quality-common.nx-wl-type-character {
	color: var(--cs-brand, #c084fc) !important;
}
.nx-wl-quality-common.nx-wl-type-cdb_platform,
.nx-wl-quality-common.nx-wl-type-platform {
	color: #38bdf8 !important;
}
.nx-wl-quality-common.nx-wl-type-cdb_person,
.nx-wl-quality-common.nx-wl-type-person {
	color: #fbbf24 !important;
}
.nx-wl-quality-common.nx-wl-type-cdb_game,
.nx-wl-quality-common.nx-wl-type-game {
	color: #10b981 !important;
}
.nx-wl-quality-common.nx-wl-type-user {
	color: #38bdf8 !important;
}
.nx-wl-quality-common.nx-wl-type-external {
	color: #f59e0b !important;
}
