/* =========================================================
   Header Manager – shared styles (all styles)
   Layout/positioning lives in styles/<style>/theme/headermanager_layout.css
   ========================================================= */

.hb-bar,
.hb-coins {
	--hb-bg: rgba(25, 15, 60, 0.6);
	--hb-bg-hover: rgba(25, 15, 60, 0.85);
	--hb-border: 1px solid rgba(255, 255, 255, 0.08);
	--hb-shadow: 0 5px 12px rgba(0, 0, 0, 0.25);
	--hb-size: 103px;
	--hb-gap: 16px;
	box-sizing: border-box;
}

.hb-size-sm { --hb-size: 80px; }
.hb-size-lg { --hb-size: 120px; }

/* ---------- Button list ---------- */

.hb-list {
	display: flex;
	flex-wrap: nowrap;
	gap: var(--hb-gap);
	width: 100%;
	margin: 0;
	padding: 0;
	list-style: none;
	pointer-events: none;
}

.hb-bar--start .hb-list  { justify-content: flex-start; }
.hb-bar--center .hb-list { justify-content: center; }
.hb-bar--end .hb-list    { justify-content: flex-end; }

.hb-item {
	flex: 0 1 var(--hb-size);
	min-width: 0;
	margin: 0;
	padding: 0;
}

.hb-link {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	aspect-ratio: 1;
	overflow: hidden;
	color: #fff;
	background: var(--hb-bg);
	border: var(--hb-border);
	border-radius: 20px;
	box-shadow: var(--hb-shadow);
	text-decoration: none;
	pointer-events: auto;
	transition: background-color 0.3s ease;
}

.hb-link:hover,
.hb-link:focus-visible {
	color: #fff;
	background: var(--hb-bg-hover);
	text-decoration: none;
}

.hb-link:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
}

.hb-icon {
	display: block;
	flex-shrink: 0;
	width: clamp(24px, 4vw, calc(var(--hb-size) * 0.47));
	height: clamp(24px, 4vw, calc(var(--hb-size) * 0.47));
	object-fit: contain;
	transition: transform 0.3s ease;
}

.hb-icons-white .hb-icon {
	filter: brightness(0) invert(1);
}

.hb-label {
	position: absolute;
	left: 50%;
	bottom: 15px;
	max-width: 90%;
	overflow: hidden;
	color: #fff;
	font-size: 13px;
	line-height: 1.2;
	white-space: nowrap;
	text-overflow: ellipsis;
	opacity: 0;
	transform: translate(-50%, 100%);
	transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Labels: on hover */
.hb-labels-hover .hb-link:hover .hb-icon,
.hb-labels-hover .hb-link:focus-visible .hb-icon {
	transform: translateY(-10px);
}

.hb-labels-hover .hb-link:hover .hb-label,
.hb-labels-hover .hb-link:focus-visible .hb-label {
	opacity: 1;
	transform: translate(-50%, 0);
}

/* Labels: always */
.hb-labels-always .hb-icon {
	transform: translateY(-8px);
}

.hb-labels-always .hb-label {
	bottom: 10px;
	opacity: 1;
	transform: translate(-50%, 0);
}

/* Labels: hidden (still read by screen readers) */
.hb-labels-none .hb-label {
	width: 1px;
	height: 1px;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
}

/* Buttons without an icon show their label centred */
.hb-bar .hb-link--text .hb-label {
	position: static;
	width: auto;
	height: auto;
	padding: 0 6px;
	clip: auto;
	clip-path: none;
	opacity: 1;
	transform: none;
}

/* Touch / small screens: show hover labels permanently */
@media (max-width: 1024px) {
	.hb-bar {
		--hb-gap: 8px;
	}

	.hb-icon {
		width: clamp(24px, 8vw, 34px);
		height: clamp(24px, 8vw, 34px);
	}

	.hb-labels-hover .hb-icon {
		transform: translateY(-7px);
	}

	.hb-labels-hover .hb-label,
	.hb-labels-always .hb-label {
		bottom: 8px;
		font-size: clamp(10px, 3vw, 13px);
		opacity: 1;
		transform: translate(-50%, 0);
	}
}

@media (max-width: 767px) {
	.hb-hide-mobile {
		display: none;
	}
}

/* ---------- Coin bar ---------- */

.hb-coins {
	display: flex;
	align-items: center;
	gap: 5px;
	padding: 5px;
	color: #fff;
	background: var(--hb-bg);
	border: var(--hb-border);
	border-radius: 12px;
	box-shadow: var(--hb-shadow);
	transition: background-color 0.3s ease;
}

.hb-coins:hover,
.hb-coins:focus-within {
	background: var(--hb-bg-hover);
}

.hb-coins__balance {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-width: 0;
	min-height: 36px;
	padding: 0 9px 0 5px;
	white-space: nowrap;
}

.hb-coins__coin {
	display: block;
	flex: 0 0 24px;
	width: 24px;
	height: 24px;
}

.hb-coins__amount {
	max-width: 12ch;
	overflow: hidden;
	color: #fff;
	font-size: 14px;
	font-variant-numeric: tabular-nums;
	font-weight: 700;
	line-height: 1;
	text-overflow: ellipsis;
}

.hb-coins__action {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 36px;
	padding: 0 11px;
	color: #fff;
	background: var(--hb-bg);
	border: var(--hb-border);
	border-radius: 8px;
	box-shadow: var(--hb-shadow);
	font-size: 12px;
	font-weight: 600;
	line-height: 1;
	text-decoration: none;
	white-space: nowrap;
	transition: background-color 0.3s ease, transform 0.2s ease;
}

.hb-coins__action:hover {
	color: #fff;
	background: var(--hb-bg-hover);
	text-decoration: none;
}

.hb-coins__action:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
}

.hb-coins__action:active {
	transform: translateY(1px);
}

.hb-coins__action--icon {
	width: 36px;
	padding: 0;
}

.hb-coins__action--icon img {
	display: block;
	width: 19px;
	height: 19px;
	filter: brightness(0) invert(1);
}

/* ---------- Accessibility preferences ---------- */

@media (prefers-reduced-motion: reduce) {
	.hb-link,
	.hb-icon,
	.hb-label,
	.hb-coins,
	.hb-coins__action {
		transition: none;
	}
}

@media (prefers-reduced-transparency: reduce) {
	.hb-bar,
	.hb-coins {
		--hb-bg: rgb(25, 15, 60);
	}
}

/* ---------- Particles ---------- */

.hm-particles {
	position: absolute;
	inset: 0;
	z-index: 1;
	overflow: hidden;
	border-radius: inherit;
	pointer-events: none;
}

.hm-particles canvas {
	display: block;
	width: 100%;
	height: 100%;
}

@media (max-width: 767px) {
	.hm-particles--no-mobile {
		display: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.hm-particles canvas {
		opacity: 0.65;
	}
}
