.ub-avatar-shop {
	--ub-ink: #1f2430;
	--ub-muted: #6b7280;
	--ub-border: #ece7fb;
	--ub-accent: #6d5bd0;
	--ub-accent-dark: #4b3aa8;
	--ub-gold: #f5a623;
	--ub-gold-bg: #fff6e6;
	--ub-green: #1fa971;
	--ub-green-bg: #eafbf3;
	--ub-radius-lg: 22px;
	--ub-radius-md: 16px;
	font-family: "Inter", -apple-system, "Segoe UI", Roboto, sans-serif;
	max-width: 1180px;
	margin: 0 auto;
	padding: 32px 24px 56px;
	color: var(--ub-ink);
	-webkit-font-smoothing: antialiased;
	position: relative;
	background: transparent;
}

.ub-shop-header,
.ub-avatar-grid,
.ub-shop-login-notice {
	position: relative;
	z-index: 1;
}

/* ---- Whole-page playful backdrop ---------------------------------------
   A "full-bleed" section: it breaks out of the theme's centered content
   column to span the full browser width, right behind the shop widget,
   using plain in-flow CSS (no fixed positioning / z-index tricks against
   the theme's own page wrappers, which proved unreliable). */
.ub-page-backdrop {
	position: relative;
	left: 50%;
	right: 50%;
	width: 100vw;
	margin-left: -50vw;
	margin-right: -50vw;
	overflow: hidden;
	padding: 12px 0 40px;
	background:
		radial-gradient(circle at 12% 18%, rgba(255, 214, 102, 0.35) 0, rgba(255, 214, 102, 0) 45%),
		radial-gradient(circle at 88% 12%, rgba(255, 137, 197, 0.28) 0, rgba(255, 137, 197, 0) 42%),
		radial-gradient(circle at 92% 82%, rgba(110, 197, 255, 0.3) 0, rgba(110, 197, 255, 0) 45%),
		radial-gradient(circle at 8% 88%, rgba(140, 224, 170, 0.28) 0, rgba(140, 224, 170, 0) 45%),
		linear-gradient(180deg, #f4f1ff 0%, #eef7ff 55%, #fef9ec 100%);
}

/* ---- Floating cartoon-style stickers (kid-friendly animated backdrop) ---- */
.ub-bg-stickers {
	position: absolute;
	inset: 0;
	overflow: hidden;
	pointer-events: none;
	z-index: 0;
}

.ub-sticker {
	position: absolute;
	font-size: 2.4rem;
	opacity: 0.5;
	filter: drop-shadow(0 4px 6px rgba(0,0,0,0.08));
	animation: ub-drift 14s ease-in-out infinite;
	will-change: transform;
}

@keyframes ub-drift {
	0%   { transform: translate(0, 0) rotate(0deg); }
	25%  { transform: translate(14px, -18px) rotate(6deg); }
	50%  { transform: translate(-8px, -6px) rotate(-4deg); }
	75%  { transform: translate(10px, 12px) rotate(4deg); }
	100% { transform: translate(0, 0) rotate(0deg); }
}

.ub-sticker-1  { top: 4%;  left: 6%;  font-size: 2.2rem; animation-duration: 12s; }
.ub-sticker-2  { top: 10%; left: 88%; font-size: 2rem;   animation-duration: 16s; animation-delay: .5s; }
.ub-sticker-3  { top: 70%; left: 4%;  font-size: 2.6rem; animation-duration: 15s; animation-delay: 1s; }
.ub-sticker-4  { top: 2%;  left: 45%; font-size: 1.6rem; animation-duration: 10s; animation-delay: 2s; }
.ub-sticker-5  { top: 85%; left: 90%; font-size: 2.4rem; animation-duration: 13s; animation-delay: .8s; }
.ub-sticker-6  { top: 40%; left: 94%; font-size: 2.2rem; animation-duration: 17s; animation-delay: 1.6s; }
.ub-sticker-7  { top: 55%; left: 48%; font-size: 1.8rem; animation-duration: 11s; animation-delay: 2.4s; opacity: 0.35; }
.ub-sticker-8  { top: 30%; left: 2%;  font-size: 2rem;   animation-duration: 14s; animation-delay: .3s; }
.ub-sticker-9  { top: 92%; left: 40%; font-size: 1.8rem; animation-duration: 12s; animation-delay: 1.9s; }
.ub-sticker-10 { top: 18%; left: 70%; font-size: 1.6rem; animation-duration: 18s; animation-delay: 2.8s; opacity: 0.35; }

@media (prefers-reduced-motion: reduce) {
	.ub-sticker { animation: none; }
}

/* ---- Header ---- */
.ub-shop-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 16px;
	padding-bottom: 20px;
	margin-bottom: 28px;
}

