/**
 * Nexus Tooltip Stylesheet — D&D Technomancy & Wowhead Rarity Design System
 * Uses Cinesist Theme Tokens: --cs-brand, --cs-brand-2, Glassmorphism
 */

:root {
	--nx-brand: var(--cs-brand, #6366f1);
	--nx-brand-2: var(--cs-brand-2, #ec4899);
	--nx-bg-glass: rgba(15, 23, 42, 0.92);
	--nx-border-glass: rgba(255, 255, 255, 0.12);
	--nx-shadow: 0 16px 36px -4px rgba(0, 0, 0, 0.6), 0 0 20px rgba(99, 102, 241, 0.15);
	--nx-radius: 12px;

	/* Wowhead Rarity Color Palette */
	--nx-rarity-poor: #9d9d9d;
	--nx-rarity-common: #ffffff;
	--nx-rarity-uncommon: #1eff00;
	--nx-rarity-rare: #0070dd;
	--nx-rarity-very_rare: #a335ee;
	--nx-rarity-legendary: #ff8000;
	--nx-rarity-artifact: #e6cc80;
}

/* Tooltip Portal Wrapper */
.nexus-tooltip-portal {
	position: fixed;
	z-index: 999999;
	pointer-events: none;
	opacity: 0;
	transform: scale(0.96) translateY(4px);
	transition: opacity 0.14s ease-out, transform 0.14s ease-out;
	max-width: 380px;
	width: max-content;
	box-sizing: border-box;
	font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	will-change: transform, opacity, left, top;
}

.nexus-tooltip-portal.is-visible {
	opacity: 1;
	transform: scale(1) translateY(0);
}

/* Card Shell */
.nx-tp-card {
	background: var(--nx-bg-glass);
	backdrop-filter: blur(16px);
	-webkit-backdrop-filter: blur(16px);
	border: 1px solid var(--nx-border-glass);
	border-radius: var(--nx-radius);
	box-shadow: var(--nx-shadow);
	padding: 14px;
	color: #f1f5f9;
	overflow: hidden;
}

.nx-tp-body {
	display: flex;
	gap: 14px;
	align-items: flex-start;
}

/* Visual Media */
.nx-tp-poster {
	width: 80px;
	height: 118px;
	flex-shrink: 0;
	border-radius: 8px;
	overflow: hidden;
	box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
	border: 1px solid rgba(255, 255, 255, 0.08);
	background: #1e293b;
}

.nx-tp-poster img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.nx-tp-icon {
	width: 54px;
	height: 54px;
	flex-shrink: 0;
	border-radius: 8px;
	overflow: hidden;
	border: 2px solid var(--nx-border-glass);
	background: #0f172a;
}

.nx-tp-icon img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.nx-tp-avatar {
	width: 60px;
	height: 60px;
	flex-shrink: 0;
	border-radius: 50%;
	overflow: hidden;
	border: 2px solid var(--nx-brand);
}

.nx-tp-avatar img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

/* Typography & Content Layout */
.nx-tp-main {
	flex: 1;
	min-width: 0;
}

.nx-tp-header-line {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 6px;
}

.nx-tp-badge {
	display: inline-block;
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	padding: 2px 7px;
	border-radius: 4px;
	background: rgba(255, 255, 255, 0.08);
	color: #94a3b8;
}

.nx-tp-badge-cinema {
	background: rgba(236, 72, 153, 0.2);
	color: #f472b6;
	border: 1px solid rgba(236, 72, 153, 0.4);
}

.nx-tp-badge-game {
	background: rgba(99, 102, 241, 0.2);
	color: #a5b4fc;
	border: 1px solid rgba(99, 102, 241, 0.4);
}

.nx-tp-badge-ext {
	background: rgba(59, 130, 246, 0.2);
	color: #60a5fa;
}

.nx-tp-rating {
	display: inline-flex;
	align-items: center;
	gap: 3px;
	font-size: 11px;
	font-weight: 700;
	color: #fbbf24;
	background: rgba(251, 191, 36, 0.12);
	padding: 2px 6px;
	border-radius: 4px;
}

.nx-tp-title {
	font-size: 16px;
	font-weight: 700;
	line-height: 1.25;
	margin: 0 0 4px;
	color: #ffffff;
	word-break: break-word;
}

.nx-tp-meta-bar {
	font-size: 12px;
	color: #94a3b8;
	margin-bottom: 6px;
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	align-items: center;
}

.nx-tp-bullet {
	opacity: 0.5;
}

.nx-tp-desc {
	font-size: 12px;
	line-height: 1.5;
	color: #cbd5e1;
	margin: 0;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.nx-tp-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	margin-bottom: 6px;
}

.nx-tp-tag {
	font-size: 10px;
	background: rgba(255, 255, 255, 0.06);
	padding: 2px 6px;
	border-radius: 4px;
	color: #cbd5e1;
}

.nx-tp-platform {
	background: rgba(99, 102, 241, 0.15);
	color: #c7d2fe;
}

.nx-tp-subdued {
	font-size: 11px;
	color: #64748b;
}

/* =========================================================================
   WOWHEAD RARITY THEMES (D&D 5E CODEX)
   ========================================================================= */

.nx-rarity-uncommon {
	border-color: var(--nx-rarity-uncommon) !important;
	box-shadow: 0 0 16px rgba(30, 255, 0, 0.25) !important;
}
.nx-title-uncommon { color: var(--nx-rarity-uncommon) !important; }
.nx-tp-badge-uncommon { background: rgba(30, 255, 0, 0.15); color: var(--nx-rarity-uncommon); }

.nx-rarity-rare {
	border-color: var(--nx-rarity-rare) !important;
	box-shadow: 0 0 18px rgba(0, 112, 221, 0.3) !important;
}
.nx-title-rare { color: var(--nx-rarity-rare) !important; }
.nx-tp-badge-rare { background: rgba(0, 112, 221, 0.15); color: var(--nx-rarity-rare); }

.nx-rarity-very_rare {
	border-color: var(--nx-rarity-very_rare) !important;
	box-shadow: 0 0 20px rgba(163, 53, 238, 0.35) !important;
}
.nx-title-very_rare { color: var(--nx-rarity-very_rare) !important; }
.nx-tp-badge-very_rare { background: rgba(163, 53, 238, 0.15); color: var(--nx-rarity-very_rare); }

.nx-rarity-legendary {
	border-color: var(--nx-rarity-legendary) !important;
	box-shadow: 0 0 24px rgba(255, 128, 0, 0.4) !important;
}
.nx-title-legendary { color: var(--nx-rarity-legendary) !important; }
.nx-tp-badge-legendary { background: rgba(255, 128, 0, 0.15); color: var(--nx-rarity-legendary); }

.nx-rarity-artifact {
	border-color: var(--nx-rarity-artifact) !important;
	box-shadow: 0 0 26px rgba(230, 204, 128, 0.5) !important;
}
.nx-title-artifact { color: var(--nx-rarity-artifact) !important; }
.nx-tp-badge-artifact { background: rgba(230, 204, 128, 0.2); color: var(--nx-rarity-artifact); }

.nx-tp-stats-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 4px 8px;
	font-size: 11px;
	color: #94a3b8;
	margin: 6px 0;
	background: rgba(0, 0, 0, 0.25);
	padding: 6px 8px;
	border-radius: 6px;
}

.nx-codex-flavor {
	font-style: italic;
	color: #fbbf24;
	opacity: 0.9;
}

/* Page & Review Badges */
.nx-tp-badge-page {
	background: rgba(14, 165, 233, 0.2);
	color: #38bdf8;
	border: 1px solid rgba(14, 165, 233, 0.3);
}

.nx-tp-badge-review {
	background: rgba(245, 158, 11, 0.2);
	color: #fbbf24;
	border: 1px solid rgba(245, 158, 11, 0.3);
}

.nx-tp-score-badge {
	display: inline-flex;
	align-items: center;
	font-size: 12px;
	font-weight: 800;
	padding: 2px 7px;
	border-radius: 6px;
	border: 1.5px solid currentColor;
	background: rgba(0, 0, 0, 0.3);
}

