/*!
 * Nickname Style Generator
 * v2.1.3 — nicknamestyle.online
 * Light theme default. No external fonts. System stack only for CWV.
 *
 * v2.1.3 changes:
 *   - Decoration panels collapsed into ONE card with a horizontal tab strip
 *   - Attractive segmented theme switch (Light / Dark) below the input
 *   - Popular picks / gallery / deco frames names CENTERED on all screens
 *   - Infinite scroll — Load More buttons removed, content auto-loads on scroll
 *   - In-game preview card redesigned for clarity on desktop & mobile
 */

.nsg-app {
	--nsg-bg: #F5F7FA;
	--nsg-surface: #FFFFFF;
	--nsg-surface-2: #F8FAFC;
	--nsg-surface-hover: #EEF1F6;
	--nsg-border: #DDE3EC;
	--nsg-border-strong: #C4CCD9;
	--nsg-text: #0F172A;
	--nsg-text-dim: #475569;
	--nsg-text-muted: #94A3B8;
	--nsg-accent: #4F46E5;
	--nsg-accent-hover: #4338CA;
	--nsg-accent-soft: #E0E7FF;
	--nsg-accent-glow: rgba(79, 70, 229, 0.18);
	--nsg-accent-2: #4F46E5;
	--nsg-success: #10B981;
	--nsg-danger: #EF4444;
	--nsg-radius: 12px;
	--nsg-radius-sm: 6px;
	--nsg-radius-lg: 18px;
	--nsg-shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04), 0 1px 3px rgba(15, 23, 42, 0.05);
	--nsg-shadow: 0 2px 8px rgba(15, 23, 42, 0.05), 0 1px 3px rgba(15, 23, 42, 0.03);
	--nsg-shadow-hover: 0 8px 24px rgba(79, 70, 229, 0.12);
	--nsg-font-ui: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--nsg-font-mono: ui-monospace, "SF Mono", "Cascadia Mono", "Segoe UI Mono", Menlo, Consolas, monospace;

	max-width: 960px;
	margin: 0 auto;
	padding: 32px 16px;
	background: var(--nsg-bg);
	color: var(--nsg-text);
	font-family: var(--nsg-font-ui);
	line-height: 1.5;
	border-radius: var(--nsg-radius-lg);
	box-sizing: border-box;
	-webkit-font-smoothing: antialiased;
	position: relative;
}

.nsg-app > * { position: relative; z-index: 1; }
.nsg-app *, .nsg-app *::before, .nsg-app *::after { box-sizing: border-box; }

.nsg-theme-dark {
	--nsg-bg: #0A0E1A;
	--nsg-surface: #131829;
	--nsg-surface-2: #1A2038;
	--nsg-surface-hover: #1F2846;
	--nsg-border: #232B47;
	--nsg-border-strong: #2E3960;
	--nsg-text: #F0F4FF;
	--nsg-text-dim: #8B95B0;
	--nsg-text-muted: #5B6480;
	--nsg-accent-soft: rgba(79, 70, 229, 0.15);
}

/* ============ HEADER ============ */

.nsg-header { text-align: center; margin-bottom: 28px; }

.nsg-title {
	font-size: clamp(28px, 5vw, 40px);
	font-weight: 800;
	margin: 0 0 8px 0;
	letter-spacing: -0.03em;
	color: var(--nsg-text);
}

.nsg-subtitle {
	font-size: 15px;
	color: var(--nsg-text-dim);
	margin: 0;
	max-width: 480px;
	margin-left: auto;
	margin-right: auto;
}

/* ============ INPUT ============ */

/* v2.1.2: sticky input — never disappears while user scrolls the tool.
   --nsg-sticky-top can be overridden in a child theme if the site has its own
   sticky header (e.g. --nsg-sticky-top: 60px;) or the WP admin bar is shown. */
.nsg-app { --nsg-sticky-top: 0px; }

.nsg-input-wrap {
	position: sticky;
	top: var(--nsg-sticky-top);
	z-index: 40;
	margin-bottom: 18px;
	background: var(--nsg-surface);
	border: 1px solid var(--nsg-border);
	border-radius: var(--nsg-radius);
	box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08), 0 1px 3px rgba(15, 23, 42, 0.05);
	overflow: hidden;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
	/* solid backdrop so cards behind don't bleed through translucent surface */
	backdrop-filter: saturate(180%);
}

.nsg-input-wrap:focus-within {
	border-color: var(--nsg-accent);
	box-shadow: 0 0 0 4px var(--nsg-accent-glow), 0 4px 14px rgba(15, 23, 42, 0.08);
}

.nsg-input {
	width: 100%;
	padding: 20px 22px 8px;
	font-size: 20px;
	font-family: var(--nsg-font-ui);
	font-weight: 500;
	background: transparent;
	color: var(--nsg-text);
	border: none;
	outline: none;
	-webkit-appearance: none;
	appearance: none;
}

.nsg-input::placeholder { color: var(--nsg-text-muted); font-weight: 400; }

.nsg-input-meta {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 8px 22px 14px;
	font-size: 13px;
}

.nsg-counter {
	font-family: var(--nsg-font-mono);
	color: var(--nsg-text-dim);
	font-variant-numeric: tabular-nums;
	font-weight: 500;
}

.nsg-counter.is-over .nsg-count,
.nsg-counter.is-over .nsg-count-sep,
.nsg-counter.is-over .nsg-count-limit {
	color: var(--nsg-danger);
	font-weight: 700;
}

.nsg-clear {
	background: none;
	border: none;
	color: var(--nsg-text-dim);
	cursor: pointer;
	font-size: 13px;
	padding: 4px 10px;
	border-radius: var(--nsg-radius-sm);
	font-family: inherit;
	font-weight: 500;
	transition: all 0.15s ease;
}