.ub-shop-header h2 {
	font-size: 26px;
	font-weight: 800;
	letter-spacing: -0.01em;
	margin: 0;
	color: var(--ub-accent-dark);
}

.ub-balance-pill {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	background: #ffffff;
	color: #8a5a00;
	font-weight: 700;
	font-size: 14px;
	letter-spacing: 0.01em;
	padding: 10px 20px;
	border-radius: 999px;
	border: 1px solid #f2d59a;
	box-shadow: 0 4px 12px rgba(245, 166, 35, 0.18);
}

.ub-balance-amount {
	font-size: 17px;
	font-weight: 800;
	color: #a5670a;
}

/* ---- Grid & Cards ---- */
.ub-avatar-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(460px, 1fr));
	gap: 24px;
}

.ub-avatar-card {
	display: flex;
	align-items: center;
	gap: 20px;
	background: #ffffff;
	border-radius: var(--ub-radius-lg);
	padding: 20px 24px 20px 20px;
	border: 1px solid var(--ub-border);
	box-shadow: 0 6px 18px rgba(90, 70, 180, 0.08);
	transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.ub-avatar-card.is-affordable:hover,
.ub-avatar-card.is-owned:hover {
	transform: translateY(-3px);
	border-color: #d9d3f5;
	box-shadow: 0 14px 28px rgba(80, 63, 178, 0.16);
}

.ub-avatar-image-wrap {
	position: relative;
	width: 132px;
	height: 132px;
	flex: 0 0 132px;
	border-radius: var(--ub-radius-md);
	overflow: hidden;
	background: #f3f2fa;
}

.ub-avatar-image-wrap img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.ub-avatar-card.is-locked .ub-avatar-image-wrap img {
	filter: grayscale(65%) brightness(0.92);
}

.ub-avatar-card.is-locked .ub-avatar-image-wrap::after {
	content: "";
	position: absolute;
	inset: 0;
	background: rgba(20, 20, 43, 0.06);
}

/* Type label moved off the artwork (it used to overlap the character's
   face and looked like a broken speech-bubble) — now a plain small tag
   sitting above the title instead. */
.ub-avatar-title-group {
	display: flex;
	flex-direction: column;
	gap: 3px;
	flex: 1;
	min-width: 0;
}

.ub-type-tag {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	align-self: flex-start;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.02em;
	color: var(--ub-muted);
	text-transform: uppercase;
}

.ub-lock-badge {
	position: absolute;
	top: 6px;
	right: 6px;
	background: rgba(20, 20, 43, 0.72);
	color: #fff;
	border-radius: 8px;
	width: 24px;
	height: 24px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 12px;
	backdrop-filter: blur(2px);
}

/* Title, price, and button live in one row here */
.ub-avatar-info {
	flex: 1;
	min-width: 0;
	display: flex;
	align-items: center;
	gap: 14px;
}

.ub-avatar-name {
	font-size: 15.5px;
	font-weight: 600;
	line-height: 1.3;
	margin: 0;
	color: var(--ub-ink);
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.ub-price-tag {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	gap: 5px;
	font-weight: 700;
	font-size: 13px;
	white-space: nowrap;
	color: #a5670a;
	background: var(--ub-gold-bg);
	border: 1px solid #f2d59a;
	padding: 6px 12px;
	border-radius: 999px;
}

.ub-price-tag.is-greyed {
	color: #9ca3af;
	background: #f3f4f6;
	border-color: #e5e7eb;
	text-decoration: line-through;
}

.ub-price-tag.is-owned {
	color: var(--ub-green);
	background: var(--ub-green-bg);
	border-color: #bdf0d9;
	text-decoration: none;
}

/* !important here is intentional: BuddyBoss and other themes ship global
   button/anchor resets that otherwise override our shop and modal buttons. */
.ub-buy-btn {
	flex: 0 0 auto;
	white-space: nowrap;
	border: none !important;
	border-radius: 10px !important;
	padding: 10px 18px !important;
	font-size: 14px !important;
	font-weight: 600 !important;
	font-family: inherit;
	line-height: normal;
	cursor: pointer;
	background: var(--ub-accent) !important;
	color: #fff !important;
	box-shadow: none !important;
	text-decoration: none !important;
	transition: background 0.15s ease, transform 0.08s ease;
}

.ub-buy-btn:hover:not(:disabled):not(.is-disabled) {
	background: var(--ub-accent-dark) !important;
}

.ub-buy-btn:active:not(:disabled):not(.is-disabled) {
	transform: scale(0.97);
}

.ub-buy-btn.is-disabled,
.ub-buy-btn:disabled {
	background: #eceef2 !important;
	color: #9aa0ab !important;
	cursor: not-allowed;
}

.ub-apply-btn {
	background: #2563eb !important;
}

.ub-apply-btn:hover {
	background: #1d4ed8 !important;
}

.ub-shop-login-notice {
	text-align: center;
	font-size: 15px;
	color: var(--ub-muted);
	padding: 60px 20px;
}

/* ---- Responsive: stack info under image on narrow cards ---- */
@media (max-width: 480px) {
	.ub-avatar-card {
		flex-wrap: wrap;
	}

	.ub-avatar-info {
		flex-wrap: wrap;
		flex-basis: 100%;
		gap: 10px;
	}

	.ub-avatar-name {
		flex-basis: 100%;
		white-space: normal;
	}
}

/* ---- Success Modal ---- */
.ub-modal-overlay {
	position: fixed;
	inset: 0;
	background: rgba(17, 17, 34, 0.5);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 99999;
	padding: 16px;
}

.ub-modal-box {
	position: relative;
	background: #fff;
	border-radius: 18px;
	max-width: 340px;
	width: 100%;
	overflow: hidden;
	text-align: center;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
	animation: ub-pop-in 0.25s ease;
}

@keyframes ub-pop-in {
	from { transform: scale(0.92); opacity: 0; }
	to   { transform: scale(1); opacity: 1; }
}

.ub-confetti-canvas-wrap {
	position: absolute;
	inset: 0;
	pointer-events: none;
}

#ub-confetti-canvas {
	width: 100%;
	height: 100%;
}

.ub-modal-content {
	position: relative;
	padding: 32px 26px 26px;
}

.ub-modal-content h2 {
	margin: 0 0 16px;
	font-size: 19px;
	font-weight: 700;
	letter-spacing: -0.01em;
	color: var(--ub-ink);
}

#ub-modal-avatar-img {
	width: 104px;
	height: 104px;
	object-fit: cover;
	border-radius: 50%;
	border: 3px solid #fff;
	box-shadow: 0 0 0 3px var(--ub-accent);
	margin-bottom: 14px;
}

