/* Site Welcome Music – sticky music icon + options panel */
.swm-player {
	--swm-color: #d4a017;
	--swm-bg: rgba(17, 17, 17, 0.9);
	position: fixed;
	z-index: 999999;
	display: flex;
	align-items: center;
	gap: 6px;
	font-family: inherit;
	line-height: 1;
}

/* Positions */
.swm-left-middle  { left: 0;  top: 50%; transform: translateY(-50%); }
.swm-right-middle { right: 0; top: 50%; transform: translateY(-50%); flex-direction: row-reverse; }
.swm-bottom-left  { left: 16px;  bottom: 16px; }
.swm-bottom-right { right: 16px; bottom: 16px; flex-direction: row-reverse; }
.swm-top-left     { left: 16px;  top: 16px; }
.swm-top-right    { right: 16px; top: 16px;  flex-direction: row-reverse; }
.admin-bar .swm-top-left, .admin-bar .swm-top-right { top: 48px; }

.swm-player button {
	margin: 0;
	padding: 0;
	font: inherit;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}
.swm-player button:focus-visible { outline: 2px solid var(--swm-color); outline-offset: 2px; }
.swm-player svg { display: block; fill: currentColor; }

/* ---- Music icon (launcher) ---- */
.swm-launcher {
	position: relative;
	width: 40px;
	height: 40px;
	flex: 0 0 auto;
	border: 2px solid var(--swm-color);
	border-radius: 50%;
	background: var(--swm-bg);
	color: var(--swm-color);
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
	transition: transform 0.2s ease, width 0.2s ease;
}
.swm-launcher svg { width: 18px; height: 18px; }
.swm-launcher:hover { transform: scale(1.06); }

/* Stuck to the screen edge: tab shape */
.swm-left-middle .swm-launcher {
	border-left: 0;
	border-radius: 0 999px 999px 0;
	width: 44px;
	padding-right: 4px;
}
.swm-right-middle .swm-launcher {
	border-right: 0;
	border-radius: 999px 0 0 999px;
	width: 44px;
	padding-left: 4px;
}
.swm-left-middle .swm-launcher:hover,
.swm-right-middle .swm-launcher:hover { transform: none; width: 48px; }

/* Music note gently bounces while music plays */
.swm-player.is-playing .swm-launcher svg { animation: swm-bob 1.4s ease-in-out infinite; }
@keyframes swm-bob {
	0%, 100% { transform: translateY(0) rotate(0); }
	50%      { transform: translateY(-2px) rotate(-8deg); }
}

/* Small equaliser badge while playing */
.swm-eq {
	position: absolute;
	top: -3px;
	right: -3px;
	display: none;
	align-items: flex-end;
	gap: 1px;
	height: 14px;
	padding: 2px 3px;
	border-radius: 7px;
	background: var(--swm-color);
}
.swm-right-middle .swm-eq { right: auto; left: -3px; }
.swm-eq i {
	display: block;
	width: 2px;
	height: 100%;
	background: #111;
	border-radius: 1px;
	transform-origin: bottom;
	animation: swm-eq 0.9s ease-in-out infinite;
}
.swm-eq i:nth-child(2) { animation-delay: -0.3s; }
.swm-eq i:nth-child(3) { animation-delay: -0.6s; }
.swm-player.is-playing .swm-eq { display: flex; }
@keyframes swm-eq {
	0%, 100% { transform: scaleY(0.3); }
	50%      { transform: scaleY(1); }
}

/* ---- Options panel (hidden until the icon is clicked) ---- */
.swm-panel {
	display: flex;
	align-items: center;
	gap: 4px;
	height: 40px;
	padding: 0 6px;
	border: 1px solid color-mix(in srgb, var(--swm-color) 60%, transparent);
	border-radius: 999px;
	background: var(--swm-bg);
	color: var(--swm-color);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transform: translateX(-8px) scale(0.96);
	transform-origin: left center;
	transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s linear 0.2s;
}
.swm-right-middle .swm-panel,
.swm-bottom-right .swm-panel,
.swm-top-right .swm-panel {
	transform: translateX(8px) scale(0.96);
	transform-origin: right center;
}
.swm-player.is-open .swm-panel {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
	transform: none;
	transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s;
}
.swm-player.is-open .swm-launcher { background: var(--swm-color); color: #111; }

.swm-ctl {
	width: 28px;
	height: 28px;
	flex: 0 0 auto;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--swm-color);
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.15s ease;
}
.swm-ctl svg { width: 14px; height: 14px; }
.swm-ctl:hover:not(:disabled) { background: color-mix(in srgb, var(--swm-color) 20%, transparent); }
.swm-ctl:disabled { opacity: 0.35; cursor: default; }

.swm-play { border: 1px solid var(--swm-color); }
.swm-play svg { width: 13px; height: 13px; }
.swm-i-pause { display: none; }
.swm-player.is-playing .swm-i-play { display: none; }
.swm-player.is-playing .swm-i-pause { display: block; }

.swm-sep {
	width: 1px;
	height: 18px;
	margin: 0 2px;
	background: color-mix(in srgb, var(--swm-color) 35%, transparent);
}

/* Speaker shows the current level */
.swm-speaker { display: flex; color: var(--swm-color); }
.swm-speaker svg { width: 15px; height: 15px; }
.swm-mute { display: none; }
.swm-player.is-low .swm-wave2 { display: none; }
.swm-player.is-muted .swm-wave1,
.swm-player.is-muted .swm-wave2 { display: none; }
.swm-player.is-muted .swm-mute { display: inline; }

.swm-vol-meter {
	width: 40px;
	height: 3px;
	flex: 0 0 auto;
	border-radius: 2px;
	background: rgba(255, 255, 255, 0.2);
	overflow: hidden;
}
.swm-vol-fill {
	display: block;
	height: 100%;
	width: 50%;
	background: var(--swm-color);
	transition: width 0.15s ease;
}
.swm-vol-level {
	min-width: 30px;
	font-size: 11px;
	font-weight: 600;
	text-align: center;
	color: #fff;
	white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
	.swm-eq i, .swm-player.is-playing .swm-launcher svg { animation: none; }
	.swm-panel { transition: none !important; }
}
@media (max-width: 600px) {
	.swm-launcher { width: 38px; height: 38px; }
	.swm-left-middle .swm-launcher,
	.swm-right-middle .swm-launcher { width: 40px; }
	.swm-panel { height: 38px; }
	.swm-vol-meter { display: none; }
	.swm-bottom-left  { left: 12px;  bottom: 12px; }
	.swm-bottom-right { right: 12px; bottom: 12px; }
}