.nsg-clear:hover, .nsg-clear:focus-visible {
	color: var(--nsg-accent);
	background: var(--nsg-accent-soft);
	outline: none;
}

/* ============ TABS ============ */

.nsg-tabs {
	display: flex;
	gap: 6px;
	overflow-x: auto;
	scrollbar-width: none;
	padding: 4px 0 16px;
	margin: 0 -16px 20px;
	padding-left: 16px;
	padding-right: 16px;
	-webkit-overflow-scrolling: touch;
}

.nsg-tabs::-webkit-scrollbar { display: none; }

.nsg-tab {
	flex-shrink: 0;
	padding: 8px 16px;
	background: var(--nsg-surface);
	color: var(--nsg-text-dim);
	border: 1px solid var(--nsg-border);
	border-radius: 999px;
	font-size: 13px;
	font-weight: 600;
	font-family: inherit;
	cursor: pointer;
	transition: all 0.15s ease;
	white-space: nowrap;
}

.nsg-tab:hover, .nsg-tab:focus-visible {
	color: var(--nsg-text);
	border-color: var(--nsg-border-strong);
	outline: none;
}

.nsg-tab.is-active {
	background: var(--nsg-text);
	color: #ffffff;
	border-color: var(--nsg-text);
}

/* ============ OUTPUT GRID ============ */

.nsg-output {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-bottom: 28px;
	min-height: 120px;
}

/* v2.1.2: card is now a 2-row grid — label (pill) top-left, fav + copy
   top-right, and the full styled name centered on its own row so it never
   gets cropped by adjacent controls. Reads clearly on mobile & desktop. */
.nsg-card {
	background: var(--nsg-surface);
	border: 1px solid var(--nsg-border);
	border-radius: var(--nsg-radius);
	padding: 12px 14px 14px;
	display: grid;
	grid-template-columns: auto 1fr auto auto;
	grid-template-areas:
		"label . fav copy"
		"text  text text text";
	column-gap: 8px;
	row-gap: 10px;
	align-items: center;
	position: relative;
	overflow: hidden;
	transition: border-color 0.15s ease, box-shadow 0.2s ease;
	box-shadow: var(--nsg-shadow-sm);
}

.nsg-card:hover {
	border-color: var(--nsg-accent);
	box-shadow: var(--nsg-shadow-hover);
}

.nsg-card-label {
	grid-area: label;
	display: inline-block;
	width: auto;
	padding: 4px 10px;
	background: var(--nsg-accent-soft);
	color: var(--nsg-accent);
	border-radius: 999px;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	line-height: 1.2;
	white-space: nowrap;
	justify-self: start;
}

.nsg-card-text {
	grid-area: text;
	min-width: 0;
	width: 100%;
	font-size: 22px;
	line-height: 1.4;
	color: var(--nsg-text);
	text-align: center;
	/* v2.1.4: wrap the full styled name onto multiple lines instead of scrolling
	   it behind a fade — every decorative symbol at the ends stays fully visible. */
	white-space: normal;
	overflow-wrap: anywhere;
	word-break: break-word;
	padding: 6px 4px;
}

.nsg-card-text::-webkit-scrollbar { display: none; }

.nsg-card > .nsg-card-fav {
	grid-area: fav;
	justify-self: end;
	align-self: center;
}

.nsg-card-copy {
	grid-area: copy;
	justify-self: end;
	align-self: center;
	background: var(--nsg-surface-2);
	color: var(--nsg-text);
	border: 1px solid var(--nsg-border);
	border-radius: var(--nsg-radius-sm);
	padding: 6px 12px;
	font-size: 12px;
	font-weight: 600;
	font-family: inherit;
	cursor: pointer;
	transition: all 0.15s ease;
	display: inline-flex;
	align-items: center;
	gap: 5px;
}

.nsg-card-copy:hover, .nsg-card-copy:focus-visible {
	background: var(--nsg-accent);
	color: #ffffff;
	border-color: var(--nsg-accent);
	outline: none;
}

.nsg-card-copy.is-copied {
	background: var(--nsg-success);
	color: #ffffff;
	border-color: var(--nsg-success);
}

.nsg-empty {
	grid-column: 1 / -1;
	text-align: center;
	padding: 50px 20px;
	color: var(--nsg-text-muted);
	background: var(--nsg-surface);
	border: 1px dashed var(--nsg-border);
	border-radius: var(--nsg-radius);
}

.nsg-empty-icon {
	display: block;
	font-size: 40px;
	margin-bottom: 12px;
	opacity: 0.4;
}

.nsg-empty p { margin: 0; font-size: 14px; }

/* ============ PANELS ============ */

.nsg-panels {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-bottom: 28px;
}

.nsg-panel {
	background: var(--nsg-surface);
	border: 1px solid var(--nsg-border);
	border-radius: var(--nsg-radius);
	overflow: hidden;
	box-shadow: var(--nsg-shadow-sm);
}

.nsg-panel-title {
	padding: 14px 18px;
	font-weight: 700;
	font-size: 14px;
	color: var(--nsg-text);
	cursor: pointer;
	list-style: none;
	display: flex;
	align-items: center;
	justify-content: space-between;
	user-select: none;
}

.nsg-panel-title::-webkit-details-marker { display: none; }

.nsg-panel-title::after {
	content: "+";
	font-size: 20px;
	font-weight: 400;
	color: var(--nsg-text-dim);
	transition: transform 0.2s ease;
}

.nsg-panel[open] .nsg-panel-title::after { content: "−"; }
.nsg-panel-title:hover { color: var(--nsg-accent); }

.nsg-wrap-grid, .nsg-symbol-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
	gap: 6px;
	padding: 0 12px 14px;
}