#ub-modal-avatar-name {
	font-size: 16px;
	font-weight: 700;
	margin: 0;
	color: var(--ub-ink);
}

.ub-modal-sub {
	color: var(--ub-muted);
	font-size: 13px;
	margin: 4px 0 22px;
}

.ub-modal-actions {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

/* !important here is intentional: BuddyBoss and other themes ship global
   button/anchor resets that otherwise override our modal's buttons/links. */
.ub-modal-btn {
	display: block;
	width: 100%;
	box-sizing: border-box;
	border: none !important;
	border-radius: 10px !important;
	padding: 11px 16px !important;
	margin: 0 !important;
	font-size: 14px !important;
	font-weight: 600 !important;
	font-family: inherit;
	line-height: normal;
	cursor: pointer;
	background: #f3f4f6 !important;
	color: #4b5563 !important;
	box-shadow: none !important;
	text-decoration: none !important;
	text-align: center;
	transition: background 0.15s ease;
}

.ub-modal-btn:hover {
	background: #e5e7eb !important;
}

.ub-modal-btn-primary {
	background: var(--ub-accent) !important;
	color: #fff !important;
}

.ub-modal-btn-primary:hover {
	background: var(--ub-accent-dark) !important;
}

.ub-modal-link-btn {
	background: #f3f4f6 !important;
	color: #4b5563 !important;
}

.ub-modal-link-btn:hover {
	background: #e5e7eb !important;
}

.ub-modal-voucher-name {
	font-size: 16px;
	font-weight: 700;
	margin: 0;
	color: var(--ub-ink);
}

.ub-code-box {
	margin: 10px 0 4px;
	padding: 14px 12px;
	background: var(--ub-gold-bg);
	border: 2px dashed #f2c464;
	border-radius: 12px;
	font-family: "SFMono-Regular", Consolas, monospace;
	font-size: 20px;
	font-weight: 800;
	letter-spacing: 0.06em;
	color: #8a5a00;
	word-break: break-all;
}

/* ---- My Rewards dashboard tweaks ---- */
.ub-my-rewards .ub-avatar-card.is-owned {
	border-color: #d9d3f5;
}