.nsg-symbol-grid { grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); }

.nsg-chip {
	background: var(--nsg-surface-2);
	border: 1px solid var(--nsg-border);
	color: var(--nsg-text);
	padding: 10px 8px;
	border-radius: var(--nsg-radius-sm);
	font-size: 14px;
	cursor: pointer;
	font-family: inherit;
	transition: all 0.12s ease;
	text-align: center;
	line-height: 1.2;
	min-height: 40px;
	display: flex;
	align-items: center;
	justify-content: center;
	word-break: break-all;
}

.nsg-chip:hover, .nsg-chip:focus-visible {
	background: var(--nsg-accent);
	color: #ffffff;
	border-color: var(--nsg-accent);
	outline: none;
	transform: translateY(-1px);
}

.nsg-chip.is-active {
	background: var(--nsg-text);
	color: #ffffff;
	border-color: var(--nsg-text);
}

.nsg-chip.is-flash { animation: nsg-flash 0.4s ease; }

@keyframes nsg-flash {
	0%, 100% { background: var(--nsg-surface-2); }
	50% { background: var(--nsg-success); color: #ffffff; }
}

/* ============ RECENT ============ */

.nsg-recent {
	padding: 0 12px 14px;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.nsg-recent-item {
	background: var(--nsg-surface-2);
	border: 1px solid var(--nsg-border);
	border-radius: var(--nsg-radius-sm);
	padding: 10px 14px;
	font-size: 15px;
	cursor: pointer;
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 10px;
	transition: border-color 0.15s ease;
}

.nsg-recent-item:hover { border-color: var(--nsg-accent); }

.nsg-recent-item-text {
	flex: 1;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	color: var(--nsg-text);
}

.nsg-recent-item-copy {
	font-size: 11px;
	color: var(--nsg-text-dim);
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	flex-shrink: 0;
}

.nsg-recent-empty {
	color: var(--nsg-text-muted);
	font-size: 13px;
	margin: 0;
	padding: 10px 4px;
}

/* ============ GALLERY ============ */

.nsg-gallery { margin-top: 8px; }

.nsg-gallery-title {
	font-size: 20px;
	font-weight: 700;
	margin: 0 0 16px 0;
	color: var(--nsg-text);
	letter-spacing: -0.01em;
}

.nsg-gallery-grid {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

/* v2.1.3: gallery item now uses the same 2-row grid as the output cards
   so the styled name always sits CENTERED and gets a full readable row.
   Meta (badge + copy) floats top-right; a small rank pill (if present) sits
   top-left. Works identically on mobile and desktop. */
.nsg-gallery-item {
	background: var(--nsg-surface);
	border: 1px solid var(--nsg-border);
	border-radius: var(--nsg-radius);
	padding: 12px 14px 14px;
	display: grid;
	grid-template-columns: auto 1fr auto;
	grid-template-areas:
		"rank .    meta"
		"text text text";
	column-gap: 8px;
	row-gap: 8px;
	align-items: center;
	cursor: pointer;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
	box-shadow: var(--nsg-shadow-sm);
}

.nsg-gallery-item:hover {
	border-color: var(--nsg-accent);
	box-shadow: var(--nsg-shadow-hover);
}

.nsg-gallery-item-text {
	grid-area: text;
	min-width: 0;
	width: 100%;
	font-size: 20px;
	line-height: 1.4;
	color: var(--nsg-text);
	text-align: center;
	white-space: normal;
	overflow-wrap: anywhere;
	word-break: break-word;
	padding: 4px 4px;
}

.nsg-gallery-item-text::-webkit-scrollbar { display: none; }

.nsg-gallery-item-meta {
	grid-area: meta;
	justify-self: end;
	align-self: center;
	display: flex;
	align-items: center;
	gap: 6px;
}

/* SSR fallback: when the Copy pill is a direct child (no meta wrapper, as in the
   server-rendered gallery before JS runs), still place it in the meta cell. */
.nsg-gallery-item > .nsg-gallery-item-btn { grid-area: meta; justify-self: end; align-self: center; }

.nsg-gallery-item-btn {
	background: var(--nsg-surface-2);
	color: var(--nsg-text-dim);
	border: 1px solid var(--nsg-border);
	border-radius: var(--nsg-radius-sm);
	padding: 5px 10px;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	flex-shrink: 0;
}

.nsg-gallery-item:hover .nsg-gallery-item-btn {
	background: var(--nsg-accent);
	color: #fff;
	border-color: var(--nsg-accent);
}

/* ============ TOAST ============ */

.nsg-toast {
	position: fixed;
	bottom: 24px;
	left: 50%;
	transform: translateX(-50%) translateY(120%);
	background: var(--nsg-text);
	color: #ffffff;
	padding: 12px 22px;
	border-radius: 999px;
	font-size: 14px;
	font-weight: 600;
	box-shadow: 0 10px 40px rgba(15, 23, 42, 0.25);
	z-index: 9999;
	opacity: 0;
	transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.2s ease;
	pointer-events: none;
	max-width: 90vw;
	text-align: center;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.nsg-toast.is-visible {
	transform: translateX(-50%) translateY(0);
	opacity: 1;
}

/* ============ A11Y ============ */

.nsg-visually-hidden {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

@media (prefers-reduced-motion: reduce) {
	.nsg-app *, .nsg-app *::before, .nsg-app *::after {
		animation-duration: 0.01ms !important;
		transition-duration: 0.01ms !important;
	}
}

/* ============ MOBILE FINE-TUNE ============ */

@media (max-width: 480px) {
	.nsg-app { padding: 16px 10px; border-radius: 0; }
	.nsg-input { padding: 14px 16px 6px; font-size: 16px; }
	.nsg-input-meta { padding: 6px 16px 12px; }
	.nsg-card { padding: 10px 10px 12px; column-gap: 6px; row-gap: 8px; }
	.nsg-card-text { font-size: 19px; padding: 4px 2px; }
	.nsg-card-label { font-size: 10px; padding: 3px 8px; }
	.nsg-card-copy { padding: 5px 10px; font-size: 11px; }
	.nsg-title { font-size: 24px; }

	/* panel headers a touch tighter, and chip grids denser on tiny screens */
	.nsg-panel-title { padding: 12px 14px; font-size: 13px; }
	.nsg-wrap-grid { grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 5px; padding: 0 10px 12px; }
	.nsg-symbol-grid { grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); gap: 5px; padding: 0 10px 12px; }
	.nsg-chip { padding: 9px 6px; font-size: 13px; min-height: 38px; }
	.nsg-emoji-chip { font-size: 18px; min-width: 36px; padding: 5px 6px; }
	.nsg-recent { padding: 0 10px 12px; }
	.nsg-recent-item { padding: 9px 12px; font-size: 14px; }
}

/* ============ GALLERY CATEGORY TABS ============ */

.nsg-gtabs {
	display: flex;
	gap: 6px;
	overflow-x: auto;
	scrollbar-width: none;
	padding: 0 0 14px;
	margin: 0 -16px 4px;
	padding-left: 16px;
	padding-right: 16px;
	-webkit-overflow-scrolling: touch;
}

.nsg-gtabs::-webkit-scrollbar { display: none; }

.nsg-gtab {
	flex-shrink: 0;
	padding: 7px 14px;
	background: var(--nsg-surface);
	color: var(--nsg-text-dim);
	border: 1px solid var(--nsg-border);
	border-radius: 999px;
	font-size: 12px;
	font-weight: 600;
	font-family: inherit;
	cursor: pointer;
	transition: all 0.15s ease;
	white-space: nowrap;
}

.nsg-gtab:hover, .nsg-gtab:focus-visible {
	color: var(--nsg-text);
	border-color: var(--nsg-border-strong);
	outline: none;
}

.nsg-gtab.is-active {
	background: var(--nsg-accent);
	color: #ffffff;
	border-color: var(--nsg-accent);
}

/* ============ GALLERY ITEM META (badge + copy) ============ */

.nsg-gallery-item-meta {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-shrink: 0;
}

.nsg-copy-badge {
	display: inline-flex;
	align-items: center;
	gap: 3px;
	background: var(--nsg-accent-soft);
	color: var(--nsg-accent);
	border-radius: 999px;
	padding: 3px 8px;
	font-size: 11px;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	line-height: 1;
}

.nsg-theme-dark .nsg-copy-badge {
	background: rgba(79, 70, 229, 0.15);
	color: #818CF8;
}

/* ============ LOAD MORE BUTTON ============ */

.nsg-gallery-more {
	display: flex;
	justify-content: center;
	margin-top: 18px;
}

.nsg-load-more {
	background: var(--nsg-surface);
	color: var(--nsg-text);
	border: 1px solid var(--nsg-border-strong);
	border-radius: 999px;
	padding: 11px 28px;
	font-size: 14px;
	font-weight: 700;
	font-family: inherit;
	cursor: pointer;
	transition: all 0.15s ease;
	box-shadow: var(--nsg-shadow-sm);
}

.nsg-load-more:hover, .nsg-load-more:focus-visible {
	background: var(--nsg-accent);
	color: #ffffff;
	border-color: var(--nsg-accent);
	outline: none;
	transform: translateY(-1px);
	box-shadow: var(--nsg-shadow-hover);
}

/* ============ SAFE STYLES TOGGLE ============ */

.nsg-safe-toggle {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 20px;
	cursor: pointer;
	user-select: none;
	padding: 4px;
}

.nsg-safe-checkbox {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
}

.nsg-safe-switch {
	position: relative;
	flex-shrink: 0;
	width: 40px;
	height: 22px;
	background: var(--nsg-border-strong);
	border-radius: 999px;
	transition: background 0.2s ease;
}

.nsg-safe-switch::after {
	content: "";
	position: absolute;
	top: 2px;
	left: 2px;
	width: 18px;
	height: 18px;
	background: #ffffff;
	border-radius: 50%;
	transition: transform 0.2s ease;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.nsg-safe-checkbox:checked + .nsg-safe-switch {
	background: var(--nsg-success);
}

.nsg-safe-checkbox:checked + .nsg-safe-switch::after {
	transform: translateX(18px);
}

.nsg-safe-checkbox:focus-visible + .nsg-safe-switch {
	box-shadow: 0 0 0 3px var(--nsg-accent-glow);
}

.nsg-safe-label {
	font-size: 13px;
	font-weight: 600;
	color: var(--nsg-text);
}

.nsg-safe-hint {
	font-weight: 400;
	color: var(--nsg-text-muted);
	font-size: 12px;
}

@media (max-width: 480px) {
	.nsg-safe-hint { display: none; }
}

/* ============ TRENDING NAMES ============ */

.nsg-trending-wrap { margin-bottom: 32px; }

.nsg-trending-sub {
	font-size: 13px;
	color: var(--nsg-text-dim);
	margin: -8px 0 16px;
}

.nsg-trending {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

/* v2.1.3: trending item mirrors the output-card grid so the popular name
   sits CENTERED, with rank pill top-left and Copy pill top-right. */
.nsg-trend-item {
	background: var(--nsg-surface);
	border: 1px solid var(--nsg-border);
	border-radius: var(--nsg-radius);
	padding: 12px 14px 14px;
	display: grid;
	grid-template-columns: auto 1fr auto;
	grid-template-areas:
		"rank . meta"
		"text text text";
	column-gap: 8px;
	row-gap: 8px;
	align-items: center;
	cursor: pointer;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
	box-shadow: var(--nsg-shadow-sm);
}

.nsg-trend-item:hover {
	border-color: var(--nsg-accent);
	box-shadow: var(--nsg-shadow-hover);
}

.nsg-trend-rank {
	grid-area: rank;
	justify-self: start;
	display: inline-block;
	padding: 3px 10px;
	background: var(--nsg-accent-soft);
	color: var(--nsg-accent);
	font-size: 11px;
	font-weight: 800;
	border-radius: 999px;
	font-variant-numeric: tabular-nums;
	letter-spacing: 0.03em;
	line-height: 1.2;
}

.nsg-trend-item:nth-child(1) .nsg-trend-rank,
.nsg-trend-item:nth-child(2) .nsg-trend-rank,
.nsg-trend-item:nth-child(3) .nsg-trend-rank {
	background: var(--nsg-accent);
	color: #fff;
}

.nsg-trend-text {
	grid-area: text;
	min-width: 0;
	width: 100%;
	font-size: 18px;
	line-height: 1.4;
	color: var(--nsg-text);
	text-align: center;
	white-space: normal;
	overflow-wrap: anywhere;
	word-break: break-word;
	padding: 4px 4px;
}

.nsg-trend-text::-webkit-scrollbar { display: none; }

.nsg-trend-meta {
	grid-area: meta;
	justify-self: end;
	align-self: center;
	display: flex;
	align-items: center;
	gap: 8px;
}

.nsg-trend-item:hover .nsg-gallery-item-btn {
	background: var(--nsg-accent);
	color: #fff;
	border-color: var(--nsg-accent);
}

.nsg-trend-copies {
	display: inline-flex;
	align-items: center;
	gap: 3px;
	background: var(--nsg-surface-2);
	color: var(--nsg-text-dim);
	border-radius: 999px;
	padding: 3px 9px;
	font-size: 11px;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	line-height: 1;
}

/* ============ DECO FRAMES ============ */

.nsg-frames-wrap { margin-bottom: 32px; }

.nsg-frames {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.nsg-frames .nsg-gallery-item-text {
	font-size: 16px;
	white-space: normal;
	overflow-wrap: anywhere;
	word-break: break-word;
}

.nsg-frames .nsg-gallery-item-text::-webkit-scrollbar { display: none; }

/* ============ TOOLBAR (safe toggle + search) ============ */

.nsg-toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 20px;
}

.nsg-toolbar .nsg-safe-toggle { margin-bottom: 0; }

.nsg-search-wrap { flex: 1; min-width: 180px; }

.nsg-search {
	width: 100%;
	padding: 10px 14px;
	font-size: 14px;
	font-family: inherit;
	background: var(--nsg-surface);
	color: var(--nsg-text);
	border: 1px solid var(--nsg-border);
	border-radius: var(--nsg-radius-sm);
	outline: none;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
	-webkit-appearance: none;
	appearance: none;
}

.nsg-search::placeholder { color: var(--nsg-text-muted); }

.nsg-search:focus {
	border-color: var(--nsg-accent);
	box-shadow: 0 0 0 3px var(--nsg-accent-glow);
}

/* ============ IN-GAME PREVIEW CARD ============ */
/* v2.1.3: rebuilt as a real "game HUD" style card — dark strip, avatar,
   centered styled name that fills the row, level badge + download button
   pinned to a top row. Clean on both mobile and desktop. */

.nsg-preview {
	margin-bottom: 20px;
	background: linear-gradient(135deg, #0f172a, #1e1b4b);
	color: #fff;
	border: 1px solid rgba(255,255,255,0.08);
	border-radius: var(--nsg-radius);
	box-shadow: 0 6px 24px rgba(15, 23, 42, 0.15);
	overflow: hidden;
}

.nsg-preview-head {
	display: grid;
	grid-template-columns: auto 1fr auto auto;
	grid-template-areas:
		"avatar label  level download"
		"avatar name   name  name";
	column-gap: 12px;
	row-gap: 4px;
	padding: 14px 16px;
	align-items: center;
}

.nsg-preview-avatar {
	grid-area: avatar;
	flex-shrink: 0;
	width: 48px;
	height: 48px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 24px;
	background: rgba(255, 255, 255, 0.12);
	border-radius: 50%;
	border: 1px solid rgba(255,255,255,0.15);
}

.nsg-preview-body {
	display: contents;
}

.nsg-preview-label {
	grid-area: label;
	justify-self: start;
	align-self: end;
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: rgba(255,255,255,0.55);
}

.nsg-preview-name {
	grid-area: name;
	min-width: 0;
	font-size: 22px;
	font-weight: 700;
	color: #fff;
	text-align: left;
	padding: 2px 0 0;
	/* v2.1.4: wrap instead of fade so the full decorated name shows in the HUD too */
	white-space: normal;
	overflow-wrap: anywhere;
	word-break: break-word;
}

.nsg-preview-name::-webkit-scrollbar { display: none; }

.nsg-preview-level {
	grid-area: level;
	justify-self: end;
	align-self: end;
	font-size: 11px;
	font-weight: 700;
	color: #fff;
	background: rgba(129, 140, 248, 0.30);
	border: 1px solid rgba(129, 140, 248, 0.5);
	padding: 3px 10px;
	border-radius: 999px;
	letter-spacing: 0.03em;
}

.nsg-preview-download {
	grid-area: download;
	justify-self: end;
	align-self: end;
	background: rgba(255,255,255,0.12);
	border: 1px solid rgba(255,255,255,0.2);
	color: #fff;
	border-radius: var(--nsg-radius-sm);
	padding: 4px 10px;
	cursor: pointer;
	font-size: 14px;
	line-height: 1;
	transition: all 0.15s ease;
}
.nsg-preview-download:hover {
	background: rgba(255,255,255,0.22);
	transform: scale(1.05);
}

@media (max-width: 480px) {
	.nsg-preview-head {
		grid-template-columns: auto 1fr auto;
		grid-template-areas:
			"avatar label level"
			"avatar name  name"
			"avatar download download";
		row-gap: 6px;
	}
	.nsg-preview-avatar { width: 40px; height: 40px; font-size: 20px; }
	.nsg-preview-name { font-size: 19px; }
	.nsg-preview-download { justify-self: start; }
}

/* ============ FAVORITE STAR ============ */

.nsg-card-fav {
	flex-shrink: 0;
	background: none;
	border: none;
	color: var(--nsg-text-muted);
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	padding: 4px;
	border-radius: var(--nsg-radius-sm);
	transition: color 0.15s ease, transform 0.15s ease;
}

.nsg-card-fav:hover, .nsg-card-fav:focus-visible {
	color: var(--nsg-accent);
	outline: none;
	transform: scale(1.15);
}

.nsg-card-fav.is-faved { color: var(--nsg-accent); }

.nsg-fav-count {
	font-size: 12px;
	font-weight: 600;
	color: var(--nsg-accent);
	margin-left: 4px;
}

.nsg-fav-remove { cursor: pointer; }
.nsg-fav-remove:hover { color: var(--nsg-danger); }

/* ============ FAQ BLOCK (SEO) ============ */

.nsg-faq-block { margin-top: 8px; margin-bottom: 24px; }

.nsg-faq {
	background: var(--nsg-surface);
	border: 1px solid var(--nsg-border);
	border-radius: var(--nsg-radius);
	padding: 2px 18px;
	margin-bottom: 8px;
	box-shadow: var(--nsg-shadow-sm);
}

.nsg-faq summary {
	padding: 14px 0;
	font-weight: 600;
	font-size: 15px;
	cursor: pointer;
	color: var(--nsg-text);
	list-style: none;
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
}

.nsg-faq summary::-webkit-details-marker { display: none; }

.nsg-faq summary::after {
	content: "+";
	font-size: 18px;
	color: var(--nsg-text-dim);
	flex-shrink: 0;
}

.nsg-faq[open] summary::after { content: "\2212"; }

.nsg-faq p {
	padding-bottom: 14px;
	margin: 0;
	font-size: 14px;
	line-height: 1.6;
	color: var(--nsg-text-dim);
}

/* SSR sample list — visible by default (v2.1.0) so search engines index
   the style variety without executing JS. v2.1.2: single column matches the
   live JS-rendered card list, so nothing shifts when the user starts typing. */
.nsg-ssr-list {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

/* ================================================================
   v2.1.0 — NEW COMPONENTS
   ================================================================ */

/* Ad slots — invisible until an ad script fills them. */
.nsg-ad {
	margin: 20px 0;
	min-height: 1px;
	text-align: center;
	overflow: hidden;
}
.nsg-ad:empty { display: none; }
.nsg-ad-1, .nsg-ad-4 { margin: 24px 0; }

/* Input actions row — Random + Clear buttons */
.nsg-input-actions {
	display: flex;
	gap: 8px;
	align-items: center;
}

.nsg-random-btn {
	background: var(--nsg-accent-soft);
	color: var(--nsg-accent);
	border: 1px solid var(--nsg-border);
	border-radius: var(--nsg-radius-sm);
	padding: 5px 12px;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	font-family: inherit;
	transition: all 0.15s ease;
}
.nsg-random-btn:hover, .nsg-random-btn:focus-visible {
	background: var(--nsg-accent);
	color: #fff;
	outline: none;
	transform: translateY(-1px);
}

/* Couple / mix name mode */
.nsg-couple-wrap {
	background: var(--nsg-surface);
	border: 1px solid var(--nsg-border);
	border-radius: var(--nsg-radius);
	margin-bottom: 18px;
	overflow: hidden;
}
.nsg-couple-summary {
	padding: 14px 20px;
	font-weight: 600;
	font-size: 15px;
	cursor: pointer;
	color: var(--nsg-text);
	list-style: none;
	display: flex;
	align-items: center;
	gap: 8px;
	background: var(--nsg-surface-2);
}
.nsg-couple-summary::-webkit-details-marker { display: none; }
.nsg-couple-summary::after {
	content: "+";
	margin-left: auto;
	font-size: 18px;
	color: var(--nsg-text-dim);
}
.nsg-couple-wrap[open] .nsg-couple-summary::after { content: "\2212"; }

.nsg-couple-body { padding: 16px 20px; }
.nsg-couple-fields {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 12px;
}
.nsg-couple-input {
	flex: 1;
	padding: 10px 12px;
	font-size: 15px;
	border: 1px solid var(--nsg-border);
	border-radius: var(--nsg-radius-sm);
	background: var(--nsg-surface);
	color: var(--nsg-text);
	font-family: inherit;
	min-width: 0;
}
.nsg-couple-input:focus {
	outline: none;
	border-color: var(--nsg-accent);
	box-shadow: 0 0 0 3px var(--nsg-accent-glow);
}
.nsg-couple-plus {
	font-size: 20px;
	font-weight: 700;
	color: var(--nsg-accent);
	flex-shrink: 0;
}
.nsg-couple-actions { margin-bottom: 12px; }
.nsg-couple-btn {
	background: var(--nsg-accent);
	color: #fff;
	border: none;
	border-radius: var(--nsg-radius-sm);
	padding: 10px 20px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	font-family: inherit;
	transition: background 0.15s ease;
}
.nsg-couple-btn:hover { background: var(--nsg-accent-hover); }

.nsg-couple-result { display: flex; flex-direction: column; gap: 8px; }
.nsg-couple-hint {
	margin: 0 0 4px;
	font-size: 13px;
	color: var(--nsg-text-dim);
}
.nsg-couple-variant {
	background: var(--nsg-surface-2);
	border: 1px solid var(--nsg-border);
	border-radius: var(--nsg-radius-sm);
	padding: 10px 14px;
	font-size: 16px;
	font-weight: 500;
	color: var(--nsg-text);
	cursor: pointer;
	font-family: inherit;
	text-align: left;
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
	transition: all 0.15s ease;
}
.nsg-couple-variant:hover {
	border-color: var(--nsg-accent);
	background: var(--nsg-accent-soft);
}
.nsg-couple-badge {
	font-size: 11px;
	font-weight: 700;
	color: var(--nsg-accent);
	background: var(--nsg-surface);
	padding: 3px 8px;
	border-radius: 10px;
	flex-shrink: 0;
}

/* Toolbar right side (dark toggle + search) */
.nsg-toolbar-right {
	display: flex;
	gap: 10px;
	align-items: center;
	flex: 1;
	justify-content: flex-end;
}

/* v2.1.3: legacy .nsg-dark-toggle removed — replaced by .nsg-theme-strip below. */

/* Emoji panel — categorized */
.nsg-emoji-panel {
	display: flex;
	flex-direction: column;
	gap: 12px;
}
.nsg-emoji-cat-label {
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--nsg-text-dim);
	margin-bottom: 6px;
}
.nsg-emoji-row {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}
.nsg-emoji-chip {
	font-size: 20px;
	padding: 6px 8px;
	min-width: 40px;
}

/* Kaomoji chips — variable width, monospace-friendly */
.nsg-kaomoji-chip {
	font-family: var(--nsg-font-mono);
	font-size: 13px;
	padding: 6px 10px;
	white-space: nowrap;
}

/* Mobile tweaks */
@media (max-width: 640px) {
	.nsg-input-actions { flex-wrap: wrap; gap: 6px; }
	.nsg-random-btn { padding: 5px 10px; font-size: 12px; }
	.nsg-couple-fields { flex-direction: column; align-items: stretch; }
	.nsg-couple-plus { text-align: center; }
	.nsg-toolbar { gap: 8px; }
	.nsg-toolbar-right { flex-wrap: wrap; width: 100%; }
	.nsg-search-wrap { flex: 1 1 100%; min-width: 100%; }
	.nsg-dark-toggle { flex-shrink: 0; }
}

/* Ultra-small screens — keep the tool usable on 320-360px phones */
@media (max-width: 360px) {
	.nsg-app { padding: 12px 8px; }
	.nsg-input { padding: 12px 14px 4px; font-size: 15px; }
	.nsg-card-text { font-size: 17px; }
	.nsg-card { padding: 10px 8px 12px; }
	.nsg-card-copy { padding: 5px 8px; }
	.nsg-tab { padding: 7px 12px; font-size: 12px; }
}

/* ================================================================
   v2.1.3 — NEW COMPONENTS
   ================================================================ */

/* ============ THEME STRIP (Light/Dark segmented pill under input) ============ */

.nsg-theme-strip {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin: -6px 0 18px;
	padding: 10px 14px;
	background: var(--nsg-surface);
	border: 1px solid var(--nsg-border);
	border-radius: var(--nsg-radius);
	box-shadow: var(--nsg-shadow-sm);
}

.nsg-theme-strip-label {
	font-size: 12px;
	font-weight: 700;
	color: var(--nsg-text-dim);
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.nsg-theme-segment {
	position: relative;
	display: inline-flex;
	background: var(--nsg-surface-2);
	border: 1px solid var(--nsg-border);
	border-radius: 999px;
	padding: 3px;
	overflow: hidden;
}

.nsg-theme-seg-btn {
	position: relative;
	z-index: 2;
	background: transparent;
	border: none;
	color: var(--nsg-text-dim);
	font-family: inherit;
	font-size: 13px;
	font-weight: 700;
	padding: 6px 14px;
	border-radius: 999px;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	cursor: pointer;
	transition: color 0.2s ease;
	line-height: 1;
}
.nsg-theme-seg-btn:focus-visible {
	outline: 2px solid var(--nsg-accent);
	outline-offset: 2px;
}

.nsg-theme-seg-thumb {
	position: absolute;
	z-index: 1;
	top: 3px;
	bottom: 3px;
	left: 3px;
	width: calc(50% - 3px);
	background: linear-gradient(135deg, var(--nsg-accent), #7C3AED);
	border-radius: 999px;
	box-shadow: 0 2px 8px rgba(79, 70, 229, 0.35);
	transition: transform 0.28s cubic-bezier(0.34, 1.4, 0.64, 1);
}

/* Segment active state driven by data-theme on the wrapper */
.nsg-theme-segment[data-theme="light"] .nsg-theme-seg-btn[data-theme-set="light"],
.nsg-theme-segment[data-theme="dark"] .nsg-theme-seg-btn[data-theme-set="dark"] {
	color: #fff;
}
.nsg-theme-segment[data-theme="dark"] .nsg-theme-seg-thumb {
	transform: translateX(100%);
}

@media (max-width: 480px) {
	.nsg-theme-strip { padding: 8px 12px; margin: -4px 0 14px; }
	.nsg-theme-strip-label { font-size: 11px; }
	.nsg-theme-seg-btn { padding: 5px 10px; font-size: 12px; }
	.nsg-theme-seg-txt { display: none; }  /* icon-only on very small screens */
	.nsg-theme-seg-btn { padding: 5px 12px; }
}

/* ============ PANELBOX (Tab-strip card that holds all decoration panels) ============ */

.nsg-panelbox {
	background: var(--nsg-surface);
	border: 1px solid var(--nsg-border);
	border-radius: var(--nsg-radius);
	box-shadow: var(--nsg-shadow-sm);
	margin-bottom: 18px;
	overflow: hidden;
}

.nsg-panel-tabs {
	display: flex;
	gap: 4px;
	padding: 8px;
	overflow-x: auto;
	scrollbar-width: none;
	-webkit-overflow-scrolling: touch;
	border-bottom: 1px solid transparent;
	transition: border-color 0.2s ease;
}
.nsg-panel-tabs::-webkit-scrollbar { display: none; }

.nsg-panelbox.is-open .nsg-panel-tabs {
	border-bottom-color: var(--nsg-border);
}

.nsg-panel-tab {
	flex: 1 1 auto;
	min-width: 74px;
	display: inline-flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 3px;
	padding: 8px 10px;
	background: transparent;
	color: var(--nsg-text-dim);
	border: 1px solid transparent;
	border-radius: var(--nsg-radius-sm);
	font-family: inherit;
	font-size: 12px;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.15s ease;
	white-space: nowrap;
	line-height: 1.2;
}
.nsg-panel-tab-ico {
	font-size: 16px;
	line-height: 1;
}
.nsg-panel-tab-txt {
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.02em;
}
.nsg-panel-tab:hover,
.nsg-panel-tab:focus-visible {
	color: var(--nsg-text);
	background: var(--nsg-surface-2);
	outline: none;
}
.nsg-panel-tab.is-active {
	background: var(--nsg-accent-soft);
	color: var(--nsg-accent);
	border-color: var(--nsg-accent-soft);
}
.nsg-panel-tab .nsg-fav-count {
	margin: 0;
	font-size: 10px;
	background: var(--nsg-accent);
	color: #fff;
	padding: 1px 6px;
	border-radius: 999px;
	line-height: 1.3;
}
.nsg-panel-tab .nsg-fav-count:empty { display: none; }

.nsg-panel-body {
	padding: 14px;
	border-top: 0;
	animation: nsg-panel-in 0.18s ease;
}

.nsg-panel-pane[hidden] { display: none; }

@keyframes nsg-panel-in {
	from { opacity: 0; transform: translateY(-4px); }
	to   { opacity: 1; transform: translateY(0); }
}

/* Reset inner grids so they don't have their own padding twice */
.nsg-panel-body .nsg-wrap-grid,
.nsg-panel-body .nsg-symbol-grid,
.nsg-panel-body .nsg-recent,
.nsg-panel-body .nsg-emoji-panel {
	padding: 0;
}

/* Mobile: tabs stay in one line via horizontal scroll (each tab compact) */
@media (max-width: 640px) {
	.nsg-panel-tabs { gap: 3px; padding: 6px; }
	.nsg-panel-tab { min-width: 68px; padding: 7px 8px; }
	.nsg-panel-tab-ico { font-size: 15px; }
	.nsg-panel-tab-txt { font-size: 10px; }
	.nsg-panel-body { padding: 12px 10px; }
}

@media (max-width: 380px) {
	.nsg-panel-tab { min-width: 62px; padding: 6px 6px; }
	.nsg-panel-tab-txt { font-size: 9.5px; }
}

/* ============ INFINITE SCROLL — hide the old Load-More button entirely ============ */

.nsg-gallery-more,
.nsg-trending-more,
.nsg-frames-more { display: none !important; }

/* Small spinner shown briefly at the end of each infinite-scroll section */
.nsg-inf-spinner {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 8px;
	padding: 12px 0 6px;
	font-size: 12px;
	color: var(--nsg-text-muted);
	font-weight: 600;
	letter-spacing: 0.03em;
	text-transform: uppercase;
}
.nsg-inf-spinner::before {
	content: "";
	width: 14px;
	height: 14px;
	border: 2px solid var(--nsg-border);
	border-top-color: var(--nsg-accent);
	border-radius: 50%;
	animation: nsg-spin 0.7s linear infinite;
}
.nsg-inf-spinner.is-done { display: none; }

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

/* Sentinel element the IntersectionObserver watches */
.nsg-inf-sentinel {
	width: 100%;
	height: 1px;
}

/* ============ DARK THEME polish for new components ============ */

.nsg-theme-dark .nsg-theme-strip { background: var(--nsg-surface); }
.nsg-theme-dark .nsg-panelbox { background: var(--nsg-surface); }
.nsg-theme-dark .nsg-panel-tab.is-active {
	background: rgba(79, 70, 229, 0.18);
	color: #a5b4fc;
	border-color: rgba(79, 70, 229, 0.35);
}
.nsg-theme-dark .nsg-gallery-item-btn {
	background: var(--nsg-surface-2);
	color: var(--nsg-text-dim);
	border-color: var(--nsg-border);
}

/* ============ SEO CONTENT SECTIONS (v2.1.5) ============ */
/* Real editorial content below the tool. Left-aligned for readability
   (body copy is never centered), clean typography, no widget chrome. */

.nsg-content {
	margin: 8px 0 28px;
	display: flex;
	flex-direction: column;
	gap: 22px;
}

.nsg-content-block {
	max-width: 760px;
}

.nsg-content-h {
	font-size: 20px;
	font-weight: 700;
	line-height: 1.3;
	margin: 0 0 8px 0;
	color: var(--nsg-text);
	letter-spacing: -0.01em;
}

.nsg-content-p {
	font-size: 15px;
	line-height: 1.7;
	margin: 0;
	color: var(--nsg-text-dim);
}

@media (max-width: 480px) {
	.nsg-content { gap: 18px; margin: 4px 0 22px; }
	.nsg-content-h { font-size: 18px; }
	.nsg-content-p { font-size: 14.5px; line-height: 1.65; }
}
